Log in

View Full Version : External vB Page


HG-ILUSION
05-09-2009, 02:33 AM
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

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

Hook Location: online_location_unknown

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 (http://img22.imageshack.us/img22/2341/34520433.jpg)
Screen #2: Logged, displays me as "loggin in" Link (http://img18.imageshack.us/img18/2656/93736870.jpg)

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

Thanks

HG-ILUSION
05-10-2009, 08:50 AM
Anyone can help me? :(

Lynne
05-10-2009, 03: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, 04: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"

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, 04: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, 05:12 PM
Thanks a lot.

Now it works fine ^^!

Thanks Lynne

Lynne
05-10-2009, 05:20 PM
So it was the "exec_shut_down(); " line?

HG-ILUSION
05-10-2009, 05:39 PM
Yes, I put that line in the bottom of the page