Размер файла: 1.99Kb
- <?php
- include 'inc/db.php';
- include 'inc/1.php';
- if (!$user)header("Location: /aut.php");
- echo "<div class='t2'>Добро пожаловать</div>";
- echo "<div class='p0'>";
- $forum=mysql_num_rows(mysql_query("SELECT `id` FROM `forum` WHERE `user` = '$user[id]'"));
- $chat=mysql_num_rows(mysql_query("SELECT `id` FROM `chat` WHERE `user` = '$user[id]'"));
- $komm=mysql_num_rows(mysql_query("SELECT `id` FROM `forum_komm` WHERE `user` = '$user[id]'"));
- $guest=mysql_num_rows(mysql_query("SELECT `id` FROM `guestbook` WHERE `user` = '$user[id]'"));
- $mail=mysql_num_rows(mysql_query("SELECT `id` FROM `mail` WHERE (`to` = '$user[id]') OR (`from` = '$user[id]')"));
- $mnen=mysql_num_rows(mysql_query("SELECT `id` FROM `mnen` WHERE `user` = '$user[id]'"));
- $votes=mysql_num_rows(mysql_query("SELECT `id` FROM `user_votes` WHERE `user` = '$user[id]'"));
- $uvotes=mysql_num_rows(mysql_query("SELECT `id` FROM `user_vote` WHERE `user` = '$user[id]'"));
- if (($user['rplus']+43200)<time()){
- $famous=round((($forum+$chat+$komm+$guest+$mail+$mnen+$votes+$uvotes)/100), 2);
- if (mysql_num_rows(mysql_query("SELECT `user` FROM `ban` WHERE `user` = '$user[id]'"))!=0)$famous=($famous*0.2);
- mysql_query("UPDATE `user` SET `famous` = '$famous' WHERE `id` = '$user[id]'");
- mysql_query("UPDATE `user` SET `rplus` = '".time()."' WHERE `id` = '$user[id]'");
- }
- else
- $famous=$user['famous'];
- $rating=$user['famous'];
- $kol=($famous-$rating);
- $kol=round($kol, 2);
- echo "Ваш рейтинг: $famous";
- if ($kol!=0){
- if ($kol>0)echo " <font color='green'>(+$kol)</font>";
- else
- echo " <font color='red'>($kol)</font>";
- }
- echo "<br><a href='/index.php'>Главная</a><br><a href='/forum.php'>Форум</a><br><a href='/chat.php'>Чат</a><br><a href='/obmen.php'>Обмен</a><br><a href='/news.php'>Новости</a><br><a href='/vote.php'>Опросы</a>";
- echo "</div>";
- $ball=($komm+$guest+$mail+($forum*2));
- mysql_query("UPDATE `user` SET `ball` = '$ball' WHERE `id` = '$user[id]'");
- include_once 'inc/foot.php';
- ?>