/*
############################# SignMe 1.5 ############################
### |-----------------------------------------------------------| ###
### | COPYRIGHT 2006 by Lukas Stalder, planetluc.com | ###
### | DO NOT REDISTRIBUTE OR RESELL THIS SCRIPT | ###
### | ANY WAYS WITHOUT MY EXPLICIT PERMISSION! | ###
### | Support: www.planetluc.com/forum/ | ###
### | Read the README.txt file for installation | ###
### |-----------------------------------------------------------| ###
#####################################################################
*/
session_start();
// ************************** CONFIG **************************
// ************************************************************
// error reporting
error_reporting(0);
// misc values
$adminname = "tamcredi";
$adminpwd = "4840";
$ppp = 6; // posts to display per page
$adminexpire = 5*60; // time in seconds until admin has to relogin
$pathtoscript = ""; // eg if you call the script from within a file in a top level folder you have to put "folder_to_signme/". Otherwise leave it blank "".
$wrap = 80; // max. length of a word (to avoid bad entries like "hhhheeeeeeeeelllllllllllloooooooooo" that destroy your design) -- set to 'false if you don't want this option
$fieldlength = 550; // width in px of the input fields
// maximum word and/or characters per post (can use one or the other, both, or none)
$wordcount = true; // count words in the message to limit the length of a post -- set to 'true' to use this option -- set to 'false' if you don't want this option
$maxwords = 80; // max. length of words (letters with space between = word) for the message to keep people from writing 200+ pages of response
$txtwordcount = "max. espacios: ($maxwords) :::::: resto de espacios: ({countdown})"; // edit text for you language -- place {countdown} where you would like the number countdown to occur
$charactercount = true; // count characters (keystrokes) to limit the length of a post -- set to 'true' to use this option -- set to 'false' if you don't want this option
$maxchars = 550; // max. length of characters for the message to keep people from writing 200+ pages of response
$txtcharactercount = "max. caracteres: ($maxchars) :::::: caracteres restantes: ({countdown})"; // edit text for you language -- place {countdown} where you would like the number countdown to occur
// date settings
$dateformat = "%e. %b. %G - %H:%M"; // %b -> short month, %e -> day, %G -> 4digit year; for all possibilities have a look at http://www.php.net/manual/function.strftime.php
$datelang = "es_ES"; // language for formatted date output, de_DE -> german formatting; see http://www.php.net/manual/function.setlocale.php
//email notification settings
$emailnotify = true; // set to 'true' if you want an email notification when a new signature is added -- 'false' if you don't want to use this option
$emailHTML = true; // set to 'true' if you want to send multipart HTML/plain-text email -- 'false' if you want to send plain-text email only
$email_to = "tonisan8@icloud.com"; // change to your email address -- separate multiple email addresses with a comma (,)
$email_from = "tonisan8@icloud.com"; // default email address in case the visitor does not include their return email address when signing the guest book
$email_subject = "Nueva firma en el libro de visitas meteoibiza.com"; // subject of sent email
$guestbook = "http://www.meteoibiza.com/signar/signar.php"; // URL to your site's guestbook location
//CAPTCHA settings (additional settings in 'captcha.php')
$captcha = true; // set to 'true' if you want CAPTCHA keyword/image verification -- 'false' if you don't want to use this option
$captcha_case = true; // set to 'false' if you want the CAPTCHA keyword case sensitive -- 'true' if you don't care
$captcha_symbol = false; // set to 'true' if you want to use symbols in the CAPTCHA or if your fonts don't support symbols (symbols included are #, $, %, &, *, =, ?, @) -- 'false' if you don't
$captcha_shapes = false; // set to 'true' if you would like shapes in the image to confuse bots -- set to 'false' if you don't want shapes in the image or if you think the keyword is too hard to read
// language settings
// menu item text
$txtsign = "Firmar libro";
$txtview = "Ver las entradas";
$txtadmin = "Administración";
$txtlogout = "Salir";
// error text
$txtbadname = "falta el nombre";
$txtbademail = "dirección de correo electrónico no es válida";
$txtbadmsg = "mensaje que falta";
$txtmsgfiltermatch = "mensaje contiene texto prohibido";
$txtmisscaptcha = "falta palabra clave";
$txtbadcaptcha = "palabra clave introducida no coincide con la imagen, por favor, inténtelo de nuevo";
$txtwordcounterror = "se ha superado el número máximo de palabras
(limitado a $ maxwords palabras)";
$txtcharcounterror = "se ha superado el número máximo de caracteres
(limitado a $ maxChars caracteres)";
$txterrors = "Han ocurrido los siguientes errores:";
// signup form text
$txtedit = "Editar";
$txtdelete = "Eliminar";
$txtreply = "Responder";
$txtblockip = "Bloquear ip";
$txtname = "Nombre";
$txtemail = "Email";
$txtwebsite = "Sitio web";
$txtmessage = "Mensaje";
$txtcaptcha = "Palabra clave";
$txtcaptchacase = "(palabra clave distingue entre mayúsculas y minúsculas)";
$txtmandatory = "* Obligatorio";
$txtsubmitbutton = "Firmar";
// admin form text
$txtlogincap = "Admin Login";
$txtlogin = "Login";
$txtpassword = "Password";
$txtloginbutton = "Login";
// badwords list, seperated by comma
$badwords = "ass,motherfucker,asshole,fuck,fucker,bitch,slut,nazi,nigger,arsch,wixer,cock,shit,dick,penis,a$$,piss";
// message spam filter (entry is not saved on match!)
// seperated by comma, use lowercase!
$msgfilter = "http://,[url],[/url]";
// CSS Styles
?>
// ********************************************************************************************************************************************************************
// ** DO NOT MAKE CHANGES BELOW HERE UNLESS YOU KNOW WHAT YOU'RE DOING! ***********************************************************************************************
// ********************************************************************************************************************************************************************
// xxs preventing
foreach ($_GET as $key => $val){
$_GET[$key] = strip_tags($val);
$_REQUEST[$key] = strip_tags($val);
}
$ptsfr = dirname(__FILE__)."/";
$dat = $ptsfr."data.dat";
$template = $ptsfr."template.inc.php";
$log = $ptsfr."log.dat.php";
setlocale(LC_TIME, $datelang);
//CAPTCHA session settings to pass to 'captcha.php'
$_SESSION['captcha_case'] = $captcha_case;
$_SESSION['captcha_symbol'] = $captcha_symbol;
$_SESSION['captcha_shapes'] = $captcha_shapes;
$_SESSION['captcha_width'] = $fieldlength;
$me = $_SERVER['PHP_SELF'];
$empty = false;
$now = time();
$version = "1.55";
if (!isset($_GET['hash']) || $_GET['hash']=="") {
srand($now);
for ($i=0; $i<16 ; $i++) $secret.=chr(rand(60, 127));
$secret = md5($secret);
$hash = md5($_SERVER['HTTP_USER_AGENT'].$now.$secret);
}else $hash = $_GET['hash'];
$getvars = "?hash=$hash";
if (isset($_REQUEST['do'])) $do = $_REQUEST['do'];
if (isset($_REQUEST['id'])) $id = $_REQUEST['id'];
if (isset($_REQUEST['action'])) $action = $_REQUEST['action'];
if (isset($_REQUEST['name'])) $name = $_REQUEST['name'];
if (isset($_REQUEST['pwd'])) $pwd = $_REQUEST['pwd'];
if (isset($_REQUEST['email'])) $email = $_REQUEST['email'];
if (isset($_REQUEST['www'])) $www = $_REQUEST['www'];
if (isset($_REQUEST['msg'])) $msg = $_REQUEST['msg'];
if (isset($_REQUEST['time'])) $time = $_REQUEST['time'];
if (isset($_REQUEST['keyword'])) $keyword = $_REQUEST['keyword'];
if (isset($_SESSION['submitCmd']))
$submitCmd = $_SESSION['submitCmd'];
else {
$submitCmd = substr($hash, 0, 10);
$_SESSION['submitCmd'] = $submitCmd;
}
// ************************** functions ***********************
// ************************************************************
class mdasort {
var $data;
var $sortkeys;
function _sortcmp($a, $b, $i=0) {
$r = strnatcmp($a[$this->sortkeys[$i][0]],$b[$this->sortkeys[$i][0]]);
if ($this->sortkeys[$i][1] == "DESC") $r = $r * -1;
if($r==0) {
$i++;
if ($this->sortkeys[$i]) $r = $this->_sortcmp($a, $b, $i);
}
return $r;
}
function msort() {
if(count($this->sortkeys)) {
usort($this->data,array($this,"_sortcmp"));
}
}
}
function getkey($index, $stuff){
foreach ($stuff->data as $key => $item){
if ($item['id']==$index){
$ret = $key;
break;
}
}
return $ret;
}
function validemail($addr){
return eregi("^[a-z0-9]+([_.-][a-z0-9]+)*@([a-z0-9]+([.-][a-z0-9]+)*)+\\.[a-z]{2,4}$", $addr);
}
function clearoldadmins() {
global $log, $now, $adminexpire;
include($log);
if (count($admins)>0){
$i=0;
$fp = fopen($log, "w");
fputs($fp, "\n");
foreach ($admins as $line){
if ($now-$line['time']<$adminexpire)
fputs($fp, "\$admins[$i]['time']=".$line[time]."; \$admins[$i]['hash']='".$line['hash']."';\n");
$i++;
}
fputs($fp, "?>");
fclose($fp);
}
}
function saveposts($stuff){
global $dat;
$fp = fopen($dat, "w");
foreach ($stuff->data as $post){
$line = $post['id']."|".$post['time']."|".$post['name']."|".$post['email']."|".$post['www']."|".$post['post']."\n";
fputs($fp, $line);
}
fclose($fp);
}
function isloggedin() {
global $log, $now, $adminexpire;
include($log);
$logged = false;
if (count($admins)>0){
foreach ($admins as $line){
if ($line['hash'] == md5($_GET['hash'])) $logged = true;
}
}
return $logged;
}
function showmenu() {
global $txtsign, $txtview, $txtadmin, $txtlogout, $me, $getvars, $submitCmd;
if (!isloggedin()) $login = "$txtadmin";
else $login = "$txtlogout";
echo "