Version: , by Zachery
Developer Last Online: May 2017
Version: Unknown
Rating:
Released: 11-14-2003
Last Update: Never
Installs: 0
No support by the author.
This should be a simple one,
This will show how many new posts there have been since a persons last visit, this now does show the ammount of new threads too, silly me, i forgot to update the varible when i copied the posts querry
this will add 2 queries to your forumhome, however i must warn that with this even only running on the forumhome, these queries might still be rather large if you have a very active forum. at least from what i understand
It will create a index in the database on the post table, the records are sorted by dateline. So when index.php is loaded vB's mysql has a index it can look at and retrive the records from, this is faster then having mySQL search the post table on every page load. However the trade off is that the index will take up some extra space in the database.
No, the query I posted will work with the modification as is. And should only be run once on the database.
Ive attached a php script that will do it for you, just upload it to the admincp directory and it should work.
Also you can cut down on alot of load by not running the querys for guests, to do so change the php block to this:
PHP Code:
if (THIS_SCRIPT == 'index' and $bbuserinfo['userid'] !== '0')
{
// Posts
$getnewposts = $DB_site->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "post WHERE dateline >= '$bbuserinfo[lastvisit]'");
$newposts = number_format($getnewposts['count']);
// Threads
$getnewthreads = $DB_site->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "thread WHERE dateline >= '$bbuserinfo[lastvisit]'");
$newthreads = number_format($getnewthreads['count']);
}
Boards that have converted their tables to innodb should avoid this modification also, it uses the count function which is slow under innodb, considering vBulletin uses count on these tables alot anyway this will only pour salt in a open wound.
Im not trying to bash this modification, you just have to be real careful when releasing/installing something like this, because it dose open the door up to all sorts of server load problems if not added correctly..
thanks brad, ill update my txt and point users to your attachment
im more than aware of this :\ and i didnt think about disabling it for guests, sliped my mind which i should know better as i already turn alot of things off for guests.
i do belive i did give somewhat of a warning however
i updated the txt instuctions to check for guests as well and redid abit of the html to make it look abit nicer to users who are guests
brad i noticed a small error in your coding when for !== would still show for guests while != will not run the querry for guests, ive updated my txt file anyone who installed this should update their phpinclude_start tempalte