проблем с един скрипт - phpbb3

val4o0o0

Registered
Код:
<?php include"forum/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 utf8";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
"<font color='#00B2EE'>
Общо регистрирани: <b>$total_users</b><br />
Най-нов: <b>$last_user</b><br />
Общо мнения: <b>$total_posts</b><br />
Общо теми: <b>$total_topics</b><br />
Баннати: <b>$total_banned</b></font>";
?>

То на практика, проблем няма, но има едно нещо което ме нервира много, виждате "Общо регистрираните" Как са извадени $total_user, но вместо потребителите, вади и ботовете и във форума като има 1 регистриран (в момента) показва 52 (тост и ботовете) как ще трябва да стане за да не ги показва и тях ?
ПП: същото важи и за $last_user
 
Изтрих ги, но проблема остава, сега видях, че дори са регистрирани и в датабазата..
 
Разбирасе, че ще пречи, особенно ако форумите не могат да се разглеждат от нерегистрирани. Върни ботовете, преброй ги и от цялото число махни колкото са те. Друга идея е да ги отделиш в друга група и нея да не я показваш въобще.
 
Върнах ги, ботовете са 50, а това да ги преброя и да ги извадя имаш в предвид да се дефинира в скрипта ? И ако да, как трябва да стане, защото надали ще мога да го направя сам..

is_bot - това дефинира ботовете, някой ще може ли да го направи, примерно if is_bot / - да не се показва ?
 
Код:
<?php include"forum/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 utf8";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 
"<font color='#00B2EE'> 
Общо регистрирани: <b>$total_users</b><br /> 
Най-нов: <b>$last_user-50</b><br /> 
Общо мнения: <b>$total_posts</b><br /> 
Общо теми: <b>$total_topics</b><br /> 
Баннати: <b>$total_banned</b></font>"; 
?>
Я пробвай така.

П.С. Едитнах го в 15:20 :) (обърках местата :D)
 
Fakeheal каза:
Код:
<?php include"forum/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 utf8";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 
"<font color='#00B2EE'> 
Общо регистрирани: <b>$total_users</b><br /> 
Най-нов: <b>$last_user</b><br /> 
Общо мнения: <b>$total_posts-50</b><br /> 
Общо теми: <b>$total_topics</b><br /> 
Баннати: <b>$total_banned</b></font>"; 
?>
Я пробвай така.

Нестава,

is_bot - това дефинира ботовете, някой ще може ли да го направи, примерно с един if is_bot / - да не се показва ?
 
Значи PHP-то не го знам ХИЧ :D , aма казваха,че е подобен на JS- а при Javascript-а това се получава. Сега ще ти дам още 1 примерен код и те уверявам,че е възможно да съществува по-лесен начин, но все още не съм се запознала с него.
Код:
<?php include"forum/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 utf8";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'];
$users=$total_users-50; } 

echo 
"<font color='#00B2EE'> 
Общо регистрирани: <b>$users</b><br /> 
Най-нов: <b>$last_user</b><br /> 
Общо мнения: <b>$total_posts</b><br /> 
Общо теми: <b>$total_topics</b><br /> 
Баннати: <b>$total_banned</b></font>"; 
?>
 

Back
Горе