phpbb3 статистика в сайт

icowwe

Registered
Дате ми код за phpbb3 статистика -
искам в саита да писе това чудо


Код:
Най-нов:  Versus       
 Общо мнения: 2196 
 Потребители: 170

за phpbb
Благгодаря предварително
 
Код:
<?php include"config.php";
$con=mysql_connect($dbhost,$dbuser,$dbpasswd)or die(mysql_error());
mysql_select_db($dbname,$con)or die(mysql_error());
$chars="set character set cp1251";mysql_query($chars);

$sql="select * from `phpbb_users` order by user_id desc limit 1"or die(mysql_error());
$result=mysql_query($sql)or die(mysql_error());
while($r=mysql_fetch_array($result)){ $last_user=$r['username']; }

$zaqvka1=mysql_query("select count(topic_id) as total_topics from `phpbb_topics`");
while($rw=mysql_fetch_array($zaqvka1)){ $total_topics=$rw['total_topics']; }
$zaqvka2=mysql_query("select count(post_id) as total_posts from `phpbb_posts`");
while($rw=mysql_fetch_array($zaqvka2)){ $total_posts=$rw['total_posts']; }
$zaqvka3=mysql_query("select count(user_id) as total_users from `phpbb_users` where username!='anonymous'");
while($rw=mysql_fetch_array($zaqvka3)){ $total_users=$rw['total_users']; }
$zaqvka7=mysql_query("select count(ban_id) as total_banned from `phpbb_banlist`");
while($rw=mysql_fetch_array($zaqvka7)){ $total_banned=$rw['total_banned']; }

echo"Най-нов: <b>$last_user</b><br>
Общо мнения: <b>$total_posts</b><br>
Общо теми: <b>$total_topics</b><br>
Потребители: <b>$total_users</b>"; ?>
 

Back
Горе