Version: 1.00, by Admin (Coder)
Developer Last Online: Nov 2024
Version: 2.3.x
Rating:
Released: 01-28-2002
Last Update: Never
Installs: 1206
No support by the author.
Here's an easy one, it barely took 4 minutes to do. :china:
This hack will add a quick replying box at the bottom of all threads, only if the user has permission to reply, so when you need to reply to something real quickly you don't need to click the Post Reply button and wait for the page to load.
Instructions are in the attached .txt file, and if you want a demo... just look below.
NOTE: For the vB 2.3.2 version please see this post.
Extras:
If you want users who have the Use Email Notification option ON, to automatically subscribe to threads they reply to with this hack, see this post.
If you want to add an option for each user to turn this feature on and off, please see this post.
If you want smilies in your quick reply box please see this post.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
if ( isset($goto) and ($goto=='lastpost' or $goto=='newpost')) {
$noheader=1;
}
// ############################################################################
// ############################# SHOW POST ####################################
// ############################################################################
if (!$thread['visible']) {
$idname="thread";
eval("standarderror("".gettemplate("error_invalidid")."");");
exit;
}
$forum=getforuminfo($thread['forumid']);
$getperms=getpermissions($thread['forumid'],-1,-1,$forum['parentlist']);
if (!$getperms['canview']) {
show_nopermission();
}
if (!$getperms['canviewothers'] and $thread['postuserid']!=$bbuserinfo['userid']) {
show_nopermission();
}
if (($bbuserinfo['userid']!=$thread['postuserid']) and (!$getperms['canviewothers'] or !$getperms['canreplyothers'])) {
$replybox='';
} elseif (!$getperms['canview'] or (!$getperms['canreplyown'] and $bbuserinfo['userid']==$thread['postuserid'])) {
$replybox='';
} elseif (!$thread['open'] and !ismoderator($thread['forumid'],'canopenclose')) {
$replybox='';
} else {
$textareacols = gettextareawidth();
eval("\$replybox = "".gettemplate('showthread_replybox')."";");
}
if ((!isset($pagenumber) or $pagenumber==0) and $pagenumber!="lastpage") {
$pagenumber=1;
}
$post=$DB_site->query_first("
SELECT
post.*,post.username AS postusername,post.ipaddress AS ip,user.*,userfield.*,".iif($forum[allowicons],'icon.title as icontitle,icon.iconpath,','')."
attachment.attachmentid,attachment.filename,attachment.visible AS attachmentvisible,attachment.counter
".iif($avatarenabled,",avatar.avatarpath,NOT ISNULL(customavatar.avatardata) AS hascustomavatar,customavatar.dateline AS avatardateline","")."
FROM post
".iif($forum[allowicons],'LEFT JOIN icon ON icon.iconid=post.iconid','')."
LEFT JOIN user ON user.userid=post.userid
LEFT JOIN userfield ON userfield.userid=user.userid
".iif ($avatarenabled,"LEFT JOIN avatar ON avatar.avatarid=user.avatarid
LEFT JOIN customavatar ON customavatar.userid=user.userid","")."
LEFT JOIN attachment ON attachment.attachmentid=post.attachmentid
WHERE post.postid = '$postid'
");
if (!$getperms['cangetattachment']) {
$viewattachedimages=0;
}
// words to highlight from the search engine
$replacewords = array();
if (!empty($highlight)) {
$highlight = preg_quote(strtolower($highlight), '#');
if ($allowwildcards) {
$highlight = str_replace('\*', '[^\s]*', $highlight);
}
$highlight = str_replace('\<', '<', $highlight);
$highlight = str_replace('\>', '>', $highlight);
$highlightwords = explode(' ', $highlight);
while (list($key,$val) = each($highlightwords)) {
if ($val=='or' OR $val=='and' OR $val=='not') {
continue;
}
$replacewords["$key"] = htmlspecialchars($val);
}
}
// oldest first or newest first
if ($postorder==0) {
$postorder="";
} else {
$postorder="DESC";
}
// goto last post
if ($goto=="lastpost") {
if (isset($threadid) and $threadid!=0) {
$threadid = verifyid("thread",$threadid);
if ($getlastpost=$DB_site->query_first("SELECT postid,post.dateline FROM post,thread WHERE post.threadid=thread.threadid AND thread.threadid='$threadid' AND post.visible=1 AND thread.visible=1 ORDER BY post.dateline DESC LIMIT 1")) {
header("Location: showthread.php?s=$session[sessionhash]&postid=$getlastpost[postid]" . iif(!empty($highlight), "&highlight=$highlight", "") . "#post$getlastpost[postid]");
exit;
}
}
if (isset($forumid) and $forumid!=0) {
$foruminfo=verifyid("forum",$forumid,1,1);
$forumid=$foruminfo['forumid'];
$forumslist = "";
$getchildforums=$DB_site->query("SELECT forumid,parentlist FROM forum WHERE INSTR(CONCAT(',',parentlist,','),',$forumid,')>0");
while ($getchildforum=$DB_site->fetch_array($getchildforums)) {
if ($getchildforum[forumid]==$forumid) {
$parentlist=$getchildforum[parentlist];
}
$forumslist.=",$getchildforum[forumid]";
}
$thread=$DB_site->query_first("SELECT threadid FROM thread WHERE forumid IN (0$forumslist) AND visible=1 AND (sticky=1 OR sticky=0) AND lastpost>='".($foruminfo[lastpost]-30)."' AND open<>10 ORDER BY lastpost DESC LIMIT 1");
if ($getlastpost=$DB_site->query_first("SELECT postid FROM post WHERE threadid='$thread[threadid]' AND visible=1 ORDER BY postid DESC LIMIT 1")) {
header("Location: showthread.php?s=$session[sessionhash]&postid=$getlastpost[postid]" . iif(!empty($highlight), "&highlight=$highlight", "") . "#post$getlastpost[postid]");
exit;
}
}
}
// goto newest post
if ($goto=="newpost") {
$threadid = verifyid("thread",$threadid);
if ($posts=$DB_site->query_first("SELECT postid,dateline FROM post WHERE post.threadid=$threadid AND post.visible=1 AND post.dateline>'$bbuserinfo[lastvisit]' ORDER BY dateline LIMIT 1")) {
header("Location: showthread.php?s=$session[sessionhash]&postid=$posts[postid]" . iif(!empty($highlight), "&highlight=$highlight", "") . "#post$posts[postid]");
exit;
} else {
header("Location: showthread.php?s=$session[sessionhash]&threadid=$threadid&goto=lastpost" . iif(!empty($highlight), "&highlight=$highlight", ""));
exit;
}
}
if ($goto=="nextnewest") {
$thread = verifyid("thread",$threadid,1,1);
if ($getnextnewest=$DB_site->query_first("SELECT threadid
FROM thread
WHERE forumid='$thread[forumid]'
AND lastpost>'$thread[lastpost]'
AND visible=1
AND open<>10
ORDER BY lastpost LIMIT 1")) {
$threadid=$getnextnewest[threadid];
unset ($thread);
} else {
eval("standarderror("".gettemplate("error_nonextnewest")."");");
}
}
if ($goto=="nextoldest") {
$thread = verifyid("thread",$threadid,1,1);
if ($getnextoldest=$DB_site->query_first("SELECT threadid
FROM thread
WHERE forumid='$thread[forumid]'
AND lastpost<'$thread[lastpost]'
AND visible=1
AND open<>10
ORDER BY lastpost DESC LIMIT 1")) {
$threadid=$getnextoldest[threadid];
unset($thread);
} else {
eval("standarderror("".gettemplate("error_nonextoldest")."");");
}
}
if (isset($postid) and $postid!=0 and $postid!="") {
$postid = verifyid("post",$postid);
$getthread=$DB_site->query_first("SELECT threadid FROM post WHERE postid='$postid'");
$threadid=$getthread[threadid];
if (!$postorder) {
$getpagenum=$DB_site->query_first("SELECT COUNT(*) AS posts FROM post WHERE threadid='$threadid' AND postid<='$postid'");
} else {
$getpagenum=$DB_site->query_first("SELECT COUNT(*) AS posts FROM post WHERE threadid='$threadid' AND postid>='$postid'");
}
if ($bbuserinfo['maxposts']!=-1 and $bbuserinfo['maxposts']!=0 and $bbuserinfo['maxposts'] <= $newmaxposts) {
sanitize_pageresults($getpagenum[posts], $pagenumber, $perpage, $newmaxposts, $bbuserinfo['maxposts']);
} else {
sanitize_pageresults($getpagenum[posts], $pagenumber, $perpage, $newmaxposts, $maxposts);
}
$pagenumber = ceil($getpagenum['posts']/$perpage);
}
if ($wordwrap!=0) {
$thread['title']=dowordwrap($thread['title']);
}
if (!$thread['visible']) {
$idname="thread";
eval("standarderror("".gettemplate("error_invalidid")."");");
exit;
}
if ($thread['open'] == 10) {
// send them to their correct thread
header("Location: showthread.php?s=$session[sessionhash]&threadid=$thread[pollid]");
exit;
}
$forum=getforuminfo($thread['forumid']);
$getperms=getpermissions($thread['forumid'],-1,-1,$forum['parentlist']);
if (!$getperms['canview']) {
show_nopermission();
}
if (!$getperms['canviewothers'] and ($thread['postuserid']!=$bbuserinfo['userid'] or $bbuserinfo['userid']==0)) {
show_nopermission();
}
if ($noshutdownfunc) {
$DB_site->query("UPDATE thread SET views=views+1 WHERE threadid='$threadid'");
} else {
$shutdownqueries[]="UPDATE LOW_PRIORITY thread SET views=views+1 WHERE threadid='$threadid'";
}
if ($bbuserinfo[cookieuser]) {
set_bbarraycookie('threadview', $threadid, time());
}
// display ratings if enabled
$ratingdisplay = '';
if ($forum['allowratings']==1) {
if ($thread['votenum'] > 0) {
$thread['voteavg'] = sprintf('%.2f', ($thread['votetotal'] / $thread['votenum']));
$thread['rating'] = intval(round($thread['voteavg']));
}
if ($thread['votenum']>=$showvotes) {
eval("\$ratingdisplay = "".gettemplate('showthread_ratingdisplay')."";");
}
}
// draw nav bar
$navbar=makenavbar($threadid,"thread",0);
$curforumid = $thread['forumid'];
makeforumjump();
if ($thread[pollid]) {
$pollid=$thread[pollid];
$pollinfo=$DB_site->query_first("SELECT * FROM poll WHERE pollid='$pollid'");
if (!$pollinfo['active'] OR !$thread['open'] or ($pollinfo['dateline'] + ($pollinfo['timeout'] * 86400) < time() AND $pollinfo['timeout'] != 0)){
//thread/poll is closed, ie show results no matter what
$showresults = 1;
} else if (!$getperms['canvote']) {
$cantvote = true;
} else {
//get userid, check if user already voted
if (get_bbarraycookie('pollvoted', $pollid) or ($bbuserinfo['userid'] and $uservote=$DB_site->query_first("SELECT pollvoteid FROM pollvote WHERE userid='$bbuserinfo[userid]' AND pollid=$pollid"))) {
$uservoted = 1;
}
}
$counter=0;
while ($counter++ < $pollinfo[numberoptions]) {
$pollinfo[numbervotes] += $splitvotes[$counter-1];
}
$counter=0;
$pollbits="";
$option = array();
while ($counter++<$pollinfo[numberoptions]) {
$option[question] = bbcodeparse($splitoptions[$counter-1],$forum[forumid],1);
$option[votes] = $splitvotes[$counter-1]; //get the vote count for the option
$option[number] = $counter; //number of the option
//Now we check if the user has voted or not
if ($showresults OR $uservoted OR $cantvote) { // user did vote or poll is closed
// can do it this way or use a strstr() for each post but I feel this will be quicker overall
unset($ignore);
$ignorelist = explode(' ', $bbuserinfo['ignorelist']);
while ( list($key, $val)=each($ignorelist) ) {
$ignore[$val] = 1;
}
$postscount=$DB_site->query_first("SELECT COUNT(*) AS posts FROM post WHERE post.threadid='$threadid' AND post.visible=1");
$totalposts=$postscount[posts];
if ($bbuserinfo['maxposts']!=-1 and $bbuserinfo['maxposts']!=0 and $bbuserinfo['maxposts'] <= $newmaxposts) {
sanitize_pageresults($totalposts, $pagenumber, $perpage, $newmaxposts, $bbuserinfo['maxposts']);
} else {
sanitize_pageresults($totalposts, $pagenumber, $perpage, $newmaxposts, $maxposts);
}
$getpostids=$DB_site->query("
SELECT post.postid FROM post
WHERE post.threadid='$threadid' AND post.visible=1
ORDER BY dateline $postorder LIMIT ".($limitlower-1).",$perpage ");
if ($limitupper>$totalposts) {
$limitupper=$totalposts;
if ($limitlower>$totalposts) {
$limitlower=$totalposts-$perpage;
}
}
if ($limitlower<=0) {
$limitlower=1;
}
$postids="post.postid IN (0";
while ($post=$DB_site->fetch_array($getpostids)) {
$postids.=",".$post['postid'];
}
$postids.=")";
$posts=$DB_site->query("
SELECT
post.*,post.username AS postusername,post.ipaddress AS ip,user.*,userfield.*,".iif($forum[allowicons],'icon.title as icontitle,icon.iconpath,','')."
attachment.attachmentid,attachment.filename,attachment.visible AS attachmentvisible,attachment.counter
".iif($avatarenabled,",avatar.avatarpath,NOT ISNULL(customavatar.avatardata) AS hascustomavatar,customavatar.dateline AS avatardateline","")."
FROM post
".iif($forum[allowicons],'LEFT JOIN icon ON icon.iconid=post.iconid','')."
LEFT JOIN user ON user.userid=post.userid
LEFT JOIN userfield ON userfield.userid=user.userid
".iif ($avatarenabled,"LEFT JOIN avatar ON avatar.avatarid=user.avatarid
LEFT JOIN customavatar ON customavatar.userid=user.userid","")."
LEFT JOIN attachment ON attachment.attachmentid=post.attachmentid
WHERE $postids ORDER BY dateline $postorder ");
if (!$getperms['cangetattachment']) {
$viewattachedimages=0;
}
$postbits = '';
$counter=0;
$postdone = array();
$sigcache = array();
while ($post=$DB_site->fetch_array($posts) and $counter++<$perpage) {
if (ismoderator($thread['forumid']) or $getperms['canopenclose'] or $getperms['candeletethread'] or $getperms['canmove']) {
eval("\$adminoptions = "".gettemplate("showthread_adminoptions")."";");
} else {
$adminoptions = " ";
}
getforumrules($forum,$getperms);
<!-- first unread and next/prev --><table cellpadding="2" cellspacing="0" border="0" width="{contenttablewidth}" {tableinvisibleextra} align="center"><tr><td><smallfont>$pagenav $firstunread </smallfont></td><td align="right"><smallfont><img src="{imagesfolder}/prev.gif" alt="" border="0"><a href="showthread.php?s=$session[sessionhash]&threadid=$threadid&goto=nextoldest">Last Thread</a> <a href="showthread.php?s=$session[sessionhash]&threadid=$threadid&goto=nextnewest">Next Thread</a><img src="{imagesfolder}/next.gif" alt="" border="0"></smallfont></td></tr></table><!-- first unread and next/prev -->
$replybox
I?ve tried on the showthread template to move the $replybox after </table> and before <!--first unread and next/prev> tags... but stilll it don?t show up... What am I doing wrong??? :ermm:
lol, I have no members so I can wait lol.... I have to install all the hacks and then design them... so I have around a month and a half ... hope someone creates a quickreply hack soon XD
If it's not working for you in 2.3.4, it is very likely you missed one important thing in the instuctions when editing the showthread.php file. There are TWO instances of the code you are supposed to replace. I overlooked this one minor detail at first and the box didn't show up. As soon as I replaced both instances, everything worked fine.
tell me where it says to change it twice in the install file and ill kiss your butt. All it says is to find that code. It never mentions it beign there again.