vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Boolean value for user online (https://vborg.vbsupport.ru/showthread.php?t=155740)

okgaz 08-20-2007 11:48 AM

Boolean value for user online
 
Hi!

I'm editing the layout of the member pages (MEMBERINFO template) + I wanted to get a boolean value (or something similar) that says whether the user is online or not.

At the moment all I can find is:

$userinfo[onlinestatus]

Which out puts the code for a red or green gif image :erm:

Anybody know how I can do it?

Thanks!

okgaz 08-22-2007 12:28 PM

Not possible? :(

EnIgMa1234 08-22-2007 01:39 PM

<if condition="$userinfo[onlinestatus] == 1">
ONLINE CODE
<else />
OFFLINE CODE
</if>

okgaz 08-22-2007 02:37 PM

Quote:

Originally Posted by EnIgMa1234 (Post 1323137)
<if condition="$userinfo[onlinestatus] == 1">
ONLINE CODE
<else />
OFFLINE CODE
</if>

That's exactly what I want to do but it doesn't work.

$userinfo[onlinestatus] returns:

Code:

<img class="inlineimg" src="http://forumname.com/images/statusicon/user_online.gif" alt="okgaz is online now" border="0" />
Rather than
Code:

1
When the user is online. :( I want something to just give a "1" or a "0" !

Wayne Luke 08-22-2007 03:41 PM

I believe you would need to create a plugin to create this value for your use.

Kirk Y 08-22-2007 03:57 PM

This may point you in the right direction: https://vborg.vbsupport.ru/showthread.php?t=153372

okgaz 08-22-2007 04:10 PM

Quote:

Originally Posted by Kirk Y (Post 1323273)
This may point you in the right direction: https://vborg.vbsupport.ru/showthread.php?t=153372

That's strange, I can't view that thread. Do I need to have certain user priviledges to view that part of the forum?

Kirk Y 08-22-2007 04:25 PM

Ah, forgot you weren't a Coder.

Create a plugin at hook location "member_complete" with the following:
Code:

$status = fetch_online_status($userinfo, false);
1 = Online; 0 = Offline; 2 = Invisible

okgaz 08-22-2007 08:08 PM

Worked perfect, thanks!!!

Quote:

Originally Posted by Kirk Y (Post 1323306)
Ah, forgot you weren't a Coder.

Create a plugin at hook location "member_complete" with the following:
Code:

$status = fetch_online_status($userinfo, false);
1 = Online; 0 = Offline; 2 = Invisible

Is it possible for me to do a similar thing for user rep power?

Something like:


Code:

$reppower = fetch_reppower($userinfo, $perms);
?

(that doesn't seem to work but I'm sure the solution is similar)


All times are GMT. The time now is 06:47 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.00994 seconds
  • Memory Usage 1,730KB
  • 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
  • (5)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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