Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin 3 Articles
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Update the "Who's Online" viewing location for new PHP files & Hacks
!!!'s Avatar
!!!
Join Date: Nov 2002
Posts: 70

 

Show Printable Version Email this Page Subscription
!!! !!! is offline 11-24-2002, 10:00 PM

This is simple, and I apologize for it being a pathetic one...but it's useful.

Open up online.php (in your root folder), and search for this code:

PHP Code:
    case 'edit':
      
$userinfo[where] = "Editing Post";
      break; 
Place below it the following code:

PHP Code:
    case 'TITLEOFPAGE':
      
$userinfo[where] = "DESCRIPTION OF PAGE";
      break; 
MAKE SURE YOU REPLACE "TITLEOFPAGE" WITH THE NAME OF THE PAGE (JUST LETTERS; NO FANCY CHARACTERS OR SPACES) -- a good idea might be to end it with "funfun" or something so that you don't replicate an already existing title.

The "DESCRIPTION OF PAGE..." part will be what shows up in the location menu on the "Who's Online" page.

Now, to add the final altering to make the whole thing work, find:

PHP Code:
  case 'register.php':
    
$userinfo[activity] = 'register';
    break; 
After it, add:

PHP Code:
  case 'NAMEOFPHPFILE':
    
$userinfo[activity] = 'TITLEOFPAGE';
    break; 
Make sure you replace "TITLEOFPAGE" with the one you used above. Then, replace "NAMEOFPHPFILE" with the name of the file that the viewer is actually at.

I did it on my boards for "toplist.php" & "attach.php." Their codes were:

Code:
    case 'toplist':
      $userinfo[where] = "Forum Top Sites";
      break;
    case 'attach':
      $userinfo[where] = "Attachment Listings";
      break;
and

Code:
  case 'toplist.php':
    $userinfo[activity] = 'toplist';
    break;
  case 'attach.php':
    $userinfo[activity] = 'attach';
    break;
I'm going to do it for the shoutbox as well, but I think you get the idea. So, have fun.
Reply With Quote
  #2  
Old 11-24-2002, 10:07 PM
Link14716's Avatar
Link14716 Link14716 is offline
 
Join Date: Jun 2002
Location: Georgia, USA
Posts: 2,519
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I personally consider this more of a reference than a hack. But hey, it qaulifies.
Reply With Quote
  #3  
Old 11-24-2002, 10:09 PM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Or you can just install Firefly's "Who's Online Location via Admin CP" hack, and do all this via your Admin CP without needing to hack your online.php each time you have a new file.
Reply With Quote
  #4  
Old 11-24-2002, 10:10 PM
LOD-squa's Avatar
LOD-squa LOD-squa is offline
 
Join Date: Aug 2002
Location: Orlando, Florida
Posts: 238
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I knew about this but it's a good idea to tell users how to do it.
Reply With Quote
  #5  
Old 11-24-2002, 11:22 PM
Link14716's Avatar
Link14716 Link14716 is offline
 
Join Date: Jun 2002
Location: Georgia, USA
Posts: 2,519
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Erwin
Or you can just install Firefly's "Who's Online Location via Admin CP" hack, and do all this via your Admin CP without needing to hack your online.php each time you have a new file.
I prefer hand-editing the file to tell you the truth. That way I have more control over it
Reply With Quote
  #6  
Old 11-25-2002, 02:21 PM
zajako's Avatar
zajako zajako is offline
 
Join Date: Jan 2002
Location: a place not to far away
Posts: 633
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hand editing something like this is only 2 lines that need not be custminzed, otehr than the name, so fireflys hack is rather good even if you like to have more control.
Reply With Quote
  #7  
Old 11-25-2002, 03:49 PM
Brad Brad is offline
 
Join Date: Nov 2001
Posts: 4,765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Fireflys hack would never work for me, so ive always done it by hand.
Reply With Quote
  #8  
Old 11-26-2002, 02:26 PM
SpeedStreet SpeedStreet is offline
 
Join Date: Aug 2002
Posts: 291
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Im in agreement with Anime-Loo. For quick and dirty and easy, say if you only have one page or so to add, this is a useful tool. Thanks!
Reply With Quote
  #9  
Old 11-27-2002, 09:43 PM
John's Avatar
John John is offline
 
Join Date: Mar 2002
Location: Norwich, UK
Posts: 1,543
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This method is great when you need to add different names for different GET strings
Reply With Quote
Reply


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 09:24 AM.


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.04128 seconds
  • Memory Usage 2,278KB
  • Queries Executed 22 (?)
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_code
  • (4)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (8)postbit
  • (9)postbit_onlinestatus
  • (9)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_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete