Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2013
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.60 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by deZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 1.1.5.0
  8. * @ Author : DeZender
  9. * @ Release on : 09.06.2012
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14.  
  15. class position {
  16. var $db = null;
  17. var $ypos = null;
  18. var $gpos = null;
  19. var $rpos = null;
  20. var $yhpos = null;
  21. var $bpos = null;
  22. var $wspos = null;
  23. var $options = null;
  24. var $lipos = null;
  25. var $competitor = null;
  26. protected $cols = null;
  27. protected $version = 1.39999999999999991118216;
  28. var $conf = null;
  29. var $liconf = null;
  30. protected $ln = null;
  31. var $date = null;
  32. var $licheck = null;
  33. var $excel = null;
  34. var $reg = null;
  35. var $queryList = null;
  36. var $allReg = false;
  37. var $gZone = false;
  38. var $queryid = array( );
  39. var $temppos = array( );
  40. var $count = array( );
  41.  
  42. function __construct($status = false) {
  43. $this->db = new db( );
  44. $this->ypos = new ypos( $this->db );
  45. $this->gpos = new gpos( $this->db );
  46. $this->rpos = new rpos( $this->db );
  47. $this->yhpos = new yhpos( $this->db );
  48. $this->bpos = new bpos( $this->db );
  49. $this->wspos = new wspos( $this->db );
  50. $this->options = new posoptions( $this->db );
  51. $this->competitor = new competitor( );
  52. $this->lipos = new lipos( $this->db );
  53. $this->conf = $this->getConf( );
  54. $this->ln = $this->check_ln( $status );
  55. $this->getCols( $status );
  56. $this->liconf = $this->getLiConf( );
  57. }
  58.  
  59. function BarPercent($req) {
  60. $stats = '';
  61.  
  62. if ($req == 0) {
  63. $stats = '<div class="percent0"></div>';
  64. }
  65.  
  66.  
  67. if (( 0 < $req && $req <= 25 )) {
  68. $stats = '<div class="percent1"></div>';
  69. }
  70.  
  71.  
  72. if (( 25 < $req && $req <= 50 )) {
  73. $stats = '<div class="percent2"></div>';
  74. }
  75.  
  76.  
  77. if (( 50 < $req && $req <= 75 )) {
  78. $stats = '<div class="percent3"></div>';
  79. }
  80.  
  81.  
  82. if (( 75 < $req && $req < 100 )) {
  83. $stats = '<div class="percent4"></div>';
  84. }
  85.  
  86.  
  87. if ($req == 100) {
  88. $stats = '<div class="percent5"></div>';
  89. }
  90.  
  91. return $stats;
  92. }
  93.  
  94. function getLiConf() {
  95. $res = array( );
  96. foreach ($this->cols as $key => $value) {
  97. switch ($value['name']) {
  98. case 'libpos': {
  99. array_push( $res, 'libpos' );
  100. break;
  101. }
  102.  
  103. case 'ligpos': {
  104. array_push( $res, 'ligpos' );
  105. break;
  106. }
  107.  
  108. case 'lirpos': {
  109. array_push( $res, 'lirpos' );
  110. break;
  111. }
  112.  
  113. case 'liyhpos': {
  114. array_push( $res, 'liyhpos' );
  115. break;
  116. }
  117.  
  118. case 'liypos': {
  119. array_push( $res, 'liypos' );
  120. }
  121. }
  122. }
  123.  
  124. return $res;
  125. }
  126.  
  127. function check_ln($status) {
  128. if ($status) {
  129. if (PHP_SAPI == 'cli') {
  130. $host = str_replace( '/pos_autoupdate.php', '', $_SERVER['SCRIPT_NAME'] );
  131. $host = explode( '/', $host );
  132. $host = $host[count( $host ) - 1];
  133.  
  134. if (!stristr( $host, '.' )) {
  135. $host = $host[count( $host ) - 2];
  136. }
  137.  
  138. $ip = gethostbyname( $host );
  139. $ln = strtoupper( md5( $host . $ip . 'a595029b6a289ddc2dd77140a435aa9a' ) );
  140. $ln = substr( $ln, 20, 5 ) . '-' . substr( $ln, 15, 5 ) . '-' . substr( $ln, 10, 5 ) . '-' . substr( $ln, 5, 5 ) . '-' . substr( $ln, 0, 5 );
  141.  
  142. if ($this->conf['license'] == $ln) {
  143. return true;
  144. }
  145.  
  146. return false;
  147. }
  148.  
  149. $host = preg_replace( '[^http:\/\/|^https:\/\/|www.]', '', getenv( 'HTTP_HOST' ) );
  150. $ip = gethostbyname( $host );
  151. $ln = strtoupper( md5( $host . $ip . 'a595029b6a289ddc2dd77140a435aa9a' ) );
  152. $ln = substr( $ln, 20, 5 ) . '-' . substr( $ln, 15, 5 ) . '-' . substr( $ln, 10, 5 ) . '-' . substr( $ln, 5, 5 ) . '-' . substr( $ln, 0, 5 );
  153.  
  154. if ($this->conf['license'] == $ln) {
  155. return true;
  156. }
  157.  
  158. return false;
  159. }
  160.  
  161.  
  162. if (empty( $this->conf['license'] )) {
  163. return false;
  164. }
  165.  
  166.  
  167. if (!isset( $_REQUEST['PHPSESSID'] )) {
  168. $phpsessid = str_replace( 'PHPSESSID=', '', $_SERVER['HTTP_COOKIE'] );
  169. } else {
  170. $phpsessid = $_REQUEST['PHPSESSID'];
  171. }
  172.  
  173.  
  174. if (!isset( $_SESSION[md5( '166' . $phpsessid )] )) {
  175. $ch = curl_init( );
  176. curl_setopt( $ch, CURLOPT_URL, 'http://users.site-control.ru/verify/' );
  177. curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
  178. curl_setopt( $ch, CURLOPT_TIMEOUT, 5 );
  179. curl_setopt( $ch, CURLOPT_POST, 1 );
  180. curl_setopt( $ch, CURLOPT_POSTFIELDS, array( 'host' => $_SERVER['HTTP_HOST'], 'ip' => $_SERVER['SERVER_ADDR'], 'module' => 166 ) );
  181. $data = curl_exec( $ch );
  182. curl_close( $ch );
  183.  
  184. if ($data !== false) {
  185. $data = json_decode( $data, true );
  186.  
  187. if (0 < count( $data )) {
  188. if (( !empty( $this->conf['license'] ) && trim( $data['key'] ) == trim( $this->conf['license'] ) )) {
  189. if ((double)$this->version <= (double)$data['version']) {
  190. $_SESSION[md5( '166' . $phpsessid )] = TRUE;
  191. return true;
  192. }
  193.  
  194. return false;
  195. }
  196.  
  197. return false;
  198. }
  199.  
  200. return false;
  201. }
  202.  
  203. $host = preg_replace( '[^http:\/\/|^https:\/\/|www.]', '', getenv( 'HTTP_HOST' ) );
  204. $ip = gethostbyname( $host );
  205. $ln = strtoupper( md5( $host . $ip . 'a595029b6a289ddc2dd77140a435aa9a' ) );
  206. $ln = substr( $ln, 20, 5 ) . '-' . substr( $ln, 15, 5 ) . '-' . substr( $ln, 10, 5 ) . '-' . substr( $ln, 5, 5 ) . '-' . substr( $ln, 0, 5 );
  207.  
  208. if ($this->conf['license'] == $ln) {
  209. return true;
  210. }
  211.  
  212. return false;
  213. }
  214.  
  215. return true;
  216. }
  217.  
  218. function delDomen($id) {
  219. $this->options->DelDomen( $id );
  220. }
  221.  
  222. function getCols($status, $group = false) {
  223. if ($status) {
  224. $group = 298;
  225. }
  226.  
  227.  
  228. if (( !$group && !$status )) {
  229. $group = $_SESSION['group'];
  230. }
  231.  
  232. $freeconf = array( 'gpos', 'ypos', 'update' );
  233.  
  234. if (( !empty( $group ) && !stristr( $group, ',' ) )) {
  235. $res = $this->db->query( 'SELECT `id`,`name`,`rank`,`value` FROM `' . DBPREFIX . 'pos_conf` WHERE `value`=\'true\' AND `group`=\'' . $group . '\' ORDER BY `rank`' );
  236. } else {
  237. $res = $this->db->query( 'SELECT * FROM `' . DBPREFIX . 'pos_conf` WHERE `value`=\'true\' AND (ISNULL(`group`) OR `group`=0) ORDER BY `rank`' );
  238. }
  239.  
  240. $cols = array( );
  241.  
  242. if ($row = $this->db->get_row( $res )) {
  243. if (!$this->ln) {
  244. if (in_array( $row['name'], $freeconf )) {
  245. $cols[$row['rank']] = array( 'id' => $row['id'], 'name' => $row['name'], 'value' => $row['value'] );
  246. }
  247. }
  248.  
  249. $cols[$row['rank']] = array( 'id' => $row['id'], 'name' => $row['name'], 'value' => $row['value'] );
  250. }
  251.  
  252. $this->cols = $cols;
  253. }
  254.  
  255. function getConf() {
  256. $res = $this->db->query( 'SELECT * FROM `' . DBPREFIX . 'pos_conf` WHERE `rank`=0 AND ISNULL(`group`)' );
  257. $conf = array( );
  258.  
  259. if ($row = $this->db->get_row( $res )) {
  260. $conf[$row['name']] = $row['value'];
  261. }
  262.  
  263. return $conf;
  264. }
  265.  
  266. function delGroup($id) {
  267. $this->db->query( 'DELETE FROM `' . DBPREFIX . 'pos_conf` WHERE `group`=' . $id );
  268. }
  269.  
  270. function check_geo($siteid, $qry) {
  271. if (!$this->ln) {
  272. return 0;
  273. }
  274.  
  275.  
  276. if (empty( $this->conf )) {
  277. $this->conf = $this->getConf( );
  278. }
  279.  
  280. $query = $this->options->getQueryById( $qry );
  281.  
  282. if ((int)$this->conf['proxy_ypos'] == 1) {
  283. $this->getProxy( 1 );
  284. $proxy = $this->conf['proxy'];
  285. $type_scan = 473;
  286. } else {
  287. $this->getProxy( 2 );
  288. $proxy = $this->conf['servers'];
  289. $type_scan = 472;
  290. }
  291.  
  292. $reg = array( '213', '54' );
  293.  
  294. if ((int)$this->conf['api_yp'] == 0) {
  295. $f = array( );
  296. foreach ($reg as $regid) {
  297. $geodp = $this->ypos->ypos_proxy( '', $query[0]['query'], 10, $regid, $proxy, $type_scan, $this->conf['antigate'], (int)$this->conf['ypos_sleep'], true, true );
  298.  
  299. if (0 < count( $geodp )) {
  300. $f[$regid] = '';
  301. foreach ($geodp as $node) {
  302. $regid;
  303. $f-> .= $node['url'];
  304. }
  305.  
  306. continue;
  307. }
  308. }
  309.  
  310.  
  311. if (( isset( $f[213] ) && isset( $f[54] ) )) {
  312. if ($f[213] == $f[54]) {
  313. $geodp = 472;
  314. } else {
  315. $geodp = 0 - 1;
  316. }
  317. } else {
  318. $geodp = 0 - 2;
  319. }
  320. } else {
  321. $f = array( );
  322. foreach ($reg as $regid) {
  323. $geodp = $this->ypos->ypos_xml( '', $query[0]['query'], 50, $regid, $proxy, $type_scan, true, true );
  324.  
  325. if (0 < count( $geodp )) {
  326. $f[$regid] = '';
  327. foreach ($geodp as $node) {
  328. $regid;
  329. $f-> .= $node['url'];
  330. }
  331.  
  332. continue;
  333. }
  334. }
  335.  
  336.  
  337. if (( isset( $f[213] ) && isset( $f[54] ) )) {
  338. if ($f[213] == $f[54]) {
  339. $geodp = 472;
  340. } else {
  341. $geodp = 0 - 1;
  342. }
  343. } else {
  344. $geodp = 0 - 2;
  345. }
  346. }
  347.  
  348. switch ($geodp) {
  349. case 0: {
  350. $this->options->updateValueGeoDep( $siteid, $qry, $geodp );
  351. '<td id="trgeodep_' . $qry . '" width="16" align="center" onclick="updateGeoDep(' . $siteid . ',' . $qry . ');"><div class="geo_no_dependent"></div></td>';
  352. }
  353.  
  354. case 0 - 1: {
  355. $this->options->updateValueGeoDep( $siteid, $qry, $geodp );
  356. '<td id="trgeodep_' . $qry . '" width="16" align="center" onclick="updateGeoDep(' . $siteid . ',' . $qry . ');"><div class="geo_dependent"></div></td>';
  357. }
  358.  
  359. case 0 - 2: {
  360. '<td id="trgeodep_' . $qry . '" width="16" align="center" onclick="updateGeoDep(' . $siteid . ',' . $qry . ');"><div class="geo_error"></div></td>';
  361. }
  362. }
  363.  
  364. return ;
  365. }
  366.  
  367. function ParsePostData($data) {
  368. $data = explode( '&', $data );
  369. $arr = array( );
  370. foreach ($data as $value) {
  371. $val = explode( '=', $value );
  372. $arr[$val[0]] = ($val[1] == 'on' ? 1 : urldecode( $val[1] ));
  373. }
  374.  
  375. return $arr;
  376. }
  377. ......................................................................
  378. ..............................
  379. ......
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement