<?php

if ( ! @include_once( './mainfile.php' ) ) { exit( '!! INCLUDE ERROR. 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: partner.php,v 1.4.2.2 2004/04/18 12:45:44 ajvwaay Exp $

######################################################################
# Partner-Addon for PHP-NUKE Version 1.0 Beta
# ===========================
#
# Copyright (c) 2001 by Dietrich Bojko (webmaster@jimmy-net.de)
# http://www.jimmy-net.de
#
#
# 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.
######################################################################


if ( isset( $_REQUEST['id'] ) && ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'click' ) )
{
    mysql_query( "UPDATE " . $mpnTables['click'] . " SET hits = hits + 1 WHERE num = '$id'" );

    $res = mysql_fetch_assoc( mysql_query( "SELECT url AS url FROM " . $mpnTables['click'] . " WHERE num = '$id'" ));

    header( "Location: {$res['url']}" );
    exit;

} // End Click

// Normal Processing

$index = 0;

include("header.$phpEx");

    $result = mysql_query( 'SELECT * FROM ' . $mpnTables['click'] );
    $numrows = mysql_num_rows($result);

    echo "<h1>" . translate ( 'Partner sites from' ) . "  $sitename</h1>\n";
    echo "<br />\n";



    if ($numrows > 0)
    {
        echo "<h2>\n";
            echo sprintf( translate( "We have <b>%s</b> partner sites" ), $numrows );
        echo "</h2>\n";

        OpenTable();

        while ( list( $num, $hits, $url, $image, $text ) = mysql_fetch_row( $result ) )
        {
            echo "<table width=90% border=0 cellspacing=5 cellpadding=5>

            <tr><td class='center' width=15% bgcolor=\"$bgcolor2\">

                <a href='./partner.php?action=click&id=$num' target='_blank'>

                    <img src=$image border=0>

                </a>

            </td><td width=75% bgcolor=\"$bgcolor3\">

                $text

            </td><td width=10% bgcolor=\"$bgcolor2\" align=center>

                <font size=1 color=\"$textcolor1\">$hits " .translate("hits")."</font>

            </td></tr>";
        }

        echo "</table>";

        CloseTable();
    }

    echo "<br /><br /><br />

        <p class='subtitle1'>

            <a href='./contact.$phpEx' title='" . translate( 'Contact Us' ) . "'>" . translate("Become a partner")."</a>

        </p><br /><br /></center>\n";

mysql_free_result($result);



include("footer.$phpEx");

?>
