Version: , by fastforward
Developer Last Online: Nov 2011
Version: Unknown
Rating:
Released: 06-05-2001
Last Update: Never
Installs: 0
No support by the author.
This is for vB 2.01
This is new thread as there seems to be a problem with editing attachments on old posts.
This little hack allows the display of the last active thread on the forums pages. This is the 'UBB like' feature. You can see an example at http://dbforums.com.
NOTES
It requires two extra column to be added in the forum table a few code additions and then the thread title and iconid can be referenced using the variables $forum[lastactivethread] and icon$forum[lastactiveiconid].gif. Instructions are in the attachment.
This was originally part of my usenet hack and due to popular request ( all two of them ) I'm releasing it seperately.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
// ###################### Start indexpost #######################
function indexpost($postid,$firstpost=-1) {
global $DB_site,$bbadminon,$minsearchlength,$maxsearchlength;
global $firstpst,$badwords,$incp;
if (!is_array($badwords)) {
if ($incp) {
include("./badwords.php");
} else {
include("./admin/badwords.php");
}
// START LAST ACTIVE THREAD HACK
update_last_active_thread(0,$post[threadid],0);
// END LAST ACTIVE THREAD HACK
}
I am seeing a bug. It is consistantly displaying the title of the post one post BEFORE the last post. It worked the first time through, meaning that the first post registered correctly. Now, it is consistantly one behind.
It seems to work perfect when I make a new thread/reply but if left for a while it constantly stays one post behind
whats also weird is that some forums are correct and some are one behind - very VERY strange
check it out and you will see what I mean
I REALLY loved this feature when used to use UBB so was very happy when you rls'd this
any help would be much appreciated (perhaps table indexes are wrong? or the function.php is slightly wrong?)
also how to increase the table width for Last post - i'd like to widen it a bit but i'm totally missing where I should implement the change (doh!)
I had the same problem. Under certain circumstances vB is not reindexing when replying to a message. This additionl index-call should solve the problem:
Just replace in newreply.php :
PHP Code:
indexpost($postid,0);
if ($visible) {
if ($threadinfo[replycount]%10==0) {
$replies=$DB_site->query_first("SELECT COUNT(*)-1 AS replies FROM post WHERE threadid='$threadid'");
$DB_site->query("UPDATE thread SET lastpost='".time()."',replycount='$replies[replies]',lastposter='".addslashes($postusername)."' WHERE threadid='$threadid'");
} else {
$DB_site->query("UPDATE thread SET lastpost='".time()."',replycount=replycount+1,lastposter='".addslashes($postusername)."' WHERE threadid='$threadid'");
}
}
by:
PHP Code:
indexpost($postid,0);
if ($visible) {
if ($threadinfo[replycount]%10==0) {
$replies=$DB_site->query_first("SELECT COUNT(*)-1 AS replies FROM post WHERE threadid='$threadid'");
$DB_site->query("UPDATE thread SET lastpost='".time()."',replycount='$replies[replies]',lastposter='".addslashes($postusername)."' WHERE threadid='$threadid'");
} else {
$DB_site->query("UPDATE thread SET lastpost='".time()."',replycount=replycount+1,lastposter='".addslashes($postusername)."' WHERE threadid='$threadid'");
}
indexpost($postid,0);
}
if there are better solutuions, please let us know how!
eurosale:
Sorry ,i still have a problem to solve.
I have three sub forums in a main forum.
in my hacked board, the main forumhome lastposttitle always show the main forum's,but the sub forums have newest thread!
eurosale:
Sorry ,i still have a problem to solve.
I have three sub forums in a main forum.
in my hacked board, the main forumhome lastposttitle always show the main forum's,but the sub forums have newest thread!