Просмотр файла include/top.php

Размер файла: 2.19Kb
  1. <?
  2. if($version == "wml")
  3. {
  4. header("Content-type: text/vnd.wap.wml; charset=utf-8");
  5. echo(doctype("Топ-20").$tag);
  6. echo("Имя - сообщений<br />\r\n");
  7. $query = mysql_query(" SELECT users.username, users.id, COUNT( posts.name ) AS cnt
  8. FROM posts, users
  9. WHERE users.username = posts.name
  10. GROUP BY users.id
  11. ORDER BY cnt DESC
  12. LIMIT 20");
  13. while($rows = mysql_fetch_assoc($query))
  14. {
  15. if($authorize)
  16. {
  17. echo("<a href=\"./?p=6&amp;v=".$version."&amp;sid=".$sid."&amp;id=".$rows['id']."\">".$rows['username']."</a> ");
  18. echo("<b>(".$rows['cnt'].")</b><br />\r\n");
  19. }
  20. }
  21. echo
  22. "<a href=\"./?p=0&amp;v=wml&amp;sid=".$sid."\">Форумы</a>\r\n",
  23. $tagC."</p></card></wml>";
  24. }
  25. elseif($version == "xhtml")
  26. {
  27. header("Content-type: text/html; charset=utf-8");
  28. echo('<html>
  29. <head>
  30. <title>Топ-20</title>
  31. </head>
  32. <body bgcolor="'.$style['background'].'" link="'.$style['link'].'" vlink="'.$style['link'].'" text="#000000">
  33. <table align="center" border="0" cellspacing="1" cellpadding="5" width="350">
  34. <tr align="center" bgcolor="'.$style['title'].'"><td colspan="2">
  35. <font color="#FFFFFF"><b>Топ-20</b></font>
  36. </td></tr>
  37. <tr bgcolor="'.$style['bottom'].'"><td colspan="2"></td></tr>
  38. <tr bgcolor="'.$style['text'].'"><td>'.$tag.'Имя'.$tagC.'</td><td>'.$tag.'сообщений'.$tagC.'</td></tr>');
  39.  
  40.  
  41. $query = mysql_query("SELECT users.username, users.id, COUNT( posts.name ) AS cnt
  42. FROM posts, users
  43. WHERE users.username = posts.name
  44. GROUP BY users.id
  45. ORDER BY cnt DESC
  46. LIMIT 20");
  47. while($rows = mysql_fetch_assoc($query))
  48. {
  49. echo("<tr bgcolor=\"".$style['text']."\">\r\n");
  50. if($authorize)
  51. {
  52. echo("<td>".$tag."<a href=\"./?p=6&amp;v=".$version."&amp;sid=".$sid."&amp;id=".$rows['id']."\">".$rows['username']."</a>".$tagC."</td>\r\n");
  53. echo("<td><b>(".$tag.$rows['cnt'].$tagC.")</b></td>");
  54. echo("</tr>");
  55. }
  56. }
  57. echo('<tr bgcolor="'.$style['bottom'].'"><td colspan="2">
  58. '.$tag.'<a href="./?p=0&amp;v=xhtml&amp;sid='.$sid.'">В форум</a> '.$tagC.'
  59. </td></tr></table>
  60. </body></html>');
  61. }
  62. ?>