ini_set("session.gc_maxlifetime", 7200); session_cache_expire(120); ini_set("session.cookie_lifetime", 0); ini_set("session.gc_probability", 1); session_start(); ini_set('max_execution_time', 3000); ini_set('memory_limit', '1000M'); # database function db_open() { $db_host = "localhost"; $db_user = "wp_fjf39"; $db_password = "9JHX4&nd"; $db_name = "gimema_corsi"; // $db_password = "fe1290"; // $db_name = "gimema#it"; global $db; $db = mysql_connect($db_host, $db_user, $db_password); if ($db == FALSE) die ("Errore nella connessione"); mysql_select_db($db_name, $db) or die ("Errore nella selezione del database"); } function db_close() { global $db; mysql_close($db); } function ins($dato) { return mysql_real_escape_string($dato); } /****/ ?> if (basename($_SERVER['SCRIPT_FILENAME']) != 'leggi-news.php') { function stripslashes_deep($value) { //if (get_magic_quotes_gpc()) { $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value); //} return $value; } } ?> # commentare su linux # /*function getmxrr($hostname, &$mxhosts) { $mxhosts = array(); exec('nslookup -type=mx '.$hostname, $result_arr); foreach($result_arr as $line) { if (preg_match("/.*mail exchanger = (.*)/", $line, $matches)) $mxhosts[] = $matches[1]; } return( count($mxhosts) > 0 ); }*/ function checkEmail($email) { // Create the syntactical validation regular expression $regexp = "^([_a-z0-9-]+)(\.[_a-z0-9-]+)*@([a-z0-9-]+)(\.[a-z0-9-]+)*(\.[a-z]{2,4})$"; // Presume that the email is invalid $valid = 0; // Validate the syntax if (eregi($regexp, $email)) { list($username,$domaintld) = split("@",$email); // Validate the domain if (getmxrr($domaintld,$mxrecords)) $valid = 1; } else { $valid = 0; } return $valid; } ?> # data from en to it function data_en_it($valore) { $dato = explode('-', $valore); $data_ita = $dato[2]."-".$dato[1]."-".$dato[0]; return $data_ita; } // data ?> # data estesa function data_estesa($data, $estesa){ //$ora = substr($data, 11, 5); $data = substr($data, 0, 10); $array = explode("-", $data); $mese = array ("Dicembre", "Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"); $giorni = array('Domenica','Lunedì','Martedì','Mercoledì','Giovedì','Venerdì','Sabato'); $int = floor($array[1]); if ($estesa) { $data_estesa = $giorni[date('w',strtotime($data))]." ".$array[2]." ".$mese[$int]." ".$array[0]; }else{ $data_estesa = $array[2]." ".$mese[$int]." ".$array[0]; } return $data_estesa; //." - ".$ora } ?> /* Advanced PHP Pagination Function. By Hemn Chawroka http://hech.wordpress.com */ //function to return the pagination string function getPaginationString($page = 1, $totalitems, $limit = 15, $adjacents = 1, $targetpage = "/", $pagestring = "?page=") { //defaults if(!$adjacents) $adjacents = 1; if(!$limit) $limit = 15; if(!$page) $page = 1; if(!$targetpage) $targetpage = "/"; //other vars $prev = $page - 1; //previous page is page - 1 $next = $page + 1; //next page is page + 1 $lastpage = ceil($totalitems / $limit); //lastpage is = total items / items per page, rounded up. $lpm1 = $lastpage - 1; //last page minus 1 /* Now we apply our rules and draw the pagination object. We're actually saving the code to a variable in case we want to draw it more than once. */ $pagination = ""; if($lastpage > 1) { $pagination .= "