vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   User last active (https://vborg.vbsupport.ru/showthread.php?t=48809)

bharvey42 02-11-2003 06:12 PM

User last active
 
Is there a variable for the last visit to the board? I am making a some modifications. Is there one for online status as well?

I tried this $bbuserinfo[lastvisit]

and that didn't do it.

Also I would like to pull some info from the db and display it in the profile

Where would I make this modification in member.php?

N9ne 02-11-2003 06:24 PM

$lastvisit = $DB_site->query("SELECT lastactivity FROM user");

That could be the query being run in member.php
$lastvisit['lastactivity'] would be the variable I think.

You'd need to use code like this though:

$lastactive=intval($lastvisit['lastactivity']/86400)

So the variable to place in the template getinfo would be $lastactive.

Ok this is just my guess on what the code could be, don't use this until someone with more experience can confirm it.

Xenon 02-11-2003 06:32 PM

if it's for the currently logged in user

there are several
$bbuserinfo[lastvisit] -> unixdatelin from the last visit (last login)
$bbuserinfo[lastactivity] -> unixdateline when the user was active the last time (normally it would be now)
$bbuserinfo[lastpost] -> dateline of last post :)

to convert the datelines into Humanreadable text you have to use the date() function :)

N9ne 02-11-2003 06:38 PM

He said that $bbuserinfo[lastvisit] didn't work in member.php. So I just grabbed the data again and messed with it :D I didn't know there was already variables for them :).

bharvey42 02-11-2003 06:41 PM

no, $bbuserinfo[lastvisit] didn't work in the template.

and using $lastactive in the template doesn't work either

Xenon 02-11-2003 06:50 PM

the $bbuserinfo variables work everywhere in every template except these templates are called from within a function where $bbuserinfo was not globalized....

if you want to show the infos from the user who's profile is viewed, you have to use $userinfo[...] instead of $bbuserinfo[..]

N9ne 02-11-2003 06:50 PM

I don't think $lastactive will work in a template until some more code is added, I think it needs to be wrapped up with the eval()'d code for the getinfo template. Did you put in the query and other code I posted aswell? Just putting in the variable will not work.

bharvey42 02-11-2003 09:08 PM

so insert the code into the member.php then the other code will work in the template?

N9ne 02-11-2003 09:30 PM

I'd need to look into this, but it's 11:30pm here and I have school tomorrow. I'll look at it tomorrow evening if it's ok and release it as a proper hack?

N9ne 02-12-2003 08:52 PM

<a href="https://vborg.vbsupport.ru/showthread.php?s=&threadid=48848" target="_blank">https://vborg.vbsupport.ru/showt...threadid=48848</a>

Hack released.


All times are GMT. The time now is 10:04 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.01352 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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