Nicklas Newbie


Anmeldungsdatum: Nov 22, 2005 Beiträge: 4
|
Verfasst am: Sa Dez 03, 2005 3:28 pm Titel: phpBB StatistikBanner |
|
|
Hallo,
ich wollte mir jetzt auf meiner Seite ein Statistik-Banner einbinden. Dazu habe ich folgenden Code verwendet:
| Code: |
<?php
define('IN_PHPBB', true);
$phpbb_root_path = './modules/Forums/';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
//
// Get basic (usernames + totals) online
// situation
//
$user_forum_sql = ( !empty($forum_id) ) ? "AND s.session_page = " . intval($forum_id) : '';
$sql = "SELECT u.user_id, s.session_ip
FROM ".USERS_TABLE." u, ".SESSIONS_TABLE." s
WHERE u.user_id = s.session_user_id
AND s.session_time >= ".( time() - 300 ) . "
$user_forum_sql";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain user/online information', '', __LINE__, __FILE__, $sql);
}
$total_online_users = 0;
$prev_user_ip = '';
while( $row = $db->sql_fetchrow($result) )
{
if ( $row['session_ip'] != $prev_session_ip )
{
$total_online_users++;
}
}
$image = "signature.png";
$im = imagecreatefrompng($image);
$tc = ImageColorAllocate ($im, 0, 0, 0);
$sitename = $board_config['sitename'];
$total_users = get_db_stat('usercount');
$total_posts = get_db_stat('postcount');
$total_topics = get_db_stat('topiccount');
$newest_userdata = get_db_stat('newestuser');
$newest_user = $newest_userdata['username'];
ImageString($im, 3, 148, 2, "Statistik von $sitename", $tc);
ImageString($im, 2, 148, 15, "Zur Zeit Online: $total_online_users User", $tc);
ImageString($im, 2, 148, 25, "Mitglieder: $total_users", $tc);
ImageString($im, 2, 148, 35, "Gepostet: $total_posts Beiträge in $total_topics Themen", $tc);
ImageString($im, 2, 148, 45, "Unser neustes Mitglied heißt: $newest_user", $tc);
header("Content-Type: image/png");
Imagepng($im,'',100);
ImageDestroy ($im);
?>
|
Das File liegt im Root-Verz. Nun bekomme ich aber nur eine Fehlermeldung:
Fatal error: Cannot instantiate non-existent class: sql_db in /www/htdocs/v027979/esse4you/db/db.php on line 76
Wenn ich das File nach ./modules/Forums verschiebe das gleiche.
Kann mir hierbei jemand weiter helfen?
Danke Nick _________________
 |
|