<?php
/**************************************************************************/
/* Module Gbook MX v2.0 Copyright (c) 2004 by Víctor Simental             */
/* $Revision 31/01/2004 - $Id preview.php - v4.1.0    EPX $               */ 
/* @URI: http://www.phpwebmasters.com                                     */ 
/* ============================================                           */
/* Based in Gbook MX v4.1.0 Copyright (c) 2003 by                         */
/* Víctor Simental - http://gbookmx.sourceforge.net                       */
/* ============================================                           */
/* GbookMX is Based in the Gbook v1.0 for PHP Nuke Copyright (c) 2003 by  */
/* http://www.PHP-Mania.com.ar                                            */
/* Programed and Design By Víctor Simental and German Cúevas              */
/* vicmx@phpwebmasters.com                                                */
/*                                                                        */
/* 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 (!eregi("modules.php", $_SERVER['PHP_SELF'])) {   
 die ("You can't access this file directly...");
}

$nombre = $_POST[nombre];
$genero = $_POST[genero];
$bandera = $_POST[bandera];
$ciudad = $_POST[ciudad];
$email = $_POST[email];
$icq = $_POST[icq];
$msn = $_POST[msn];
$yim = $_POST[yim];
$url = $_POST[url];
$firma = $_POST[firma];
$aim = $_POST[aim];

include("header.php");
include("modules/$module_name/includes/javascript.php");


 if($allowhtml == 1){
 $firma = quotes(nl2br($firma));
 $nombre = quotes(trim($nombre));
 $ciudad = quotes(trim($ciudad));
 $icq = quotes(trim($icq));
 $aim = quotes(trim($aim));
 $msn = quotes(trim($msn));
 $yim = quotes(trim($yim));
 }
 else
 {
 $nombre = quotes(trim(htmlspecialchars($nombre)));
 $firma = quotes(htmlspecialchars($firma));
 $ciudad = quotes(trim(htmlspecialchars($ciudad)));
 $url = quotes(trim(htmlspecialchars($url)));
 
 $icq = quotes(trim(htmlspecialchars($icq)));
 $aim = quotes(trim(htmlspecialchars($aim)));
 $msn = quotes(trim(htmlspecialchars($msn)));
 $yim = quotes(trim(htmlspecialchars($yim)));
 }
 if(!ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'.'@'.'[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.'.'[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $email)){
 Table();
 echo "<center><b>"._INVALIDEMAIL."</b><br>\n<input type=\"button\" name=\"back\" value=\""._BACK."\" onclick=\"javascript:history.go(-1)\"></center>";
 EndTable();
 include("footer.php");
 }
 else
 {
 echo $valida;
 Table();
 echo "<center><b>$sitename :<br>\n"._PREVMENSAJE." $nombre</b><br></center>\n";
 EndTable();
 echo "<br>";
 Table();
 echo "<form action=\"modules.php?name=$module_name\" method=\"post\" name=\"book\" onsubmit=\"return validarform2()\">\n"
		."<table width=\"100%\" align=\"center\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\" bgcolor=\"$bordercolor\">\n"
		."<tr bgcolor=\"$tableheader\">\n"
		."<td width=\"20%\" valign=\"top\">\n"
		."<center><font class=\"title\"><b>"._TABLENOMBRE."</b></font></center>\n</td>\n"
		."<td width=\"80%\" valign=\"top\">\n"
		."<center><font class=\"title\"><b>"._COMENTARIOS."</b></font></center>\n</td>\n"
		."</tr><tr bgcolor=\"$Colortab\">\n"
		."<td width=\"20%\" valign=\"top\">\n"
		."<center>$nombre&nbsp;";		
			if($genero_field == 1){
				if($male){
				echo "<img src=\"modules/$module_name/images/$genero.gif\" align=\"absmiddle\">\n";
				}
				else
				{
				echo "<img src=\"modules/$module_name/images/$genero.gif\" align=\"absmiddle\">\n";
				}
			}
		if($pais_field == 1){
			if($bandera!= "blank.gif"){echo "<br>"._PAIS."\n";}
			echo "<br><img src=\"modules/$module_name/images/flags/$bandera\" border=\"0\" align=\"absmiddle\"";
			//FIX door peter, voor oude versie van basename
			//$bandera=basename(strval($bandera),".gif");
			$bandera=basename(strval($bandera));
			if (substr($bandera, -4) == ".gif"){
			$bandera=substr($bandera, 0, -4);
			}
			//einde FIX
			echo "alt=\"".ucfirst($bandera)."\">";
		}
		if($ciudad_field ==1){
			if(!empty($ciudad)){echo "<br>"._CIUDAD."<br>\n"
			."$ciudad";
			}
		}
		echo "</center>";
		if($email!= ""){
		echo "<br><a href=\"mailto:$email\"><img src=\"modules/$module_name/images/email.gif\" border=\"0\" alt=\"$email\"></a>\n";
		}
		if($url!= "http://"){
		echo "<a href=\"$url\" target=\"_blank\"><img src=\"modules/$module_name/images/home.gif\" border=\"0\" align=\"absmiddle\" alt=\"$url\"></a>\n";
		}
		if($msn!= ""){
		echo "<img src=\"modules/$module_name/images/msn.gif\" align=\"absmiddle\" border=\"0\" alt=\"$msn\">\n";
		}
		if($yim!= ""){
		echo "<a href=\"http://edit.yahoo.com/config/send_webmesg?.target=$yim&.src=pg\"><img src=\"modules/$module_name/images/yim.gif\" align=\"absmiddle\" border=\"0\" alt=\"$yim\"></a>\n";
		}
		if($icq!= ""){
		echo "<a href=\"http://wwp.icq.com/scripts/search.dll?to=$icq\"><img src=\"modules/$module_name/images/icq.gif\" align=\"absmiddle\" border=\"0\" alt=\"$icq\"></a>";
		}
		if($aim!= ""){
		echo "<a href=\"aim:goim?screenname=$aim&amp;message=Hello+Are+you+there?\"><img src=\"modules/$module_name/images/aim.gif\" align=\"absmiddle\" border=\"0\"></a>\n";
		}
		echo "</td>\n"
		."<td width=\"80%\" valign=\"top\">\n".emoticon($firma)."\n"
		."<input type=\"hidden\" name=\"nombre\" value=\"$nombre\">\n"
		."<input type=\"hidden\" name=\"email\" value=\"$email\">\n";
		if($genero_field == 1){
		echo "<input type=\"hidden\" name=\"genero\" value=\"$genero\">\n";
		}
		else
		{
		echo "<input type=\"hidden\" name=\"genero\" value=\"blank\">\n";
		}
		if($pais_field == 1){
		echo "<input type=\"hidden\" name=\"bandera\" value=\"$bandera.gif\">\n";
		}
		else
		{
		echo "<input type=\"hidden\" name=\"bandera\" value=\"\">\n";
		}
		$firma=str_replace("<br />","",$firma);
		echo "<input type=\"hidden\" name=\"ciudad\" value=\"$ciudad\">\n"
		."<input type=\"hidden\" name=\"url\" value=\"$url\">\n"
		."<input type=\"hidden\" name=\"icq\" value=\"$icq\">\n"
		."<input type=\"hidden\" name=\"msn\" value=\"$msn\">\n"
		."<input type=\"hidden\" name=\"yim\" value=\"$yim\">\n"
		."<input type=\"hidden\" name=\"aim\" value=\"$aim\">\n"
		."<input type=\"hidden\" name=\"firma\" value=\"$firma\">\n"
		."<input type=\"hidden\" name=\"userrec\" value=\"$userrec\">\n";
		if (is_user($user)){
		echo "<input type=\"hidden\" name=\"gbook_user\" value=\"1\">\n";
		}
		echo "<input type=\"hidden\" name=\"op\" value=\"save\">\n"
		."</td>\n</tr>\n"
		."</table><br>\n";
		EndTable();
		echo "<br>";
		Table();
		echo "<br><center>\n"
		."<input type='submit' name='submit' value='"._SIGN."'>\n"
		."<input type=\"button\" name=\"back\" value=\""._BACK."\" onclick=\"javascript:history.go(-1)\"></form>\n</center>";
		EndTable();
		include("footer.php");
		
}
		
if(!@file_exists("modules/$module_name/copyright.php"))
	  die("<h1>Your Gbook MX its an copy ilegal<br> <b>DO NOT REMOVE THE COPYRIGHT. YOU'RE NOT ALLOWED TO REMOVE NOR EDIT THIS.!!!!</b></h1>");
		
?>