PDA

View Full Version : hopefully this is a quick one $userinfo[action]


testbot
09-06-2009, 03:10 PM
i'm trying to get where the user is using below but it doesn't seem to be working. am i doing it wrong?

<if condition="$userinfo[action] == 'Gallery'">
whatever2
</if>

Lynne
09-06-2009, 03:35 PM
You are trying to get where the user is viewing? On what page? If you search on "userinfo['action']" in the php pages, you'll see that is only defined in the online.php page. So, you'd have to grab all that code for use on whatever page you want to use it on. Perhaps you can just use their 'lastactivity' or 'activity'? But, those are kinda weird to use cuz if they open up several pages in a tab, the last tab opened will be their last activity and that can be misleading.

Perhaps tell us what you are trying to do and we can suggest a way to do it.

testbot
09-06-2009, 03:54 PM
we have our main site menu at the top of the forum (http://forum.ampprod.com) and would like to set the 'Gallery' as the active menu item instead of 'Community Forum' when our members are viewing the gallery. i thought the best way to achive this would be to detect when someone is view the gallery and have an if condition change the menu item to active.

something like:

<li class="<if condition="">active<else >menu-item4</if>">

Lynne
09-06-2009, 04:25 PM
The gallery page should have something at the top that looks like this:
define('THIS_SCRIPT', 'gallery');

Then you can use THIS_SCRIPT in your template:
<if condiition="THIS_SCRIPT == 'gallery'">
stuff if they are on the gallery page
</if>

testbot
09-06-2009, 05:14 PM
worked like a charm! i'll have to buy you a drink one day for your help all the time. haha