Recent Topics

1 Jun 05, 2005 08:33    

OK. I am working on a hack (I guess that's what it is) to allow uploading images in comments. I am pretty clueless when coding so bare with me...

I didn't know how to allow for multiple forms in the javascript that is located on the "/admin/b2upload.php" file so I went ahead and created a duplicate copy of b2upload.php and named it b2upload_comments.php. In the script on that page I have :


	function targetopener(blah, closeme, closeonly) {
		if (! (window.focus && window.opener))return true;
		window.opener.focus();
		if (! closeonly)window.opener.document.post.content.value += blah;
		if (closeme)window.close();
		return false;
	}
	


I want to change the values 'post.content' in the 4th line above so that I can allow the script to paste the generated text back into the form on the page "/skins/_feedback.php" but there is a problem. The form on "/skins/_feeback.php" doesn't have a "name" or "id" attribute. It just reads :

<form action="<?php echo $htsrv_url ?>/comment_post.php" method="post" class="bComment">


Is there a reason for this? Will I screw something up if I edit _feedback.php so that it looks like this:

<form action="<?php echo $htsrv_url ?>/comment_post.php" method="post" class="bComment" name="feedbackform" id="feedbackform">

That way I can simply change values that I mentioned earlier to read:

if (! closeonly)window.opener.document.feedbackform.comment.value += blah;


I just want to make sure doing this isn't going to affect anything else in a bad way.

2 Jun 05, 2005 13:15

Just wanted to update : I did the change as I said above... figured I'd go ahead and just give it a try. As far as I can tell it works just fine. That along with a few other changes and I now have an upload image button on my comments pages. I will try to post the entire hack later if anyone wants it.


Form is loading...