Просмотр файла hi.php

Размер файла: 1.99Kb
  1. <?php
  2. include 'inc/db.php';
  3. include 'inc/1.php';
  4. if (!$user)header("Location: /aut.php");
  5. echo "<div class='t2'>Добро пожаловать</div>";
  6. echo "<div class='p0'>";
  7. $forum=mysql_num_rows(mysql_query("SELECT `id` FROM `forum` WHERE `user` = '$user[id]'"));
  8. $chat=mysql_num_rows(mysql_query("SELECT `id` FROM `chat` WHERE `user` = '$user[id]'"));
  9. $komm=mysql_num_rows(mysql_query("SELECT `id` FROM `forum_komm` WHERE `user` = '$user[id]'"));
  10. $guest=mysql_num_rows(mysql_query("SELECT `id` FROM `guestbook` WHERE `user` = '$user[id]'"));
  11. $mail=mysql_num_rows(mysql_query("SELECT `id` FROM `mail` WHERE (`to` = '$user[id]') OR (`from` = '$user[id]')"));
  12. $mnen=mysql_num_rows(mysql_query("SELECT `id` FROM `mnen` WHERE `user` = '$user[id]'"));
  13. $votes=mysql_num_rows(mysql_query("SELECT `id` FROM `user_votes` WHERE `user` = '$user[id]'"));
  14. $uvotes=mysql_num_rows(mysql_query("SELECT `id` FROM `user_vote` WHERE `user` = '$user[id]'"));
  15. if (($user['rplus']+43200)<time()){
  16. $famous=round((($forum+$chat+$komm+$guest+$mail+$mnen+$votes+$uvotes)/100), 2);
  17. if (mysql_num_rows(mysql_query("SELECT `user` FROM `ban` WHERE `user` = '$user[id]'"))!=0)$famous=($famous*0.2);
  18. mysql_query("UPDATE `user` SET `famous` = '$famous' WHERE `id` = '$user[id]'");
  19. mysql_query("UPDATE `user` SET `rplus` = '".time()."' WHERE `id` = '$user[id]'");
  20. }
  21. else
  22. $famous=$user['famous'];
  23. $rating=$user['famous'];
  24. $kol=($famous-$rating);
  25. $kol=round($kol, 2);
  26. echo "Ваш рейтинг: $famous";
  27. if ($kol!=0){
  28. if ($kol>0)echo " <font color='green'>(+$kol)</font>";
  29. else
  30. echo " <font color='red'>($kol)</font>";
  31. }
  32. 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>";
  33. echo "</div>";
  34. $ball=($komm+$guest+$mail+($forum*2));
  35. mysql_query("UPDATE `user` SET `ball` = '$ball' WHERE `id` = '$user[id]'");
  36. include_once 'inc/foot.php';
  37. ?>