vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   Update the "Who's Online" viewing location for new PHP files & Hacks (https://vborg.vbsupport.ru/showthread.php?t=46077)

!!! 11-24-2002 10:00 PM

Update the "Who's Online" viewing location for new PHP files & Hacks
 
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.

Link14716 11-24-2002 10:07 PM

I personally consider this more of a reference than a hack. But hey, it qaulifies. ;)

Erwin 11-24-2002 10:09 PM

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. :)

LOD-squa 11-24-2002 10:10 PM

I knew about this but it's a good idea to tell users how to do it.

Link14716 11-24-2002 11:22 PM

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 ;)

zajako 11-25-2002 02:21 PM

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.

Brad 11-25-2002 03:49 PM

Fireflys hack would never work for me, so ive always done it by hand.

SpeedStreet 11-26-2002 02:26 PM

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!

John 11-27-2002 09:43 PM

This method is great when you need to add different names for different GET strings :)


All times are GMT. The time now is 02:15 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.01311 seconds
  • Memory Usage 1,733KB
  • 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_code_printable
  • (4)bbcode_php_printable
  • (1)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