Version: , by MrLister
Developer Last Online: Oct 2012
Version: 2.2.x
Rating:
Released: 10-31-2001
Last Update: Never
Installs: 85
No support by the author.
Somebody here request it so I made it quickly.... Basically this hack here tells your users how many new posts and threads there have been since hteir last visit on the main page.
$getnewthread=$DB_site->query_first("SELECT COUNT(*) AS threads FROM thread WHERE lastpost > '$bbuserinfo[lastvisit]'");
$getnewpost=$DB_site->query_first("SELECT count(*) AS posts FROM post WHERE dateline > '$bbuserinfo[lastvisit]'");
In the template forumhome_welcometext find:
PHP Code:
Welcome back, <b>$bbuserinfo[username]</b>
right under it add:
PHP Code:
<br>There have been <b>$getnewthread[threads]</b> threads and <b>$getnewpost[posts]</b> posts since your last visit!
That's it! If you installed the hack please click the install button!
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
is there a possibility with all the changes that have occured with this hack that someone can post the actual coding that does in fact work correctly again?
Im a bit unsure after reading through these posts what to remove and what not too and having the updated changes in one spot would be nice.
Roody (and any else who doesn't want to read through) ... in a good mood today, so I compiled the optimizations from the posts here and here it is:
:::Since Your LastVisit:::
*** optimized per the suggestions of the posts here. I also changed the text to display "There are X new thread and X new posts! ... simply b/c the other way made it seemed crowded up top. change it to whatever you'd like.
Run this query on your DB:
Code:
ALTER TABLE `post` ADD INDEX(`dateline`) ;
Edit: "index.php"
Find:
Code:
// if user is know, then welcome
Add below it:
Code:
$getnewthread=$DB_site->query_first("SELECT COUNT(*) AS threads FROM thread WHERE dateline > '$bbuserinfo[lastvisit]'");
$getnewpost=$DB_site->query_first("SELECT COUNT(*) AS posts FROM post WHERE dateline > '$bbuserinfo[lastvisit]'");
Edit Template: /Forum Home Page Templates/"forumhome_welcometext"
Find:
Code:
Welcome back, <b>$bbuserinfo[username]</b>
Add below it:
Code:
<br>There are <b>$getnewthread[threads]</b> new threads and <b>$getnewpost[posts]</b> new posts!
Originally posted by ExAvIoUr Roody (and any else who doesn't want to read through) ... in a good mood today, so I compiled the optimizations from the posts here and here it is:
:::Since Your LastVisit:::
*** optimized per the suggestions of the posts here. I also changed the text to display "There are X new thread and X new posts! ... simply b/c the other way made it seemed crowded up top. change it to whatever you'd like.
Run this query on your DB:
Code:
ALTER TABLE `post` ADD INDEX(`dateline`) ;
Edit: "index.php"
Find:
Code:
// if user is know, then welcome
Add below it:
Code:
$getnewthread=$DB_site->query_first("SELECT COUNT(*) AS threads FROM thread WHERE dateline > '$bbuserinfo[lastvisit]'");
$getnewpost=$DB_site->query_first("SELECT COUNT(*) AS posts FROM post WHERE dateline > '$bbuserinfo[lastvisit]'");
Edit Template: /Forum Home Page Templates/"forumhome_welcometext"
Find:
Code:
Welcome back, <b>$bbuserinfo[username]</b>
Add below it:
Code:
<br>There are <b>$getnewthread[threads]</b> new threads and <b>$getnewpost[posts]</b> new posts!
hi, this does speed things up, but when i mark all forums read or when i log out, and log back in, it still displays new threads.
thanks for the help man. sorry if you think i wasnt reading this thread through. in fact i read it thoroughly, but after all the posts i found it a little confusing. thanks for the update though.