vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Mini Mods - Add Last Visit field to AdminCP (https://vborg.vbsupport.ru/showthread.php?t=264038)

TalkVirginia 05-22-2011 10:00 PM

Add Last Visit field to AdminCP
 
1 Attachment(s)
What does it do?
This code change will add the Last Visit time field to the user edit screen in the AdminCP. Not sure why this hasn't been added to the standard code set but I've been wanting this for a while. I figured others might too. This does make a simple change to the vbulletin user.php file.


What to do:
To make the change do the following. Anytime you make a change you may want to make a copy of the file in case for some strange reason the fille get corrupted. Either that or just replace it with the originial file from the distribution zip.

1. Open the user.php file in your AdminCP folder in Notepad++ or your favor text editor.
2. Go to line 473. On or about line 478 will be the array element for lastpost. Insert
a new lastvisit array element after the lastpost array element which should look like the following:
PHP Code:

  $user = array(
   
'invisible'                 => $vbulletin->bf_misc_regoptions['invisiblemode'] & $vbulletin->options['defaultregoptions'] ? 0,
   
'daysprune'                 => -1,
   
'joindate'                  => TIMENOW,
   
'lastactivity'              => TIMENOW,
   
'lastpost'                  => 0,
   
'lastvisit'                 => TIMENOW,
   
'adminemail'                => $vbulletin->bf_misc_regoptions['adminemail'] & $vbulletin->options['defaultregoptions'] ? 0,
   
'showemail'                 => $vbulletin->bf_misc_regoptions['receiveemail'] & $vbulletin->options['defaultregoptions'] ? 0,
   
'receivepm'                 => $vbulletin->bf_misc_regoptions['enablepm'] & $vbulletin->options['defaultregoptions'] ? 0

This array element will initialize the Last Visit Time field when manually adding a new member through the "Add new user" screen.

3. Find the "TIME FIELDS SECTION" of code which starts on or about line 935.
4. Insert the following line of code below the last activity field which is on or about line 941.

PHP Code:

 print_time_row($vbphrase['last_visit'], 'user[lastvisit]'$user['lastvisit']); 

5. Save the file.

You're done.

Log into your adminCP and check your work. You should now have the Last Visit time field in the user edit screen.

Special Pages 05-22-2011 11:32 PM

This is cool. Thanks again!

Alan_SP 05-23-2011 12:18 AM

What is difference between last activity and last visit? In image it's the same time.

TalkVirginia 05-23-2011 12:46 AM

Your last activity can be different than your last visit. Your last activity changes like when you post or blog, etc. You can login and not do anything therefore your last activity may not change.
What you see on the screen shot is from "Add new user" edit screen. Join date, Last activity, and last visit default to the current date.

Da-Vinci 05-23-2011 05:57 PM

1 Attachment(s)
Just checked my ACP on my own user profile and I get this.

https://vborg.vbsupport.ru/external/2011/05/20.jpg

I've just logged into my forum, not done anything else and the last Activity shows today's date and the time is from 3 minutes ago when I took the screen shot.

TalkVirginia 05-23-2011 06:44 PM

Quote:

Originally Posted by Da-Vinci (Post 2199190)
Just checked my ACP on my own user profile and I get this.

https://vborg.vbsupport.ru/attachmen...1&d=1306176939

I've just logged into my forum, not done anything else and the last Activity shows today's date and the time is from 3 minutes ago when I took the screen shot.

Ok. :confused: As I mentioned in a post or two up, the screen shot I took is from the "Add new user" screen. It's shows what it looks like after the code change.


All times are GMT. The time now is 01:56 PM.

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.01068 seconds
  • Memory Usage 1,739KB
  • 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_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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