Announcement

Collapse
No announcement yet.

How to parse two php cals in one .php file?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to parse two php cals in one .php file?

    On my main page I have one <? include ("../cgi-bin/newspro/news.txt") ?>

    To read in the news generated by my news script.

    Now I want to be able to show the people browsing the forums on my main page.

    So I used:

    <?
    chdir($DOCUMENT_ROOT . "/forums");
    require($DOCUMENT_ROOT . "/forums/global.php");

    if ($displayloggedin==1) {
    $datecut=time()-$cookietimeout;
    $loggedins=$DB_site->query_first("SELECT COUNT(sessionid) AS sessions FROM session");
    $totalonline=$loggedins[sessions];
    $loggedins=$DB_site->query_first("SELECT COUNT(sessionid) AS sessions FROM session WHERE userid=0");
    $numberguest=$loggedins[sessions];
    $loggedins=$DB_site->query_first("SELECT COUNT(sessionid) AS sessions FROM session WHERE userid<>0");
    $numberregistered=$loggedins[sessions];

    $numbervisible=0;
    $loggedins=$DB_site->query("SELECT DISTINCT user.userid,username,location FROM user,session WHERE session.userid=user.userid AND session.userid<>0 AND invisible=0 AND usergroupid<>3 ORDER BY username");
    if ($loggedin=$DB_site->fetch_array($loggedins)) {
    $numbervisible++;
    $userid=$loggedin[userid];
    $username=$loggedin[username];
    $location=$loggedin[location];

    eval("\$activeusers .= \"".gettemplate("loggedinuser")."\";");

    while ($loggedin=$DB_site->fetch_array($loggedins)) {
    $numbervisible++;
    $userid=$loggedin[userid];
    $username=$loggedin[username];
    $location=$loggedin[location];
    eval("\$activeusers .= \", ".gettemplate("loggedinuser")."\";");
    }
    }
    $numberinvisible=$numberregistered-$numbervisible;
    eval("\$loggedinusers = \"".gettemplate("loggedinusers")."\";");
    }

    echo "$activeusers and $numberguest guests.";
    ?>


    But when I add that code, the news code isn't working...

    If anyone know how to get both calls to work at the same time please post the answer here

    Thanks a lot

widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...
X