0; } } while ($already_exists); } if ($use_sessions_type < 3) { if( $use_sessions_type == 2 ) # restore handler for mysql sessions session_set_save_handler ( 'db_session_open', 'db_session_close', 'db_session_read', 'db_session_write', 'db_session_destroy', 'db_session_gc' ); # # Using standard PHP sessions # session_cache_limiter('none'); session_name($R_SESSION_NAME); if ($sessid) session_id($sessid); session_start(); $RSESSID = session_id(); return; } if (empty($config['Sessions']['session_length'])) { $config['Sessions']['session_length'] = 300; } $curtime = time(); $expiry_time = $curtime + $config['Sessions']['session_length']; $db->sql_query("DELETE FROM ".$sql_tab['sessions_data']." WHERE expiry<'".time()."'"); $sess_data = func_query_first("SELECT * FROM ".$sql_tab['sessions_data']." WHERE sessid='$sessid'"); if ($sess_data) { $R_SESSION_VARS = unserialize($sess_data['data']); $db->sql_query("UPDATE ".$sql_tab['sessions_data']." SET expiry='$expiry_time' WHERE sessid='$sessid'"); } else { $db->sql_query("INSERT INTO ".$sql_tab['sessions_data']." (sessid, start, expiry) VALUES('$sessid', '$curtime', '$expiry_time')"); } $RSESSID = $sessid; setcookie($R_SESSION_NAME, $RSESSID, 0, "/", "", 0); } # # Change current session to session with specified ID # function r_session_id($sessid="") { global $sql_tab, $db, $use_sessions_type, $R_SESSION_VARS, $RSESSID; if ($use_sessions_type < 3) { # # Using standard PHP sessions # if ($sessid) { session_write_close(); r_session_start($sessid); return; } $RSESSID = session_id(); return $RSESSID; } if ($sessid) { $sess_data = $db->func_query_first("SELECT * FROM ".$sql_tab['sessions_data']." WHERE sessid='$sessid'"); $RSESSID = $sessid; if ($sess_data) $R_SESSION_VARS = unserialize($sess_data['data']); else r_session_start($sessid); } else $sessid = $RSESSID; return $sessid; } # # Cut off variable if it is come from _GET, _POST or _COOKIES # function check_session_var($varname) { if (isset($_GET[$varname]) || isset($_POST[$varname]) || isset($_COOKIE[$varname])) return false; return true; } // Fix for removed Session functions function fix_session_register(){ function session_register(){ $args = func_get_args(); foreach ($args as $key){ $_SESSION[$key]=$GLOBALS[$key]; } } function session_is_registered($key){ return isset($_SESSION[$key]); } function session_unregister($key){ unset($_SESSION[$key]); } } if (!function_exists('session_register')) fix_session_register(); # # Register variable R_SESSION_VARS array from the database # function r_session_register($varname, $default="") { global $R_SESSION_VARS, $R_SESSION_UNPACKED_VARS; global $use_sessions_type; if (empty($varname)) return false; if ($use_sessions_type < 3) { # # Using standard PHP sessions # // if (!session_is_registered($varname) && !check_session_var($varname)) { // $_SESSION[$varname] = $default; // } // session_register($varname); # # Register global variable # $GLOBALS[$varname] =& $_SESSION[$varname]; return; } # # Register variable $varname in $R_SESSION_VARS array # if (!isset($R_SESSION_VARS[$varname])) { if (isset($GLOBALS[$varname]) && check_session_var($varname)) { $R_SESSION_VARS[$varname] = $GLOBALS[$varname]; } else { $R_SESSION_VARS[$varname] = $default; } } else { if (isset($GLOBALS[$varname]) && check_session_var($varname)) { $R_SESSION_VARS[$varname] = $GLOBALS[$varname]; } } # # Unpack variable $varname from $R_SESSION_VARS array # $R_SESSION_UNPACKED_VARS[$varname] = $R_SESSION_VARS[$varname]; $GLOBALS[$varname] = $R_SESSION_VARS[$varname]; } # # Save the R_SESSION_VARS array in the database # function r_session_save() { global $RSESSID; global $R_SESSION_VARS, $R_SESSION_UNPACKED_VARS; global $sql_tab, $db, $use_sessions_type; if ($use_sessions_type < 3) { # # Using standard PHP sessions # return; } $varnames = func_get_args(); if (!empty($varnames)) { foreach($varnames as $varname) { if (isset($GLOBALS[$varname])) $R_SESSION_VARS[$varname] = $GLOBALS[$varname]; } } elseif (is_array($R_SESSION_UNPACKED_VARS)) { foreach($R_SESSION_UNPACKED_VARS as $varname=>$value) { if (isset($GLOBALS[$varname])) $R_SESSION_VARS[$varname] = $GLOBALS[$varname]; } } # # Save session variables in the database # $db->sql_query("UPDATE ".$sql_tab['sessions_data']." SET data='".addslashes(serialize($R_SESSION_VARS))."' WHERE sessid='$RSESSID'"); } # # Unregister variable $varname from $R_SESSION_VARS array # function r_session_unregister($varname, $unset_global=false) { global $R_SESSION_VARS, $R_SESSION_UNPACKED_VARS; global $use_sessions_type; if (empty($varname)) return false; if ($use_sessions_type < 3) { # # Using standard PHP sessions # session_unregister($varname); return; } unset($R_SESSION_VARS[$varname]); unset($R_SESSION_UNPACKED_VARS[$varname]); if ($unset_global) { unset($GLOBALS[$varname]); unset($GLOBALS[$varname]); } } # # Find out whether a global variable $varname is registered in # $R_SESSION_VARS array # function r_session_is_registered($varname) { global $R_SESSION_VARS; global $use_sessions_type; if (empty($varname)) return false; if ($use_sessions_type < 3) { # # Using standard PHP sessions # return session_is_registered($varname); } return isset($R_SESSION_VARS[$varname]); } ?> "Internetové stránky fotoklubu Zvonek z Dolního Žukova u Českého Těšína", "e_menu_domu" => "Home", "r_menu_domu" => "домой", "g_menu_domu" => "Startseite", "p_menu_domu" => "Strona główna", ); if (isset($_POST['email'])) $arr["email_exist"] = "Email ".$_POST['email']." již existuje v odběru novinek!"; if (isset($_POST['email'])) $arr["email_ready"] = "Email ".$_POST['email']." byl úspěšně zaregistrován k odběru novinek. Děkujeme za Váš zájem."; ?> sql_query("SELECT nadpis FROM ".$sql_tab['simple_rs']." WHERE id=".$_GET['id']); $row = $db->sql_fetch_array($result); $nadpis = $row['nadpis']; if ($nadpis==''){ header('HTTP/1.0 404 Not found'); header('Location: '.PAGE_URL.'/'); } } break; case "clen": if (!empty($_GET['kdo'])) { $result = $db->sql_query("SELECT * FROM ".$sql_tab['clenove']." WHERE clen_adresar='".$_GET['kdo']."'"); $row = $db->sql_fetch_array($result); $nadpis = $row['clen_jmeno']." ".$row['clen_prijmeni']; if ($nadpis==''){ header('HTTP/1.0 404 Not found'); header('Location: '.PAGE_URL.'/'); }else $datadotaz=$row; } else { header('HTTP/1.0 404 Not found'); header('Location: '.PAGE_URL.'/'); } break; case "aktuality": if (!empty($_GET['pid'])) { $result = $db->sql_query("SELECT * FROM ".$sql_tab['aktuality']." WHERE (id='".$_GET['pid']."') AND( zobr='A')"); $row = $db->sql_fetch_array($result); $nadpis = $row['nadpis']; if ($nadpis==''){ header('HTTP/1.0 404 Not found'); header('Location: '.PAGE_URL.'/'); }else $datadotaz=$row; } else { header('HTTP/1.0 404 Not found'); header('Location: '.PAGE_URL.'/'); } break; case "doku": if (!empty($_GET['nazev'])) { $result = $db->sql_query("SELECT * FROM ".$sql_tab['dokumenty']." WHERE nazev='".$_GET['nazev']."' LIMIT 1"); $row = $db->sql_fetch_array($result); $nadpis= explode(";",$row['title']); $nadpis= $nadpis[0]; if ($nadpis==''){ header('HTTP/1.0 404 Not found'); header('Location: http://'.PAGE_URL.'/'); } else $datadotaz=$row; } else { header('HTTP/1.0 404 Not found'); header('Location: '.PAGE_URL.'/'); } break; default: $nadpis = $lng['nadpis_'.$akc]; } } $limit=""; if ((isset($_GET['limit'])) AND ($_GET['limit']<>'0') AND ($_GET['limit']<>'')) { $limit=" |strana ".(Ceil($_GET['limit']/$ini['katalog max polozek'])+1); } if ((!$description) AND ($title)){ // co dat do title $detail_title = ""; if ($_GET['akc']=="rs" && !empty($_GET['id'])) { return $nadpis."|".PAGE_NAME; }elseif ($_GET['akc']=="basic") { return $nadpis; } else { return $detail_title.$nadpis." | ".PAGE_NAME; } } elseif ((!$title) AND (!$description)) { //zobrazuji nadpis H1 return "

".$nazevvyrobce2.$nadpis.$pp5.$pp15.$pp14.$pp4.$limit."

"; } } function description($akc) { global $sql_tab, $db, $lng, $limit,$texy, $nadpis,$datadotaz; if (($_GET['akc']=="clen" && !empty($_GET['kdo']))AND(!empty($datadotaz))) { $popisdec=$texy->process($datadotaz['clen_vybava']); $popisdec=set_nadpisek($popisdec); if (strlen($popisdec) >= 152) { $text = substr($popisdec, 0, 153); $pos = strrpos($text, " "); $text = substr($text, 0, ($pos ? $pos : -1)) . ".."; } else $text=$popisdec; $popisdec = "Stránka člena fotoklubu: ".$nadpis." - ".$text; }elseif ($_GET['akc']=="doku" && !empty($_GET['nazev'])) { $popisdec=$texy->process($datadotaz['description']); $popisdec=set_nadpisek($popisdec); if (strlen($popisdec) >= 152) { $text = substr($popisdec, 0, 153); $pos = strrpos($text, " "); $text = substr($text, 0, ($pos ? $pos : -1)) . ".."; } else $text=$popisdec; $popisdec = $text; } elseif ($_GET['akc']=="akt" && !empty($_GET['id'])) { $result_des = $db->sql_query("SELECT text,nadpis FROM ".$sql_tab['aktuality']." WHERE id='".$_GET['id']."'"); list($popisdec) = $db->sql_fetch_array($result_des); $popisdec=$texy->process($popisdec); $popisdec=set_nadpisek($popisdec); if (strlen($popisdec) >= 152) { $text = substr($popisdec, 0, 153); $pos = strrpos($text, " "); $text = substr($text, 0, ($pos ? $pos : -1)) . ".. | ".PAGE_NAME; } else $text=$popisdec; $popisdec = $text; } elseif ($_GET['akc']=="basic"){ $popisdec =$lng['description']; } else $popisdec = $nadpis." | ".PAGE_NAME; return $popisdec; } ?> '')) $hled_links="&hltex=".$_REQUEST['hltex']; else $hled_links=""; if (!isset($_GET['dsort'])) $_GET['dsort']=""; if (!isset($_GET['ksort'])) $_GET['ksort']=""; if (!isset($_GET['sfiltr'])) $_GET['sfiltr']=""; $ret = "

".$lng['links_strana']." "; $vpredu = $vzadu = ""; $desitka = floor($aktiv/10); $strana = Ceil($pocet_polozek/$krokLimit); $konec = (10*($desitka+1))-1; $start = (10*($desitka-1)); if ($start<1) { $start=0; } if ($desitka>0) { $vpredu = "«  "; } if ($konec>=$strana) { $konec = $strana; } else { $vzadu = "  »"; } $ret .= $vpredu; for ($x=(10*$desitka);$x<=$konec;$x++) { if ($x!=0) { if ((($x-(10*$desitka))!=0) and ($x!=1)) { $ret .= "|"; } if ($x==$aktiv) { $ret .= "".$x.""; } elseif ($x==1) { $ret .= "".$x.""; } else { $ret .= "".$x.""; } } } $ret .= $vzadu; $ret .= "

"; } else { if (!isset($_GET['ksort'])) $_GET['ksort']=""; if (!isset($_GET['sfiltr'])) $_GET['sfiltr']=""; if ((isset($_GET['akc'])) AND($_GET['akc']=="kateg") AND (isset($_GET['kateg'])) AND ($_GET['kateg']<>'')) { $index_links=$_GET['kateg']."-k.html"; } elseif ((isset($_GET['v'])) AND (isset($_GET['vid'])) AND ($_GET['vid']<>'')){ $index_links=$_GET['vid']."-v"; $par_vid=""; } elseif ((isset($_GET['akc'])) AND ($_GET['akc']=='hodnoceni_zakazniku')){ $index_links="index.php?akc=".$_GET['akc']; $par_vid=""; } else { $index_links="hledani"; } if (!isset($_GET['vid'])) $_GET['vid']=""; if ((isset($_REQUEST['hltex']))AND($_REQUEST['hltex']<>'')) {$hled_links="&hltex=".$_REQUEST['hltex'];} else {$hled_links="";} if (!isset($_GET['dsort'])) $_GET['dsort']=""; for ($x=1;$x<=15;$x++) { if (!isset($_GET['p'.$x])) {$_GET['p'.$x]='';} } $ret = "

".$lng['links_strana']." "; $vpredu = $vzadu = ""; $desitka = floor($aktiv/10); $strana = Ceil($pocet_polozek/$krokLimit); $konec = (10*($desitka+1))-1; $start = (10*($desitka-1)); if ($start<1) { $start=0; } if ($desitka>0) { $vpredu = "«  "; if ((isset($_GET['akc'])) AND ($_GET['akc']=='hodnoceni_zakazniku')){$vpredu = "«  ";} } if ($konec>=$strana) { $konec = $strana; } else { $vzadu = "  »"; if ((isset($_GET['akc'])) AND ($_GET['akc']=='hodnoceni_zakazniku')){$vzadu = "  »";} } $ret .= $vpredu; for ($x=(10*$desitka);$x<=$konec;$x++) { if ($x!=0) { if ((($x-(10*$desitka))!=0) and ($x!=1)) { $ret .= "|"; } if ($x==$aktiv) { $ret .= "".$x.""; } elseif ($x==1) { $link_prvni = str_replace("?&", "?", strip_tags("?".$hled_links.$par_vid.$par_sfiltr.$par_dsort.$par_ksort.$vypis_parametru));if ($link_prvni=="?") $link_prvni =""; $ret .= "".$x.""; } else { if ((isset($_GET['akc'])) AND ($_GET['akc']=='hodnoceni_zakazniku')){$ret .= "".$x."";} else $ret .= "".$x.""; } } } $ret .= $vzadu; $ret .= "

"; } return $ret; } ?> <?echo strip_tags(hlNadpis($_GET['akc'], true, false));?>
">
sql_query("SELECT * FROM ".$sql_tab['aktuality']." WHERE zobr='A' ORDER BY poradi, id DESC LIMIT 10"); $count = $db->sql_num_rows($resultak); if ($count!=0) { while ($rowa = $db->sql_fetch_array($resultak)) { $aktuality[]=$rowa; } } if ($aktuality[0]['odkaz']=="A") $odkaz="
";else $odkaz=""; if (($aktuality[0]['img']<>'')AND($_SESSION['mobilne']=="on")) $aktuality[0]['img']="\"".$aktuality[0]['nadpis']."\"/"; else $aktuality[0]['img']="\"".$aktuality[0]['nadpis']."\"/"; echo '

'.$aktuality[0]['nadpis'].'

'.$texy->process(htmlspecialchars_decode($aktuality[0]['text'])).'
'.$aktuality[0]['img'].$odkaz.'
'; $pocet=$count-1; if ($pocet%2==0)$a=$b=$pocet/2; else{ $a = ((int)($pocet/2))+($pocet%2); } ?>
";else $odkaz=""; if (!empty($aktuality[$i]['img']))$obr=" \"".$aktuality[$i]['nadpis']."\"/ "; else $obr=""; echo '
'.htmlspecialchars_decode($aktuality[$i]['doobrazku']).'
'.$obr.'

'.htmlspecialchars_decode($aktuality[$i]['nadpis']).'

'.$texy->process(htmlspecialchars_decode($aktuality[$i]['text'])).'
'.$odkaz.'
'; } ?>
";else $odkaz=""; if (!empty($aktuality[$i]['img']))$obr=" \"".$aktuality[$i]['nadpis']."\"/ "; else $obr=""; echo '
'.htmlspecialchars_decode($aktuality[$i]['doobrazku']).'
'.$obr.'

'.htmlspecialchars_decode($aktuality[$i]['nadpis']).'

'.$texy->process(htmlspecialchars_decode($aktuality[$i]['text'])).'
'.$odkaz.'
'; } ?>

© 2016 Fotoklub Zvonek