Lea Verou |
11-14-2007 01:04 PM |
As I promised, here's how to fix the new/old post icon issue:
Open the plugin Alp Ajax Start
Find:
PHP Code:
$gthreads = $db->query_read(" SELECT thread.threadid, thread.title, thread.lastpost, thread.forumid, thread.replycount, thread.lastposter, thread.dateline, IF(thread.views<=thread.replycount, thread.replycount+1, thread.views) AS views, thread.visible, user.username, user.userid, user.usergroupid, IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, forum.title as forum_title FROM " . TABLE_PREFIX . "thread AS thread LEFT JOIN " . TABLE_PREFIX . "user AS user ON (user.username = thread.lastposter) LEFT JOIN " . TABLE_PREFIX . "forum as forum on (thread.forumid = forum.forumid) WHERE NOT ISNULL(thread.threadid) $excludedforums AND thread.visible = 1 ORDER BY lastpost DESC LIMIT 0, $alpmax");
replace with:
PHP Code:
$gthreads = $db->query_read(" SELECT thread.threadid, thread.title, thread.lastpost, thread.forumid, thread.replycount, thread.lastposter, thread.dateline, IF(thread.views<=thread.replycount, thread.replycount+1, thread.views) AS views, thread.visible, user.username, user.userid, user.usergroupid, IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, forum.title as forum_title " . (($vbulletin->options['threadmarking'] AND $vbulletin->userinfo['userid']) ? ", threadread.readtime AS readtime" : "") . " FROM " . TABLE_PREFIX . "thread AS thread LEFT JOIN " . TABLE_PREFIX . "user AS user ON (user.username = thread.lastposter) LEFT JOIN " . TABLE_PREFIX . "forum as forum ON (thread.forumid = forum.forumid) " . (($vbulletin->options['threadmarking'] AND $vbulletin->userinfo['userid']) ? " LEFT JOIN " . TABLE_PREFIX . "threadread AS threadread ON (threadread.threadid = thread.threadid AND threadread.userid = " . $vbulletin->userinfo['userid'] . ")" : "") . " WHERE NOT ISNULL(thread.threadid) $excludedforums AND thread.visible = 1 ORDER BY lastpost DESC LIMIT 0, $alpmax");
Then find:
PHP Code:
if ($getstats_thread[lastpost] > $vbulletin->userinfo['lastvisit']) { $gthread_newpost = 'new'; } else { $gthread_newpost = 'old'; }
and replace with:
PHP Code:
if ($gthread['lastpost'] <= $gthread['readtime']) { $gthread_newpost = 'old'; } else { $gthread_newpost = 'new'; }
Do the same with the plugin Alp Load.
Notice: The code to find is from the previous version. I didn't upgrade to the latter as I didn't need the new features, so perhaps the code to find is a little different.
Btw I noticed another bug with this: If in a forum a user can only view own threads and not others' threads, the permission doesn't get applied to the new posts: He can view others' threads from that forum as well.
|