Város
Hírek, információk
Nevezetességek, látnivalók, vendéglátás
Önkörmányzat
Harangod
Képgaléria
Fórum
Vendéghönyv
 
'.$latogatok.'
'.$UVCS['count']; } ?>

New entrys allentrys
Keresés a vendégkönyben
"); echo("

".$_err_mess."

"); die(); } //-------------------------------------------------------------------------- function load_messages($_file, $_highlight="") { $_conn = fopen($_file,"r") or err_handle("Nem tudtam megnyitni:".$_file); $_size = filesize($_file); while ($_sor = fgets($_conn,$_size)) { if (strlen($_sor)<3) continue; list($_date,$_name,$_email,$_message) = split("\|",$_sor); if (empty($_highlight)) { $_messages[] = array($_date,$_name,$_email,$_message); } else { if (eregi($_highlight,$_message)) { $_messages[] = array($_date,$_name,$_email,ereg_replace($_highlight, "".$_highlight."", $_message)); } } } fclose($_conn); return $_messages; } //-------------------------------------------------------------------------- function insert_messages ($_file,$_date,$_name,$_email,$_message) { $_name = str_replace("|","",strip_tags($_name)); $_email = str_replace("|","",strip_tags($_email)); $_message = str_replace("|","",$_message); $_message = parse_string($_message); // Parse the message string $_conn = fopen($_file,"r"); $_rest = fread($_conn, filesize($_file)); fclose($_conn); $_conn = fopen($_file,"w"); fwrite($_conn, $_date."|".$_name."|".$_email."|".$_message."\n"); fwrite($_conn,$_rest); fclose($_conn); } //-------------------------------------------------------------------------- function get_segment ($_first_mess,$_messages,$_part,$vendegkonyvname) { // $_first_mess -> első üzenet sorszáma // $_messages -> összes üzenet száma // $_part -> mennyi üzenet legyen egy lapon if ($_messages<=$_part) {$result="";} if ($_messages-$_first_mess-$_part>0) { if (($_messages-$_first_mess-$_part)>$_part) {$result="Előző ".$_part." üzenet  ";} else {$result="Első ".($_messages-$_first_mess-$_part)." üzenet  ";} } if ($_first_mess>0) { if ($_first_mess-$_part>0) {$result=$result." Következő ".$_part." üzenet
";} else {$result=$result."Utolsó ".$_first_mess." üzenet
";} } return $result; } //-------------------------------------------------------------------------- function show_messages ($_messages, $_header, $_first_mess=-1, $_part=10,$vendegkonyvname) { $_mesnum = sizeof($_messages); if ($_mesnum == 0) { $data=array(); show_simplate('./guestbook/no_message.sim',$data); } else { $data=array( "header" => $_header, "mesnum" => $_mesnum, "seglin" => $_first_mess==-1 ? "" : get_segment($_first_mess,$_mesnum,$_part,$vendegkonyvname)); show_simplate('./guestbook/header.sim',$data); $count=0; foreach ($_messages as $_mess_row) { list($_date,$_name,$_email,$_message)=$_mess_row; if (($_first_mess<=$count) and (($_first_mess+$_part)>$count)) { $data=array( "date" => $_date, "email" => $_email, "name" => $_name, "mess" => $_message); show_simplate('./guestbook/body.sim',$data); } ++$count; } $data=array( "seglin" => $_first_mess==-1 ? "" : get_segment($_first_mess,$_mesnum,$_part,$vendegkonyvname)); show_simplate('./guestbook/footer.sim',$data); } } ?>