Uutiset:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu
Advertisement:

Can SMF recognize if your last session was in a board?

Aloittaja Biology Forums, elokuu 23, 2013, 02:18:48 AP

« edellinen - seuraava »

Biology Forums

I would like to do the following:

if(users last session was at board)

echo'';

else echo'';

Can that be done using $_SESSION?

Arantor

For what purpose exactly? The answer is probably no, but depending *exactly* what you're trying to do it might be doable in other ways.
Holder of controversial views, all of which my own.


Biology Forums

Thanks for the reply.

What I would like to create is:

IF(previous board session is not the same as current board session)

echo'';

So, let's say your board session is for board 1, if your new board session is from board 2 then execute whatever.

The reason I want this is there is a mod called topic filter. If you specify a specific setting/filter for board 1, it will have that setting for every other board you go to, unless you press reset. I want it to reset automatically once you leave board 1, for example. The code that causes this is (found in load.php):

'filter_topic' => isset($user_settings['filter_topic']) ? unserialize($user_settings['filter_topic']) : (empty($_SESSION['filter_topic']) ? '' : unserialize($_SESSION['filter_topic'])),

If SMF creates board sessions, I can say

IF(previous board session is not the same as current board session)
echo (THAT CODE)
else echo (NOTHING)

A good friend of mine did it for me a while ago very well, but my forum crashed and lost the code months ago.

Arantor

It doesn't create board sessions, it has a single session that persists for your visit. Nor does it store the board you're in inside a session. Doing so would be... interesting. And unreliable.
Holder of controversial views, all of which my own.


Advertisement: