<?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");

incoh();
	if (eregi("<!--pagebreak-->", $text)) {
		$text = ereg_replace("<!--pagebreak-->","&lt;!--pagebreak--&gt;;",$text);
	}
	$id = $db->XMFnum($id);
	$title = stripslashes(FixQuotes(check_html($title, "nohtml")));
	$text = htmlspecialchars(stripslashes(Fixquotes(urldecode(check_html($text, "")))));
	$reviewer = stripslashes(check_html($reviewer, "nohtml"));
	$url_title = stripslashes(check_html($url_title, "nohtml"));
	$email = stripslashes(check_html($email, "nohtml"));
	$score = $db->XMFnum($score);
	$cover = stripslashes(check_html($cover, "nohtml"));
	$url = stripslashes(check_html($url, "nohtml"));
	$url_title = stripslashes(check_html($url_title, "nohtml"));
	$hits = $db->XMFnum($hits);
	if (eregi("&lt;!--pagebreak--&gt;", $text)) {
		$text = ereg_replace("&lt;!--pagebreak--&gt;","<!--pagebreak-->",$text);
	}
	Max_OpenTable();
	echo "<br /><center>"._RTHANKS."";
	$id = $db->XMFnum($id);
	if ($id != 0)
	echo " "._MODIFICATION."";
	else
	echo ", $reviewer !";
	br('1');
	if ($score < 0 OR $score > 10) {
		$score = 0;
	}
	if ((defined('ADMIN_ALLOW')) && ($id == 0)) {
		$db->sql_query("INSERT INTO ".TABLE_REVIEWS." values (NULL, '$date', '$title', '$text', '$reviewer', '$email', '$score', '$cover', '$url', '$url_title', '1', '$rlanguage')");
		echo ""._ISAVAILABLE."";
	} else if ((defined('ADMIN_ALLOW')) && ($id != 0)) {
		$db->sql_query("UPDATE ".TABLE_REVIEWS." SET date='$date', title='$title', text='$text', reviewer='$reviewer', email='$email', score='$score', cover='$cover', url='$url', url_title='$url_title', hits='$hits', rlanguage='$rlanguage' where id = '$id'");
		echo ""._ISAVAILABLE."";
	} else {
		$db->sql_query("INSERT INTO ".TABLE_REVIEWS."_add valueS (NULL, '$date', '$title', '$text', '$reviewer', '$email', '$score', '$url', '$url_title', '$rlanguage')");
		echo ""._EDITORWILLLOOK."";
	}
	br('2');
	echo "[ <a href=\"modules.php?name=$module_name\">"._RBACK."</a> ]<br /></center>";
	Max_CloseTable();
	incof();