vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   [HowTo] Add Custom Pages to WOL (https://vborg.vbsupport.ru/showthread.php?t=82882)

Jenta 10-07-2005 06:31 PM

seems u cant do phrasing in...
$userinfo['where'] = '<a href="YOUR_ADDIN_FILE.php?'.$vbulletin->session->vars[sessionurl].'">'.$vbulletin->options[bbtitle].PHRASE</a>';
unless someone wants to explain to me how

you can use them under viewing blah(the description) though

ps. can someone delete all the redirects in here?

dreamer81 11-08-2005 03:38 PM

uhhhhhh how do I add hooks? or do this???? ???

MrBen 02-18-2006 09:36 PM

How would I go about adding a custom WOL line for a URL like somepage.php?foo=bar

$filename only contains somepage.php so is there another variable that contains the querystring?

Thanks,
Ben

IrPr 04-11-2006 07:51 AM

Quote:

Originally Posted by imported_MrBen
How would I go about adding a custom WOL line for a URL like somepage.php?foo=bar

$filename only contains somepage.php so is there another variable that contains the querystring?

Thanks,
Ben

Me Too!

MrBen 04-12-2006 05:00 PM

Quote:

Originally Posted by IrPr
Me Too!

This is what I did in the end... It's basically the same as the OP but you add some code in another hook.


There are three hook locations we need to add plugins to:
  • vBulletin : Who's Online? -> online_location_preprocess
  • vBulletin : Who's Online? -> online_location_process
  • vBulletin : Who's Online? -> online_location_unknown

Add the online_location_preprocess hook plugin...
Hook Location: online_location_preprocess
Name: WOL Online Location PreProcess
Active: YES
Code:
PHP Code:

if ($loc == '/folder/index.php?foo=bar' OR $loc == '/folder/?foo=bar')
{
    
$filename 'foo_bar.php';


The rest is the same as the OP but I'll post it here for completeness...

Add the online_location_process hook plugin...
Hook Location: online_location_process
Name: WOL Online Location Process
Active: YES
Code:
PHP Code:

if($filename=='foo_bar.php'){$userinfo['activity'] = 'YOUR_ACTIVITY';} 


Add the online_location_unknown hook plugin...
Hook Location: online_location_unknown
Name: WOL Online Location Unknown
Active: YES
Code:
PHP Code:

if($userinfo['activity']=='YOUR_ACTIVITY')
{
    
$userinfo['where'] = '<a href="YOUR_ADDIN_FILE.php?'.$vbulletin->session->vars[sessionurl].'">'.$vbulletin->options[bbtitle].' YOUR_ACTIVITY</a>'
    
$userinfo['action'] = 'YOUR_ACTIVITY';
    
$handled true;


Ben

phill2003 09-03-2006 07:58 PM

Hi,

This is brill but i have a question if i may.

How do i go about giving seperate locations if 2 files share the same name. i have a gallery with an index.php and the whos online gives the location as the home page because thats index as well.

I tried this.

Code:

if ($loc == '/folder/index.php')
{
    $filename = 'index.php';

in the preprocess to hopefully get it to recognose the different index.php but it didnt.

Antivirus 10-14-2006 11:29 PM

One thing I notice about this is it only seems to work when the user is logged in, otherwise if it's a guest viewing a custom page, it just says "Viewing Index". Is there any way to get it to show custom locations for guests as well?

harmor19 10-16-2006 05:21 AM

Thank you for the tutorial.

ruinernix 10-18-2006 12:55 AM

I coded this to show my index.php properly, so I don't have to edit vb's code.. may have to customize it for your own needs ;) it's working for me... so I can show my pages from index.php and use hooks to properly name/show them. Hope it helps.

PHP Code:

require_once('global.php');
require_once(
'includes/functions_user.php');

if(
$vbulletin->userinfo['userid'] > 0
    
$location $vbulletin->db->query_first("SELECT location,sessionhash FROM " TABLE_PREFIX "session WHERE userid = ".$vbulletin->userinfo['userid']." ORDER BY lastactivity DESC LIMIT 1");
else
    
$location $vbulletin->db->query_first("SELECT location,sessionhash FROM " TABLE_PREFIX "session WHERE sessionhash = '".$vbulletin->session->vars['dbsessionhash']."' ORDER BY lastactivity DESC LIMIT 1");

if(
$location['sessionhash'] != "") {
    
$vbulletin->db->query_first("UPDATE " TABLE_PREFIX "session SET location = 'konspiracy.php?"$_SERVER["QUERY_STRING"] ."', lastactivity = '"TIMENOW ."' WHERE sessionhash = '"$location['sessionhash'] ."' LIMIT 1");
} else {
    
$vbulletin->db->query_first("INSERT INTO `session` ( `sessionhash` , `userid` , `host` , `idhash` , `lastactivity` , `location` , `useragent` , `styleid` , `languageid` , `loggedin` , `inforum` , `inthread` , `incalendar` , `badlocation` , `bypass` , `profileupdate` ) 
        VALUES ( '"
$vbulletin->session->vars['dbsessionhash']."', ".$vbulletin->userinfo['userid'].",  '".IPADDRESS."' , '".$vbulletin->session->vars['idhash']."', '".TIMENOW."', 'konspiracy.php?"$_SERVER["QUERY_STRING"] ."', '".$_SERVER["HTTP_USER_AGENT"]."', '0', '0', '1', '0', '0', '0', '0', '0', '0');");



Antivirus 11-10-2006 11:09 PM

Thanks Ruinerix, i think that will help, going to try it out this weekend.


All times are GMT. The time now is 06:51 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.01728 seconds
  • Memory Usage 1,766KB
  • 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)bbcode_code_printable
  • (4)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete