Verfasst: 21.04.2003 19:34
wie bekomme ich statt der forenversion die anzahl der online user rein - welche variable ist das ?
phpBB.de - Die deutsche phpBB-Community
https://www.phpbb.de/community/
Die Variable ist $total_online_usersfussle hat geschrieben:wie bekomme ich statt der forenversion die anzahl der online user rein - welche variable ist das ?
Code: Alles auswählen
<?php
define('IN_PHPBB', true);
$phpbb_root_path = './';
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 = "myphpbb.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);
?>
Code: Alles auswählen
HTTP_ACCEPT: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/msword, application/vnd.ms-powerpoint, application/x-shockwave-flash, */*
Code: Alles auswählen
header("Content-Type: image/jpeg");
Imagejpeg($im,'',100);
Du hast das Bild im ASCII Modus hochgeladenSnoopmore hat geschrieben:mal sehn obs klappt....
e/ sieht nicht so aus.....