Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 05-16-2010, 02:40 AM
Xencored Xencored is offline
 
Join Date: Sep 2008
Location: UK, Scuny
Posts: 1,337
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Question about [HOW TO - vB4] Create your own vBulletin page

Quote:
Originally Posted by Lynne View Post
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
Reply With Quote
  #2  
Old 05-16-2010, 03:31 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 05-16-2010, 03:37 AM
Xencored Xencored is offline
 
Join Date: Sep 2008
Location: UK, Scuny
Posts: 1,337
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
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
Reply With Quote
  #4  
Old 05-16-2010, 03:39 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 05-16-2010, 03:41 AM
Xencored Xencored is offline
 
Join Date: Sep 2008
Location: UK, Scuny
Posts: 1,337
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
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 !
Reply With Quote
  #6  
Old 05-16-2010, 02:54 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I use BBEdit, but it's for Macs.
Reply With Quote
  #7  
Old 05-17-2010, 03:27 AM
Xencored Xencored is offline
 
Join Date: Sep 2008
Location: UK, Scuny
Posts: 1,337
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #8  
Old 05-17-2010, 02:27 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #9  
Old 05-17-2010, 03:33 PM
Xencored Xencored is offline
 
Join Date: Sep 2008
Location: UK, Scuny
Posts: 1,337
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
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:
Reply With Quote
  #10  
Old 05-17-2010, 07:03 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
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 10:13 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.04565 seconds
  • Memory Usage 2,293KB
  • Queries Executed 12 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (4)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete