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.
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.