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

Размер файла: 978B
  1. <?php
  2. include 'inc/db.php';
  3. include 'inc/1.php';
  4. $id=intval($_GET['id']);
  5. if (!$_GET['id']){header("Location: /index.php");
  6. exit;}
  7. $ank=gus($id);
  8. if ($ank['name']==''){header("Location: /index.php");
  9. exit;}
  10. echo "<div class='t2'>Темы пользователя</div>";
  11. if (!$_GET['p'])$_GET['p']=1;
  12. $p=intval($_GET['p']);
  13. $start=(($p*15)-15);
  14. $q=mysql_query("SELECT `id`, `name`, `time` FROM `forum` WHERE `user` = '$id' ORDER BY `time` DESC LIMIT $start, 15");
  15. $b=1;
  16. while ($f=mysql_fetch_assoc($q)){
  17. $post=($b%2);
  18. echo "<div class='p$post'>";
  19. $name=out($f['name']);
  20. $time=vremja($f['time']);
  21. echo "<a href='theme.php?id=$f[id]'>$name</a> ($ank[name])<br>[$time]";
  22. echo "</div>";
  23. $b++;
  24. }
  25. $q1=(mysql_num_rows(mysql_query("SELECT `id` FROM `forum` WHERE `user` = '$id'"))/15);
  26. $q2=round(mysql_num_rows(mysql_query("SELECT `id` FROM `forum` WHERE `user` = '$id'"))/15);
  27. if ($q1>$q2)$pages=($q2+1);
  28. pages($pages, $p, "?p");
  29. include 'inc/foot.php';
  30. ?>