1

Topic: New/Not New posts

Hey!
I would like to know how can i do that when there are no new posts in the forum,
And when somebody will post a message the picture will be changed into the regular pic ( http://punbb.org/forums/img/Oxygen_new.png ).
And you have to be logged in, If the user will not be logged in, The picture of no new messages will appear...
Here is a sample from IPB:
http://www.imagetown.net/images/92597452.jpeg

And just like Simple Exploding Man did on his forums:
http://punbb.org/forums/viewtopic.php?id=3700

But I need just a one pic...

Thanks everybody! wink

Re: New/Not New posts

I'd give you the code but my server is down right now :verymad:.

3

Re: New/Not New posts

Ok,
So please give me the code when your server will work...

Re: New/Not New posts

The reason you don't see this icon's when you are not logged in is basicly because the server has no way of knowing if you have seen the post before or not.
You could implement that with a coockie, but why waste valuable server resource on that when you can be doing something else for your logged in users.

5 (edited by Simple Exploding Man 2004-04-27 12:06)

Re: New/Not New posts

You should have something like this on index.php:

if (!$cookie['is_guest'] && $cur_forum['last_post'] > $cur_user['last_visit'])
{
    if ($cur_user['show_img'] == '1')
        $icon = '<img src="img/'.$cur_user['style'].'_new.png" width="16" height="16" alt="">';
    else
        $icon = '<span class="puntext"><b>?</b></span>';
}
else
    $icon = ' ';

if (!$cookie['is_guest'] && $cur_forum['last_post'] > $cur_user['last_visit'])
{
    if ($cur_user['show_img'] == '1')
        $icon = '<img src="img/'.$cur_user['style'].'_new_on.png" alt="">';
    else
        $icon = '<span class="puntext"><b>?</b></span>';
}
else
{
    if ($cur_user['show_img'] == '1' || $cookie['is_guest'])
        $icon = '<img src="img/'.$cur_user['style'].'_new_off.png" alt="">';
    else
        $icon = ' ';
}

1) BACK UP :). It's a single file, but back it up.
2) I've removed the width/height setting.
3) If you want different images for different styles (CSS) you'll have to create them all. I use a single style (custom) so I removed the $cur_user['style'] code.

Change the code, then rename img/new.png to img/new_on.png and create a img/new_off.png that suits your tastes.

-----

Edit: The "dot" shown above has a code (& + #8226 + semicolon), look at the source because the forum it's converting it.

6

Re: New/Not New posts

Thanks wink