Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 12-09-2006, 09:21 AM
aibon aibon is offline
 
Join Date: Mar 2002
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default count sessions from nonvb pages

hi there,

we recently upgraded to vb3 and moved our forum to a different server. For cosmetic reasons we want the users on our main site to be counted in our forum and as sideefect keep their sessions if they switch form the forum to the mainsite and vice versa. to achieve that we thought about using this little neat trick: on every page on our main site we put a transparaent image that is generated in the forum:
Code:
<img src="http://www.forum.com/sessionimage.php?" width="1" height="1">
the code for the sessionimage.php looks like this:

Code:
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('THIS_SCRIPT', 'index');
define('VB_AREA', 'Forum');
define('NOPMPOPUP', 1);

require_once('./global.php');

header('Content-type: image/png');
$Img = @ImageCreate (1, 1);
$Gray = imagecolorallocate($Img,32,32,32);
imagecolortransparent($Img,$Gray);
imagepng($Img);
imagedestroy($Img);
this should work. but for some reason vbulletin isn't counting that sessions. i suppose there's somewhere a check for referring pages or something like that which prevents vbulletin from generating the session. but i can't find anything. any clue why this isn't working?

cookies are set right, both sites are subdomain, cookiepath . .comain.com. i also checked the settings in admincp for allowing access from diffrent domains. but i doubt that these has anything to do ith the problem.

thx
Reply With Quote
  #2  
Old 12-09-2006, 06:14 PM
MarkPW MarkPW is offline
 
Join Date: Apr 2006
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there a reason why you are (trying to) include it via an image rather than using the standard include() or require() methods?
Reply With Quote
  #3  
Old 12-10-2006, 01:15 AM
KingPin6's Avatar
KingPin6 KingPin6 is offline
 
Join Date: Sep 2006
Posts: 50
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

an image can be appended to a page to show how many users are online and at the same time count how many on that non vb page, although a php include would do the job just as well but an image can be made to look nicer in some instances
Reply With Quote
  #4  
Old 12-10-2006, 01:22 AM
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Posts: 2,528
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It's not actually updated until it runs the shutdown queries. Add this to your PHP file,
PHP Code:
exec_shut_down(); 
Reply With Quote
  #5  
Old 12-11-2006, 08:04 AM
aibon aibon is offline
 
Join Date: Mar 2002
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

the reason for not including the vb files is
Quote:
moved our forum to a different server
. so there's no direct access to the database or the filesystem. and thats fine to have both systems clearly seperated...

thx for the hint SirAdrian... sounds logic..
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 11:33 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.03691 seconds
  • Memory Usage 2,201KB
  • Queries Executed 13 (?)
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
  • (2)bbcode_code
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)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_postinfo_query
  • fetch_postinfo
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete