//Connection parameter $sqluser="heritage_sayt"; $sqlpasword="h6-m=0UNs*QO"; $sqllocalhost="localhost"; $dbname="heritage_kitabxana"; //Connection $db_link = @mysql_connect($sqllocalhost, $sqluser, $sqlpasword) or die (mysql_errno().' '.mysql_error()); @mysql_select_db ($dbname,$db_link) or die(mysql_errno().' '.mysql_error()); mysql_query ("set character_set_client='utf8'"); mysql_query ("set character_set_results='utf8'"); mysql_query ("set collation_connection='utf8_general_ci'"); //update page set `content`=convert(CONVERT(CONVERT(`content` USING latin1) USING binary) using cp1251); // defines define("CUST_DISABLED", 1); define("CUST_AXSAM", 2); define("CUST_SUPERUSER", 4); define("CUST_XEBER", 8); define("CUST_HEFTE", 16); define("CUST_CONTENT", 32); define("CUST_SESVERME", 64); extract($_GET); extract($_POST); $title = "Kitabxana"; $ipass = "1343"; $curlang['Arabic']='ar'; $curlang['Azerbaijani']='az'; $curlang['Belarusian']='bl'; $curlang['Bosnian']='bo'; $curlang['Bulgarian']='bg'; $curlang['Chinese']='zh'; //$curlang['Chinese']='ch'; $curlang['Croatian']='cr'; $curlang['Czech']='cz'; $curlang['Danish']='da'; $curlang['Dutch']='du'; $curlang['English']='en'; $curlang['Estonian']='ee'; $curlang['Finnish']='fi'; $curlang['French']='fr'; $curlang['Georgian']='ge'; $curlang['German']='de'; $curlang['Greek']='gr'; $curlang['Russian']='ru'; $curlang['Hebrew']='he'; $curlang['Hungarian']='hu'; $curlang['Indian']='in'; $curlang['Indonesian']='iz'; $curlang['Icelandic']='is'; $curlang['Italian']='it'; $curlang['Japanese']='ja'; $curlang['Kazakh']='ka'; $curlang['Kyrgyz']='kz'; $curlang['Korean']='ko'; $curlang['Laothian']='ls'; $curlang['Latvian']='lv'; $curlang['Lithuanian']='li'; $curlang['Macedonian']='mk'; $curlang['Norwegian']='no'; $curlang['Persian']='pe'; $curlang['Tagalog']='fl'; $curlang['Polish']='pl'; $curlang['Portuguese']='po'; $curlang['Romanian']='ro'; $curlang['Serbian']='sr'; $curlang['Slovenian']='si'; $curlang['Slovak']='sl'; $curlang['Spanish']='es'; $curlang['Swedish']='sw'; $curlang['Turkish']='tk'; $curlang['Thai']='ti'; $curlang['Turkmen']='tm'; $curlang['Ukrainian']='uk'; $curlang['Urdu']='ur'; $curlang['Uzbek']='uz'; //$curlang['Armenian']='am'; $curlang['Vietnamese']='vt'; $webkey = "1234"; $format = "html"; $deflang = "en"; $defpage = "index"; $amenu['Əsas menyu'] = "1"; $amenu['Əlavə menyu'] = "7"; $editor = "2"; function cp1251_to_utf8 ($txt) { $in_arr = array ( chr(208), chr(192), chr(193), chr(194), chr(195), chr(196), chr(197), chr(168), chr(198), chr(199), chr(200), chr(201), chr(202), chr(203), chr(204), chr(205), chr(206), chr(207), chr(209), chr(210), chr(211), chr(212), chr(213), chr(214), chr(215), chr(216), chr(217), chr(218), chr(219), chr(220), chr(221), chr(222), chr(223), chr(224), chr(225), chr(226), chr(227), chr(228), chr(229), chr(184), chr(230), chr(231), chr(232), chr(233), chr(234), chr(235), chr(236), chr(237), chr(238), chr(239), chr(240), chr(241), chr(242), chr(243), chr(244), chr(245), chr(246), chr(247), chr(248), chr(249), chr(250), chr(251), chr(252), chr(253), chr(254), chr(255) ); $out_arr = array ( chr(208).chr(160), chr(208).chr(144), chr(208).chr(145), chr(208).chr(146), chr(208).chr(147), chr(208).chr(148), chr(208).chr(149), chr(208).chr(129), chr(208).chr(150), chr(208).chr(151), chr(208).chr(152), chr(208).chr(153), chr(208).chr(154), chr(208).chr(155), chr(208).chr(156), chr(208).chr(157), chr(208).chr(158), chr(208).chr(159), chr(208).chr(161), chr(208).chr(162), chr(208).chr(163), chr(208).chr(164), chr(208).chr(165), chr(208).chr(166), chr(208).chr(167), chr(208).chr(168), chr(208).chr(169), chr(208).chr(170), chr(208).chr(171), chr(208).chr(172), chr(208).chr(173), chr(208).chr(174), chr(208).chr(175), chr(208).chr(176), chr(208).chr(177), chr(208).chr(178), chr(208).chr(179), chr(208).chr(180), chr(208).chr(181), chr(209).chr(145), chr(208).chr(182), chr(208).chr(183), chr(208).chr(184), chr(208).chr(185), chr(208).chr(186), chr(208).chr(187), chr(208).chr(188), chr(208).chr(189), chr(208).chr(190), chr(208).chr(191), chr(209).chr(128), chr(209).chr(129), chr(209).chr(130), chr(209).chr(131), chr(209).chr(132), chr(209).chr(133), chr(209).chr(134), chr(209).chr(135), chr(209).chr(136), chr(209).chr(137), chr(209).chr(138), chr(209).chr(139), chr(209).chr(140), chr(209).chr(141), chr(209).chr(142), chr(209).chr(143) ); $txt = str_replace($in_arr,$out_arr,$txt); return $txt; } function domain($link){ preg_match('@^(?:http://)?([^/]+)@i', $link, $matches); $host = $matches[1]; preg_match('/[^.]+\.[^.]{2,3}\.[^.]{2}$/', $host, $matches); if (empty($matches)) { preg_match('/[^.]+\.[^.]+$/', $host, $matches); } return $matches[0]; } function SortArray() { $arguments = func_get_args(); $array = $arguments[0]; $code = ''; for ($c = 1; $c < count($arguments); $c += 2) { if (in_array($arguments[$c + 1], array("ASC", "DESC"))) { $code .= 'if ($a["'.$arguments[$c].'"] != $b["'.$arguments[$c].'"]) {'; if ($arguments[$c + 1] == "ASC") { $code .= 'return ($a["'.$arguments[$c].'"] < $b["'.$arguments[$c].'"] ? -1 : 1); }'; } else { $code .= 'return ($a["'.$arguments[$c].'"] < $b["'.$arguments[$c].'"] ? 1 : -1); }'; } } } $code .= 'return 0;'; $compare = create_function('$a,$b', $code); usort($array, $compare); return $array; } function split_links($link,$db_link){ $link=preg_split('[/]', $link, -1); list($type, $link1) = split('[?]', $link[3]); $link=preg_split('[&]', $link1, -1); foreach ($link as $key => $value) { list($type, $id) = split('=', $value); $links[$type]=$id; } return map($links['type'],$links['content_id'],$db_link); } function map($type,$content_id,$db_link){ if (empty($type)) {$word='Baş səhifə';} if (($type==view_news)or($type==news)){$word='Xəbərlər';} if ($type==contact) {$word='Məktub göndər';} if ($type==sesverme) {$word='Sorğular';} if ($type==ses_all) {$word='Digər sorğuların nəticələr';} if ($type==links) {$word='Rəsmi internet informasiya resursları';} if ($type==multimedia) {$word='Multimedia';} if ($type==faq) {$word='Sual-cavab';} if ($type==archive) {$word='Arxiv';} if ($type==search) {$word='Axtarış';} if ($type==content) {$word=@mysql_result(mysql_query("SELECT name_az FROM category where id='$content_id'",$db_link), 0, 0);} if ($type==content_sol) {$word=@mysql_result(mysql_query("SELECT name_az FROM category_sol where id='$content_id'",$db_link), 0, 0);} if (empty($word)) {$word='Baş səhifə';} return $word; } function open_ip($ip){ $array = array(1 => '192.168.10.135', 2 => '160.10.0.8', 3 => '192.168.10.32', 4 => '192.168.10.100', 5 => '127.0.0.1', 6=>'160.10.0.6'); $ip1=array_search($ip, $array); if (empty($ip1)) die("olmaz"); } function os($report){ if(strstr($report,"NT 5.1")) $os = "Windows XP"; if(strstr($report,"NT 5.0")) $os = "Windows 2000"; if(strstr($report,"NT 5.2")) $os = "Windows 2003"; if(strstr($report,"NT 6.0")) $os = "Windows Vista"; if(strstr($report,"NT 6.1")) $os = "Windows 7"; if(strstr($report,"Linux")) $os = "Linux"; if(strstr($report,"Macintosh")) $os = "Macintosh"; if(empty($os)) $os="Naməlum"; return $os; } function browser($report){ if(strstr($report,"Chrome")) $browser = "Chrome"; elseif(strstr($report,"MSIE 5.0")) $browser = "Internet explorer v5.0"; elseif(strstr($report,"MSIE 5.5")) $browser = "Internet explorer v5.5"; elseif(strstr($report,"MSIE 6.0")) $browser = "Internet explorer v6.0"; elseif(strstr($report,"MSIE 7.0")) $browser = "Internet explorer v7.0"; elseif(strstr($report,"MSIE 8.0")) $browser = "Internet explorer v8.0"; elseif(strstr($report,"MSIE 9.0")) $browser = "Internet explorer v9.0"; elseif(strstr($report,"Mozilla")) $browser = "Mozilla"; elseif(strstr($report,"Opera")) $browser = "Opera"; elseif(strstr($report,"Netscape")) $browser = "Netscape"; elseif(strstr($report,"Firefox")) $browser = "Firefox"; elseif(strstr($report,"Konqueror")) $browser = "Konqueror"; elseif(strstr($report,"Maxthon")) $browser = "Maxthon"; elseif(strstr($report,"Safari")) $browser = "Safari"; elseif(empty($browser)) $browser="Naməlum"; return $browser; } function aylar($mon){ if($mon=="01"){return "Yanvar";} if($mon=="02"){return "Fevral";} if($mon=="03"){return "Mart";} if($mon=="04"){return "Aprel";} if($mon=="05"){return "May";} if($mon=="06"){return "İyun";} if($mon=="07"){return "İyul";} if($mon=="08"){return "Avqust";} if($mon=="09"){return "Sentyabr";} if($mon=="10"){return "Oktyabr";} if($mon=="11"){return "Noyabr";} if($mon=="12"){return "Dekabr";} } function hefteler($dn){ if($dn=="Mon"){return "Bazar ertəsi";} if($dn=="Tue"){return "Çərşənbə axşamı";} if($dn=="Wed"){return "Çərşənbə";} if($dn=="Thu"){return "Cümə axşamı";} if($dn=="Fri"){return "Cümə";} if($dn=="Sat"){return "Şənbə";} if($dn=="Sun"){return "Bazar";} } function Conv_Date($tarix){ list($tarix, $saat) = split(" ", $tarix); list($year, $month, $day) = split("-", $tarix); // date("d aylar(m) Y",mktime(0, 0, 0, $month, $day ,$year)); if($saat=='00:00:00') return $day.' '.aylar($month).' '.$year; elseif($saat) return $day.' '.aylar($month).' '.$year.' '.$saat; else return $day.' '.aylar($month).' '.$year; } if ($lang==az){ } if ($lang==ru){ } ?> $ip = addslashes($_SERVER['REMOTE_ADDR']); $report=addslashes($_SERVER['HTTP_USER_AGENT']); $link=addslashes($_SERVER['HTTP_REFERER']); $lang=addslashes($_SERVER['HTTP_ACCEPT_LANGUAGE']); $referrer=addslashes($_GET['referrer']); if (empty($referrer)) $referrer=$link; $date=date('Y-m-d'); $screen=$_GET['screen']; $browser=browser($report); $os=os($report); //$sql="INSERT INTO iplog (`ip`, `report`, `create_date`, `create_time`, `os`, `browser`, `referrer` , `link` , `lang` ,`screen`) VALUES ('".$ip."','".$report."' ,NOW(), NOW(), '".$os."', '".$browser."', '".$referrer."', '".$link."', '".$lang."', '".$screen."')"; //$result = mysql_query ($sql,$db_link) or die("mysql_query failed with: ".mysql_errno().' '.mysql_error()); //@mysql_free_result($result); if($_POST['addcomment']){ if(($_POST['mail'])and($_POST['name'])and($_POST['text'])){ @mysql_query("INSERT INTO `comment` (`cid`,`lang`, `tarix`, `saat`, `mail`, `name`, `text`)VALUES ('".$_POST['cid']."','".$_POST['lang']."', NOW(), NOW(), '".$_POST['mail']."', '".$_POST['name']."', '".strip_tags($_POST['text'])."')"); $com_text="Sizizn fikriniz admin tərəfindən yoxlandıqdan sonra aktiv ediləcək"; }else{ $com_text="Bütün bölmələri doldurun"; } } function banner($ban,$lang) { $query = "SELECT * FROM banner where yer='$ban' and lang='$lang' and display='yes'"; $result = mysql_query ($query) or die("mysql_query failed with: ".mysql_errno().' '.mysql_error()); while ($line = mysql_fetch_array($result)){ $nomre = $line["id"]; $text = $line["content"]; if($text) print $text; } @mysql_free_result($result); } function comment($id,$lang,$com_text){ print '
$basliq | $tarix | $saat
$kicxeb
| Fotoqalereya |
\n";
//$count =@mysql_result(mysql_query ("SELECT count(id) FROM `photos` WHERE m_id='$page' order by id asc"), 0, 0);
//$v_say=ceil($count/30);
//$i=0;
print'
|
| "; else print " | ";
print " $ust_title $tarix $basliq | ";
if($i==3) {print "
|
".$lnn['anonslar']." |
"; */ /*echo "