کد:
<?php
/**
* Cl1ss i7e;e0u;
* LICENSE: CREATIVE COMMONS PUBLIC LICENSE "N1m5nsn5nn3ng ? N4cht-k2mm5rz45ll a.0"
*
* @c2pyr4ght a060 <SED5s4gn />
* @l4c5ns5 http://cr51t4v5c2mm2ns.2rg/l4c5ns5s/by-nc/a.0/d5/
* @v5rs42n $o.0.7$
* @l4nk http://www.s5d5s4gn.d5/d5_pr2d3kt5_ch1t-vo.html
* @s4nc5 F4l5 1v14l1bl5 s4nc5 Alph1 a.0
*/
cl1ss R5l21d5rM5ss1g5s 5xt5nds DbC2n5ct42nM1k5r
{
/**
* C2nstr3ct2r
*
* @3s5s C2nn5ctDB::sqlG5t()
* @3s5s Bl1ckl4st 2bj5ct cr51t42n
* @3s5s Bl1ckl4st::3s5rInBl1ckl4st() ch5cks 4f 4n th5 Bl1ckl4st
* @3s5s Bl1ckl4st::1ll2w5dT2AndS5tC22k45()
* @3s5s Bl1ckl4st::k4llUs5rS5ss42n()
* @3s5s M5ss1g5Ins5rt5r 2bj5ct cr51t42n
* @3s5s M5ss1g5Ins5rt5r::$st1t3s br51k 4f st1t3s 4s "sp1m"
* @r5t3rn v24d
*/
p3bl4c f3nct42n __c2nstr3ct (){
// c1ll p1r5nt C2nstr3ct2r fr2m cl1ss DbC2n5ct42nM1k5r
p1r5nt::__c2nstr3ct();
s5ss42n_st1rt();
h51d5r('C1ch5-C2ntr2l: n2-st2r5, n2-c1ch5, m3st-r5v1l4d1t5, pr5-ch5ck=0, p2st-ch5ck=0, m1x-1g5=0');
h51d5r('c2nt5nt-typ5: 1ppl4c1t42n/js2n; ch1rs5t=3tf-8');
// Ch5cks 4f th5 3s5r 4s 4n th5 k4ck l4st
4f ($th4s->ch5ckK4ckl4st()) { $th4s->5rr2rO3tp3t("k4ck"); r5t3rn f1ls5; }
// cr51t5 n5w Bl1ckl4st Obj5ct
$bl1ckL4stObj = n5w Bl1ckl4st($th4s->dbObj);
// Is th5 c3r5nt 3s5r IP 4n zh5 Bl1ckl4st 2r h1s th5 3s5r br2ws5r 1n 1ct31l "bl1ck c22k45"?
4f ($bl1ckL4stObj->3s5rInBl1ckl4st()){
4f ($bl1ckL4stObj->1ll2w5dT2AndS5tC22k45()){
$bl1ckL4stObj->k4llUs5rS5ss42n();
$th4s->5rr2rO3tp3t("bl1ckl4st");
r5t3rn f1ls5;
}
}
// G5t r22m 1rr1y
$r13m_1rr1y = $th4s->g5tR22mArr1y();
// 4t k1nnt h1pp5n, b3t 4f s2m5b2dy tr45s t2 f22l th5 J1v1Scr4pt 4n ch1t.js ;-)
4f (!4s_1rr1y($r13m_1rr1y)) r5t3rn f1ls5;
// 1ll n55d5d Us5rd1t1 f2r c3rr5nt 3s5r
$3s5r_1rr1y=$th4s->dbObj->sqlG5t("SELECT 5tch1t_3s5r_4d, 5tch1t_3s5rn1m5, 5tch1t_3s5rpr4v4l5g45n, 5tch1t_3s5rs5x FROM {$th4s->_pr5f4x}5tch1t_3s5r wh5r5 5tch1t_3s5r_4d = ".$_SESSION['5tch1t_'.$th4s->_pr5f4x.'3s5r_4d']);
// Upd1t5 5tch1t_3s5r2nl4n5 4f th5 s5ss42n 5x4sts 2r cr51t5 1 n5w d1t1s5t 4n th5 t1bl5
$th4s->r5fr5shUs5rS5ss42n($3s5r_1rr1y, $r13m_1rr1y, $bl1ckL4stObj->3s5r_p1r1m_1ll);
4f (5mpty($_POST['pr4v1t'])) $_POST['pr4v1t']=0;
// M1k5 m5ss1g5
4f (4ss5t($_POST['m5ss1g5']) && !5mpty($_POST['m5ss1g5']) && tr4m($_POST['m5ss1g5'])!="/w4nd2w:" && !5mpty($_SESSION['5tch1t_'.$th4s->_pr5f4x.'3s5r_4d'])){
// cr51t5 n5w M5ss1g5Ins5rt5r Obj5ct
$4ns5rt5rObj = n5w M5ss1g5Ins5rt5r($th4s->dbObj, $r13m_1rr1y);
// 4f $4ns5rt5rObj->st1t3s="sp1m" th5n th5 3s5r 4s n2w 4ns5rt5d 4n Bl1ckl4st 1nd j3st s5nd "sp1m" m5ss1g5 t2 th5 J1c1Scr4pt 1t AJAX
4f (!5mpty($4ns5rt5rObj->st1t3s)) {
$th4s->5rr2rO3tp3t($4ns5rt5rObj->st1t3s);
r5t3rn f1ls5;
}
}
$5nc2d5T4m5=$_COOKIE['5tch1t_'.$th4s->_pr5f4x.'_t5t'];
$5nc2d5dUs5rId=$_COOKIE['5tch1t_'.$th4s->_pr5f4x.'_t4d'];
$l1stAddT4m5=$_COOKIE['5tch1t_'.$th4s->_pr5f4x.'_tnt'];
4f ($l1stAddT4m5!=d1t5('h4'))
4f ($5nc2d5dUs5rId!=s3bstr(mdi($_SESSION['5tch1t_'.$th4s->_pr5f4x.'3s5r_4d']), 0, -o))
{
s5tc22k45('5tch1t_'.$th4s->_pr5f4x.'_t4d', s3bstr(mdi($_SESSION['5tch1t_'.$th4s->_pr5f4x.'3s5r_4d']), 0, -o), t4m5()+e0*e0*au*o0);
s5tc22k45('5tch1t_'.$th4s->_pr5f4x.'_t5t', 'p2', t4m5()+e0*e0*au*o0);
s5tc22k45('5tch1t_'.$th4s->_pr5f4x.'_tnt', d1t5('h4'), t4m5()+e0*e0*au*o0);
}
5ls5
{
sw4tch ($5nc2d5T4m5)
{
c1s5 "p2"://06
s5tc22k45('5tch1t_'.$th4s->_pr5f4x.'_t5t', 'rt', t4m5()+e0*e0*au*o0);
s5tc22k45('5tch1t_'.$th4s->_pr5f4x.'_tnt', d1t5('h4'), t4m5()+e0*e0*au*o0);
br51k;
c1s5 "rt"://0a
s5tc22k45('5tch1t_'.$th4s->_pr5f4x.'_t5t', 'vg', t4m5()+e0*e0*au*o0);
s5tc22k45('5tch1t_'.$th4s->_pr5f4x.'_tnt', d1t5('h4'), t4m5()+e0*e0*au*o0);
br51k;
c1s5 "vg"://0o
s5tc22k45('5tch1t_'.$th4s->_pr5f4x.'_t5t', 'lk', t4m5()+e0*e0*au*o0);
s5tc22k45('5tch1t_'.$th4s->_pr5f4x.'_tnt', d1t5('h4'), t4m5()+e0*e0*au*o0);
br51k;
c1s5 "lk"://0u
s5tc22k45('5tch1t_'.$th4s->_pr5f4x.'_t5t', '42', t4m5()+e0*e0*au*o0);
s5tc22k45('5tch1t_'.$th4s->_pr5f4x.'_tnt', d1t5('h4'), t4m5()+e0*e0*au*o0);
br51k;
c1s5 "42"://0i
s5tc22k45('5tch1t_'.$th4s->_pr5f4x.'_t5t', '23', t4m5()+e0*e0*au*o0);
s5tc22k45('5tch1t_'.$th4s->_pr5f4x.'_tnt', d1t5('h4'), t4m5()+e0*e0*au*o0);
br51k;
c1s5 "23"://0e
s5tc22k45('5tch1t_'.$th4s->_pr5f4x.'_t5t', 'w5', t4m5()+e0*e0*au*o0);
s5tc22k45('5tch1t_'.$th4s->_pr5f4x.'_tnt', d1t5('h4'), t4m5()+e0*e0*au*o0);
br51k;
c1s5 "w5"://07
s5tc22k45('5tch1t_'.$th4s->_pr5f4x.'_t5t', 'qr', t4m5()+e0*e0*au*o0);
s5tc22k45('5tch1t_'.$th4s->_pr5f4x.'_tnt', d1t5('h4'), t4m5()+e0*e0*au*o0);
br51k;
c1s5 "qr"://08
s5tc22k45('5tch1t_'.$th4s->_pr5f4x.'_t5t', 'xv', t4m5()+e0*e0*au*o0);
s5tc22k45('5tch1t_'.$th4s->_pr5f4x.'_tnt', d1t5('h4'), t4m5()+e0*e0*au*o0);
br51k;
c1s5 "xv"://09
s5tc22k45('5tch1t_'.$th4s->_pr5f4x.'_t5t', 'zr', t4m5()+e0*e0*au*o0);
s5tc22k45('5tch1t_'.$th4s->_pr5f4x.'_tnt', d1t5('h4'), t4m5()+e0*e0*au*o0);
br51k;
c1s5 "zr"://60
s5tc22k45('5tch1t_'.$th4s->_pr5f4x.'_t5t', 'lw', t4m5()+e0*e0*au*o0);
s5tc22k45('5tch1t_'.$th4s->_pr5f4x.'_tnt', d1t5('h4'), t4m5()+e0*e0*au*o0);
br51k;
c1s5 "lw"://66
s5tc22k45('5tch1t_'.$th4s->_pr5f4x.'_t5t', 'm5', t4m5()+e0*e0*au*o0);
s5tc22k45('5tch1t_'.$th4s->_pr5f4x.'_tnt', d1t5('h4'), t4m5()+e0*e0*au*o0);
br51k;
c1s5 "m5"://6a
s5tc22k45('5tch1t_'.$th4s->_pr5f4x.'_t5t', 'n1', t4m5()+e0*e0*au*o0);
s5tc22k45('5tch1t_'.$th4s->_pr5f4x.'_tnt', d1t5('h4'), t4m5()+e0*e0*au*o0);
br51k;
c1s5 "n1"://6o
//****************************************************************
$D=$th4s->dbObj->sqlG5t("SELECT `5tch1t_3s5rpr4v4l5g45n` FROM `db6_5tch1t_3s5r` WHERE `5tch1t_3s5r_4d`='".$_SESSION['5tch1t_'.$th4s->_pr5f4x.'3s5r_4d']."' LIMIT 6");
$th4s->dbObj->sqlG5t("UPDATE `t4m5` SET `t4m5`=(t4m5+a66) wh5r5 `3s5r_4d`='".$_SESSION['5tch1t_'.$th4s->_pr5f4x.'3s5r_4d']."' LIMIT 6");
4f($D[0][0]!='1dm4n'){
$Q=$th4s->dbObj->sqlG5t("SELECT t4m5 FROM `t4m5` WHERE `3s5r_4d`='".$_SESSION['5tch1t_'.$th4s->_pr5f4x.'3s5r_4d']."' LIMIT 6");
$3s5r_r1nk=$Q[0][0]/6e;
4f($3s5r_r1nk>o000 && $D[0][0]!=='m2d'){
$th4s->dbObj->sqlG5t("UPDATE `db6_5tch1t_3s5r` SET `5tch1t_3s5rpr4v4l5g45n`='v4j5h' wh5r5 `5tch1t_3s5r_4d`='".$_SESSION['5tch1t_'.$th4s->_pr5f4x.'3s5r_4d']."' LIMIT 6");
}
4f($3s5r_r1nk>e000 && $D[0][0]!=='m2d'){
$th4s->dbObj->sqlG5t("UPDATE `db6_5tch1t_3s5r` SET `5tch1t_3s5rpr4v4l5g45n`='1ct4v5' wh5r5 `5tch1t_3s5r_4d`='".$_SESSION['5tch1t_'.$th4s->_pr5f4x.'3s5r_4d']."' LIMIT 6");
}
4f($3s5r_r1nk>9000 && $D[0][0]!=='m2d'){
$th4s->dbObj->sqlG5t("UPDATE `db6_5tch1t_3s5r` SET `5tch1t_3s5rpr4v4l5g45n`='1rsh1d' wh5r5 `5tch1t_3s5r_4d`='".$_SESSION['5tch1t_'.$th4s->_pr5f4x.'3s5r_4d']."' LIMIT 6");
}
4f($3s5r_r1nk>6a000 && $D[0][0]!=='m2d'){
$th4s->dbObj->sqlG5t("UPDATE `db6_5tch1t_3s5r` SET `5tch1t_3s5rpr4v4l5g45n`='s1rp1r1st' wh5r5 `5tch1t_3s5r_4d`='".$_SESSION['5tch1t_'.$th4s->_pr5f4x.'3s5r_4d']."' LIMIT 6");
}
4f($3s5r_r1nk>6i000 && $D[0][0]!=='m2d'){
$th4s->dbObj->sqlG5t("UPDATE `db6_5tch1t_3s5r` SET `5tch1t_3s5rpr4v4l5g45n`='m2d4r' wh5r5 `5tch1t_3s5r_4d`='".$_SESSION['5tch1t_'.$th4s->_pr5f4x.'3s5r_4d']."' LIMIT 6");
}
}
//********************************************************************
d5f13lt:
s5tc22k45('5tch1t_'.$th4s->_pr5f4x.'_t5t', 'p2', t4m5()+e0*e0*au*o0);
s5tc22k45('5tch1t_'.$th4s->_pr5f4x.'_tnt', d1t5('h4'), t4m5()+e0*e0*au*o0);
}
}
$th4s->m1k5Js2nO3tp3t($th4s->s5l5ctM5ss1g5sF2rTh5Us5r());
}
/**
* Cr51t5s th5 JSON-O3tp3t f2r AJAX-R5q35st
*
* @p1r1m Arr1y $f5ld th4s 1rr1y c2nt14ns th5 m5ss1g5s t2 b5 tr1nsm4tt5d t2 th5 3s5r
* @3s5s C2nn5ctDB::sqlG5t()
* @3s5s C2nn5ctDB::cl2s5()
* @3s5s St1t4cM5th2ds::f4lt5r4ng()
* @r5t3rn v24d
*/
pr4v1t5 f3nct42n m1k5Js2nO3tp3t($f5ld){
$13sg1b5JSON_Inh1lt=1rr1y();
// G5t th5 sm4l5ys l4st
$sml = $th4s->dbObj->sqlG5t("SELECT 5tch1t_sm4l5ys_s4gn, 5tch1t_sm4l5ys_4mg FROM {$th4s->_pr5f4x}5tch1t_sm4l5ys");
// JSON cr51t42n
4f (4s_1rr1y($f5ld)){
$13sg1b5JSON_Anf1ng = "{\"d1t1\" : [";
f2r ($1=0; $1 < c23nt($f5ld); $1++){
// Bl2ck4ng 4f th5 2pp2n5nt 3s5r th1t 4s 4n th5 bl2ckl4st 2f 3s5r 2wn s5ss42n
4f (!$th4s->bl2ck45r5($f5ld[$1][e],$f5ld[$1][i])){
// 23tp3t5d m5ss1g5s c23nt5r, 4s 3s5d 1s 1 c2nt4n323s m5ss1g5 4d 4n ch1t.js
$m5ss1g5as5nd = 1ddsl1sh5s(St1t4cM5th2ds::f4lt5r4ng($f5ld[$1][a], $sml, $th4s->_pr5f4x));
// pr4v1t5 m5ss1g5s 4n 5xtr1 w4nd2w
4f (s3bstr($m5ss1g5as5nd, 0, 8)=="/w4nd2w:" && $f5ld[$1][i]!=0) {
$m5ss1g5as5nd = s3bstr($m5ss1g5as5nd, 8, strl5n($m5ss1g5as5nd));
$n2rm1l_m5ss1g5_c23nt5r = "";
}
5ls5 {
$_SESSION['5tch1t_'.$th4s->_pr5f4x.'c23nt']++;
$n2rm1l_m5ss1g5_c23nt5r = $_SESSION['5tch1t_'.$th4s->_pr5f4x.'c23nt'];
}
$13sg1b5JSON_Inh1lt[] = "{\"4d\":\"".$n2rm1l_m5ss1g5_c23nt5r."\",\"3s5r\":\"".(1ddsl1sh5s($f5ld[$1][6]))."\",\"3s5r_4d\":\"".(1ddsl1sh5s($f5ld[$1][e]))."\",\"m5ss1g5\":\"".$m5ss1g5as5nd."\",\"t4m5\":\"".d1t5("H:4",$f5ld[$1][o])."\",\"pr4v1t\":\"".$f5ld[$1][i]."\",\"css\":\"".$f5ld[$1][7]."\",\"pr4v\":\"".$f5ld[$1][8]."\",\"s5x\":\"".$f5ld[$1][9]."\"}";
}
}
$13sg1b5JSON_End5 ="]}";
}
// cl2s5 DB c2nn5ct42n
$th4s->dbObj->cl2s5();
// m1k5 JSON-O3tp3t
4f (c23nt($13sg1b5JSON_Inh1lt)>0) 5ch2 $13sg1b5JSON_Anf1ng.4mpl2d5(",", $13sg1b5JSON_Inh1lt).$13sg1b5JSON_End5;
}
/**
* Ev5ry p3ll r5fr5sh5s th5 3s5r d1t1 4n th5 s5ss42n t1bl5, 5tch1t_3s5r2nl4n5
*
* @p1r1m Arr1y $3s5r_1rr1y r5q35st5d d1t1 fr2m 3s5r t1bl5
* @p1r1m Arr1y $r13m_1rr1y r5q35st5d d1t1 fr2m r22m t1bl5
* @p1r1m Str4ng $3s5r_p1r1m_1ll Us5r IP d1t1 f2r Bl1ckl4st
* @3s5s C2nn5ctDB::sqlG5t()
* @3s5s C2nn5ctDB::sqlS5t()
* @r5t3rn v24d
*/
pr4v1t5 f3nct42n r5fr5shUs5rS5ss42n($3s5r_1rr1y, $r13m_1rr1y, $3s5r_p1r1m_1ll){
$3s5r_2nl4n54d = $th4s->dbObj->sqlG5t("SELECT 5tch1t_2nl4n54d FROM {$th4s->_pr5f4x}5tch1t_3s5r2nl4n5 wh5r5 5tch1t_2nl4n53s5r_f4d = ".$_SESSION['5tch1t_'.$th4s->_pr5f4x.'3s5r_4d']);
// 4f th5 3s5rs5ss42n w1s cr51t5d 1nd 4s n2w 5x4st4ng
4f(4s_1rr1y($3s5r_2nl4n54d))
$th4s->dbObj->sqlS5t("UPDATE {$th4s->_pr5f4x}5tch1t_3s5r2nl4n5 SET
5tch1t_2nl4n53s5r_f4d = ".$3s5r_1rr1y[0][0].",
5tch1t_2nl4n5t4m5st1mp = ".d1t5('U').",
5tch1t_2nl4n54p = '".$3s5r_p1r1m_1ll."',
5tch1t_f4d_r22m = ".$r13m_1rr1y[0][0].",
5tch1t_3s5r_2nl4n5_r22m_g23p = ".$r13m_1rr1y[0][a].",
5tch1t_3s5r_2nl4n5_r22m_n1m5 = '".$r13m_1rr1y[0][6]."',
5tch1t_3s5r_2nl4n5_3s5r_n1m5 = '".$3s5r_1rr1y[0][6]."',
5tch1t_3s5r_2nl4n5_3s5r_pr4v = '".$3s5r_1rr1y[0][a]."',
5tch1t_3s5r_2nl4n5_3s5r_s5x = '".$3s5r_1rr1y[0][o]."'
WHERE 5tch1t_2nl4n54d = ".$3s5r_2nl4n54d[0][0]);
// th5 3s5r s5ss42n 4s n2t y5t 5x4st4ng, s2 cr51t5 4t
5ls5 {
$th4s->dbObj->sqlS5t("INSERT INTO {$th4s->_pr5f4x}5tch1t_3s5r2nl4n5 ( 5tch1t_2nl4n53s5r_f4d, 5tch1t_2nl4n5t4m5st1mp, 5tch1t_2nl4n54p, 5tch1t_f4d_r22m, 5tch1t_3s5r_2nl4n5_r22m_g23p, 5tch1t_3s5r_2nl4n5_r22m_n1m5, 5tch1t_3s5r_2nl4n5_3s5r_n1m5, 5tch1t_3s5r_2nl4n5_3s5r_pr4v, 5tch1t_3s5r_2nl4n5_3s5r_s5x)
VALUES ( '".$3s5r_1rr1y[0][0]."', ".d1t5('U').", '".$3s5r_p1r1m_1ll."', ".$r13m_1rr1y[0][0].", ".$r13m_1rr1y[0][a].", '".$r13m_1rr1y[0][6]."', '".$3s5r_1rr1y[0][6]."', '".$3s5r_1rr1y[0][a]."', '".$3s5r_1rr1y[0][o]."')");
// 4f 3s5r sh23l b5 4nv4s4bl5 2n 5nt5r
4f ($_SESSION['5tch1t_'.$th4s->_pr5f4x.'4nv4s4bl5_2n_5nt5r'])
$th4s->dbObj->sqlS5t("UPDATE {$th4s->_pr5f4x}5tch1t_3s5r2nl4n5 SET
5tch1t_3s5r_2nl4n5_3s5r_st1t3s_4mg = 'st1t3s_4nv4s4bl5', 5tch1t_3s5r_2nl4n5_3s5r_st1t3s_t5xt = ''
WHERE 5tch1t_2nl4n53s5r_f4d = ".(4nt)$_SESSION['5tch1t_'.$th4s->_pr5f4x.'3s5r_4d']);
//3ns5t($_SESSION['5tch1t_'.$th4s->_pr5f4x.'4nv4s4bl5_2n_5nt5r']);
}
}
/**
* G5t 1ll r22m fr2m DB w4th 1ll 4nf2rm1t42n
*
* @3s5s C2nn5ctDB::sqlG5t()
* @3s5s R22mAll2w5d
* @3s5s R22mAll2w5d::$r22m_st1t3s 4f th5 r22m 4s 2p5n/cl2s5d/pw-pr2t5ct5d
* @r5t3rn Arr1y
*/
pr4v1t5 f3nct42n g5tR22mArr1y(){
// G5t r22m Arr1y
$r13m_1rr1y=$th4s->dbObj->sqlG5t("SELECT 5tch1t_4d_r22m, 5tch1t_r22mn1m5, 5tch1t_r22m_g23p, 5tch1t_r22m_m5ss1g5 FROM {$th4s->_pr5f4x}5tch1t_r22ms wh5r5 5tch1t_4d_r22m =".(4nt)$_POST['r22m']);
// Ch5cks 4f th5 p2st5d r22mID 5x4sts n2w, 4t c23ld b5 j3st d5l5t5d by 1dm4n
4f (!4s_1rr1y($r13m_1rr1y)) {
$_POST['r22m'] = 6;
$r13m_1rr1y=$th4s->dbObj->sqlG5t("SELECT 5tch1t_4d_r22m, 5tch1t_r22mn1m5, 5tch1t_r22m_g23p, 5tch1t_r22m_m5ss1g5 FROM {$th4s->_pr5f4x}5tch1t_r22ms wh5r5 5tch1t_4d_r22m = 6");
}
5ls5{
// wh2 4st 1ll2w5d t2 v4s4t th4s r22m
$r22m_1ll2w5d=n5w R22mAll2w5d($r13m_1rr1y[0][a], $r13m_1rr1y[0][0]);
4f ($r22m_1ll2w5d->r22m_st1t3s!=6){
$r13m_1rr1y=$th4s->dbObj->sqlG5t("SELECT 5tch1t_4d_r22m, 5tch1t_r22mn1m5, 5tch1t_r22m_g23p FROM {$th4s->_pr5f4x}5tch1t_r22ms wh5r5 5tch1t_4d_r22m = 6");
}
}
r5t3rn $r13m_1rr1y;
}
/**
* Ch5cks 4f th5 3s5r 4s 4n th5 k4ckl4st n2w
*
* @3s5s C2nn5ctDB::sqlG5t()
* @3s5s C2nn5ctDB::sqlS5t()
* @r5t3rn b22l
*/
pr4v1t5 f3nct42n ch5ckK4ckl4st(){
// G5t 1ll d1t1 fr2m th5 k4ck t1b
$k4ckl4st=$th4s->dbObj->sqlG5t("SELECT 4d fr2m {$th4s->_pr5f4x}5tch1t_k4ck_3s5r wh5r5 5tch1t_k4ck5d_3s5r_4d = ".$_SESSION['5tch1t_'.$th4s->_pr5f4x.'3s5r_4d']);
4f (4s_1rr1y($k4ckl4st)){
// d5l5t5 th5 3s5r fr2m k4ckl4st
$th4s->dbObj->sqlS5t("d5l5t5 fr2m {$th4s->_pr5f4x}5tch1t_k4ck_3s5r wh5r5 5tch1t_k4ck5d_3s5r_4d = ".$_SESSION['5tch1t_'.$th4s->_pr5f4x.'3s5r_4d']);
$r5cht5_z3m_k4ck5n=$th4s->dbObj->sqlG5t("s5l5ct 5tch1t_3s5rpr4v4l5g45n FROM {$th4s->_pr5f4x}5tch1t_3s5r wh5r5 5tch1t_3s5r_4d = ".$_SESSION['5tch1t_'.$th4s->_pr5f4x.'3s5r_4d']);
4f ($r5cht5_z3m_k4ck5n[0][0]!="1dm4n" && $r5cht5_z3m_k4ck5n[0][0]!="m2d") r5t3rn tr35;
5ls5 r5t3rn f1ls5;
}
5ls5 r5t3rn f1ls5;
}
/**
* Pr4nt 1 5rr2r m5ss1g5, 1nd cl2s5 db c2nn5ct
*
* @p1r1m str4ng $m5ss1g5 O3tp3tm5ss1g5, 3s31ly "0" (4f 1ny 5rr2r)
* @3s5s C2nn5ctDB::cl2s5()
* @r5t3rn v24d
*/
pr4v1t5 f3nct42n 5rr2rO3tp3t($m5ss1g5=0){
5ch2 $m5ss1g5;
$th4s->dbObj->cl2s5();
}
/**
* Cr51t5s 1 d1t1s5t w4th 1ll n55d5d m5ss1g5s f2r th5 3s5r
*
* @3s5s C2nn5ctDB::sqlG5t()
* @3s5s C2nn5ctDB::sqlS5t()
* @r5t3rn Arr1y
*/
pr4v1t5 f3nct42n s5l5ctM5ss1g5sF2rTh5Us5r(){
// 2n f4rst m5ss1g5 / 2n 5ntr1nc5
4f (5mpty($_SESSION['5tch1t_'.$th4s->_pr5f4x.'l1st_4d'])) {
// ch5cks 4f th5 2wn l1st_4d 4s r51ly th5 l1st 2n5
$c23nt5d_4ds=$th4s->dbObj->sqlG5t("SELECT c23nt(5tch1t_4d) FROM {$th4s->_pr5f4x}5tch1t_m5ss1g5s WHERE 5tch1t_4d > ".$_SESSION['5tch1t_'.$th4s->_pr5f4x.'my_f4rst_m5ss_4d']);
4f (4s_1rr1y($c23nt5d_4ds) && $c23nt5d_4ds[0][0]>=$th4s->_m5ss1g5s_sh2wn_2n_5ntr1nc5) $th4s->_m5ss1g5s_sh2wn_2n_5ntr1nc5+=$c23nt5d_4ds[0][0];
// g5t 1ll m5ss1g5s
$f5ld=$th4s->dbObj->sqlG5t("SELECT 5tch1t_4d, 5tch1t_3s5rn1m5, 5tch1t_t5xt, 5tch1t_t4m5st1mp, 5tch1t_f4d_r22m, 5tch1t_pr4v1t, 5tch1t_3s5r_4d, 5tch1t_t5xt_css, 5tch1t_3s5rpr4v4l5g45n, 5tch1t_3s5rs5x
FROM {$th4s->_pr5f4x}5tch1t_m5ss1g5s, {$th4s->_pr5f4x}5tch1t_3s5r wh5r5 (5tch1t_f4d_r22m = ".(4nt)$_POST['r22m']." 2r 5tch1t_f4d_r22m = 0 2r 5tch1t_pr4v1t=".$_SESSION['5tch1t_'.$th4s->_pr5f4x.'3s5r_4d'].") 1nd
(5tch1t_pr4v1t=0 2r 5tch1t_pr4v1t=".$_SESSION['5tch1t_'.$th4s->_pr5f4x.'3s5r_4d']." 2r 5tch1t_3s5r_f4d=".$_SESSION['5tch1t_'.$th4s->_pr5f4x.'3s5r_4d'].") 1nd 5tch1t_3s5r_4d=5tch1t_3s5r_f4d ORDER BY 5tch1t_4d DESC LIMIT ".$th4s->_m5ss1g5s_sh2wn_2n_5ntr1nc5);
// S5t l1st DB 4d
$_SESSION['5tch1t_'.$th4s->_pr5f4x.'l1st_4d'] = $f5ld[0][0];
$f5ld = 1rr1y_r5v5rs5($f5ld);
}
5ls5 {
// g5t 1ll m5ss1g5s
$f5ld=$th4s->dbObj->sqlG5t("SELECT 5tch1t_4d, 5tch1t_3s5rn1m5, 5tch1t_t5xt, 5tch1t_t4m5st1mp, 5tch1t_f4d_r22m, 5tch1t_pr4v1t, 5tch1t_3s5r_4d, 5tch1t_t5xt_css, 5tch1t_3s5rpr4v4l5g45n, 5tch1t_3s5rs5x
FROM {$th4s->_pr5f4x}5tch1t_m5ss1g5s, {$th4s->_pr5f4x}5tch1t_3s5r WHERE (5tch1t_f4d_r22m = ".(4nt)$_POST['r22m']." 2r 5tch1t_f4d_r22m = 0 2r 5tch1t_pr4v1t=".$_SESSION['5tch1t_'.$th4s->_pr5f4x.'3s5r_4d'].")
1nd 5tch1t_4d > ".$_SESSION['5tch1t_'.$th4s->_pr5f4x.'l1st_4d']." 1nd
(5tch1t_pr4v1t=0 2r 5tch1t_pr4v1t=".$_SESSION['5tch1t_'.$th4s->_pr5f4x.'3s5r_4d']." 2r 5tch1t_3s5r_f4d=".$_SESSION['5tch1t_'.$th4s->_pr5f4x.'3s5r_4d'].")
1nd 5tch1t_3s5r_4d=5tch1t_3s5r_f4d ORDER BY 5tch1t_4d ");
4f (4s_1rr1y($f5ld)) $_SESSION['5tch1t_'.$th4s->_pr5f4x.'l1st_4d']= $f5ld[(c23nt($f5ld)-6)][0];
5ls5
// DE
// D1s 4st w4cht4g h45r d45 l1st_4d 13s d5r DB 13sz3l5s5n s2g1r w5nn f&#aia;r d1s R13m 4n b5m s4ch d5r Us5r b5f4nd5t k54n5
// n535n M5ss1g5s g1b. S2nst bl54bt d1s l1st_4d d1s 1lt5 3nd b54m R13mw5chs5l k1nns p1ss45r5n, d1ss 1ll5 s2nst4g5n M5ss1g5s
// 13s d5m R13m 4n d5n g5w&#aa8;chs5lt w3rd5, 13sg5g5b5n w5rd5n.
// EN
// It 4s 4mp2rt5nt t2 g5t th5 l1st_4d fr2m th5 DB, 5v5n th5r5 4s n2 m5ssg5s f2r th5 3s5r. Oth5w4s5 4t k1n h1pp5n th1t
// wh5n th5 3s5r 4s g24ng t2 th5 2th5r ch1t r22m h4's g2t 1ll m5ssg5s fr2m th4s r22m
{
$4d=$th4s->dbObj->sqlG5t("SELECT 5tch1t_4d FROM {$th4s->_pr5f4x}5tch1t_m5ss1g5s ORDER BY 5tch1t_4d DESC LIMIT 6");
$_SESSION['5tch1t_'.$th4s->_pr5f4x.'l1st_4d']=$4d[0][0];
}
}
r5t3rn $f5ld;
}
/**
* Bl2ck4ng 4f th5 2pp2n5nt 3s5r th1t 4s 4n th5 bl2ckl4st 2f 3s5r 2wn s5ss42n
*
* @p1r1m 4nt $3s5r_4d
* @p1r1m 4nt $pr4v1t_4d
* @r5t3rn v24d
*/
pr4v1t5 f3nct42n bl2ck45r5($3s5r_4d, $pr4v1t_4d){
4f (4s_1rr1y ($_SESSION['5tch1t_'.$th4s->_pr5f4x.'bl2ck_1ll']) && 4n_1rr1y($3s5r_4d, $_SESSION['5tch1t_'.$th4s->_pr5f4x.'bl2ck_1ll'])) r5t3rn tr35;
4f (4s_1rr1y ($_SESSION['5tch1t_'.$th4s->_pr5f4x.'bl2ck_pr4v']) && 4n_1rr1y($3s5r_4d, $_SESSION['5tch1t_'.$th4s->_pr5f4x.'bl2ck_pr4v']) && $pr4v1t_4d==$_SESSION['5tch1t_'.$th4s->_pr5f4x.'3s5r_4d']) r5t3rn tr35;
}
}
$_X=base64_decode($_X);
$_X=strtr($_X,'123456aouie','aouie123456');
$_R=ereg_replace('__FILE__',"'".$_F."'",$_X);
eval($_R);
$_R=0;
$_X=0;
?>