Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: 1.00, by Admin (Coder) Admin is offline
Developer Last Online: Nov 2024 Show Printable Version Email this Page

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.

Comments
  #1322  
Old 01-17-2004, 04:38 PM
bigdaddy04 bigdaddy04 is offline
 
Join Date: Jan 2004
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Something is up here, I'm trying to install this on vB 2.3.3 and its just not working,
the showthread_replybox template is created, the $replybox in the showthread template is there, and i did infact upload the new showthread.php..

very weird, im kinda confused since it worked for everyone else...
Reply With Quote
  #1323  
Old 01-17-2004, 04:49 PM
bigdaddy04 bigdaddy04 is offline
 
Join Date: Jan 2004
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

installed this one:
https://vborg.vbsupport.ru/showpost....postcount=1180

works fine, but its on top of the page instead of the bottom in showthread.php
Reply With Quote
  #1324  
Old 01-17-2004, 05:15 PM
bigdaddy04 bigdaddy04 is offline
 
Join Date: Jan 2004
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

never mind, its all fine...

except i want the fields to be checkboxes, not hidden fields...how can i do that?

where is everyone??
Reply With Quote
  #1325  
Old 01-17-2004, 05:46 PM
Elyk X Elyk X is offline
 
Join Date: Feb 2003
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Its not working at all for me..... im on 2.3.4 and its not working.... Ive done everything 3 times now and still nothing.
Reply With Quote
  #1326  
Old 01-17-2004, 06:02 PM
bigdaddy04 bigdaddy04 is offline
 
Join Date: Jan 2004
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here is my showthread_replybox template...everything works, except the signature, url parsing and email notification options..

Code:
<script language="javascript">
<!--
var postmaxchars = $postmaxchars;
function validate(theform) {
	if (theform.message.value=="") {
		alert("Please complete the message field.");
		return false; }
	if (postmaxchars != 0) {
		if (theform.message.value.length > $postmaxchars) {
			alert("Your message is too long.\n\nReduce your message to $postmaxchars characters.\nIt is currently "+theform.message.value.length+" characters long.");
			return false; }
		else { return true; }
	} else { return true; }
}
function checklength(theform) {
	if (postmaxchars != 0) { message = "\nThe maximum permitted length is $postmaxchars characters."; }
	else { message = ""; }
	alert("Your message is "+theform.message.value.length+" characters long."+message);
}
//-->
</script>

<form enctype="multipart/form-data" action="newreply.php" name="vbform" method="post" onSubmit="return validate(this)">

<table cellpadding="{tableouterborderwidth}" cellspacing="0" border="0" bgcolor="{tablebordercolor}" {tableouterextra} width="{contenttablewidth}" align="center"><tr><td>
<table cellpadding="4" cellspacing="{tableinnerborderwidth}" border="0" {tableinnerextra} width="100%">
<tr>
	<td bgcolor="{tableheadbgcolor}" colspan="2"><normalfont color="{tableheadtextcolor}" class="thtcolor"><b>Post Reply</b></normalfont></td>
</tr>
<tr>
	<td bgcolor="{secondaltcolor}">
		      <table cellpadding="0" cellspacing="0" border="0" align="center">
                <tr valign="top"> 
                  <td>
                    <textarea name="message" rows="7" cols="$textareacols" wrap="virtual" tabindex="1"></textarea>
                    <br><smallfont><a href="javascript:checklength(document.vbform);">[check 
                    message length]</a></smallfont>                    
                  </td>
                  <td><smallfont><input type="hidden" name="s" value="$session[sessionhash]">
                    <input type="hidden" name="action" value="postreply">
                    <input type="hidden" name="threadid" value="$threadid">
                    <input type="hidden" name="title" value="">
                    <input type="hidden" name="iconid" value="0">
                    <input type="checkbox" name="parseurl" value="yes">
                    Parse URLs?<br>
                    <input type="checkbox" name="email" value="">
                    Email Notification?<br>
                    <input type="hidden" name="disablesmilies" value="">
                    <input type="hidden" name="closethread" value="">
                    <input type="hidden" name="hiddenreply" value="">
                    <input type="checkbox" name="signature" value="yes">
                    Signature?<br>
                    <input type="hidden" name="rating" value="0"></smallfont></td>
                </tr>
              </table>
	</td>
</tr>
</table>
</td></tr></table>

<br>

<table cellpadding="2" cellspacing="0" border="0" width="{contenttablewidth}" {tableinvisibleextra} align="center">
<tr>
	<td align="center"><normalfont>
	<input type="submit" class="bginput" name="submit" value="Submit Reply" accesskey="s" tabindex="2">
	<input type="reset" class="bginput" name="reset" value="Reset Form" accesskey="r" tabindex="3">
	</normalfont></td>
</tr>
</table>

</form>
Reply With Quote
  #1327  
Old 01-17-2004, 06:03 PM
bigdaddy04 bigdaddy04 is offline
 
Join Date: Jan 2004
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Elyk X
Its not working at all for me..... im on 2.3.4 and its not working.... Ive done everything 3 times now and still nothing.
use this one
https://vborg.vbsupport.ru/showpost....postcount=1180
Reply With Quote
  #1328  
Old 01-17-2004, 06:38 PM
Elyk X Elyk X is offline
 
Join Date: Feb 2003
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by bigdaddy04
I did do that one =\

thats the one thats not working
Reply With Quote
  #1329  
Old 01-17-2004, 06:56 PM
bigdaddy04 bigdaddy04 is offline
 
Join Date: Jan 2004
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

where is everyone!?
Reply With Quote
  #1330  
Old 01-17-2004, 08:10 PM
Elyk X Elyk X is offline
 
Join Date: Feb 2003
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

to busy working on vb3, but the only reason i installed vb2 again was cause it has hacks that vb3 doesnt have yet. like..the rpg hacks.

I had a quick reply working on my old 2.2.8 version....but for some reason this ones just being stupid.
Reply With Quote
  #1331  
Old 01-17-2004, 10:25 PM
Solid-Snake Solid-Snake is offline
 
Join Date: Oct 2003
Location: Ohio
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I cant find this bit in my showthread.php. I can find the first line of it but not the rest, its different. It says to find this
Code:
// ##################################################
if (!$getperms['canviewothers'] and ($thread['postuserid']!=$bbuserinfo['userid'] or $bbuserinfo['userid']==0)) {
  show_nopermission();
}

if ((!isset($pagenumber) or $pagenumber==0) and $pagenumber!="lastpage") {
  $pagenumber=1;
}
Instead I have
Code:
	if (!$getperms['canviewothers'] and ($thread['postuserid']!=$bbuserinfo['userid'] or $bbuserinfo['userid']==0)) {
	  show_nopermission();
	}

	$bbcodeon=iif($forum[allowbbcode],$ontext,$offtext);
	$imgcodeon=iif($forum[allowimages],$ontext,$offtext);
	$htmlcodeon=iif($forum[allowhtml],$ontext,$offtext);
	$smilieson=iif($forum[allowsmilies],$ontext,$offtext);

	$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;
	}
and I also have this in the same code
Code:
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());
}
Can someone tell me what to do I really want this its like a necessity.

I use 2.3.4 despite what it says to the left.
Reply With Quote
  #1332  
Old 01-18-2004, 01:27 AM
Elyk X Elyk X is offline
 
Join Date: Feb 2003
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

oh yeah...its a good thing the support over here is so good *rolls eyes*
Reply With Quote
  #1333  
Old 01-18-2004, 08:46 PM
Elyk X Elyk X is offline
 
Join Date: Feb 2003
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok..nvm, i put in an old one for 2.2.6 that works....but its kinda funny that it works...and this one doenst.
Reply With Quote
  #1334  
Old 01-20-2004, 08:53 PM
kurv kurv is offline
 
Join Date: Jan 2004
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I can not get this working either... any help would be appreciated I am running 2.3.4

I have checked and rechecked my settings and the install...
Reply With Quote
  #1335  
Old 01-21-2004, 02:07 AM
Deska's Avatar
Deska Deska is offline
 
Join Date: Aug 2002
Location: Asia
Posts: 161
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This hack work with v2.3.4!
Reply With Quote
  #1336  
Old 01-21-2004, 02:20 AM
MeTaL_oRgY MeTaL_oRgY is offline
 
Join Date: Jul 2003
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, tried bigdaddy`s hack first and it didn?t work..... the box don?t appear....

can?t get the box to appear... I?m on 2.3.4, here are my files:

showthread.php
PHP Code:
<?php

error_reporting
(7);

$action $HTTP_GET_VARS['action'];
$goto $HTTP_GET_VARS['goto'];

if ( isset(
$goto) and ($goto=='lastpost' or $goto=='newpost')) {
  
$noheader=1;
}

// ############################################################################
// ############################# SHOW POST ####################################
// ############################################################################

if ($action=="showpost") {

    
$templatesused 'postbit_search,postbit_buddy,postbit_useremail,icq,aim,yahoo,postbit_homepage,postbit_profile,postbit_ip_show,postbit_ip_hidden,postbit,postbit_sendpm,postbit_avatar,postbit_offline,postbit_online,postbit_editedby,postbit_signature,postbit_attachment,postbit_attachmentimage,showpost';
    include(
'./global.php');

    if (isset(
$postid) and $postid!=and $postid!="") {
      
$postid verifyid("post",$postid);

      
$getthread=$DB_site->query_first("SELECT threadid FROM post WHERE postid='$postid'");
      
$threadid=$getthread[threadid];
    }

    
$threadid intval($threadid);
    
$thread verifyid("thread",$threadid,1,1);

    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;
}

    
$bbcodeon=iif($forum[allowbbcode],$ontext,$offtext);
    
$imgcodeon=iif($forum[allowimages],$ontext,$offtext);
    
$htmlcodeon=iif($forum[allowhtml],$ontext,$offtext);
    
$smilieson=iif($forum[allowsmilies],$ontext,$offtext);

    
$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;
    }

    
$postbits getpostbit($post);

    
updateuserforum($thread['forumid']);

    eval(
"dooutput(\"".gettemplate("showpost")."\");");
    exit;
}

// ##############################################################################
// ############################# SHOW THREAD ####################################
// ##############################################################################

$templatesused 'showthread_ratingdisplay,postbit_search,postbit_buddy,postbit_ignore,postbit_useremail,icq,aim,yahoo,postbit_homepage,postbit_profile,postbit_ip_show,postbit_ip_hidden,postbit,postbit_sendpm,postbit_avatar,postbit_offline,postbit_online,postbit_editedby,postbit_signature,postbit_attachment,postbit_attachmentimage,showthread_adminoptions,showthread_threadrate,showthread_pollresults_voted,showthread_pollresults_closed,showthread_pollresults_cantvote,showthread_firstunread,showthread_nextnewestthread,showthread_nextoldestthread,forumrules,showthread';
require(
'./global.php');

// 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 ((
$tview get_bbarraycookie('threadview'$threadid)) > $bbuserinfo['lastvisit']) {
    
$bbuserinfo['lastvisit'] = $tview;
  }

  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")."\");");
    }
}

$umaxposts explode(','$usermaxposts ",$maxposts");
$newmaxposts max($umaxposts);

if (isset(
$postid) and $postid!=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']!=-and $bbuserinfo['maxposts']!=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);
}

$threadid intval($threadid);
$thread verifyid("thread",$threadid,1,1);

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'$threadidtime());
}

// 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'");

  
$pollinfo[question]=bbcodeparse($pollinfo[question],$forum[forumid],1);

  
$splitoptions=explode("|||"$pollinfo[options]);
  
$splitvotes=explode("|||",$pollinfo[votes]);

  
$showresults 0;
  
$uservoted 0;
  
$cantvote 0;

  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

      
if ($option[votes] == 0){
        
$option[percent] = 0;
      } else{
        
$option[percent] = number_format($option[votes]/$pollinfo[numbervotes]*100,2);
      }

      
$option[graphicnumber]=$option[number]%1;
      
$option[barnumber] = round($option[percent])*2;
      if (
$showresults) {
        eval(
"\$pollstatus = \"".gettemplate("showthread_pollresults_closed")."\";");
      } elseif (
$cantvote) {
          eval(
"\$pollstatus = \"".gettemplate("showthread_pollresults_cantvote")."\";");
      } elseif (
$uservoted) {
        eval(
"\$pollstatus = \"".gettemplate("showthread_pollresults_voted")."\";");
      } else {
        
$pollstatus ''// just in case
      
}
      eval(
"\$pollbits .= \"".gettemplate("pollresult")."\";");
    } else {
      if (
$pollinfo['multiple']) {
            eval(
"\$pollbits .= \"".gettemplate("polloption_multiple")."\";");
        } else {
            eval(
"\$pollbits .= \"".gettemplate("polloption")."\";");
        }
     }
  }

  if (
$pollinfo['multiple']) {
       
$pollinfo['numbervotes'] = $pollinfo['voters'];
    }

  if (
$showresults OR $uservoted OR $cantvote) {
    eval(
"\$poll = \"".gettemplate("showthread_pollresults")."\";");
  } else {
    eval(
"\$poll = \"".gettemplate("showthread_polloptions")."\";");
  }
} else {
  
$poll="";
}

$bbcodeon=iif($forum[allowbbcode],$ontext,$offtext);
$imgcodeon=iif($forum[allowimages],$ontext,$offtext);
$htmlcodeon=iif($forum[allowhtml],$ontext,$offtext);
$smilieson=iif($forum[allowsmilies],$ontext,$offtext);

$counter=0;

// 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']!=-and $bbuserinfo['maxposts']!=and $bbuserinfo['maxposts'] <= $newmaxposts)    {
   
sanitize_pageresults($totalposts$pagenumber$perpage$newmaxposts$bbuserinfo['maxposts']);
} else {
   
sanitize_pageresults($totalposts$pagenumber$perpage$newmaxposts$maxposts);
}

$limitlower=($pagenumber-1)*$perpage+1;
$limitupper=($pagenumber)*$perpage;

$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 (
$postdone[$post[postid]]) {
    
$counter--;
    continue;
  } else {
    
$postdone[$post[postid]]=1;
  }
  
$postbits .= getpostbit($post);
}

$pagenav getpagenav($totalposts,"showthread.php?s=$session[sessionhash]&amp;threadid=$threadid&amp;perpage=$perpage".iif(isset($highlight), "&amp;highlight=$highlight"""));

$DB_site->free_result($posts);
unset(
$post);
unset(
$sigcache); //don't need the signature cache anymore

if ($thread[open]) {
  
$replyclose="{replyimage}";
} else {
  
$replyclose="{closedthreadimage}";
}

if (
$thread[lastpost]>$bbuserinfo[lastvisit]) {
  
// do blue arrow link

  
if ($firstnew) {
        
$newpostlink="#newpost";
  } else {
        
$newpostlink="showthread.php?s=$session[sessionhash]&amp;threadid=$threadid&amp;goto=newpost";
  }

  eval(
"\$firstunread = \"".gettemplate("showthread_firstunread")."\";");

} else {
  
$firstunread="";
}
if (
$forum[allowratings]) {
  eval(
"\$threadrateselect = \"".gettemplate("showthread_threadrate")."\";");
} else {
  
$threadrateselect "&nbsp;";
}

if (
ismoderator($thread['forumid']) or $getperms['canopenclose'] or $getperms['candeletethread'] or $getperms['canmove']) {
  eval(
"\$adminoptions = \"".gettemplate("showthread_adminoptions")."\";");
} else {
  
$adminoptions "&nbsp;";
}
getforumrules($forum,$getperms);

updateuserforum($thread['forumid']);

eval(
"dooutput(\"".gettemplate("showthread")."\");");

?>
showthread template
HTML Code:
<!-- first unread and next/prev -->
<table cellpadding="2" cellspacing="0" border="0" width="{contenttablewidth}" {tableinvisibleextra} align="center">
<tr>
	<td><smallfont>$pagenav $firstunread&nbsp;</smallfont></td>
	<td align="right"><smallfont>
	<img src="{imagesfolder}/prev.gif" alt="" border="0">
	<a href="showthread.php?s=$session[sessionhash]&amp;threadid=$threadid&amp;goto=nextoldest">Last Thread</a>
	&nbsp;
	<a href="showthread.php?s=$session[sessionhash]&amp;threadid=$threadid&amp;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:
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:53 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07785 seconds
  • Memory Usage 2,589KB
  • Queries Executed 30 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_code
  • (1)bbcode_html
  • (1)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (16)post_thanks_box
  • (16)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (16)post_thanks_postbit_info
  • (15)postbit
  • (16)postbit_onlinestatus
  • (16)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete