login  Naam:   Wachtwoord: 
Registreer je!
 Scripts:

Scripts > PHP > Snippets > Langste bericht top 25 in phpBB

Langste bericht top 25 in phpBB

Auteur: LuckyLuke - 04 september 2004 - 16:01 - Gekeurd door: Dennisvb - Hits: 2513 - Aantal punten: 3.67 (3 stemmen)




Nog een klein scriptje dat de langste berichten uit de DB haalt en sorteert 

Code:
  1. <HTML>
  2. <HEAD>
  3. <title>Langste bericht top 25</title>
  4. <style type="text/css">
  5. body {
  6. font: 12px verdana, tahoma, arial, sans-serif;
  7. scrollbar-face-color: {T_TR_COLOR2};
  8. scrollbar-highlight-color: {T_TD_COLOR2};
  9. scrollbar-shadow-color: {T_TR_COLOR2};
  10. scrollbar-3dlight-color: {T_TR_COLOR3};
  11. scrollbar-arrow-color: {T_BODY_LINK};
  12. scrollbar-track-color: {T_TR_COLOR1};
  13. scrollbar-darkshadow-color: {T_TH_COLOR1};
  14. }
  15. .10px {
  16. font-size: 12px;
  17. font-face: verdana;
  18. }
  19. </style>
  20. </HEAD>
  21. <BODY>
  22. <font size="5">Langste bericht top 25</font>
  23. <font class="10px">
  24. <br>
  25. <br>
  26. <?php
  27. //(c) 2004 by Lucas van Dijk
  28. include("config.php");
  29. mysql_connect($dbhost, $dbuser, $dbpasswd);
  30. mysql_select_db($dbname);
  31. echo "<table class='10px'>
  32. <tr class='10px'>
  33. <td width=\"20\" class='10px'>&nbsp</td>
  34. <td width=\"500\" class='10px'><b>Topic</b></td>
  35. <td width=\"300\" class='10px'><b>Lengte van het bericht</b></td>
  36. </tr></table><hr>";
  37. $plaats = 1;
  38. $sql2 = mysql_query("SELECT * FROM phpbb_posts_text ORDER BY CHAR_LENGTH(post_text) DESC LIMIT 25");
  39. echo "<table class='10px'>";
  40. while($row = mysql_fetch_object($sql2)) {
  41. $sql = mysql_query("SELECT * FROM phpbb_posts WHERE post_id='".$row->post_id."'");
  42. $list = mysql_fetch_object($sql);
  43. $lengtebericht = strlen($row->post_text);
  44. $sql3 = mysql_query("SELECT * FROM phpbb_topics WHERE topic_id='".$list->topic_id."'");
  45. $show = mysql_fetch_object($sql3);
  46. echo "<tr class='10px'>";
  47. echo "<td width=\"20\" class='10px'>".$plaats."</td><td width=\"500\" class='10px'><a href=\"viewtopic.php?p=".$row->post_id."#".$row->post_id."\">".$show->topic_title."</a></td><td width=\"300\" class='10px'>".$lengtebericht."</td></tr>";
  48. $plaats++;
  49. }
  50. ?>
  51. </table><br><font size="2"><center>&copy 2004 Lucas van Dijk</center></font>
  52. </font></BODY></HTML>
Download code! Download code (.txt)

 Bekijk een voorbeeld van dit script!
 Stemmen
Niet ingelogd.

 Reacties
Post een reactie
Lees de reacties (2)
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.022s