View file kat_starwapru/kat_starwapru/config.php

File size: 4.36Kb
<?php
$DB_HOST = "localhost"; //е®бв а бЇ®«®¦Ґ­Ёп Ў §л ¤ ­­ле
$DB_USER = "starwa_starwap"; //Ё¬п Ї®«м§®ў вҐ«п Ў §л
$DB_PASS = "ff6w73jj19gs"; //Ї а®«м Ї®«м§®ў вҐ«п
$DB_NAME = "starwa_katt";  //­ §ў ­ЁҐ Ў §л
//гбв ­ ў«Ёў Ґ¬ ᮥ¤Ё­Ґ­ЁҐ
mysql_connect($DB_HOST,$DB_USER,$DB_PASS) or die (mysql_error());
//ўлЎЁа Ґ¬ Ў §г ¤«п а Ў®вл
mysql_select_db($DB_NAME);

//ЇаҐдЁЄб ¤«п в Ў«Ёж, ЇҐаҐ¬Ґ­­ п $px
$px="kat_";
//в Ў«Ёж  б ࠬЁ
$utable = "users";
//Ј« ў­ п бва ­Ёж  б ©в 
$index="http://starwap.ru/index.php";
//ў и  Ї®«­ п ббл«Є  ­  б ©в, в.Ґ. ᮠ᫥襬 ў Є®­жҐ Ё«Ё б Ј« ў­л¬ д ©«®¬
$site="http://starwap.ru/";
//¬ ббЁў бЁ¬ў®«®ў
$rus = array(
"іђ"=>"&#x410;","і-"=>"&#x430;","і‘"=>"&#x411;","і-"=>"&#x431;",
"і’"=>"&#x412;","і-"=>"&#x432;","і“"=>"&#x413;","іі"=>"&#x433;",
"і”"=>"&#x414;","і+"=>"&#x434;","і•"=>"&#x415;","іі"=>"&#x435;",
"іЃ"=>"&#x415;","і–"=>"&#x416;","іі"=>"&#x436;","і—"=>"&#x417;",
"ії"=>"&#x437;","і?"=>"&#x418;","ії"=>"&#x438;","і™"=>"&#x419;",
"іі"=>"&#x439;","іљ"=>"&#x41A;","іі"=>"&#x43A;","і›"=>"&#x41B;",
"ії"=>"&#x43B;","іњ"=>"&#x41C;","і-"=>"&#x43C;","іќ"=>"&#x41D;",
"і-"=>"&#x43D;","іћ"=>"&#x41E;","і-"=>"&#x43E;","іџ"=>"&#x41F;",
"ії"=>"&#x43F;","і "=>"&#x420;","TЂ"=>"&#x440;","іЎ"=>"&#x421;",
"TЃ"=>"&#x441;","іў"=>"&#x422;","T‚"=>"&#x442;","іЈ"=>"&#x423;",
"Tѓ"=>"&#x443;","і¤"=>"&#x424;","T„"=>"&#x444;","іҐ"=>"&#x425;",
"T…"=>"&#x445;","і¦"=>"&#x426;","T†"=>"&#x446;","і§"=>"&#x427;",
"T‡"=>"&#x447;","іЁ"=>"&#x428;","T€"=>"&#x448;","і©"=>"&#x429;",
"T‰"=>"&#x449;","іЄ"=>"&#x42A;","TЉ"=>"&#x44A;","і«"=>"&#x42B;",
"T‹"=>"&#x44B;","і¬"=>"&#x42C;","TЊ"=>"&#x44C;","і­"=>"&#x42D;",
"TЌ"=>"&#x44D;","і®"=>"&#x42E;","TЋ"=>"&#x44E;","іЇ"=>"&#x42F;",
"TЏ"=>"&#x44F;","T‘"=>"&#x451;"
);
//дг­ЄжЁп ЇҐаҐў®¤  ­  агббЄЁ© п§лЄ Ё§ о­ЁЄ®¤ 
function cyr($cyr_str) {
global $rus;
return strtr($cyr_str,$rus);
}
//ᮧ¤ Ґ¬ ¬ ббЁў § ¬Ґ­л бЁ¬ў®«®ў
  $tr = array(
   "Ђ"=>"іђ"," "=>"і-","Ѓ"=>"і‘","Ў"=>"і-","‚"=>"і’",
   "ў"=>"і-","ѓ"=>"і“","Ј"=>"іі","„"=>"і”","¤"=>"і+",
   "…"=>"і•","Ґ"=>"іі","р"=>"іЃ","†"=>"і–","¦"=>"іі",
   "‡"=>"і—","§"=>"ії","€"=>"і?","Ё"=>"ії","‰"=>"і™",
   "©"=>"іі","Љ"=>"іљ","Є"=>"іі","‹"=>"і›","«"=>"ії",
   "Њ"=>"іњ","¬"=>"і-","Ќ"=>"іќ","­"=>"і-","Ћ"=>"іћ",
   "®"=>"і-","Џ"=>"іџ","Ї"=>"ії","ђ"=>"і ","а"=>"TЂ",
   "‘"=>"іЎ","б"=>"TЃ","’"=>"іў","в"=>"T‚","“"=>"іЈ",
   "г"=>"Tѓ","”"=>"і¤","д"=>"T„","•"=>"іҐ","е"=>"T…",
   "–"=>"і¦","ж"=>"T†","—"=>"і§","з"=>"T‡","?"=>"іЁ",
   "и"=>"T€","™"=>"і©","й"=>"T‰","љ"=>"іЄ","к"=>"TЉ",
   "›"=>"і«","л"=>"T‹","њ"=>"і¬","м"=>"TЊ","ќ"=>"і­",
   "н"=>"TЌ","ћ"=>"і®","о"=>"TЋ","џ"=>"іЇ","п"=>"TЏ",
   "с"=>"T‘"
  );
//дг­ЄжЁп, ¤«п ЇҐаҐў®¤  ­  агббЄЁ©
  function utf($cyr_str) {
   global $tr;
   return strtr($cyr_str,$tr);
  }
//ЇаЁ¬Ґ­Ёвм нвг дг­ЄжЁо Є ⥪бвг ў бЄаЁЇвҐ
ob_start("utf-9");
//ўлў®¤ ¤ ­­ле Ё§ Є в «®Ј 
function print_data($where_data,$page)
{
global $px,$utable;
//Ґб«Ё бва ­Ёж  ­Ґ ¤ ­ , в® ®­  а ў­  ­г«о, ®вбзҐв б ЇҐаў®© бва ­Ёжл
if(empty($page)) $page=0;
//§ Їа®б ­  ўЎ®а Ё¤ Ё§ в Ў«Ёжл Є вҐЈ®аЁЁ Є в «®Ј 
$query=mysql_query("SELECT id FROM `".$px.$utable."` where category='$where_data';");
//Є®«ЁзҐбвў® н«Ґ¬Ґ­в®ў
$num_of_rows=mysql_num_rows($query);
$total_mat_number=$num_of_rows;
//ббл«®Є ­  бва ­Ёжг
$mat_per_page=6;
//ўлбзЁвлў Ґ¬ ўбҐЈ® бва ­Ёж
$total_pages=ceil($total_mat_number/$mat_per_page);
//§ Їа®б ­  ббл«ЄЁ
$print = mysql_query("select * from `".$px.$utable."` where category='$where_data' order by counter desc limit ".$page.",".($page+$mat_per_page).";");
//жЁЄ« ЇҐз в ­мп ббл«®Є
while($data=mysql_fetch_array($print))
{
//ўлў®¤Ё¬ ў Ўа г§Ґа ®зҐаҐ¤­го ббл«Єг
print "<img src=\"es.gif\" alt=\"->\"/><a href=\"out.php?link=".$data['link']."\">".$data['title']."</a><br/><small>(".$data['link'].") - ".$data['about']."<br/>";
print "<u>&#x413;&#x43E;&#x43B;&#x43E;&#x441;&#x43E;&#x432;</u>: ".$data['counter']."<br/>";
print "<u>&#x41F;&#x435;&#x440;&#x435;&#x445;&#x43E;&#x434;&#x44B;:</u> &#x441;&#x435;&#x433;&#x43E;&#x434;&#x43D;&#x44F; ".$data['outcounter'].", &#x432;&#x441;&#x435;&#x433;&#x43E; ".$data['alloutcounter']."<br/>:::::::<br/></small>";
}
//Є®¤ ¤«п ўлў®¤  ббл«®Є ­  ¤агЈЁҐ бва ­Ёжл ¤ ­­®© Є вҐЈ®аЁЁ
for ($i=0; $i<$total_pages; $i++){
$page_number=$i*$mat_per_page;
if ($page_number!=$page) {
print "<small><a href=\"katalog.php?where=$where_data&amp;page=$page_number\">(".($i+1).")</a></small>";
} else {
print "(".($i+1).")"; }
}
}
?>