home *** CD-ROM | disk | FTP | other *** search
/ PC World 2005 April / PCWorld_2005-04_cd.bin / akce / web / unitednuke / unitednuke.exe / html / admin / modules / referers.php < prev    next >
PHP Script  |  2004-01-10  |  3KB  |  72 lines

  1. <?php
  2.  
  3. /************************************************************************/
  4. /* PHP-NUKE: Web Portal System                                          */
  5. /* ===========================                                          */
  6. /*                                                                      */
  7. /* Copyright (c) 2002 by Francisco Burzi                                */
  8. /* http://phpnuke.org                                                   */
  9. /*                                                                      */
  10. /* This program is free software. You can redistribute it and/or modify */
  11. /* it under the terms of the GNU General Public License as published by */
  12. /* the Free Software Foundation; either version 2 of the License.       */
  13. /************************************************************************/
  14.  
  15. if (!eregi("admin.php", $_SERVER['PHP_SELF'])) { die ("Access Denied"); }
  16. global $prefix, $db;
  17. $aid = substr(trim($aid), 0,25);
  18. $row = $db->sql_fetchrow($db->sql_query("SELECT radminsuper FROM ".$prefix."_authors WHERE aid='$aid'"));
  19. if ($row['radminsuper'] == 1) {
  20.  
  21. /*********************************************************/
  22. /* Referer Functions to know who links us                */
  23. /*********************************************************/
  24.  
  25. function hreferer() {
  26.     global $bgcolor2, $prefix, $db;
  27.     include ("header.php");
  28.     GraphicAdmin();
  29.     OpenTable();
  30.     echo "<center><font class=\"title\"><b>"._HTTPREFERERS."</b></font></center>";
  31.     CloseTable();
  32.     echo "<br>";
  33.     OpenTable();
  34.     echo "<center><b>"._WHOLINKS."</b></center><br><br>"
  35.     ."<table border=\"0\" width=\"100%\">";
  36.     $result = $db->sql_query("SELECT rid, url from " . $prefix . "_referer");
  37.     while ($row = $db->sql_fetchrow($result)) {
  38.     $rid = intval($row['rid']);
  39.     $url = $row['url'];
  40.     echo "<tr><td bgcolor=\"$bgcolor2\"><font class=\"content\">$rid</td>"
  41.         ."<td bgcolor=\"$bgcolor2\"><font class=\"content\"><a target=\"_blank\" href=\"$url\">$url</a></td></tr>";
  42.     }
  43.     echo "</table>"
  44.     ."<form action=\"admin.php\" method=\"post\">"
  45.     ."<input type=\"hidden\" name=\"op\" value=\"delreferer\">"
  46.     ."<center><input type=\"submit\" value=\""._DELETEREFERERS."\"></center>";
  47.     CloseTable();
  48.     include ("footer.php");
  49. }
  50.  
  51. function delreferer() {
  52.     global $prefix, $db;
  53.     $db->sql_query("delete from ".$prefix."_referer");
  54.     Header("Location: admin.php?op=adminMain");
  55. }
  56.  
  57. switch($op) {
  58.  
  59.     case "hreferer":
  60.     hreferer();
  61.     break;
  62.  
  63.     case "delreferer":
  64.     delreferer();
  65.     break;
  66.  
  67. }
  68.  
  69. } else {
  70.     echo "Access Denied";
  71. }
  72. ?>