Errors:
Quote:
Warning: chdir(): No such file or directory (errno 2) in /home/dp/public_html/beta/online.php on line 9
Warning: main(./includes/init.php): failed to open stream: No such file or directory in /home/dp/public_html/forum/global.php on line 18
Fatal error: main(): Failed opening required './includes/init.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/dp/public_html/forum/global.php on line 18
|
Online.php:
Quote:
<?php
error_reporting(E_ALL & ~E_NOTICE);
$path = "./forum/"; // path to your forums folder, normally /forum/
$phrasegroups = array('wol');
chdir($path);
require_once("/home/dp/public_html/forum/global.php");
$showusernames = 1; // 1 to show usernames online, 0 to only show the number of users online
$datecut = time()-$vboptions['cookietimeout'];
if ($showusernames == 1)
{
$regmembers = $DB_site->query("SELECT DISTINCT username,options FROM ".$tableprefix."user,".$tableprefix."session
WHERE ".$tableprefix."session.userid=".$tableprefix."use r.userid AND ".$tableprefix."session.lastactivity>$datecut
ORDER BY username ASC") or exit("oops2");
while($regmember = $DB_site->fetch_array($regmembers))
{
$regmember['options'] = intval($regmember['options']);
foreach($_USEROPTIONS as $optionname => $optionval)
{
$regmember["$optionname"] = iif($regmember['options'] & $optionval, 1, 0);
}
if ((($regmember['invisible'] == 0)) and $regmemberson or ($bbuserinfo['usergroupid'] == 6 and $regmember['invisible'] == 1))
{
$regmemberson .= ", ";
}
$regmembercomma++;
if ($regmember['invisible'] == 0 or $bbuserinfo['usergroupid'] == 6) {
if ($regmember['invisible'] == 1) {
$userinvisible = "*";
}
$regmemberson .= $regmember['username'].$userinvisible;
} else {
$regmembercomma++;
}
}
if (!$regmemberson)
{
$regmemberson = "(none)";
}
} else {
$regmembers = $DB_site->query_first("SELECT COUNT(DISTINCT userid) AS membersonline FROM ".$tableprefix."session WHERE userid>0 AND ".$tableprefix."session.lastactivity>$datecut" ) or exit("oops3");
$regmemberson = number_format($regmembers['membersonline']);
}
$howmany = substr_count($regmemberson,",");
if (($showusernames == 1 and $howmany >= 1) or ($showusernames == 0 and $regmemberson > 1))
{
$memberstext = $vbphrase['members'];
}
else
{
$memberstext = $vbphrase['member'];
}
$guests = $DB_site->query_first("SELECT COUNT(userid) AS guestsonline FROM ".$tableprefix."session WHERE userid=0 AND ".$tableprefix."session.lastactivity>$datecut" ) or exit("oops4");
if ($guests['guestsonline'] > 1)
{
$gueststext = $vbphrase['guests'];
}
else
{
$gueststext = $vbphrase['guest'];
}
$guestson = number_format($guests['guestsonline']);
$show = $memberstext.' '.strtolower($vbphrase['online']).': '.$regmemberson.'. '.$gueststext.' '.strtolower($vbphrase['online']).': '.$guestson.'.';
?>
|
Top of PHP page I want to include members on:
Quote:
<?php require_once("online.php"); ?>
|
Table I want members to show up in, same page as last quote:
Quote:
<table class="online">
<tr>
<td class="online" valign="top">
<span class="head">Who's Online</span><br /><br />
<?php
print $show;
?>
</td>
</tr>
</table>
|
Online.php and the file I want the members to show up on are in the same directory which is public_html/beta/ and the forum is public_html/forum/.
What am I doing wrong?