'; elseif ($type == 'number'): $element = ''; elseif ($type == 'email'): $element = ''; elseif ($type == 'url'): $element = ''; elseif ($type == 'select'): $element = ''; elseif ($type == 'yes/no'): $element = ''; if ($data == 'yes') $element.= ''; if ($data == 'no') $element.= ''; endif; return $element; } function control_data($data,$type,$min,$max) { $fail = 0; if ($type == 'text') { if (strlen($data) < $min): $fail = 1; elseif (strlen($data) > $max): $fail = 2; else: $fail = 0; endif; } if ($type == 'number') { if ($data < $min): $fail = 1; elseif ($data > $max): $fail = 2; else: $fail = 0; endif; } if ($type == 'email') { $pattern = "^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$"; $host = explode("@",$data); if ($min > 0 && empty($data)): $fail = 1; elseif ($min > 0 && !eregi($pattern, $data)): $fail = 2; elseif ($min > 0 && !checkdnsrr($host[1])): $fail = 3; elseif (strlen($data) > $max): $fail = 4; else: $fail = 0; endif; } if ($type == 'url') { if ($min > 0 && empty($data)): $fail = 1; elseif ($min > 0 && !checkdnsrr(getdomain($data))): $fail = 2; elseif (strlen($data) > $max): $fail = 3; else: $fail = 0; endif; } return $fail; } function getdomain($url) { if(filter_var($url, FILTER_VALIDATE_URL, FILTER_FLAG_HOST_REQUIRED) === false) { return false; } $parts = parse_url($url); return $parts['scheme'].'://'.$parts['host']; } $secretpass = 'webdesign_kerettye'; function Encode($data,$pwd) { $pwd_length = strlen($pwd); for ($i = 0; $i < 255; $i++) { $key[$i] = ord(substr($pwd, ($i % $pwd_length)+1, 1)); $counter[$i] = $i; } for ($i = 0; $i < 255; $i++) { $x = ($x + $counter[$i] + $key[$i]) % 256; $temp_swap = $counter[$i]; $counter[$i] = $counter[$x]; $counter[$x] = $temp_swap; } for ($i = 0; $i < strlen($data); $i++) { $a = ($a + 1) % 256; $j = ($j + $counter[$a]) % 256; $temp = $counter[$a]; $counter[$a] = $counter[$j]; $counter[$j] = $temp; $k = $counter[(($counter[$a] + $counter[$j]) % 256)]; $Zcipher = ord(substr($data, $i, 1)) ^ $k; $Zcrypt .= chr($Zcipher); } return $Zcrypt; } // function hex2bin($hexdata) { // for ($i=0;$i','
',$htmlbe); $htmlki = str_replace("
","
",$htmlki); $htmlki = str_replace(' ',' ',$htmlki); $htmlki = str_replace('align="absMiddle"','align="middle"',$htmlki); $htmlki = str_replace("'","\'",$htmlki); return $htmlki; } function textdemo($text, $length) { $text = strip_tags($text); $text = explode(" ",$text); $tmp = 0; while ($tmp < $length) { $textout.= $text[$tmp].' '; $tmp++; } return $textout; } function linkfromtext($text) { $what = array("í","ű","á","é","ú","ő","ó","ü","ö", "Í","Ű","Á","É","Ú","Ő","Ó","Ü","Ö", "!","§","'","\"","/","(",")","÷","×", "$","ß"," ","¤","&","@","#","<",">", ",",".",":","Ł","ł","đ","Đ","~","ˇ", "^","˘","°","˛","`","˙","´","˝","¨", "¸"); $swap = array("i","u","a","e","u","o","o","u","o", "I","U","A","E","U","O","O","U","O", "","","","","","","","","", "","ss","_","","","","","","", "-","-","","","","","","","", "","","","","","","","","", ""); $linkout = strtolower(str_replace($what,$swap,$text)); unset($text,$what,$swap); return $linkout; } function validip($ip) { if (!empty($ip) && ip2long($ip)!=-1) { $reserved_ips = array ( array('0.0.0.0','2.255.255.255'), array('10.0.0.0','10.255.255.255'), array('127.0.0.0','127.255.255.255'), array('169.254.0.0','169.254.255.255'), array('172.16.0.0','172.31.255.255'), array('192.0.2.0','192.0.2.255'), array('192.168.0.0','192.168.255.255'), array('255.255.255.0','255.255.255.255') ); foreach ($reserved_ips as $r) { $min = ip2long($r[0]); $max = ip2long($r[1]); if ((ip2long($ip) >= $min) && (ip2long($ip) <= $max)) return false; } return true; } else return false; } function getip() { //global $HTTP_SERVER_VARS; if (validip($_SERVER["HTTP_CLIENT_IP"])) return $_SERVER["HTTP_CLIENT_IP"]; elseif ($_SERVER["HTTP_X_FORWARDED_FOR"]!="") { $forwarded=str_replace(",","",$_SERVER["HTTP_X_FORWARDED_FOR"]); $forwarded_array=split(" ",$forwarded); foreach($forwarded_array as $value) if (validip($value)) return $value; } return $_SERVER["REMOTE_ADDR"]; } function squarepic($bemenet, $kimenet, $meret) { $size_t = $meret; $image = imagecreatefromjpeg($bemenet); $szelesseg_e = imagesx($image); $magassag_e = imagesy($image); if ($szelesseg_e/$magassag_e > 1) { $left = ($szelesseg_e-$magassag_e)/2; $top = 0; } else { $left=0; $top = ($magassag_e-$szelesseg_e)/2; } $image_p = imagecreatetruecolor($size_t, $size_t); imagecopyresampled($image_p, $image, 0, 0, $left, $top, $size_t, $size_t, min($szelesseg_e, $magassag_e), min($szelesseg_e, $magassag_e)); ob_start(); imagejpeg($image_p, null, 90); $contents = ob_get_contents(); ob_end_clean(); imagedestroy($image_p); $f = fopen($kimenet, 'w'); fwrite($f, $contents); fclose($f); chmod($kimenet,0755); return true; } function checkextension($fajlnev, $good) { $kiterjesztes = explode(".", str_replace(" ","",$fajlnev)); $kitsegit = count($kiterjesztes); $kitsegit--; $keptipus = strtolower($kiterjesztes[$kitsegit]); if (!in_array($keptipus,$good)) { $kithiba = 'rossz'; } else { $kithiba = 'jo'; } return $kithiba; } function numbertotext($number,$length) { $length_in = $length - strlen($number); if ($length_in > 0) { while ($length_in > 0) { $nulls.= '0'; $length_in--; } $number_out = $nulls.$number; } else { $number_out = $number; } return $number_out; } function cleantext($text,$table) { $sql = mysql_query("SELECT what,swap FROM $table ORDER BY word_id ASC") or die(mysql_error()); while ($sor = mysql_fetch_array($sql)) { $what[] = $sor[0]; $swap[] = $sor[1]; } $textout = str_replace($what,$swap,$text); return $textout; } function defaulthtmlletter($subject,$message,$footer,$to,$downfooter) { $letterout = ' laptop-sticker.hu

'.$subject.'

'; $letterout.= $message.'

'.$footer.'

'; return $letterout; } ?>
var menus = new Array();'; $tmp = 1; while($row = mysql_fetch_assoc($sql)) { echo 'menus['.$tmp.']= "'.$row[link].'";'; $tmp++; } echo ''; } $sql = mysql_query("SELECT name, link, menu_id FROM $tables[menus] WHERE lang = '$lang' AND type = 2 ORDER BY row ASC") or die(mysql_error()); if (mysql_num_rows($sql) != 0) { echo '
    '; while($row = mysql_fetch_assoc($sql)) { if ($pg == $row[link]) { echo '
  • '.$row[name].'
  • '; if ($params[left_submenu] == 'yes') { $isql = mysql_query("SELECT name, link FROM $tables[menus] WHERE main = $row[menu_id] ORDER BY row ASC") or die(mysql_error()); if (mysql_num_rows($isql) != 0) { echo '
      '; while($irow = mysql_fetch_assoc($isql)) { if ($action == $irow[link]) { echo '
    • '.$irow[name].'
    • '; } else { echo '
    • '.$irow[name].'
    • '; } } echo '
    '; } } } else { echo '
  • '.$row[name].'
  • '; if ($params[left_submenu_extract] == 'no') { $isql = mysql_query("SELECT name, link FROM $tables[menus] WHERE main = $row[menu_id] ORDER BY row ASC") or die(mysql_error()); if (mysql_num_rows($isql) != 0) { echo '
      '; while($irow = mysql_fetch_assoc($isql)) { if ($action == $irow[link]) { echo '
    • '.$irow[name].'
    • '; } else { echo '
    • '.$irow[name].'
    • '; } } echo '
    '; } } } } echo '
'; } } ?>