<?php
/************************************************************************/
/* Maximus CMS: Web Portal System                                       */
/* ==============================                                       */
/*                                                                      */
/* Copyright (c) 2002 - 2006                                            */
/* http://www.php-maximus.fr                                            */
/* dev@php-maximus.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.       */
/************************************************************************/
/* Based on PHP-NUKE: Web Portal System                                 */
/************************************************************************/
defined('MAXIMUS') or Header("Location: index.php");

    $sql = "SELECT `site_url`, `site_status` FROM `".TABLE_NSNSP_SITES."` WHERE `site_id`='$site_id'";
    if ( !($result = $db->sql_query($sql)) )
{ query_die(GENERAL_ERROR, 'Could not obtain nsnsp_sites modules', '', __LINE__, __FILE__, $sql);}
    $row    = $db->sql_fetchrow($result);
    $url    = stripslashes($row['site_url']);
    $status = $db->XMFbin($row['site_status']);
    if ($status==1) {
        $db->sql_query("UPDATE `".TABLE_NSNSP_SITES."` set `site_hits`=site_hits+1 WHERE `site_id`='$site_id'");
    }
    redirect_url("$url");