vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Idle? Member's name turns grey. (https://vborg.vbsupport.ru/showthread.php?t=276710)

kpf1827 01-10-2012 03:27 AM

Idle? Member's name turns grey.
 
Looking for some help building a hack. If a member does not move pages for 5 minutes, their username turns grey to symbolize that they are idle.

Disasterpiece 01-10-2012 03:30 AM

there is a var called "last action" or something similar in the $vbulletin->session var which should be of use for your idea. Just check if the number is greater than $whatever_amount_of_seconds, then make the name grey, otherwise don't.

kpf1827 01-10-2012 03:55 AM

Can you nudge me in the right direction.

I have experience with template variables (if conditionals), however I am lost when you mention $vbulletin->session var

Disasterpiece 01-10-2012 04:52 AM

in template conditionals, you normally use regular php code, so... yeah. Something like this maybe:

HTML Code:

<vb:if condition="$vbulletin->session['lastactivity'] > 3600"><span class="idle"><vb:else /><span class="normal"></vb:if>
Not tested, but should do the trick.
Replace 3600 with any amount in seconds after you want the user to be idle.

kpf1827 01-12-2012 12:45 AM

Thanks, However I went into postbit_legacy and where it shows the username I added your code... with no effect

I've got to be missing something.

HTML Code:

<if condition="$show['profile']">
                               
<a class="bigusername" href="member.php?$session[sessionurl]u=$post[userid]">$post[musername]</a>


                                <script type="text/javascript"> vbmenu_register("postmenu_$post[postid]", true); </script>
                                <else />
                                <if condition="$vbulletin->session['lastactivity'] > 2000"><b>$post[musername]</b><else /><i>$post[musername]</i></if>
                                </if>
                        </div>


kpf1827 01-14-2012 01:23 AM

I am running Vbulletin 3.6.8 By the way, I think your above posts are referencing to vbulletin 4.0+

LifesGreatestGift 01-14-2012 05:10 AM

kpf1827's code is for vB3 ;)


All times are GMT. The time now is 11:16 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.01063 seconds
  • Memory Usage 1,722KB
  • 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
  • (2)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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