vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   how to include active user info in non-vb page ? (https://vborg.vbsupport.ru/showthread.php?t=2710)

08-30-2000 02:41 AM

eva:

Well,

Global.php has an explicit REQUIRE for /admin/config.php, so turn this:

Code:

require("/home/usr1/www.animeboards.net/htdocs/forums/admin/config.php");
 require("/home/usr1/www.animeboards.net/htdocs/forums/global.php");

into this:

Code:

require("/home/usr1/www.animeboards.net/htdocs/forums/global.php");
I'm not sure why you have that first require( config.php ) deal in there, but global.php does it for you. That's why you're getting the redefinition error.

09-09-2000 04:45 PM

Eva this works for me - see at http://www.hedgehogwheels.com/online.php

My forums are in /forums but I don't have an anchor = active so when you click it just goes to the page.

Code:

<?php 
chdir($DOCUMENT_ROOT . "/forums");
require($DOCUMENT_ROOT . "/forums/global.php");
 
  $loggedins=$DB_site->query_first("SELECT COUNT(sessionid) AS sessions FROM session WHERE userid=0");
  $guests=$loggedins[sessions];   
  $loggedins=$DB_site->query_first("SELECT COUNT(sessionid) AS sessions FROM session WHERE userid<>0");
  $members=$loggedins[sessions];       

  echo "There are currently <a href=\"forums/index.php#active\">$members</a> members and
        <a href=\"forums/index.php#active\">$guests</a> guests viewing this forum";
 
?>

Putting $DOCUMENT_ROOT in all requires is a smart thing to do and makes this all easier. If all the PHP files in vBulletin had $DOCUMENT_ROOT then we wouldn't need to chdir.

[Edited by rangersfan on 09-09-2000 at 01:48 PM]

09-09-2000 04:50 PM

thanks mrogish and rangersfan... i had almost given up on this thread :D ...

i shall be giving this a try in the morning :)

man, is the code here messing with the newreply page... the text box is in the middle of my brower and had to scroll horizontally :(

09-12-2000 03:10 AM

I tried Rangerfans code but got this error:
Quote:

Fatal error: Call to a member function on a non-object in /home/php/pbcity/vb/etc/online.php on line 5

09-12-2000 03:27 AM

What I posted works, you can verify it by clicking the link in the same post.

09-12-2000 03:35 AM

Right,

Not for me though.

I tried putting both the absolute path and the url to the paths you specified in the chdir and the require statements.

Any ideas?

09-12-2000 03:14 PM

Chris Schreiber tried this yesterday as well Rangersfan and it did not work for him.

Any ideas?

09-12-2000 03:31 PM

I'm sorry but as it is, it works on my server.

Code:

Fatal error: Call to a member function on a non-object in /home/php/pbcity/vb/etc/online.php on line 5
Line 5 is the first reference to "$DB_site->query_first"

My script is in /
My forums are in /forums

Is your directory structure the same? If the script is in the same directory as the forum then no chdirs are needed.

09-12-2000 04:36 PM

The script is running at:
http://forums.paintballcity.com/etc/online.php
the full path to that is:
/home/php/pbcity/vb/etc

The forums are at:
http://forums.paintballcity.com
The full path to that is:
/home/php/pbcity/vb

What would be the right config?

09-12-2000 04:42 PM

By the paths you list than the etc directory is a sub-directory in the directory that contains your forums?


All times are GMT. The time now is 06:28 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.01237 seconds
  • Memory Usage 1,737KB
  • 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
  • (4)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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