new?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Johnzer
Forum Newbie
Posts: 3
Joined: Mon Nov 10, 2003 2:01 pm

new?

Post by Johnzer »

Hey all,

I was wondering does anyone know how to do this:

When you login, and if you have a new pm or theres a new upcoming important event how would I got about displaying this??

A perfect example is when you recieve a new pm (on this forum) and you login and it says how many new pm's you have, but I dont want it in a popup just an echo statement and another good example is when the images change to orange (on this board), when there is a new message since the last time you logged in/read that thread, btw I not making a forum just wondering how to do these things as I am making a script for my clan site (not up yet).

All help apperiated
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

Post by qads »

in the database, the PMs table has a field called "read", when you have viewd your messsage, it puts a value in it, later when you move to another page, it checks to see if there is any message with out a value in "read" field, if there is then thats the new message.

make sense?
Johnzer
Forum Newbie
Posts: 3
Joined: Mon Nov 10, 2003 2:01 pm

Post by Johnzer »

Yes I understand quite perfectly, how would i go about inserting this value into the database when the user checks on the message and goes into it to read it (the message it self)
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

When the user goes to read the message there's a bit of script that runs which uses the user's ID and the message's ID in order to update a record. So basically all you need is a unique identifier for your user and one for the message and you can mark stuff read for a particular user.

Mac
Johnzer
Forum Newbie
Posts: 3
Joined: Mon Nov 10, 2003 2:01 pm

Post by Johnzer »

Thanks qads and twigletmac, I'll try the user id and message id thing, once again thanks!
Post Reply