PDA

View Full Version : View New Posts Color


amykhar
11 Oct 2001, 19:17
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
11 Oct 2001, 19:38
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
13 Oct 2001, 15:57
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
13 Oct 2001, 16:10
It's not a released hack. Just a combo of ideas posted in the request forum by various coders.

Amy

DarkManX_19
13 Oct 2001, 16:21
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