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.
if ($visible) {
+--------------------------------------------------------------------------+
|
+-----------------------------------------------+
| Replace it with:
+--------------------------------------------------------------------------+
updateforumcount($threadinfo[forumid]);
$lastpost=$DB_site->query_first("SELECT * FROM forum WHERE forumid='$threadinfo[forumid]'");
if($lastpost['lastpost']==$threadinfo['dateline']) {
$DB_site->query("UPDATE forum SET lastthread='".addslashes(htmlspecialchars($title)) ."' WHERE forumid='$threadinfo[forumid]'");
}
if ($visible) {
+--------------------------------------------------------------------------+
that dont show for me either on vb 2.2.6 for the postings.php file.
when i search for updateforumcount($threadinfo[forumid]); .. about 4 of them comes up without the invisible part.
I just installed this on 2.2.9 but I got an error when I went to update the forum info. This is the error:
Quote:
Database error in vBulletin Control Panel 2.2.9:
Invalid SQL: SELECT * FROM thread WHERE forumid='10' AND lastposter='Boofo's Babe' AND lastpost='1042060020'
mysql error: You have an error in your SQL syntax near 's Babe' AND lastpost='1042060020'' at line 1
I changed the user name causing this to Boofos Babe without the apostrophe, but it still gives me the error. Can anyone please help me with this as my board is messed up now?
Ok, I finally got the forum update counters to work by making the last post by someone other than the user with an apostrophe in the name. If they post any last posts in the future, then we are going to run into the problem again. I think it has something to do with adding htmlspecialchars or something like that to the last poster in the hack but I'm not sure where to add that to avoid the db error problem in the future. Can anyone lend a hand on that? Also, I get this error when I click on a last post link from a forum that has only 1 thread and 1 post in it.
Quote:
No thread specified. If you followed a valid link, please notify the webmaster
It seems if there is more than 1 post in 1 thread, then the link clicks through fine. Anyone have any ideas on how to fix this?
Originally posted by TECK it's fixed now. make sure when you download the file, at the top it says version 1.1, not 1.0.
if it says 1.0, clear your browser temp files.
for those of you who want to have a link the the thread itself, instead of going to the last post do this:
open showthread.php and find:
Code:
if ($goto=="nextnewest") {
replace it with:
Code:
// goto newest thread
if ($goto=="newthread") {
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");
header("Location: showthread.php?s=$session[sessionhash]&threadid=$thread[threadid]");
exit;
}
}
if ($goto=="nextnewest") {
scott, let me know if you found the code acceptable on the .txt file. thanks you.
update: i'm gonna look also in postings.php file, it needs to be also modified. for example if you edit a thread title, it wont update the thread... i will look into it and post the mod here...
floren.
Floren, will the following code do the same thing or do I need to change it to your code above?
Code:
open showthread.php and above:
if ($goto=="nextnewest") {
$thread = verifyid("thread",$threadid,1,1);
add:
// goto newest thread
if ($goto=="newthread") {
if (isset($forumid) and $forumid!=0) {
$foruminfo=verifyid("forum",$forumid,1,1);
$forumid=$foruminfo['forumid'];
$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;
}
}
In the "forumhome_lastpostby" template:
change:
<a href="showthread.php?s=$session[sessionhash]&goto=lastpost&forumid=$forum[forumid]">$forum[lastthread]</a>
to:
<a href="showthread.php?s=$session[sessionhash]&goto=newthread&forumid=$forum[forumid]" title="Go to first post">$forum[lastthread]</a>
Is anyone still supporting this hack? I finally got it working ok, but I ran into a problem earlier tonight. I got the
Quote:
No thread specified. If you followed a valid link, please notify the webmaster
error again while clicking on the last title link on one of the forums on the forumhome. When I ran the update counters for the threads and then the forums, the link was clickable again. Does anyone have any idea what would cause this to happen? The thread in question did have some dashes in the title name, if that means anything.
I found a bug in this hack, say you disallow guests to view threads in a forum, the guest can still see the title on forumhome, what can I do to make it so they only see the last post they're supposed to see?
I have installed this hack and it partly works. I have checked the installation and all seems to be as per instructions. I also have a gateway (usenet) hack installed which maybe causing a conflict.
My problem is:
The last post date / name etc are fine
The last post title is incorrect - it was correct the first time but won't update.
The link from the last post title works, and takes you to the last post.
Ok - I think I've figured it out. As all my threads come from usenet, the gateway script imports them into the db. Therefore after each import, the 'update forums info' needs to be run. In my case this is 6 times every hour. I have written a cron job calling the misc.php file. It seems to be working, but don't know what it will mean to the server load.
have the same problem using 2.2.9 Hack was working then I installed this hack https://vborg.vbsupport.ru/showthrea...threadid=34361 now when someone registers it puts the info for that user in the post but does not update on forumhome page. I can go and run update counters in admin cp and it updates then. Any ideas.?