<?php

@( (bool)FALSE === strpos( $_SERVER['REQUEST_URI'], basename( __FILE__ ) ) ) OR exit( '!! ACCESS DENIED !!' );
error_reporting( _E_VALUE );


/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | myPHPNuke Version 188_8 RC2                                          |
// +----------------------------------------------------------------------+
// | License: GNU/GPL - http://www.gnu.org/copyleft/gpl.html              |
// +----------------------------------------------------------------------+
// | Support: http://myphpnuke.com/                                       |
// +----------------------------------------------------------------------+
// | Author: myPHPNuke Dev Team                                           |
// +----------------------------------------------------------------------+
// | Copyright: © 2001-2004 myPHPNuke Dev Team                            |
// +----------------------------------------------------------------------+
// $Id: referers.php,v 1.4.2.5 2004/08/15 12:58:04 kirilt Exp $

/************************************************************************/
/* PHP-NUKE: Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2001 by Francisco Burzi (fburzi@ncc.org.ve)            */
/* http://phpnuke.org                                                   */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/

checkAccess( 'util', NULL, TRUE );

$hlpfile = getHelpFile("referer.html");
/*********************************************************/
/* Referer Functions to know who links us                */
/*********************************************************/

function hreferer() {
    global $hlpfile, $admin, $mpnTables,$phpEx;
    include ("header.$phpEx");
    GraphicAdmin($hlpfile);
    OpenTable();
    echo "
    <font size=4><center><b>".translate("HTTP Referers")."</b></center></font>
    <center><b>(".translate("Who is linking our site?").")</b></center><br><br>
    <table border=0 width=100%>";
    $hresult = mysql_query("select rid, url from ".$mpnTables['referer']);
    while(list($rid, $url) = mysql_fetch_row($hresult)) {
    echo "<tr><td bgcolor=CCCCCC><font size=2>$rid</td>";
    echo "<td bgcolor=CCCCCC><font size=2><a target=_blank href=$url>$url</a></td></tr>";
    }
    echo "</table>";
    echo "<form action=admin.$phpEx method=post>";
    echo "<input type=hidden name=op value=delreferer>";
    echo "<center><input class='button' type=submit value=\"".translate("Delete Referers")."\"></center>";
    echo "</td></tr></table></td></tr></table>";
    include ("footer.$phpEx");
}

function delreferer() {
    global $mpnTables;

    mysql_query("delete from ".$mpnTables['referer']);

    $_SERVER['F_LIB'] -> redirectRequest( 'admin.php?op=adminMain' );
}

switch($op) {

        case "hreferer":
            hreferer();
            break;

        case "delreferer":
            delreferer();
            break;

}

?>
