Author Topic: Random Image > phpBB2 Fetch Info conflict  (Read 4438 times)

0 Members and 1 Guest are viewing this topic.

Offline SLL

  • Hero Member
  • *****
  • Posts: 585
    • View Profile
Random Image > phpBB2 Fetch Info conflict
« on: January 09, 2003, 11:36:41 AM »
This mod works fine for me, as well as phpBB Fetch Info does, but only one of these mods on the same page, alone. When I'm trying to run both mods together, on the same page, the phpBB Fetch Info doesn't work at all. I'm using different database for 4images and pbpBB.

Please advise, what could be the reason for this conflict? Thanks in advance!

Code: [Select]
<?php
#################################################################
## Mod Title&#58;   phpBB Fetch Info
## Author&#58;      Ca5ey <ca5ey@clanunity.net> Volker Rattel
#################################################################
#-----[ EXAMPLE USAGE &#93;------------------------------------------
## <?php
## define&#40;'IN_PHPBB', true&#41;;
## include&#40;'phpbb_fetch_info.php'&#41;;
## $info = phpbb_fetch_info&#40;&#41;;
## 
?>

## Total Posts: <?php echo $info['f_total_posts'&#93;; ?><br>
## Total Users: <?php echo $info['f_total_users'&#93;; ?><br>
## Newest User: <?php echo $info['newest_username'&#93;; ?><br>
## Newest User ID: <?php echo $info['newest_userid'&#93;; ?><br>
## User Online: <?php echo $info['f_user_online'&#93;; ?><br>
#################################################################
$phpbb_root_path = './phpBB2/';
$CFG['close_db'] = 1;

if (!file_exists($phpbb_root_path . 'extension.inc')) {
    die('<b>phpBB Fetch Info:</b> The $phpbb_root_path setting is wrong and DOES NOT point to your forum.');
}
include_once ($phpbb_root_path . 'extension.inc');
include_once ($phpbb_root_path . 'common.'.$phpEx);

function phpbb_fetch_info()
{

    global $db;
    $info = array();
    $info['f_total_posts']     = get_db_stat('postcount');
    $info['f_total_users']     = get_db_stat('usercount');
    $newest_user             = get_db_stat('newestuser');
    $info['newest_userid']   = $newest_user[0];
    $info['newest_username'] = $newest_user[1];

    $sql = 'SELECT
              COUNT(session_id)
            FROM
              ' . SESSIONS_TABLE . '
            WHERE
              session_time >= ' . ( time() - 300 );

    if( !($result = $db->sql_query($sql)) ) {
        message_die(GENERAL_ERROR, 'Could not obtain user/online information', '', __LINE__, __FILE__, $sql);
    }

    $f_user_online = $db->sql_fetchrow($result);
    $info['f_user_online'] = $f_user_online[0];

    if ($CFG['close_db']) {
        $db->sql_close();
    }
    return $info;

} // phpbb_fetch_info

?>


Offline sorestar

  • Newbie
  • *
  • Posts: 17
    • View Profile
Random Image > phpBB2 Fetch Info conflict
« Reply #1 on: January 11, 2003, 08:06:50 AM »
I have the same problem. At first, I installed the fetch post. It's worked great. But I decided to install the random image additionally. However, one works other doesn't.

Offline SLL

  • Hero Member
  • *****
  • Posts: 585
    • View Profile
Random Image > phpBB2 Fetch Info conflict
« Reply #2 on: January 12, 2003, 05:00:21 PM »
I hope PHP-Guru at this forum will find the reason of conflict it this short code  :wink:

Let's be patient and wait...