home *** CD-ROM | disk | FTP | other *** search
/ PC World 2001 March / PCWorld_2001-03_cd.bin / KOMUNIK / progweb / progweb.exe / phpnuke / html / admin / referers.php < prev    next >
PHP Script  |  2000-12-05  |  2KB  |  69 lines

  1. <?PHP
  2.  
  3. ######################################################################
  4. # PHP-NUKE: Web Portal System
  5. # ===========================
  6. #
  7. # Copyright (c) 2000 by Francisco Burzi (fburzi@ncc.org.ve)
  8. # http://phpnuke.org
  9. #
  10. # This modules is the main administration part
  11. #
  12. # This program is free software. You can redistribute it and/or modify
  13. # it under the terms of the GNU General Public License as published by
  14. # the Free Software Foundation; either version 2 of the License.
  15. ######################################################################
  16.  
  17. if (!eregi("admin.php", $PHP_SELF)) { die ("Access Denied"); }
  18. $hlpfile = "manual/referer.html";
  19. $result = mysql_query("select radminsuper from authors where aid='$aid'");
  20. list($radminsuper) = mysql_fetch_row($result);
  21. if ($radminsuper==1) {
  22.  
  23. /*********************************************************/
  24. /* Referer Functions to know who links us                */
  25. /*********************************************************/
  26.  
  27. function hreferer() {
  28.     global $hlpfile, $admin;
  29.     include ("header.php");
  30.     GraphicAdmin($hlpfile);
  31.     OpenTable();
  32.     echo "
  33.     <font size=4><center><b>".translate("HTTP Referers")."</b></center></font>
  34.     <center><b>(".translate("Who is linking our site?").")</b></center><br><br>
  35.     <table border=0 width=100%>";
  36.     $hresult = mysql_query("select rid, url from referer");
  37.     while(list($rid, $url) = mysql_fetch_row($hresult)) {
  38.     echo "<tr><td bgcolor=CCCCCC><font size=2>$rid</td>";
  39.     echo "<td bgcolor=CCCCCC><font size=2><a target=_blank href=$url>$url</a></td></tr>";
  40.     }
  41.     echo "</table>";
  42.     echo "<form action=admin.php method=post>";
  43.     echo "<input type=hidden name=op value=delreferer>";
  44.     echo "<center><input type=submit value=\"".translate("Delete Referers")."\"></center>";
  45.     echo "</td></tr></table></td></tr></table>";
  46.     include ("footer.php");
  47. }
  48.  
  49. function delreferer() {
  50.     mysql_query("delete from referer");
  51.     Header("Location: admin.php?op=AdminMain");
  52. }
  53.  
  54. switch($op) {
  55.  
  56.         case "hreferer":
  57.             hreferer();
  58.             break;
  59.  
  60.         case "delreferer":
  61.             delreferer();
  62.             break;
  63.  
  64. }
  65.  
  66. } else {
  67.     echo "Access Denied";
  68. }
  69. ?>