vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Question about [HOW TO - vB4] Create your own vBulletin page (https://vborg.vbsupport.ru/showthread.php?t=242607)

Xencored 05-16-2010 02:40 AM

Question about [HOW TO - vB4] Create your own vBulletin page
 
Quote:

Originally Posted by Lynne (Post 1915364)
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:
Code:

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:
Code:

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

Quote:

Originally Posted by Lynne (Post 2037706)
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

Quote:

Originally Posted by Lynne (Post 2037713)
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 Code:

<?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
Code:

<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
PHP Code:

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
PHP Code:

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

Quote:

Originally Posted by Lynne (Post 2038556)
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:
PHP Code:

$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

1 Attachment(s)
Quote:

Originally Posted by Lynne (Post 2038684)
Try changing these lines to not have the .php:
PHP Code:

$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"

Attachment 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

Quote:

Originally Posted by Lynne (Post 2038790)
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.

Quote:

Originally Posted by Lynne (Post 2038790)
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

Quote:

Originally Posted by Lynne (Post 2038808)
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:
PHP Code:

switch ($userinfo['activity']  == 'extra_online_users'



It's supposed to just be:
PHP Code:

switch ($userinfo['activity']) 


Xencored 05-17-2010 11:15 PM

Quote:

Originally Posted by Lynne (Post 2038851)
Wait a sec... why did you make this line like this:
PHP Code:

switch ($userinfo['activity']  == 'extra_online_users'



It's supposed to just be:
PHP Code:

switch ($userinfo['activity']) 


I was mixing codes from https://vborg.vbsupport.ru/showthrea...ghlight=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

Quote:

Originally Posted by Lynne (Post 2038868)
So exactly what is your code in those two plugins right now?


Product= vBulletin
Hook Location = online_location_process
Title = online_location_process
PHP Code:

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
PHP Code:

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:

PHP Code:

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

Quote:

Originally Posted by Lynne (Post 2038932)
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

Quote:

Originally Posted by ChopSuey (Post 2056454)
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 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

Quote:

Originally Posted by ChopSuey (Post 2056466)
Download your plugin for the WOL as an xml...that's what i meant.

https://vborg.vbsupport.ru/showpost....6&postcount=19
There is my two plugins mate :up:

ChopSuey 06-20-2010 04:16 PM

Try this for second one?

PHP Code:

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

Quote:

Originally Posted by ChopSuey (Post 2056483)
Try this for second one?

PHP Code:

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

PHP Code:

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

K now! For the second part online_unknown_location
PHP Code:

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

Quote:

Originally Posted by ChopSuey (Post 2056499)
Okay here's the online_location_process

PHP Code:

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

K now! For the second part online_unknown_location
PHP Code:

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

PHP Code:

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

&

PHP Code:

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

Quote:

Originally Posted by ChopSuey (Post 2056518)
Sorry
use this

PHP Code:

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

&

PHP Code:

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

Quote:

Originally Posted by ChopSuey (Post 2056528)
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

Quote:

Originally Posted by DragonBlade (Post 2056651)
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

Quote:

Originally Posted by DragonBlade (Post 2056669)
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


All times are GMT. The time now is 05:36 AM.

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.01547 seconds
  • Memory Usage 1,908KB
  • 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
  • (3)bbcode_code_printable
  • (22)bbcode_php_printable
  • (19)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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