PDA

View Full Version : View New Posts Color


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

amykhar
10-11-2001, 06:38 PM
Oops. I just realized something. My off.gif is a one pixel transparent gif. If your off.gif is an actual image, you will want to upload a one pixel blank gif, and substitue the name for that image where I have "off"

Amy

DarkManX_19
10-13-2001, 02:57 PM
what hack is that when u goto your forums and if your not reg'd that lil registration box pops up for you to register......

amykhar
10-13-2001, 03:10 PM
It's not a released hack. Just a combo of ideas posted in the request forum by various coders.

Amy

DarkManX_19
10-13-2001, 03:21 PM
Originally posted by amykhar
It's not a released hack. Just a combo of ideas posted in the request forum by various coders.

Amy

could you help me to do that??

or point me to the right threads so i could possible add it to my forum??


thanks