Verfasst: 06.09.2003 01:26
Wieso geht mein latest topic nicht?
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++;
}
}
$j2 = strlen($latest_topic);
if (($j + $j2)>38)
{
$words = explode (" ", $latest_topic);
$text = '';
$latest_topic = '';
for($i=0;strlen($text) < (35 - $j);$i++) {
$text = $text . $words[$i] . " ";
}
$latest_topic = str_replace($words[$i-1],"...",$text);
}
$image = "myphpbb.png";
$im = imagecreatefrompng($image);
$tc = ImageColorAllocate ($im, 0, 0, 0);
$green = ImageColorAllocate ($im, 7,128, 27);
$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, 320, 15, "Mitglieder: $total_users", $tc);
ImageString($im, 2, 148, 25, "letztes Thema: $latest_topic", $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: ", $tc);
ImageString($im, 2, 325, 45, "$newest_user", $green);
header("Content-Type: image/png");
Imagepng($im,'',100);
ImageDestroy ($im);
?>