Announcement

Collapse
No announcement yet.

online.php called from another domain

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

  • Jez
    replied
    You might also consider using '@include()' instead of 'require' as it will continue processing even if was unsuccessful in including a file, as long as the @ is prefixed.

    Also consider setting 'error_reporting(0)'.

    Leave a comment:


  • Jez
    replied
    What I meant was add the following '@' before the function any PHP won't ouput error messages, instead it will die gracefully.

    PHP Code:
    <?php 
    chdir
    ("/home/user1/public_html/");
    @require(
    "/home/user1/public_html/global.php");

    Leave a comment:


  • George L
    replied
    Ed and Jez, i'm still very much php illiterate for now


    any help is appreciated

    Leave a comment:


  • Jez
    replied
    Couldn't you do an eval and check if any errors occured?

    Or how about adding an '@' to the require function, which should prevent error outputting.

    Leave a comment:


  • Mike Sullivan
    replied
    You'll actually have to do some (kludgy) hacking to the global.php.

    Or you can just remove the global.php require()'ment and do the processing without bothering to check whether the bb is closed.

    Leave a comment:


  • George L
    replied
    thanks kevin but that didn't work, closing the forum still outputs gibberish text

    Leave a comment:


  • tubedogg
    replied
    Try adding
    Code:
    $bon = $DB_site->query_first("SELECT value FROM setting WHERE varname='bbactive'");
    if ($bon[value] == "0") {
      echo("Sorry the forums are closed");
      exit;
    }
    right before
    Code:
    if ($displayloggedin) { 
    $datecut=time()-$cookietimeout;

    Leave a comment:


  • George L
    replied
    Originally posted by Jez
    Have you tried something along the following lines?
    PHP Code:
    if (!$bbactive) {
      exit();

    didn't work or i might not have put it in the proper place in the online.php ?

    Leave a comment:


  • Jez
    replied
    Have you tried something along the following lines?
    PHP Code:
    if (!$bbactive) {
      exit();

    Leave a comment:


  • George L
    replied
    any ideas ? i just integrated kevin's last active topic hacks as well

    http://bubblegumcrisis2040.com/forum/

    http://www.eva2000.com/forum/

    i closing the forums will display garbled text on those pages

    Leave a comment:


  • George L
    replied
    the file has the following code
    Code:
    <?php 
    chdir("/home/user1/public_html/");
    require("/home/user1/public_html/global.php");
    
    if ($displayloggedin) { 
    $datecut=time()-$cookietimeout; 
    
    //$loggedins=$DB_site->query_first("SELECT COUNT(*) AS sessions FROM session WHERE lastactivity>$datecut"); 
    //$totalonline=$loggedins['sessions']; 
    $loggedins=$DB_site->query_first("SELECT COUNT(*) AS sessions FROM session WHERE userid=0 AND lastactivity>$datecut"); 
    $numberguest=$loggedins['sessions']; 
    //$numberregistered=$totalonline-$numberguest; 
    
    $numbervisible=0; 
    $numberregistered=0; 
    //$loggedins=$DB_site->query("SELECT DISTINCT user.userid,username FROM user,session WHERE session.userid=user.userid AND session.userid<>0 AND invisible=0 AND session.lastactivity>$datecut ORDER BY username"); 
    $loggedins=$DB_site->query("SELECT DISTINCT session.userid,username,invisible 
    FROM session 
    LEFT JOIN user ON (user.userid=session.userid) 
    WHERE session.userid<>0 AND session.lastactivity>$datecut 
    ORDER BY invisible ASC, username ASC"); 
    if ($loggedin=$DB_site->fetch_array($loggedins)) { 
    $numberregistered++; 
    if ($loggedin['invisible']==0 or $bbuserinfo['usergroupid']==6) { 
    $numbervisible++; 
    $userid=$loggedin['userid']; 
    if ($loggedin['invisible']==1) { // Invisible User but show to Admin 
    $username=$loggedin['username']; 
    $invisibleuser = '*'; 
    } else { 
    $username=$loggedin['username']; 
    $invisibleuser = ''; 
    } 
    $location=$loggedin['location']; 
    eval("\$activeusers = \"".gettemplate('forumhome_loggedinuser')."\";"); 
    } 
    
    while ($loggedin=$DB_site->fetch_array($loggedins)) { 
    $numberregistered++; 
    $invisibleuser = ''; 
    if ($loggedin['invisible']==1 and $bbuserinfo['usergroupid']!=6) { 
    continue; 
    } 
    $numbervisible++; 
    $userid=$loggedin['userid']; 
    if ($loggedin['invisible']==1) { // Invisible User but show to Admin 
    $username=$loggedin['username']; 
    $invisibleuser = '*'; 
    } else { 
    $username=$loggedin['username']; 
    } 
    $location=$loggedin['location']; 
    eval("\$activeusers .= \", ".gettemplate('forumhome_loggedinuser')."\";"); 
    } 
    } 
    $DB_site->free_result($loggedins); 
    
    $totalonline=$numberregistered+$numberguest; 
    
    $numberinvisible=$numberregistered-$numbervisible; 
    
    } 
    
    echo "<FONT FACE=\"Verdana, Arial, Helvetica, sans-serif\" SIZE=\"1\"><b>forum users</b>:&nbsp; 
    &nbsp;<a href=http://animeboards.com/index.php#active target=\"_blank\"><FONT FACE=\"Verdana, Arial, Helvetica, sans-serif\" SIZE=\"1\">$numberregistered</font></a>
    &nbsp;members&nbsp;+&nbsp;
    <a href=http://animeboards.com/index.php#active target=\"_blank\"><FONT FACE=\"Verdana, Arial, Helvetica, sans-serif\" SIZE=\"1\">$numberguest</font></a>&nbsp;guests&nbsp;&nbsp;:&nbsp;
    <a href=http://animeboards.com/register.php?s=&action=signup target=\"_blank\"><FONT FACE=\"Verdana, Arial, Helvetica, sans-serif\" SIZE=\"1\">Register!</font></a></font>";
    
    ?>

    Leave a comment:


  • George L
    started a topic online.php called from another domain

    online.php called from another domain

    Okay i figured out how to call a file online.php from several domains on the same server as my vB by placing the file online.php in the root of each domain i.e. call http://www.eva2000.com/online.php from this page using SSIhttp://www.eva2000.com/movies/index.shtml

    Problem
    it works but when i close the forum from the admin panel, the included code on other domains chucks a fit and displays a bunch of garbled up text

    is there a way around this so that when i close my forum a simple message is displayed on the online.php output

    i.e. instead of

    forum users: 45 members + 124 guests : Register!

    it would say

    forum status: maintenance be back soon.. : Register
    Last edited by George L; Sat 16 Jun '01, 1:50am.
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...
X