vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   External vB Page (https://vborg.vbsupport.ru/showthread.php?t=213215)

HG-ILUSION 05-09-2009 01:33 AM

External vB Page
 
1 Attachment(s)
Hi, I follow the example of phgstats integration (https://vborg.vbsupport.ru/showthread.php?t=183096) and I "modified" this page (file attached).

The problem is if I on the external page I don't see me on "Who's Online" page

I put this code as plugin:

Hook Location: online_location_process

PHP Code:

if ($filename == 'prueba.php')
{
        
$userinfo['activity'] = 'prueba';



Hook Location:
online_location_unknown

PHP Code:

if ($userinfo['activity'] == 'prueba')
{
        
$userinfo['action'] = 'Contactando al Staff de Hunter Gamers';
        
$userinfo['where'] = '<a href="/foro/prueba.php'.$vbulletin->session->vars['sessionurl_q'].'">"Contactar al Staff"</a>';
        
$handled true;


Screen #1: Unlogged, display no permission in custom page. Link
Screen #2: Logged, displays me as "loggin in" Link

Sorry if you can't understand me. I have very bad english :p

Thanks

HG-ILUSION 05-10-2009 07:50 AM

Anyone can help me? :(

Lynne 05-10-2009 02:07 PM

I'm guessing it's because you aren't using a template to spit out the page and thus you are missing some call at the end of the file. Someone else posted a problem where the who's online wasn't working corrected on a page and they weren't using a template for the external page either and the problem was traced to that. The fix was posted in the thread. Do a search in this forum for another thread about this issue - search on the name of one of those hook locations - and you should find it.

HG-ILUSION 05-10-2009 03:33 PM

I'm not using a template because I need use a php code in that page.

I can't find that thread. Have you got the link?

I have this php code but it says "Unknow Location"

PHP Code:

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 = 'prueba.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."', 'prueba.php?"$_SERVER["QUERY_STRING"] ."', '".$_SERVER["HTTP_USER_AGENT"]."', '0', '0', '1', '0', '0', '0', '0', '0', '0');");


Thanks for your reply.

Lynne 05-10-2009 03:42 PM

This is the thread I was thinking of - https://vborg.vbsupport.ru/showthread.php?t=210615


With that code you have above... have you looked in the database to see what is getting input, if anything?

HG-ILUSION 05-10-2009 04:12 PM

Thanks a lot.

Now it works fine ^^!

Thanks Lynne

Lynne 05-10-2009 04:20 PM

So it was the "exec_shut_down(); " line?

HG-ILUSION 05-10-2009 04:39 PM

Yes, I put that line in the bottom of the page


All times are GMT. The time now is 08:44 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.02891 seconds
  • Memory Usage 1,745KB
  • 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_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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