Hier die signatur.php:
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 = "signatur.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, 200, 2, "Community Statistik", $tc);
ImageString($im, 2, 200, 15, "Zur Zeit Online: $total_online_users User", $tc);
ImageString($im, 2, 200, 25, "Mitglieder: $total_users", $tc);
ImageString($im, 2, 200, 35, "Gepostet: $total_posts Beiträge in $total_topics Themen", $tc);
ImageString($im, 2, 200, 45, "Unser neustes Mitglied heißt: $newest_user", $tc);
header("Content-Type: image/png");
Imagepng($im,'',100);
ImageDestroy ($im);
?>