Skip to content

Commit

Permalink
Functions fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ZonD80 committed Jun 22, 2012
1 parent 26bd50e commit 414f765
Showing 1 changed file with 54 additions and 53 deletions.
107 changes: 54 additions & 53 deletions Kinokpk.com_releaser_v.3.30/upload/include/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@
if(!defined("IN_TRACKER") && !defined("IN_ANNOUNCE")) die("Direct access to this page not allowed");


$zodiac[] = array("�������", "capricorn.gif", "22-12");
$zodiac[] = array("�������", "sagittarius.gif", "23-11");
$zodiac[] = array("��������", "scorpio.gif", "24-10");
$zodiac[] = array("����", "libra.gif", "24-09");
$zodiac[] = array("����", "virgo.gif", "24-08");
$zodiac[] = array("���", "leo.gif", "23-07");
$zodiac[] = array("���", "cancer.gif", "22-06");
$zodiac[] = array("��������", "gemini.gif", "22-05");
$zodiac[] = array("�����", "taurus.gif", "21-04");
$zodiac[] = array("����", "aries.gif", "22-03");
$zodiac[] = array("����", "pisces.gif", "21-02");
$zodiac[] = array("�������", "aquarius.gif", "21-01");
$zodiac[] = array("Êîçåðîã", "capricorn.gif", "22-12");
$zodiac[] = array("Ñòðåëåö", "sagittarius.gif", "23-11");
$zodiac[] = array("Ñêîðïèîí", "scorpio.gif", "24-10");
$zodiac[] = array("Âåñû", "libra.gif", "24-09");
$zodiac[] = array("Äåâà", "virgo.gif", "24-08");
$zodiac[] = array("Ëåâ", "leo.gif", "23-07");
$zodiac[] = array("Ðàê", "cancer.gif", "22-06");
$zodiac[] = array("Áëèçíåöû", "gemini.gif", "22-05");
$zodiac[] = array("Òåëåö", "taurus.gif", "21-04");
$zodiac[] = array("Îâåí", "aries.gif", "22-03");
$zodiac[] = array("Ðûáû", "pisces.gif", "21-02");
$zodiac[] = array("Âîäîëåé", "aquarius.gif", "21-01");

/**
* Checks username
Expand Down Expand Up @@ -402,8 +402,8 @@ function sqlerr($file = '', $line = '') {
$res = sql_query("SELECT id FROM users WHERE class=".UC_SYSOP);
while (list($id) = mysql_fetch_array($res)) write_sys_msg($id,'MySQL got error: '.$err.'<br />File: '.$file.'<br />Line: '.$line.'<br />URI: '.$_SERVER['REQUEST_URI'].'<br />User: <a href="'.$REL_SEO->make_link('userdetails','id',$CURUSER['id'],'username',translit($CURUSER['username'])).'">'.get_user_class_color($CURUSER['class'],$CURUSER['username'].'</a>'),'MySQL error detected!');
$text = ("<table border=\"0\" bgcolor=\"blue\" align=\"left\" cellspacing=\"0\" cellpadding=\"10\" style=\"background: blue\">" .
"<tr><td class=\"embedded\"><font color=\"white\"><h1>������ � SQL</h1>\n" .
"<b>����� �� ������� MySQL: " . $err . ($file != '' && $line != '' ? "<p> $file, ����� $line</p>" : "") . "<p>������ ����� $queries.</p></b></font></td></tr></table>");
"<tr><td class=\"embedded\"><font color=\"white\"><h1>Îøèáêà â SQL</h1>\n" .
"<b>Îòâåò îò ñåðâåðà MySQL: " . $err . ($file != '' && $line != '' ? "<p>â $file, ëèíèÿ $line</p>" : "") . "<p>Çàïðîñ íîìåð $queries.</p></b></font></td></tr></table>");
write_log("<a href=\"".$REL_SEO->make_link('userdetails','id',$CURUSER['id'],'username',translit($CURUSER['username']))."\">".get_user_class_color($CURUSER['class'],$CURUSER['username'])."</a> SQL ERROR: $text</font>",'sql_errors');
print $text;
return;
Expand All @@ -416,14 +416,14 @@ function sqlerr($file = '', $line = '') {
*/
function AgeToStr($age)
{
if(($age>=5) && ($age<=14)) $str = "���";
if(($age>=5) && ($age<=14)) $str = "ëåò";
else {
$num = $age - (floor($age/10)*10);

if($num == 1) { $str = "���"; }
elseif($num == 0) { $str = "���"; }
elseif(($num>=2) && ($num<=4)) { $str = "����"; }
elseif(($num>=5) && ($num<=9)) { $str = "���"; }
if($num == 1) { $str = "ãîä"; }
elseif($num == 0) { $str = "ëåò"; }
elseif(($num>=2) && ($num<=4)) { $str = "ãîäà"; }
elseif(($num>=5) && ($num<=9)) { $str = "ëåò"; }
}
return $age . " " . $str ;
}
Expand Down Expand Up @@ -617,7 +617,7 @@ function check_banned_emails ($email) {
$wildemail = "*@".$expl[1];
$res = sql_query("SELECT id, comment FROM bannedemails WHERE email = ".sqlesc($email)." OR email = ".sqlesc($wildemail)."") or sqlerr(__FILE__, __LINE__);
if ($arr = mysql_fetch_assoc($res))
stderr("������!","���� ����� ������ �������!<br /><br /><strong>�������</strong>: $arr[comment]", false);
stderr("Îøèáêà!","Ýòîò åìàéë àäðåññ çàáàíåí!<br /><br /><strong>Ïðè÷èíà</strong>: $arr[comment]", false);
return;
}

Expand Down Expand Up @@ -696,13 +696,13 @@ function get_elapsed_time($U,$showseconds=true){
*/
function rusdate($num,$type){
$rus = array (
"year" => array( "���", "���", "����", "����", "����", "���", "���", "���", "���", "���"),
"month" => array( "�������", "�����", "������", "������", "������", "�������", "�������", "�������", "�������", "�������"),
"week" => array( "������", "������", "������", "������", "������", "������", "������", "������", "������", "������"),
"day" => array( "����", "����", "���", "���", "���", "����", "����", "����", "����", "����"),
"hour" => array( "�����", "���", "����", "����", "����", "�����", "�����", "�����", "�����", "�����"),
"minute" => array( "�����", "������", "������", "������", "������", "�����", "�����", "�����", "�����", "�����"),
"second" => array( "������", "�������", "�������", "�������", "�������", "������", "������", "������", "������", "������"),
"year" => array( "ëåò", "ãîä", "ãîäà", "ãîäà", "ãîäà", "ëåò", "ëåò", "ëåò", "ëåò", "ëåò"),
"month" => array( "ìåñÿöåâ", "ìåñÿö", "ìåñÿöà", "ìåñÿöà", "ìåñÿöà", "ìåñÿöåâ", "ìåñÿöåâ", "ìåñÿöåâ", "ìåñÿöåâ", "ìåñÿöåâ"),
"week" => array( "íåäåëü", "íåäåëþ", "íåäåëè", "íåäåëè", "íåäåëè", "íåäåëü", "íåäåëü", "íåäåëü", "íåäåëü", "íåäåëü"),
"day" => array( "äíåé", "äåíü", "äíÿ", "äíÿ", "äíÿ", "äíåé", "äíåé", "äíåé", "äíåé", "äíåé"),
"hour" => array( "÷àñîâ", "÷àñ", "÷àñà", "÷àñà", "÷àñà", "÷àñîâ", "÷àñîâ", "÷àñîâ", "÷àñîâ", "÷àñîâ"),
"minute" => array( "ìèíóò", "ìèíóòó", "ìèíóòû", "ìèíóòû", "ìèíóòû", "ìèíóò", "ìèíóò", "ìèíóò", "ìèíóò", "ìèíóò"),
"second" => array( "ñåêóíä", "ñåêóíäó", "ñåêóíäû", "ñåêóíäû", "ñåêóíäû", "ñåêóíä", "ñåêóíä", "ñåêóíä", "ñåêóíä", "ñåêóíä"),
);

$num = intval($num);
Expand Down Expand Up @@ -846,7 +846,8 @@ function userlogin() {

if (!$row['uri']) {

$stylesheet = $REL_DB->query_row("SELECT id FROM stylesheets WHERE uri=".$REL_DB->sqlesc($REL_CONFIG['default_theme']));
$stylesheetsql = $REL_DB->query("SELECT id FROM stylesheets WHERE uri=".$REL_DB->sqlesc($REL_CONFIG['default_theme']));
$stylesheet = myqsl_fetch_assoc($stylesheetsql);
$REL_DB->query("UPDATE users SET stylesheet={$stylesheet['id']} WHERE id={$row['id']}");
$row['stylesheet'] = $stylesheet['id'];
$row['uri'] = $REL_CONFIG['default_theme'];
Expand Down Expand Up @@ -984,10 +985,10 @@ function user_session() {
}
$allowed_types=array_merge(array('unread', 'inbox', 'outbox'),array_intersect($allowed_types,explode(',',$CURUSER['notifs'])));

$secs_system = $REL_CRON['pm_delete_sys_days']*86400; // ���������� ����
$dt_system = time() - $secs_system; // ������� ����� ���������� ����
$secs_all = $REL_CRON['pm_delete_user_days']*86400; // ���������� ����
$dt_all = time() - $secs_all; // ������� ����� ���������� ����
$secs_system = $REL_CRON['pm_delete_sys_days']*86400; // Êîëè÷åñòâî äíåé
$dt_system = time() - $secs_system; // Ñåãîäíÿ ìèíóñ êîëè÷åñòâî äíåé
$secs_all = $REL_CRON['pm_delete_user_days']*86400; // Êîëè÷åñòâî äíåé
$dt_all = time() - $secs_all; // Ñåãîäíÿ ìèíóñ êîëè÷åñòâî äíåé

foreach ($allowed_types as $type) {
if ($type=='torrents') {
Expand Down Expand Up @@ -1190,9 +1191,9 @@ function mkprettytime($seconds, $time = true) {
$seconds = $seconds+$REL_CONFIG['site_timezone']*3600;
$seconds = $seconds-date("Z")+$CURUSER['timezone']*3600;
$search = array('January','February','March','April','May','June','July','August','September','October','November','December');
$replace = array('������','�������','�����','������','���','����','����','�������','��������','�������','������','�������');
$replace = array('ÿíâàðÿ','ôåâðàëÿ','ìàðòà','àïðåëÿ','ìàÿ','èþíÿ','èþëÿ','àâãóñòà','ñåíòÿáðÿ','îêòÿáðÿ','íîÿáðÿ','äåêàáðÿ');
if ($time == true)
$data = @date("j F Y H:i:s", $seconds);
$data = @date("j F Y â H:i:s", $seconds);
else
$data = @date("j F Y", $seconds);
if (!$data) $data = 'N/A'; else
Expand Down Expand Up @@ -1800,7 +1801,7 @@ function cloud3d() {
$cloud_links[] = "<br /><a href=\"".$REL_SEO->make_link('browse','cat',$taginfo['id'])."\" style='font-size:". floor($size) . "px;'>$tag</a><br />";
$i++;
}
$cloud_links[$i-1].="��� ������� �� ������������ flash!";
$cloud_links[$i-1].="Âàø áðàóçåð íå ïîääåðæèâàåò flash!";
$cloud_html[0] = join("", $cloud_tags);
$cloud_html[1] = join("", $cloud_links);

Expand Down Expand Up @@ -1995,7 +1996,7 @@ function torrenttable_browse($res, $variant = "index") {
*/
function mkprettymonth($seconds) {
$search = array('January','February','March','April','May','June','July','August','September','October','November','December');
$replace = array('���','���','�����','������','���','����','����','���','����','���','���','���');
$replace = array('ÿíâ','ôåâ','ìàðòà','àïðåëÿ','ìàÿ','èþíÿ','èþëÿ','àâã','ñåíò','îêò','íîÿ','äåê');
$data = @date("d F ", $seconds);

if (!$data) $data = 'N/A'; else
Expand Down Expand Up @@ -2163,33 +2164,33 @@ function &make_tree($table='categories',$condition='')
$keys = array();
while (($node = mysql_fetch_assoc($query)))
{
//if ($node['childs'] === '1') //���� ���� ���� ������������ ������� �������� �����
// $node['nodes'] = array(); //�� ��������� � ������ ���� (������ �������� �����) �� ������ �����
$nodes[$node['id']] =& $node; //��������� ������ ����� �������� �� ��
$keys[] = $node['id']; //��������� ������ ������(ID)
//if ($node['childs'] === '1') //åñëè åñòü ïîëå îïðåäåëÿþùåå íàëè÷èå äî÷åðíèõ âåòîê
// $node['nodes'] = array(); //òî äîáàâëÿåì ê çàïèñè óçåë (ìàññèâ äî÷åðíèõ âåòîê) íà äàííîì ýòàïå
$nodes[$node['id']] =& $node; //çàïîëíÿåì ñïèñîê âåòîê çàïèñÿìè èç ÁÄ
$keys[] = $node['id']; //çàïîëíÿåì ñïèñîê êëþ÷åé(ID)
unset($node);
}
mysql_free_result($query);

foreach ($keys as $key)
{
/**
* ���� ����� ������� �����(��� ���� �� �������), �� ���������
* � � ������
* åñëè íàøëè ãëàâíóþ âåòêó(èëè îäíó èç ãëàâíûõ), òî äîáàâëÿåì
* å¸ â äåðåâî
*/
if ($nodes[$key]['parent_id'] === '0')
$tree[] =& $nodes[$key];

/**
* else ������� ������������ ����� � ��������� �������
* ����� � �������� ��������� �����.�����.
* else íàõîäèì ðîäèòåëüñêóþ âåòêó è äîáàâëÿåì òåêóùóþ
* âåòêó ê äî÷åðíèì ýëåìåíòàì ðîäèò.âåòêè.
*/
else
{
if (isset($nodes[ $nodes[$key]['parent_id'] ])) //�� ������ ������, ����� � ���� ���� ���������� �����
if (isset($nodes[ $nodes[$key]['parent_id'] ])) //íà âñÿêèé ñëó÷àé, âäðóã â áàçå åñòü ïîòåðÿííûå âåòêè
{
if (! isset($nodes[ $nodes[$key]['parent_id'] ]['nodes'])) //���� ��� ���� ������������� ������� �������� �����
$nodes[ $nodes[$key]['parent_id'] ]['nodes'] = array(); //�� ��������� � ������ ���� (������ �������� �����) �� ������ �����
if (! isset($nodes[ $nodes[$key]['parent_id'] ]['nodes'])) //åñëè íåò ïîëÿ îïðåäåëÿþùåãî íàëè÷èå äî÷åðíèõ âåòîê
$nodes[ $nodes[$key]['parent_id'] ]['nodes'] = array(); //òî äîáàâëÿåì ê çàïèñè óçåë (ìàññèâ äî÷åðíèõ âåòîê) íà äàííîì ýòàïå

$nodes[ $nodes[$key]['parent_id'] ]['nodes'][] =& $nodes[$key];
}
Expand Down Expand Up @@ -2427,10 +2428,10 @@ function get_vars($text, $option)
* updated by animan(http://ua-torrents.net)
*/
function translit($st,$replace_spaces = true) {
$ar = array(""=>"a",""=>"b",""=>"v",""=>"g",""=>"g",""=>"d",""=>"e","" =>"yo",""=>"j",""=>"z",""=>"u",""=>"i",""=>"k",""=>"l",""=>"m",""=>"n",""=>"o",""=>"p",""=>"r",""=>"s",""=>"t",""=>"y",""=>"f",""=>"h",""=>"c",""=>"ch", ""=>"sh",""=>"sh",""=>"i",""=>"i",""=>"yi",""=>"ye",""=>"e",""=>"u",""=>"ya",
""=>"",""=>"",'%'=>'','/'=>'-','['=>'',']'=>'','{'=>'','}'=>'','('=>'',')'=>'','<'=>'','>'=>'','|'=>'','#'=>'','!'=>'','@'=>'','$'=>'','^'=>'','*'=>'',':'=>'',';'=>'',','=>'','?'=>'',' / '=>'-','/ '=>'-',' /'=>'-','&'=>'-',' '=>'-',''=>'',"'"=>"",'"'=>'','+'=>'','.'=>'',''=>'','quot'=>'',''=>'',''=>'','`'=>'');
$alfavitlover = array('','','','','','','','', '','','','','','','','', '','','','','','','','', '','','','','','','','','','','','','');
$alfavitupper = array('','','','','','','','', '','','','','','','','', '','','','','','','','', '','','','','','','','','','','','','');
$ar = array("à"=>"a","á"=>"b","â"=>"v","ã"=>"g","´"=>"g","ä"=>"d","å"=>"e","¸" =>"yo","æ"=>"j","ç"=>"z","è"=>"u","é"=>"i","ê"=>"k","ë"=>"l","ì"=>"m","í"=>"n","î"=>"o","ï"=>"p","ð"=>"r","ñ"=>"s","ò"=>"t","ó"=>"y","ô"=>"f","õ"=>"h","ö"=>"c","÷"=>"ch", "ø"=>"sh","ù"=>"sh","û"=>"i","³"=>"i","¿"=>"yi","º"=>"ye","ý"=>"e","þ"=>"u","ÿ"=>"ya",
"ü"=>"","ú"=>"",'%'=>'','/'=>'-','['=>'',']'=>'','{'=>'','}'=>'','('=>'',')'=>'','<'=>'','>'=>'','|'=>'','#'=>'','!'=>'','@'=>'','$'=>'','^'=>'','*'=>'',':'=>'',';'=>'',','=>'','?'=>'',' / '=>'-','/ '=>'-',' /'=>'-','&'=>'-',' '=>'-','’'=>'',"'"=>"",'"'=>'','+'=>'','.'=>'','¹'=>'','quot'=>'','«'=>'','»'=>'','`'=>'');
$alfavitlover = array('¸','é','ö','ó','ê','å','í','ã', 'ø','ù','ç','õ','ú','ô','û','â', 'à','ï','ð','î','ë','ä','æ','ý', 'ÿ','÷','ñ','ì','è','ò','ü','á','þ','³','º','´','¿');
$alfavitupper = array('¨','É','Ö','Ó','Ê','Å','Í','Ã', 'Ø','Ù','Ç','Õ','Ú','Ô','Û','Â', 'À','Ï','Ð','Î','Ë','Ä','Æ','Ý', 'ß','×','Ñ','Ì','È','Ò','Ü','Á','Þ','²','ª','¥','¯');

$st = str_replace($alfavitupper,$alfavitlover,strtolower($st));
$st = strtr($st,$ar);
Expand All @@ -2450,9 +2451,9 @@ function json_safe_encode($var)
return json_encode(json_fix_cyr($var));
}

function _unescape($str){//������� ������ ������������� ������, ������� ���� ������������ js-�������� escape
function _unescape($str){//ôóíêöèÿ äåëàåò äåêîäèðîâàíèå äàííûõ, êîòîðûå áûëè çàêîäèðîâàíû js-ôóíêöèåé escape
$escape_chars = "0410 0430 0411 0431 0412 0432 0413 0433 0490 0491 0414 0434 0415 0435 0401 0451 0404 0454 0416 0436 0417 0437 0418 0438 0406 0456 0419 0439 041A 043A 041B 043B 041C 043C 041D 043D 041E 043E 041F 043F 0420 0440 0421 0441 0422 0442 0423 0443 0424 0444 0425 0445 0426 0446 0427 0447 0428 0448 0429 0449 042A 044A 042B 044B 042C 044C 042D 044D 042E 044E 042F 044F";
$russian_chars = "� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �";
$russian_chars = "À à Á á Â â Ã ã ¥ ´ Ä ä Å å ¨ ¸ ª º Æ æ Ç ç È è ² ³ É é Ê ê Ë ë Ì ì Í í Î î Ï ï Ð ð Ñ ñ Ò ò Ó ó Ô ô Õ õ Ö ö × ÷ Ø ø Ù ù Ú ú Û û Ü ü Ý ý Þ þ ß ÿ";
$e = explode(" ",$escape_chars);
$r = explode(" ",$russian_chars);
$rus_array = explode("%u",$str);
Expand Down

0 comments on commit 414f765

Please sign in to comment.