PDA

View Full Version : Last / Next Thread Name in thread view


bad_madman
27 Jun 2002, 18:34
Showing in thread view the last thread name and next thread name instead of "last thread" and "next thread".

Advantage:
-I know before whether the thread is interesting for me.
-The link to the thread isn't shown, if there is not any next or last thread.
-Additional information possible (for example thread starter, views etc.).

Disadvantage:
- The previous thread isn't the previous thread any more, if somebody writes into this in the meantime :nervous:

See the screenshot for more informations.

Xenon
27 Jun 2002, 18:44
hey mate, very good idea, so this links can be usefull :)
i don't think the old style is used so much ;)

bad_madman
27 Jun 2002, 18:54
Ups. Have forgotten the code :rolleyes:

Search in showthread.php for:

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")."\");");
}
}
and replace with:
if ($nextthread=$DB_site->query_first("SELECT threadid,title,views,replycount,postusername FROM thread WHERE forumid='$thread[forumid]' AND lastpost>'$thread[lastpost]' AND visible=1 AND open<>10 ORDER BY lastpost LIMIT 1")) {$nextthr=$nextthread[title]; if(strlen($nextthr)>45) $nextthr=substr($nextthr,0,42)."...";}
if ($lastthread=$DB_site->query_first("SELECT threadid,title,views,replycount,postusername FROM thread WHERE forumid='$thread[forumid]' AND lastpost<'$thread[lastpost]' AND visible=1 AND open<>10 ORDER BY lastpost DESC LIMIT 1")) {$lastthr=$lastthread[title]; if(strlen($lastthr)>45) $lastthr=substr($lastthr,0,42)."...";}
$nextlastthread="<table><tr>".iif($lastthr!="","<td align='right'><smallfont><a href='showthread.php?s=$session[sessionhash]&threadid=$lastthread[threadid]'><b>&laquo; Previous Thread</b><br>$lastthr<br>$lastthread[views] Views, $lastthread[replycount] Replys, Starter: $lastthread[postusername]</a></smallfont></td>","")."<td>&nbsp;</td>".iif($nextthr!="","<td><smallfont><a href='showthread.php?s=$session[sessionhash]&threadid=$nextthread[threadid]'><b>Next Thread &raquo;</b><br>$nextthr<br>$nextthread[views] Views, $nextthread[replycount] Replys, Starter: $lastthread[postusername]</a></smallfont></td>","")."</tr></table>"

search in template showthread for:

<smallfont>
<img src="http://www.vbulletin.org/forum/images/prev.gif" alt="" border="0">
<a href="showthread.php?s=$session[sessionhash]&threadid=$threadid&goto=nextoldest">Last Thread</a>
&nbsp;
<a href="showthread.php?s=$session[sessionhash]&threadid=$threadid&goto=nextnewest">Next Thread</a>
<img src="http://www.vbulletin.org/forum/images/next.gif" alt="" border="0">
</smallfont>

and replace with:

$nextlastthread

Xenon
27 Jun 2002, 19:04
i was sure you want to post the code in the next post ;)
A tip for the next version:
Don't make the Design hardcoded as you made here, would be better if you can set own designs in a template :)

bad_madman
27 Jun 2002, 19:20
Hmm. Right. Thx for the tip. I always make this to my Hacks actually, too ;)

Originally posted by Xenon
i was sure you want to post the code in the next post ;)
A tip for the next version:
Don't make the Design hardcoded as you made here, would be better if you can set own designs in a template :)

Velocd
27 Jun 2002, 20:35
Nice ;)

I will probably only use the title of the thread though, that extra information seems to make it look cluttered.

BigJohnson
02 Jul 2002, 17:51
Can someone make it so it uses a template instead of being so hard coded because i have different styles and I have different pics for each style for the next and previous buttons. Thanks. That would really really help.

Xenon
02 Jul 2002, 17:58
i'm not the creator of it, and i think he'll do it more comfortable hisself, but you can do this:

replace$nextlastthread="<table><tr>".iif($lastthr!="","<td align='right'><smallfont><a href='showthread.php?s=$session[sessionhash]&threadid=$lastthread[threadid]'><b> Previous Thread</b><br>$lastthr<br>$lastthread[views] Views, $lastthread[replycount] Replys, Starter: $lastthread[postusername]</a></smallfont></td>","")."<td> </td>".iif($nextthr!="","<td><smallfont><a href='showthread.php?s=$session[sessionhash]&threadid=$nextthread[threadid]'><b>Next Thread </b><br>$nextthr<br>$nextthread[views] Views, $nextthread[replycount] Replys, Starter: $lastthread[postusername]</a></smallfont></td>","")."</tr></table>"

with this:
eval("\$nextlastthread = \"".gettemplate("nextlastthread")."\";");

then create the template nextlastthread and put in the infos you want :), like $lastthread[postusername] or whatever ;)

bad_madman
03 Jul 2002, 02:17
Thx Xenen :)
I will publish a new version with Templates - soon... :D

padblaz
09 Jul 2003, 06:47
i'm looking for this hack since a long time
do you think that you can publish the new version soon ? ;)
up one year later :D