View Full Version : you guys already have this hack?
Its like the UBB look, it shows the last post icon and title for each forum instead of just the username , time and date on the forum front page (index.php) in the LAST POST column.
I can post it if nobody has released it
SNA
Ill take that as a 'what the hell are you talking about'
heres what i mean
im sorry, but that seems compleatly useless!
(hey 100 posts)
This is a function my members have been using on my ubb and I would love to have a hack for VB that does it!
Where is it at?
You can do it by editing the templates.
Its easy to do.
You have to hack the templates yes but you need to write code to get the latest title and icon in each forum.
If you can do it without writing a function please let me know.
I can post the hack on how I did it you guys want.
Thank you SNA
I would love to try your hack on my board. waiting ..
EDITED >> 3-18-2001 11:07 AM Central Time
Fixed the Select Statement to take in consideration if the thread was moved or not by looking for open='1'.
Add this code to the bottom of admin/functions.php before ?>
function active_topic($theforumid)
{
global $DB_site;
$activeresult = $DB_site->query("SELECT thread.title,thread.iconid,icon.iconpath FROM thread LEFT JOIN icon ON thread.iconid=icon.iconid WHERE forumid='$theforumid' AND open='1' ORDER BY lastpost DESC LIMIT 1");
$activeresults = $DB_site->fetch_array($activeresult);
return($activeresults);
}
Add this code to index.php
$lastposthome = active_topic($forum[forumid]);
$lastposthome[title] = substr($lastposthome[title],0,40) . "...";
if($lastposthome[iconpath]){
} else {
$lastposthome[iconpath] = "images/icons/icon1.gif";
}
after
if ($forum['lastpost']>0) {
$forum['lastpostdate']=vbdate($dateformat,$forum['lastpost']);
$forum['lastposttime']=vbdate($timeformat,$forum['lastpost']);
now add this code to forumdisplay.php
$lastposthome = active_topic($forum[forumid]);
$lastposthome[title] = substr($lastposthome[title],0,40) . "...";
if($lastposthome[iconpath]){
} else {
$lastposthome[iconpath] = "images/icons/icon1.gif";
}
after
if ($forum['lastpost']>0) {
$forum['lastpostdate']=vbdate($dateformat,$forum['lastpost']);
$forum['lastposttime']=vbdate($timeformat,$forum['lastpost']);
Now to get it to show up on you board.
Edit the 'forumhome' template.
replace it with this
<img src="$lastposthome[iconpath]" border=0>
<a href="showthread.php?s=$session[sessionhash]&goto=lastpost&forumid=$forum[forumid]"><smallfont>$lastposthome[title]</smallfont></a>
<smallfont>(by <a href="member.php?s=$session[sessionhash]&action=getinfo&find=lastposter&forumid=$forum[forumid]">$forum[lastposter]</a>)</smallfont>
<br>
<smallfont>$forum[lastpostdate]</smallfont> <smallfont COLOR="#6c6081">$forum[lastposttime]</smallfont>
There you go...
Again, I am new to PHP/MySQL and right now I know how to make things work. Whether its efficient or not, thats another story, im getting there :)
PM me if you have any problems.
Fatal error: Call to undefined function: active_topic() in /home/dlrarmy/public_html/forums/index.php on line 236
I would really like to use this hack~~~~
What am I doing wrong?
You didnt copy the active_topic function to admin/functions.php
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.