Well, you could require() the global.php file and then you could use the $cookietimeout variable. Or you could pull it from the database yourself, either way (it's in the settings table, I believe).

But then, you would adjust the code:
Code:
<?
require("forum/admin/config.php");
$datecut = time()-$cookietimeout;
$db=mysql_connect($servername,$dbusername,$dbpassword);
mysql_select_db($dbname);
$loggedins=mysql_query("SELECT COUNT(userid) AS users FROM session WHERE lastactivity>$datecut AND userid=0",$db) or die ("oops");
while($loggedin = mysql_fetch_array($loggedins))
$totalonline=number_format($loggedin[users]);
// rest deleted to save space, but leave it in there!
?>
I added the part in
red