' . $_LANG['globalsystemname'] . ''; $templatefile = 'homepage'; $pageicon = ''; $query = '' . 'SELECT * FROM tblpagecontent WHERE name=\'Home\' AND lang=\'Italiano\''; $result = mysql_query ($query); $data = mysql_fetch_array ($result); $id_madre = $data['id']; if ($_SESSION['Language'] <> '' ) { $query = '' . 'SELECT * FROM tblpagecontent WHERE id_madre=\'' . $id_madre . '\' AND lang=\'' . $_SESSION['Language'] . '\''; if ($_SESSION['Language'] == 'English' ) { $smarty->assign ('langeng', 'true'); } } else { $query = '' . 'SELECT * FROM tblpagecontent WHERE id=\'' . $id_madre . '\''; } $result = mysql_query ($query); $data = mysql_fetch_array ($result); $content = $data['content']; $title = 'Escursionismo ed Educazione Ambientale'; $smarty->assign ('contenuto', $content); $smarty->assign ('titolo', $title); if ($view <> '') { $query = '' . 'SELECT * FROM tblpagecontent WHERE name=\'' . $view . '\' AND lang=\'Italiano\''; $result = mysql_query ($query); $data = mysql_fetch_array ($result); $id_madre = $data['id']; if ($_SESSION['Language'] <> '' ) { $query = '' . 'SELECT * FROM tblpagecontent WHERE id_madre=\'' . $id_madre . '\' AND lang=\'' . $_SESSION['Language'] . '\''; } else { $query = '' . 'SELECT * FROM tblpagecontent WHERE id=\'' . $id_madre . '\''; } $result = mysql_query ($query); $data = mysql_fetch_array ($result); $content = $data['content']; $title = $data['name']; if ($title == 'Attivita' ) { $title = 'Attività'; } $templatefile = 'views'; $smarty->assign ('contenuto', $content); $smarty->assign ('titolo', $title); $smarty->assign ('subcontenuto', $subcontent); if ($id_madre == '2' ) { $templatefile = 'zafferana'; } if ($view == 'Guestbook') { $templatefile = 'firme'; if ($write == 'true') { require_once('includes/recaptchalib.php'); // Get a key from http://recaptcha.net/api/getkey $publickey = '6LfFNAkAAAAAAGwf7F8AXbZLqoP1XqBkoWy4ZqBO'; $privatekey = '6LfFNAkAAAAAAJOJ8bYbvpHEatiiWIYDGw21WGAW '; # the response from reCAPTCHA $resp = null; # the error code from reCAPTCHA, if any $error = 'errore'; if ($send) { $name = sanitize ($_POST['name']); $email = sanitize ($_POST['email']); $message = sanitize ($_POST['message']); if ($name == '') { $errormessage .= '
  • ' . $_LANG['contacterrorname']; } if ($email == '') { $errormessage .= '
  • ' . $_LANG['clientareaerroremail']; } if (!eregi ('' . '^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,6})$', $email)) { $errormessage .= '
  • ' . $_LANG['clientareaerroremailinvalid']; } if ($message == '') { $errormessage .= '
  • ' . $_LANG['contacterrormessage']; } $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); if (!$resp->is_valid) { $errormessage .= '
  • ' . $_LANG['clientregisterverifyinvalid']; } if ($errormessage == '') { $query = '' . 'INSERT INTO tblfirme (name,email,message,datepost) VALUES (\'' . $name . '\',\'' . $email . '\',\'' . $message . '\',now())'; $result = mysql_query ($query); $smarty->assign ('messagez', 'true'); } else { $smarty->assign ('errormessage', $errormessage); $smarty->assign ('name', $name); $smarty->assign ('email', $email); $smarty->assign ('message', $message); $capatacha = recaptcha_get_html($publickey, $error); $smarty->assign ('capatacha', $capatacha); } $smarty->assign ('write', 'true'); } else { $capatacha = recaptcha_get_html($publickey, $error); $smarty->assign ('capatacha', $capatacha); $smarty->assign ('write', 'true'); } } else { $table = 'tblfirme'; $fields = ''; $where = ''; $result = select_query ($table, $fields, $where); while ($data = mysql_fetch_array ($result)) { $id = $data['id']; $name = $data['name']; $email = $data['email']; $message = $data['message']; $date = $data['datepost']; $firmes[] = array ('id' => $id, 'name' => $name, 'email' => $email, 'message' => $message, 'date' => $date); } $smarty->assign ('firmes', $firmes); } } } require 'display.php'; ?>