Version: , by Scott MacVicar
Developer Last Online: Mar 2016
Version: 2.2.x
Rating:
Released: 09-20-2001
Last Update: Never
Installs: 85
No support by the author.
I had tried a version suggested by someone else instead of my own and well, all it did was send the load average up by about 10 times what it was.
This version inserts the last title into the forum database when it is updating the last post name and time. There is no difference in loading time as everything is called normally by vBulletin.
This works on 2.0.x and 2.2.x
Updated at 11:34 GMT on 28th September 2002
Thanks to floren for the latest update.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
Originally posted by Omero I've tried to edit the code to make the title NOT appear for all forums where the user don't have access to, copying a couple of lines from forumdisplay.php (I'm no hacker, i'm simply a user, and know very little of PHP).
It works perfectly for me (but TEST IT AT YOUR OWN RISK, im no php coder ), but:
A) I'm sure there is a better way to implement it... i RECHECK permissions, while probably permissions are already checked and i should just pull them out from the right variable... but i dont know how
B) I'm not sure at all if the title will display or not, in the case
Category
- Private subforum
- Non private subforum
I think this mini edit i did just remove the title in the case the forum is VISIBLE from homepage, and NOT in the case the title is in a category visibile, but comes from a private subforum you shouldnt have access to (that's because i simply check if the user can enter the forum, and display nothing if he can't... the user can access that category, so the title is shown, even if the title comes from a "non accessible for the user" forum
Yet, it works, it doesn't show the title for the forums you don't have access to I tested it, but USE IT AT YOUR OWN RISK.
Code:
// Last post hack + check for view
$titleperm=getpermissions($forumid,-1,-1,$foruminfo['parentlist']);
if ($titleperm[canview]) {
$showtitle=1;
}
if ($showtitle) {
$forum['lasttitle']=unhtmlspecialchars($forum['lasttitle']);
if (strlen($forum['lasttitle']) > 25) {
$forum['lasttitle'] = substr($forum['lasttitle'], 0, 23);
$forum['lasttitle'] .= '..';
}
} else {
$forum['lasttitle']='';
}
Hello... at wich plase i must paste with code in.... sorry my english is not the best and i dont understand all that you write...
Sometimes when I click on the last title on the forum home I get the dreaded no thread specified error. I have narrowed it down to this piece of code (which is an addon to this hack posted by PPN elsewhere in this thread).
PHP Code:
// goto newest thread
if ($goto=="newthread") {
if (isset($forumid) and $forumid!=0) {
$foruminfo=verifyid("forum",$forumid,1,1);
$forumid=$foruminfo['forumid'];
$lastthread=$DB_site->query_first("SELECT threadid FROM post WHERE username='".addslashes($foruminfo[lastposter])."' AND dateline='$foruminfo[lastpost]'");
// $lastthread=$DB_site->fetch_array($DB_site->query("SELECT threadid FROM post WHERE username='".addslashes($foruminfo[lastposter])."' AND dateline='$foruminfo[lastpost]'"));
header("Location: showthread.php?s=$session[sessionhash]&threadid=$lastthread[threadid]");
exit;
}
}
and here is the line to replace in the "forumhome_lastpostby" template:
Quote:
<a href="showthread.php?s=$session[sessionhash]&goto=newthread&forumid=$forum[forumid]" title="Go to first post">$forum[lastthread]</a>
Can anyone please tell me why the threadid will not update at times? If I go into the Admin CP and use the update counters, then it works fine.
I've actually come really close to fixing that very issue. but unfortunately, i only had it working for some usergroups, while it was not updating for the others, is this the same problem your having? i'm using v2.2.9.
i was trying this hack for 2.3.0 but i did't appear to wrk, cause it shows the last title for everyone even if you are not logged in or the forum is a private one.