vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   hopefully this is a quick one $userinfo[action] (https://vborg.vbsupport.ru/showthread.php?t=222586)

testbot 09-06-2009 03:10 PM

hopefully this is a quick one $userinfo[action]
 
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:
PHP Code:

define('THIS_SCRIPT''gallery'); 

Then you can use THIS_SCRIPT in your template:
HTML Code:

<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


All times are GMT. The time now is 02:49 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01102 seconds
  • Memory Usage 1,720KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_html_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete