Jump to content

New session with global value


Alex007152

Recommended Posts

Hi, i'm stuck with my sessions on my new forum. When a new topic has been posted, the script automaticaly creates a new session saying the topic has not yet been read:

 

$_SESSION["Topic $topic"] = "Not Read";

 

Wich is obviously changed to "Read" as soon as the user gets redirected to his new topic. However, to everyone else this session obviously does not have a value when it's created. I basicaly need to give the session the value "Not Read" when it's created and that it appears so to everyone else. Never done this before, not sure how to. I've tried some database changes but that didnt work it out. Any idea's? Thanks allot in advance.  :)

Link to comment
Share on other sites

Perhaps theres an alternative method to do this? I basicaly need to get new topics indicating their new. For instance, a red button indicates the button is new, a blue button indicates its read or old. The problem is that my script automaticaly displays blue buttons (indicating the topic is read or old) when the session is not set or set as "Read", as the session will be deleted in time and thus not set (since it would take relatively few people to fill my web storage with sessions if they wouldnt be deleted) so i decided to give the user 7 days to read the topic or it's session will automaticaly be deleted and thus the blue button will be rendered. The problem is that i dont know how to give new topics a value so that they will be rendered red. If you know an alternative menthod please let me know, i urgently need to get this right. Thanks  :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.