Neustes Thema in der Mini-Statistik
Verfasst: 28.12.2004 23:55
Hallo zusammen,
ich habe eine kleine png-Statistik von meinem Forum, wo aktuelle Daten wie "Neuster User" "Anzahl der Beiträge" usw. drinne stehen.
Was aber muss ich in die php-Datei einfügen, damit der Titel des neusten Themas gezeigt wird?
Die Statistik.php sieht so aus:
Grüße,
Dominik
ich habe eine kleine png-Statistik von meinem Forum, wo aktuelle Daten wie "Neuster User" "Anzahl der Beiträge" usw. drinne stehen.
Was aber muss ich in die php-Datei einfügen, damit der Titel des neusten Themas gezeigt wird?
Die Statistik.php sieht so aus:
Code: Alles auswählen
<?php
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
$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 = "signatur.php.png";
$im = imagecreatefrompng($image);
$tc = ImageColorAllocate ($im, 0, 0, 0);
$red = ImageColorAllocate ($im, 0, 0, 0);
$blue = 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, 7, 325, 38, "$total_users", $tc);
ImageString($im, 7, 325, 55, "$total_online_users", $tc);
ImageString($im, 7, 325, 73, "$total_posts Beiträge in $total_topics Themen", $tc);
ImageString($im, 7, 325, 91, "$newest_user", $tc);
//header("Content-Type: image/png");
Imagepng($im,'',100);
ImageDestroy ($im);
?>
Dominik