amykhar
10-10-2001, 10:00 PM
I am lazy by nature. I want to tell at a glance at the top of my forum home page if new posts are available or not. This hack does that.
In Index.php find:
} else {
$pminfo='';
}
Add right below:
$newJunk = $DB_site->query_first("SELECT lastpost AS recent FROM forum ORDER by lastpost
DESC");
if ($bbuserinfo['lastvisit'] < $newJunk['recent']) {
$newLinkColor = "red";
$newPostImage = "new";
}
else {
$newLinkColor = "black";
$newPostImage = "off";
}
(modify colors to your taste)
Upload a gif image called new.gif to your images folder. Many are freely available online. Pick one that suits your board.
Open template forumhome_newposts
Remove the code there, and insert this:
<img src="{image<b></b>sfolder} /$newPostImage.gif"> <a href="search.php?s=$session[sessionhash]&action=getnew"><font color="$newLinkColor">View New Posts</font></a>
That should do it.
Demo:
http://www.eaforums.com
Of course, the demo only works if you are registered and logged in.
Amy
In Index.php find:
} else {
$pminfo='';
}
Add right below:
$newJunk = $DB_site->query_first("SELECT lastpost AS recent FROM forum ORDER by lastpost
DESC");
if ($bbuserinfo['lastvisit'] < $newJunk['recent']) {
$newLinkColor = "red";
$newPostImage = "new";
}
else {
$newLinkColor = "black";
$newPostImage = "off";
}
(modify colors to your taste)
Upload a gif image called new.gif to your images folder. Many are freely available online. Pick one that suits your board.
Open template forumhome_newposts
Remove the code there, and insert this:
<img src="{image<b></b>sfolder} /$newPostImage.gif"> <a href="search.php?s=$session[sessionhash]&action=getnew"><font color="$newLinkColor">View New Posts</font></a>
That should do it.
Demo:
http://www.eaforums.com
Of course, the demo only works if you are registered and logged in.
Amy