PDA

View Full Version : Yet Another Multi-Quote Hack


chriswible
02-17-2005, 10:00 PM
This particular hack allows users to multi-quote directly from the newreply page instead of in the thread itself. A "quote" link is placed in each post in the thread review, allowing for quck, efficient multi-quoting without the need to plan posts in advance. ;)

Only two file edits and a template tweak, nothing major.

Suggestions/bug reports (and fixes) are welcome... this is my first hack so be nice. XD Thanks to Snow for pointing out WYSIWYG incompatibility problem and fixing my javascript. ;)

*INSTALLATION*

In newreply.php:

FIND:

require_once('./includes/functions_bbcodeparse.php');
$reviewmessage = parse_bbcode($post['pagetext'], $foruminfo['forumid'], $post['allowsmilie']);
ABOVE, INSERT:

$poststep1 = strip_quotes($post['pagetext']);
$b1 = '[';
$b2 = ']';
$quo = 'QUOTE';
$poststep2 = "$b1$quo=$username$b2$poststep1$b1/$quo$b2";
$poststep3 = addslashes($poststep2);
$poststep4 = explode("\n",$poststep3);
for ($xyz = 0; $xyz < count($poststep4); $xyz++){
$poststep4[$xyz] = rtrim($poststep4[$xyz]);
}
$poststep5 = implode('\n',$poststep4);
$poststep5 = "\\n$poststep5\\n";

in clientscript/vbulletin_editor.js:
at the end, ADD:
function do_quote_hack(quotestring,is_ie)
{
if (document.getElementById('htmlbox'))
{
if (is_moz)
{
moz_insert_smilie('<br>'+quotestring+'<br>');
}
else
{
document.getElementById('htmlbox').innerHTML += quotestring;
}
}
else
{
document.vbform.message.value += quotestring;
}
}

In the template newreply_reviewbit:
FIND:
<td class="alt1" width="125" align="center">$username</td>
REPLACE WITH:
<td class="alt1" width="125" align="center"><p align=center>$username</p>

<script language=javascript>
var quotestring$post[postid] = '$poststep5';
</script>
<p align=center><a href=# onClick="do_quote_hack(quotestring$post[postid],is_ie);"><img src="$stylevar[imgdir_button]/quote.gif" border=0></a></p></td>



Screenshot is of the Thread Review section in newreply.

OrangeFlea
02-19-2005, 02:16 AM
screenshots?

chriswible
02-19-2005, 03:01 AM
Not much visual in this hack, but okay.

saree
02-19-2005, 06:35 AM
nice hack that going to save me alot of quoting time. i trust you when you said that you tried it and it's fully working with no errors. :rolleyes:

thanks again. :smoke:

Snow
02-19-2005, 09:34 AM
It doesn't work for me :( When I click on the multi-quote (when posting a new reply), nothing happens other than adding a # to the end of the url.

chriswible
02-19-2005, 06:09 PM
It doesn't work for me :( When I click on the multi-quote (when posting a new reply), nothing happens other than adding a # to the end of the url.
Do you get a javascript error? if so, does it occur on loading the page or when you click?

EDIT: Er... I just visited your forums and it works for me. :ermm: What browser are you using?

Snow
02-19-2005, 06:53 PM
Do you get a javascript error? if so, does it occur on loading the page or when you click?Nope, no errors that I've noticed, it just doesn't so anything (at least for me) :disappointed:

EDIT: Er... I just visited your forums and it works for me. :ermm: What browser are you using? :surprised:
Firefox 1.0

chriswible
02-19-2005, 09:24 PM
Yeesh, I tried firefox 1.0 and it still worked. :speechless:

Maybe you should try polling your users to see if they're having problems. :ermm:

Snow
02-21-2005, 04:41 AM
Yeesh, I tried firefox 1.0 and it still worked. :speechless:

Maybe you should try polling your users to see if they're having problems. :ermm:OKI've found out what the problem is (I think). I tried it with theStandard Editor and it does work, but it refuses to work with theWYSIWYG editor. I will run a poll to see if anyone has managed toget it working with the WYSIWYG editor as you suggested.

chriswible
02-21-2005, 05:21 AM
Yeah, you got it. :o how n00bish of me. I'll get right to fixing that...

chriswible
02-24-2005, 02:50 PM
Sorry for the double post, but it's fixed. it *should* now work for standard and WYSIWYG in IE and Mozilla. :) note the additional file edit.

Snow
02-25-2005, 04:30 PM
:D I think it's working now, Thank you it's a great hack!

Oh I did have to do some very very minor edits to thevbulletin_editor.js edit. For some reason it doesn't work in firefox ifthe { and } are not on seperate lines.
:rolleyes:
function do_quote_hack(quotestring,is_ie)
{
if (document.getElementById('htmlbox'))
{
if (is_moz)
{
moz_insert_smilie('<br>'+quotestring+'<br>');
}
else
{
document.getElementById('htmlbox').innerHTML += quotestring;
}
}
else
{
document.vbform.message.value += quotestring;
}
}

chriswible
02-25-2005, 08:40 PM
:D I think it's working now, Thank you it's a great hack!

Oh I did have to do some very very minor edits to thevbulletin_editor.js edit. For some reason it doesn't work in firefox ifthe { and } are not on seperate lines.
:rolleyes:
Noted and edited, thank you. My bracketing pisses off my compsci teacher also. :p

Glad you like the hack.

Binoy
04-04-2006, 06:06 AM
does this work for vb 3.5.x????

FunaGuy
07-05-2006, 07:39 PM
<font color="Red">its working with vb 3.5.4 ??</font>

aisais
04-11-2008, 11:53 PM
its working with vb 3.5.4 ??
Is it?