home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2003 May / INTERNET103.ISO / pc / software / windows / building / php_nuke / html / modules / forums / statistiche.php < prev    next >
Encoding:
PHP Script  |  2002-09-16  |  4.6 KB  |  118 lines

  1. <?php
  2.  
  3. ######################################################################
  4. # Modulo Splatt Forum per PHP-NUKE ver.5.X
  5. #-------------------------
  6. # Versione: 3.2
  7. #
  8. # Copyright (c) 2002 by:
  9. #
  10. # Giorgio Ciranni (~Splatt~)
  11. # (http://www.splatt.it)
  12. # (webmaster@splatt.it)
  13. #
  14. # Supporto tecnico disponibile sul Forum di www.splatt.it 
  15. ######################################################################
  16. # Splatt Forum is free software. You can redistribute it and/or modify
  17. # it under the terms of the GNU General Public License as published by
  18. # the Free Software Foundation; either version 2 of the License.
  19. # Splatt Forum is distributed in the hope that it will be useful,
  20. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  22. # GNU General Public License for more details.
  23. #
  24. # You should have received a copy of the GNU General Public License
  25. # along with this program; if not, write to the Free Software
  26. # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA   
  27. # 02111-1307  USA
  28. ######################################################################
  29.  
  30. $mtime = microtime();
  31. $mtime = explode(" ",$mtime);
  32. $mtime = $mtime[1] + $mtime[0];
  33. $starttime = $mtime;
  34.  
  35.  
  36. if (!eregi("modules.php", $PHP_SELF)) {
  37.     die ("You can't access this file directly...");
  38.     }
  39.  
  40. $module_name = "$name";
  41.  
  42. include("config.php");
  43. include("modules/$module_name/functions.php");
  44. include("modules/$module_name/auth.php");
  45. include("header.php");
  46.  
  47.  
  48.     echo"<table width=\"100%\"><tr><td align=\"left\">"
  49.         ."<img src=\"images/forum/forumlogo11.gif\" width=\"168\" height=\"84\" alt=\"Forum\"></td>"
  50.         ."<td><center><b>Statistiche dettagliate forum di: $sitename</b><br><br>"
  51.         ."</center><br></td></tr></table>";
  52.  
  53. if(!$result = mysql_query("SELECT * FROM ${prefix}_catagories ORDER BY cat_order"))
  54.         die("<font size=+1>"._ERRORE1."</font><hr>"._UNABLETOQUERY."");
  55. Opentable2();
  56.  
  57.         echo "Utenti maggiormente attivi...";
  58. Closetable();
  59.         echo"<table align=\"center\" border=\"0\" cellpadding=\"0\" width=\"100%\"><tr><td align=\"center\">"
  60.            ."<table align=\"center\" border=\"0\" cellpadding=\"0\" width=\"100%\" BGCOLOR=\"$bgcolor2\"><tr><td align=\"left\">";
  61. $a = 1;
  62. $r = mysql_query("select uid,uname,user_posts from ".$user_prefix."_users where user_posts >= '5' order by user_posts desc");
  63. while(list ($uid,$uname,$user_posts)= mysql_fetch_row($r)) 
  64.  
  65. {
  66. echo"$a ) $uname - ($user_posts)<br>";
  67. $a++;
  68. }
  69. //Closetable();
  70.  
  71. $a = 1;
  72.  
  73. $result = mysql_query("SELECT   t1.topic_id,t1.topic_title,t1.topic_time, t1.topic_views,t1.forum_id  FROM ${prefix}_forums t0,${prefix}_forumtopics t1   WHERE t0.forum_type = 0  AND t0.forum_id = t1.forum_id     ORDER BY t1.topic_views  DESC  LIMIT 0, 20");
  74. while(list($topic_id, $topic_title, $topic_time, $topic_views, $forum_id) = mysql_fetch_row($result)) 
  75.  
  76. {
  77.     $title2 = ereg_replace("_", " ", $topic_title);
  78.     $title3 = substr("$title2", 0,35);
  79.     $content1 .= "<strong><big>·</big></strong> $a:  <a href=\"modules.php?op=modload&name=$module_name&file=viewtopic&topic=$topic_id&forum=$forum_id \">$title2</a>        ($topic_views)<br>";
  80.  
  81. $a++;
  82.    
  83. }
  84. $contenuto = "<i><b><center></b></i></center><br> $content1<br>";
  85. Opentable2();
  86. echo"I messaggi pi∙ letti";
  87. Closetable();
  88. Opentable();
  89. echo"$content1";
  90. Closetable();
  91.  
  92.  
  93. $totale_topics = mysql_num_rows(mysql_query("SELECT * FROM ${prefix}_forumtopics"));
  94. $totale_posts = mysql_num_rows(mysql_query("SELECT * FROM ${prefix}_posts"));
  95. $mediarisposte = $totale_posts / $totale_topics;
  96. Opentable2();
  97. echo"Risposte medie per ogni discussione: $mediarisposte";
  98. Closetable();
  99.  
  100. $totale_utenti_attivi = mysql_num_rows(mysql_query("SELECT * FROM ${prefix}_forumtopics"));
  101.  
  102. $tot_attivi = mysql_num_rows(mysql_query("select uid,uname,user_posts from ".$user_prefix."_users where user_posts >= '1'"));
  103.  
  104. $tot_user = mysql_num_rows(mysql_query("select uid,uname,user_posts from ".$user_prefix."_users where uid != '1'"));
  105. Opentable2();
  106. echo"Utenti totali registrati al sito: $tot_user <br> Utenti utilizzatori del forum: $tot_attivi";
  107. Closetable();
  108.  
  109. echo"<p align=\"center\">Splatt Forum © By: <a href=\"http://www.splatt.it\" target=\"_blank\">Splatt.it</a><br>Version: $forumver</font></p><br><br>";
  110.  
  111. $mtime = microtime();
  112. $mtime = explode(" ",$mtime);
  113. $mtime = $mtime[1] + $mtime[0];
  114. $endtime = $mtime;
  115. $totaltime = ($endtime - $starttime);
  116. printf("<center><font size=-2>Elaboration time:  %f  seconds.</font></center><br>", $totaltime);
  117. include("footer.php");
  118. ?>