Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons
Add Last Visit field to AdminCP Details »»
Add Last Visit field to AdminCP
Version: 1.00, by TalkVirginia TalkVirginia is offline
Developer Last Online: Mar 2013 Show Printable Version Email this Page

Category: Mini Mods - Version: 4.x.x Rating:
Released: 05-22-2011 Last Update: Never Installs: 7
Code Changes  
No support by the author.

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.

Screenshots

File Type: png admincp_lastvisit.png (33.3 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 05-22-2011, 11:32 PM
Special Pages Special Pages is offline
 
Join Date: Nov 2010
Location: www.TheDiscussionCafe.com
Posts: 194
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is cool. Thanks again!
Reply With Quote
  #3  
Old 05-23-2011, 12:18 AM
Alan_SP's Avatar
Alan_SP Alan_SP is offline
 
Join Date: Nov 2009
Posts: 1,122
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What is difference between last activity and last visit? In image it's the same time.
Reply With Quote
  #4  
Old 05-23-2011, 12:46 AM
TalkVirginia's Avatar
TalkVirginia TalkVirginia is offline
 
Join Date: Oct 2008
Location: Virginia
Posts: 545
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 05-23-2011, 05:57 PM
Da-Vinci Da-Vinci is offline
 
Join Date: Mar 2010
Posts: 249
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just checked my ACP on my own user profile and I get this.



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.
Attached Images
File Type: png Capture.PNG (28.9 KB, 0 views)
Reply With Quote
  #6  
Old 05-23-2011, 06:44 PM
TalkVirginia's Avatar
TalkVirginia TalkVirginia is offline
 
Join Date: Oct 2008
Location: Virginia
Posts: 545
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Da-Vinci View Post
Just checked my ACP on my own user profile and I get this.



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. 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.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:07 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06453 seconds
  • Memory Usage 2,281KB
  • Queries Executed 20 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (5)postbit
  • (2)postbit_attachment
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete