View file nkat/xconf.php

File size: 4.14Kb
<?php
error_reporting(0);

$namecat = "xxx";
$DB_HOST = "localhost"; //хост расположения базы данных
$DB_USER = "root"; //Пользователь 
$DB_PASS = ""; //Пароль
$DB_NAME = "nkat";  //База
$namekat = ""; //Название каталога
$mailadmin = "[email protected]"; //мыло админа
$site="http://pornox.net.ru/nkat"; //расположение скрипта с http://
$index="../";
mysql_connect($DB_HOST,$DB_USER,$DB_PASS) or die (mysql_error());
mysql_select_db($DB_NAME);
$datecool=date("d.m.Y");
$q=mysql_query("select `kol` from `cool_nastr`");
$mat_per_page=mysql_result($q,"kol");
$q=mysql_query("select `activsit` from `cool_nastr`");
$active_site=mysql_result($q,"activsit");
$q=mysql_query("select `date` from `cool_pro` order by `ip` desc limit 1");
$olddate=mysql_result($q,"date");
if($olddate!=$datecool){
@mysql_query("update `cool_site` set counter=0, outcounter=0;");
@mysql_query("delete from `cool_pro`");
@mysql_query("insert into `cool_pro` values('0','$datecool','5','5')");}
function print_data($where_data,$page){
global $mat_per_page;
global $active_site;
$where_data=intval($where_data);
$page=intval($page);
if(empty($page)){$page=0;}
if($active_site==1){
///////
if($where_data!="all"){$query=mysql_query("SELECT id FROM `cool_site` where category=".$where_data."and activ=1 and counter>0;");}else{
$query=mysql_query("SELECT id FROM `cool_site` where activ='1' and counter>'0'");}
}else{
if($where_data!="all"){$query=mysql_query("SELECT id FROM `cool_site` where category=".$where_data." and activ=1;");}else{
$query=mysql_query("SELECT id FROM `cool_site` where activ=1");}}
///////
$num_of_rows=mysql_num_rows($query);
$total_mat_number=$num_of_rows;
$total_pages=ceil($total_mat_number/$mat_per_page);
if($active_site==1){
if($where_data!="all"){$prints = mysql_query("select * from `cool_site` where category=".$where_data." and activ<>0 and counter>0 order by counter desc limit ".$page.",".($page+$mat_per_page).";");}else{
$prints=mysql_query("select * from `cool_site` where activ=1 and counter>0 order by counter desc limit ".$page.",".($page+$mat_per_page).";");}
}else{
if($where_data!="all"){$prints = mysql_query("select * from `cool_site` where category=".$where_data." and activ<>0 order by counter desc limit ".$page.",".($page+$mat_per_page).";");}else{
$prints=mysql_query("select * from `cool_site` where activ<>0 order by counter desc limit ".$page.",".($page+$mat_per_page).";");}}
while($data=mysql_fetch_array($prints)){
print "<b><a href=\"out.php?go=".$data['link']."\">".$data['title']."</a></b><br/>";
print  "(".$data['link'].")<br/>";
print $data['about']."<br/>";
print "<small><u>Р?Р· каталога:</u> ".$data['outcounter']."<br/>";
print "<u>В каталог:</u> ".$data['counter']."</small><br/><br/>";}
for ($i=0; $i<$total_pages; $i++){
$page_number=$i*$mat_per_page;
include "fo.php";
$version=trim($version);
if ($version=="xhtml"){
$version=xhtml;      
}
else {
$version=wml;
}
if($page_number!=$page){print "<a href=\"katalog.php?c=$where_data&amp;page=$page_number&amp;version=$version\">[".($i+1)."]</a>";
}else{
print "<b>".($i+1)."</b>";}}}
function coding_cool($value){
$value1=array("&","$","'","\"","<",">");
$value2=array("&amp;","$$","&#x27;","&quot;","&lt;","&gt;");
$value=str_replace($value1,$value2,$value);
if(get_magic_quotes_gpc()){
$value = stripslashes($value);}
$value = mysql_real_escape_string($value);
return $value;}
function translit_cool($value){
$value1=array("Jo","Zh","Ch","Sh","Sch","Je","Yu","Ya","jo","zh","ch","sh","sch","je","yu","ya","''","A","B","V","G","D","E","Z","I","J","K","L","M","N","O","P","R","S","T","U","F","H","C","Y","a","b","v","g","d","e","z","i","j","k","l","m","n","o","p","r","s","t","u","f","h","c","y","'");
$value2=array("РЃ","Р–","Р§","РЁ","Р©","Р­","Р®","РЇ","С‘","Р¶","С‡","С€","С‰","СЌ","СЋ","СЏ","СЉ","Рђ","Р‘","Р’","Р“","Р”","Р•","Р—","Р?","Р™","Рљ","Р›","Рњ","Рќ","Рћ","Рџ","Р ","РЎ","Рў","РЈ","Р¤","РҐ","Р¦","Р«","Р°","Р±","РІ","Рі","Рґ","Рµ","Р·","Рё","Р№","Рє","Р»","Рј","РЅ","Рѕ","Рї","СЂ","СЃ","С‚","Сѓ","С„","С…","С†","С‹","СЊ");
$value=str_replace($value1,$value2,$value);
return $value;}
?>