PDA

View Full Version : Question about [HOW TO - vB4] Create your own vBulletin page


Xencored
05-16-2010, 02:40 AM
Instructions to Add your Page to the Who's Online List (WOL):
Create two plugins using the following hooks. Replace mypage and similar with your information.

1. hook location - online_location_process:
switch ($filename)
{
case 'test.php':
$userinfo['activity'] = 'mypage';
break;
// add more cases here if you have more than one custom page. no need for multiple plugins. one plugin can handle all.
}.
2. hook location online_location_unknown:
switch ($userinfo['activity'])
{
case 'mypage':
$userinfo['where'] = '<a href="test.php?'.$vbulletin->session->vars[sessionurl].'">My Page</a>';
$userinfo['action'] = "Viewing My Page";
$handled = true;
break;
// add more cases here if you have more than one custom page. no need for multiple plugins. one plugin can handle all.
}.
The colored part in the code above shows what you need to change in the plugins (both reds should be the same and both blues should be the same, whereas green can be whatever you want).
[/URL]

Hey i quoted this from your "[HOW TO - vB4] Create your own vBulletin page" but didnt want to ask on that Article because my question is to do with a None Vbulletin page

Can i use this code for adding a none Vbulletin page on 4.0?

case 'href="www.test.com'
Something like that?

Thanks

Lynne
05-16-2010, 03:31 AM
Follow the hook_location "online_location_process" and find out what the switch is doing. It's looking at the location your user is at. And, that location is grabbed from the location field in the session table. If your users location is in there, then you can use it. If your user is somewhere where the location isn't entered into the session table, they you can't use it.

Xencored
05-16-2010, 03:37 AM
Follow the hook_location "online_location_process" and find out what the switch is doing. It's looking at the location your user is at. And, that location is grabbed from the location field in the session table. If your users location is in there, then you can use it. If your user is somewhere where the location isn't entered into the session table, they you can't use it.

Thanks i have never messed with Hooks before and no idea where to find them
Where would i search "online_location_process" or "hook_location" in the adminCP

Would it be the "Plugin System"?
Thanks

Lynne
05-16-2010, 03:39 AM
Doesn't your text editor search files? I just plug in a word and ask it to do a search in my uploads directory. I couldn't code if I couldn't go look up hook locations (how else do you find what variables are available for use?). This particular hook is in the functions_online.php file.

Xencored
05-16-2010, 03:41 AM
Doesn't your text editor search files? No can you tell me which one you use please?

and you can search Within the files in your FTP?

Edit wow it does lol Thanks
i didnt even know it could do this Thank you !

Lynne
05-16-2010, 02:54 PM
I use BBEdit, but it's for Macs.

Xencored
05-17-2010, 03:27 AM
All right hours trying (thought i could do it without asking your help again but here i am)

This is what i have done and where i am also stuck

I made this php script

<?php

error_reporting(E_ALL & ~E_NOTICE);
define('NO_REGISTER_GLOBALS', 1);
define('CSRF_PROTECTION', true);

$phrasegroups = array();
$specialtemplates = array();
$globaltemplates = array();
$actiontemplates = array();

chdir ('/home/*******/public_html');
require_once('./global.php');

exec_shut_down();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="ltr" lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Extra Online Users</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="content-language" content="en" />
</head>
<body style="margin: 0px">
<!-- -->
</body>
</html>

And uploaded it to my root
I than added
<iframe src="http://www.myanimeisland.com/extra_online_users.php" scrolling="no" allowtransparency="true" frameborder="0" width="0" height="0"></iframe>
To my none VB page

Than added these two in the plugin manager

online_location_proces
switch ($filename)
{
case 'extra_online_users.php':
$userinfo['activity'] = 'extra_online_users.php';
break;
// add more cases here if you have more than one custom page. no need for multiple plugins. one plugin can handle all.
}

online_location_unknown
switch ($userinfo['activity'] == 'extra_online_users')
{
case 'extra_online_users.php':
$userinfo['where'] = '<a href="extra_online_users.php?'.$vbulletin->session->vars[sessionurl].'">MAI-Wallpapers</a>';
$userinfo['action'] = "Viewing MAI-Wallpapers";
$handled = true;
break;
// add more cases here if you have more than one custom page. no need for multiple plugins. one plugin can handle all.
}

Now on my whos online i see the user on my page But it says
Unknown Location
/extra_online_users.php

I just cant seem to get it to say "Viewing MAI-Wallpapers" and point to the URL
Anyone any ideas?

Thanks alot:D

Lynne
05-17-2010, 02:27 PM
I don't think putting it in an iframe is going to work with this. Have you tried going to the page and then checking your location in the session table to see what it says? Like I said above, the location is in there and so you need to make sure it is correct in there or you can't use it.

Xencored
05-17-2010, 03:33 PM
I don't think putting it in an iframe is going to work with this. Have you tried going to the page and then checking your location in the session table to see what it says? Like I said above, the location is in there and so you need to make sure it is correct in there or you can't use it.

Hey
Yea ive been to the page and it says Unknown Location /extra_online_users.php in the whos-online

You say iframe might not work how would you add it if you was doing this?

Thanks Lynne your the best :up:

Lynne
05-17-2010, 07:03 PM
Try changing these lines to not have the .php:
$userinfo['activity'] = 'extra_online_users';
case 'extra_online_users':

Also, did you make sure your plugins were turned on?

Xencored
05-17-2010, 08:54 PM
Try changing these lines to not have the .php:
$userinfo['activity'] = 'extra_online_users';
case 'extra_online_users':

Also, did you make sure your plugins were turned on?

Hey
I tryed without the .php same problem tho

here is a screeny of the "whos online"

117244

Thanks

Lynne
05-17-2010, 09:39 PM
Have you looked to see exactly what is in the session table at all? and those plugins are active?

Xencored
05-17-2010, 09:43 PM
Have you looked to see exactly what is in the session table at all? I dont understand what you mean so ;/ No dont think i have.

and those plugins are active?
Yup there are Active

Lynne
05-17-2010, 09:50 PM
I mean, have you actually looked at the session table in the database and seen what is in there - you need to see what information is in there. Also, is your custom page in the same directory as the vbulletin files? This won't work if it isn't.

Xencored
05-17-2010, 10:22 PM
Also, is your custom page in the same directory as the vbulletin files? This won't work if it isn't.

Oh wait yes the "extra_online_users.php" is in my Forum Dir
As for the database no i stay away from them they scare me :/

if this means i have to mess with SQL i guess ill have to forget the idea
I saw you tut and the other guys "whos online idea" and tryed to get it to work on 4.0

Thanks

Lynne
05-17-2010, 11:03 PM
Wait a sec... why did you make this line like this:
switch ($userinfo['activity'] == 'extra_online_users')

It's supposed to just be:
switch ($userinfo['activity'])

Xencored
05-17-2010, 11:15 PM
Wait a sec... why did you make this line like this:
switch ($userinfo['activity'] == 'extra_online_users')

It's supposed to just be:
switch ($userinfo['activity'])

I was mixing codes from https://vborg.vbsupport.ru/showthread.php?t=157329&highlight=online

An i trying without == 'extra_online_users

Same results

Lynne
05-17-2010, 11:18 PM
So exactly what is your code in those two plugins right now?

Xencored
05-17-2010, 11:38 PM
So exactly what is your code in those two plugins right now?


Product= vBulletin
Hook Location = online_location_process
Title = online_location_process
switch ($filename)
{
case 'extra_online_users':
$userinfo['activity'] = 'extra_online_users';
break;
// add more cases here if you have more than one custom page. no need for multiple plugins. one plugin can handle all.
}
Plugin is Active = Yes

Product= vBulletin
Hook Location = online_location_unknown
Title = online_location_unknown
switch ($userinfo['activity'])
{
case 'extra_online_users':
$userinfo['where'] = '<a href="extra_online_users.php?'.$vbulletin->session->vars[sessionurl].'">MAI-Wallpapers</a>';
$userinfo['action'] = "Viewing MAI-Wallpapers";
$handled = true;
break;

// add more cases here if you have more than one custom page. no need for multiple plugins. one plugin can handle all.
}
Plugin is Active = Yes

This is the two codes from the plugins
Thanks

Lynne
05-18-2010, 01:53 AM
Whoops.... when I told you to change that one line and remove the .php from it, I meant the other one, not both. Sorry about that. For the first plugin, you need to have that in the case line:

switch ($filename)
{
case 'extra_online_users.php':
$userinfo['activity'] = 'extra_online_users';
break;
// add more cases here if you have more than one custom page. no need for multiple plugins. one plugin can handle all.
}

Leave the second one as is. Now let's see if it works. (Again, sorry about that, I didn't look to see that the line was the same in two places.)

Xencored
05-18-2010, 03:09 AM
Whoops.... when I told you to change that one line and remove the .php from it, I meant the other one, not both. Sorry about that. For the first plugin, you need to have that in the case line:
Leave the second one as is. Now let's see if it works. (Again, sorry about that, I didn't look to see that the line was the same in two places.)

lol its not a problem at all hehe your helping me nothing to be sorry about :up:
Anyways, Good news it now shows
Viewing MAI-Wallpapers
MAI-Wallpapers

But the Url still showing /extra_online_users.php?
Soo close hehe

Xencored
05-23-2010, 04:55 PM
Well ive tryed and tryed i still cant get the Link to work

Anyone got any more ideas?

Thanks

Xencored
06-01-2010, 12:35 PM
Anyone know anymore why the last bit wont work >? so close to give up :D

Thanks

Xencored
06-20-2010, 03:17 PM
Bump :(

ChopSuey
06-20-2010, 03:45 PM
If you want, you can PM me your XML and your template. I'll see what i can do.

Xencored
06-20-2010, 03:51 PM
If you want, you can PM me your XML and your template. I'll see what i can do.

Hey ChopSuey
Where is no XML mate or template
or i dont understand what you mean :confused:

p.s lmfao at your avy i remmber this dude from some time ago me and a made made a youtube (http://www.youtube.com/user/MyLittleWigger) account after he deleted his one :) so he is never lost

ChopSuey
06-20-2010, 03:54 PM
Download your plugin for the WOL as an xml...that's what i meant.

Xencored
06-20-2010, 04:00 PM
Download your plugin for the WOL as an xml...that's what i meant.

https://vborg.vbsupport.ru/showpost.php?p=2038876&postcount=19
There is my two plugins mate :up:

ChopSuey
06-20-2010, 04:16 PM
Try this for second one?

switch ($userinfo['activity'])
{
case 'extra_online_users':
$userinfo['where'] = "<a href=\"extra_online_users.php\">MAI - Wallpapers</a>\n"));
$userinfo['action'] = "Viewing MAI-Wallpapers";
$handled = true;
break;

// add more cases here if you have more than one custom page. no need for multiple plugins. one plugin can handle all.

Xencored
06-20-2010, 04:28 PM
Try this for second one?

switch ($userinfo['activity'])
{
case 'extra_online_users':
$userinfo['where'] = "<a href=\"extra_online_users.php\">MAI - Wallpapers</a>\n"));
$userinfo['action'] = "Viewing MAI-Wallpapers";
$handled = true;
break;

// add more cases here if you have more than one custom page. no need for multiple plugins. one plugin can handle all.

Parse error: syntax error, unexpected ')' in /home/myanimeisland/public_html/includes/functions_online.php(1201) : eval()'d code on line 59

Parse error: syntax error, unexpected ')' in /home/myanimeisland/public_html/includes/functions_online.php(1201) : eval()'d code on line 59

Parse error: syntax error, unexpected ')' in /home/myanimeisland/public_html/includes/functions_online.php(1201) : eval()'d code on line 59

Parse error: syntax error, unexpected ')' in /home/myanimeisland/public_html/includes/functions_online.php(1201) : eval()'d code on line 59

Parse error: syntax error, unexpected ')' in /home/myanimeisland/public_html/includes/functions_online.php(1201) : eval()'d code on line 59

Parse error: syntax error, unexpected ')' in /home/myanimeisland/public_html/includes/functions_online.php(1201) : eval()'d code on line 59

etc

ChopSuey
06-20-2010, 04:45 PM
Okay here's the online_location_process

if($filename=='extra_whos_online.php'){$userinfo['activity'] = 'Viewing MAI Wallpapers';}

K now! For the second part online_unknown_location
if($userinfo['activity']=='Viewing MAI Wallpapers')
{
$userinfo['where'] = '<a href="extra_whos_online.php?'.$vbulletin->session->vars[sessionurl].'">'.$vbulletin->options[bbtitle].' - Viewing MAI Wallpapers</a>';
$userinfo['action'] = 'Viewing MAI-Wallpapers';
$handled = true;
}

;)

Replace your old code.

Xencored
06-20-2010, 05:06 PM
Okay here's the online_location_process

if($filename=='extra_whos_online.php'){$userinfo['activity'] = 'Viewing MAI Wallpapers';}

K now! For the second part online_unknown_location
if($userinfo['activity']=='Viewing MAI Wallpapers')
{
$userinfo['where'] = '<a href="extra_whos_online.php?'.$vbulletin->session->vars[sessionurl].'">'.$vbulletin->options[bbtitle].' - Viewing MAI Wallpapers</a>';
$userinfo['action'] = 'Viewing MAI-Wallpapers';
$handled = true;
}

;)

Replace your old code.

OH so close thanks
It shows right
But the URL points to

http://www.myanimeisland.com/extra_whos_online.php?

ChopSuey
06-20-2010, 05:16 PM
Sorry
use this

if($filename=='extra_online_users.php'){$userinfo['activity'] = 'Viewing MAI Wallpapers';}

&

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

I may warn you that it gives a little error when you go to the online.php page. Since its vB3 code.

Xencored
06-20-2010, 05:23 PM
Sorry
use this

if($filename=='extra_online_users.php'){$userinfo['activity'] = 'Viewing MAI Wallpapers';}

&

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

I may warn you that it gives a little error when you go to the online.php page. Since its vB3 code.

Same as before mate when you click the "Viewing MAI Wallpapers" take me too
http://www.myanimeisland.com/extra_online_users.php
not the page there viewing

and aye its changed all my over links to "Unknown Location"

ChopSuey
06-20-2010, 05:25 PM
I'm sorry i would help more but yet i don't have admincp access and would mess with the code more but i have other things to do.

Delete the plugin's that you just made. Also your page is blank.

Xencored
06-20-2010, 05:34 PM
I'm sorry i would help more but yet i don't have admincp access and would mess with the code more but i have other things to do.

Delete the plugin's that you just made. Also your page is blank.

Hmm i think am asking the wrong way

all i am trying to do is get my None Vbulletin pages to show in the Whosonline in vbulletin when a user is on them
maybe making that extra_online_users.php was a bad idea (there is nothing on it should be blank)

Thanks anyway :up:

DragonBlade
06-20-2010, 09:41 PM
What is the URL to your wallpaper page

Xencored
06-20-2010, 09:43 PM
What is the URL to your wallpaper page

i cant link it its 18+
But here is one more i also need to show

http://www.myanimeisland.com/

miku <3

DragonBlade
06-20-2010, 10:21 PM
Right now, I'm trying to figure out if it can detect something else rather than file since you are using WP page URLs right?

Xencored
06-20-2010, 10:37 PM
Right now, I'm trying to figure out if it can detect something else rather than file since you are using WP page URLs right?

Yea i have 2 wordpress and 2 gallerys am trying to work with

Reeve of shinra
06-21-2010, 02:50 AM
Just a gut feeling but I don't think your wordpress files are using the vb session table. If its not, then this code wont have anything to read.

$userinfo['where'] = '<a href="extra_online_users.php?'.$vbulletin->session->vars[sessionurl].'">MAI-Wallpapers</a>';

Xencored
06-21-2010, 03:00 AM
Just a gut feeling but I don't think your wordpress files are using the vb session table. If its not, then this code wont have anything to read.

$userinfo['where'] = '<a href="extra_online_users.php?'.$vbulletin->session->vars[sessionurl].'">MAI-Wallpapers</a>';



hey Thanks
yea looks that way
this gives me

Unknown Location
/extra_online_users.php

and i was on page http://www.myanimeisland.com/music/new-vocaloid-character-sukone-tei/

looks like am trying to do something which cant be done :(

or is there a way to get them to use vb session tables :D