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]