Guest User

Untitled

a guest
Oct 29th, 2014
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 41.04 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by deZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Loader)
  6. *
  7. * @ Version : 2.0.0.3
  8. * @ Author : DeZender
  9. * @ Release on : 06.05.2013
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. function hex2bin($hexdata) {
  15.  
  16. $i = 0;
  17. while ($i < strlen($hexdata))
  18. {
  19. $bindata .= chr(hexdec(substr($hexdata, $i, 2)));
  20. $i += 2;
  21. continue;
  22. }
  23. return $bindata;
  24. }
  25.  
  26. function __autoload($classname) {
  27.  
  28. $tre = substr($classname, 0, 5);
  29. if ($tre == "vodo-")
  30. {
  31. $folder = DIR . "/hooks/";
  32. $folder1 = "../hooks/";
  33. }
  34. else
  35. {
  36. $folder = DIR . "/includes/";
  37. $folder1 = "../includes/";
  38. }
  39. if (file_exists($folder . $classname))
  40. {
  41. require_once $folder . $classname;
  42. return null;
  43. }
  44. if (file_exists($folder1 . $classname))
  45. {
  46. require_once $folder1 . $classname;
  47. return null;
  48. }
  49. $htmlerror = "<html dir=\"rtl\">\r
  50. \r
  51. <head>\r
  52. <meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1256\">\r
  53. <meta http-equiv=\"Content-Language\" content=\"ar-eg\">\r
  54. <title>(SYSTEM ERROR)</title>";
  55. die($htmlerror . "<B>ÎØà ÞÇÊá</B> : áÇ íãßä ÊÍãíá ÇáßáÇÓ <u>" . $folder . $classname . "<br /><b>ÇáÎØà Ýí ÇáÓØÑ</b>:" . 74 . "</HTML>");
  56. return;
  57. }
  58.  
  59. function setting() {
  60.  
  61. global $db;
  62. $Query = "SELECT * FROM " . TABLE_PREFIX . "setting";
  63. $result = $db->dbquery($Query);
  64. $r = $db->db_object($result);
  65. $output["sitename"] = iconv("utf-8", CHARSET, $r->sitename);
  66. $output["sitetitle"] = iconv("utf-8", CHARSET, $r->sitetitle);
  67. $output["siteemail"] = $r->siteemail;
  68. $output["metakeywords"] = iconv("utf-8", CHARSET, $r->metakeywords);
  69. $output["metadesc"] = iconv("utf-8", CHARSET, $r->metadesc);
  70. $output["closesite"] = $r->closesite;
  71. $output["siteclosemsg"] = $r->siteclosemsg;
  72. $output["siteclosemsg"] = iconv("utf-8", CHARSET, $r->siteclosemsg);
  73. $output["emailsactive"] = $r->emailsactive;
  74. $output["fileswhere"] = $r->fileswhere;
  75. $output["style"] = $r->style;
  76. $output["alluploads"] = $r->alluploads;
  77. $output["sitelogo"] = $r->sitelogo;
  78. $output["version"] = $r->version;
  79. $output["lang"] = $r->lang;
  80. $output["cpstyle"] = $r->cpstyle;
  81. $output["cronjobhash"] = $r->cronjobhash;
  82. $output["timezone"] = $r->timezone;
  83. $output["members_updated"] = $r->members_updated;
  84. return $output;
  85. }
  86.  
  87. function get_site_style() {
  88.  
  89. $setting = setting();
  90. if (!$_COOKIE["style"])
  91. {
  92. return $setting["style"];
  93. }
  94. return $_COOKIE["style"];
  95. }
  96.  
  97. function check_session() {
  98.  
  99. if (SAVELOGINDATA == "session")
  100. {
  101. return session_start();
  102. }
  103. return;
  104. }
  105.  
  106. function fetch_cookie($cookie) {
  107.  
  108. global $PHPSESSID;
  109. if (!empty($cookie))
  110. {
  111. $c = userdetails(intval($cookie));
  112. $cookie = base64_decode(COOKIE_PREFIX . $cookie . baz . fez . faz . femtolayerinc);
  113. $cookie = str_replace(COOKIE_PREFIX, "", $cookie);
  114. $cookie = str_replace("bazfezfazfemtolayerinc", "", $cookie);
  115. return $cookie;
  116. }
  117. return "";
  118. }
  119.  
  120. function userdetails($id) {
  121.  
  122. global $db;
  123. $Query = "SELECT * FROM " . TABLE_PREFIX . "users WHERE id='" . $id . "'";
  124. $result = $db->dbquery($Query);
  125. if ($db->dbrows($result) != "0")
  126. {
  127. $r = $db->db_object($result);
  128. $output["userid"] = $r->id;
  129. $output["admin"] = $r->admin;
  130. $output["username"] = xss_clean($r->username);
  131. $output["password"] = $r->password;
  132. $output["email"] = xss_clean($r->email);
  133. $output["country"] = $r->country;
  134. $output["ipaddress"] = $r->ipaddress;
  135. $output["usercode"] = $r->usercode;
  136. $output["dateline"] = $r->dateline;
  137. $output["active"] = $r->active;
  138. $output["lastlogin"] = $r->lastlogin;
  139. $output["membershipid"] = $r->membershipid;
  140. $output["membertype"] = $r->membertype;
  141. $output["signature"] = $r->signature;
  142. $output["mobile"] = $r->mobile;
  143. }
  144. else ;
  145. return $output;
  146. }
  147.  
  148. function check_user_active() {
  149.  
  150. global $errormsg;
  151. global $tmps;
  152. global $body;
  153. $userid = intval($_SESSION["valid_login"]);
  154. $user = userdetails($userid);
  155. if ($user["active"] != "0")
  156. {
  157. $errormsg = "ÚÝæÇ , áÇÈÏ ãä ÊÝÚíá ÇáÚÖæíÉ ÃæáÇ";
  158. $body .= $tmps->get_temponly("error");
  159. $tmps->getHtml("body");
  160. $tmps->getHtml("footer");
  161. exit();
  162. }
  163. return;
  164. }
  165.  
  166. function admindetails($id) {
  167.  
  168. global $db;
  169. $Query = "SELECT * FROM " . TABLE_PREFIX . "admins WHERE userid='" . $id . "'";
  170. $result = $db->dbquery($Query);
  171. if ($db->dbrows($result) != "0")
  172. {
  173. $r = $db->db_object($result);
  174. $output["access"] = $r->access;
  175. $output["usertitle"] = $r->usertitle;
  176. $output["hooks"] = xss_clean($r->hooks);
  177. $output["dateline"] = $r->dateline;
  178. }
  179. else ;
  180. return $output;
  181. }
  182.  
  183. function femtosetcookie($name, $value = "", $permanent = true, $allowsecure = true, $httponly = false) {
  184.  
  185. if (defined("NOCOOKIES"))
  186. {
  187. return null;
  188. }
  189. if ($permanent)
  190. {
  191. $expire = TIMENOW + 60 * 60 * 24 * 365;
  192. }
  193. else
  194. {
  195. $expire = 0;
  196. }
  197. $httponly = $httponly && (is_browser("ie") || is_browser("mac")) ? (false) : ($httponly);
  198. $secure = REQ_PROTOCOL === "https" || $allowsecure ? (true) : (false);
  199. $name = COOKIE_PREFIX . $name;
  200. $filename = "N/A";
  201. $linenum = 0;
  202. if (!headers_sent($filename, $linenum))
  203. {
  204. if (!($value === "") && $value === false)
  205. {
  206. global $_ENV;
  207. if (!($_SERVER["PATH_INFO"]) || $_ENV["PATH_INFO"])
  208. {
  209. {
  210. global $_ENV;
  211. }
  212. $scriptpath = $_SERVER["PATH_INFO"] ? ($_SERVER["PATH_INFO"]) : ($_ENV["PATH_INFO"]);
  213. }
  214. else
  215. {
  216. global $_ENV;
  217. if (!($_SERVER["REDIRECT_URL"]) || $_ENV["REDIRECT_URL"])
  218. {
  219. {
  220. global $_ENV;
  221. }
  222. $scriptpath = $_SERVER["REDIRECT_URL"] ? ($_SERVER["REDIRECT_URL"]) : ($_ENV["REDIRECT_URL"]);
  223. }
  224. else
  225. {
  226. {
  227. global $_ENV;
  228. }
  229. $scriptpath = $_SERVER["PHP_SELF"] ? ($_SERVER["PHP_SELF"]) : ($_ENV["PHP_SELF"]);
  230. }
  231. }
  232. $scriptpath = preg_replace(array("#/[^/]+\\.php\$#i", "#/(" . preg_quote($__config["config"]["cpfolder"], "#") . "|" . preg_quote($__config["config"]["cpfolder"], "#") . ")(/|\$)#i"), "", $scriptpath);
  233. $dirarray = explode("/", preg_replace("#/+\$#", "", $scriptpath));
  234. $alldirs = "";
  235. $havepath = false;
  236. if (!defined("SKIP_AGGRESSIVE_LOGOUT"))
  237. {
  238. foreach ($dirarray as $thisdir)
  239. {
  240. $alldirs .= '' . $thisdir;
  241. $havepath = true;
  242. if (!empty($thisdir))
  243. {
  244. femto_setcookie($name, $value, $expire, $alldirs, "", $secure, $httponly);
  245. }
  246. $alldirs .= "/";
  247. femto_setcookie($name, $value, $expire, $alldirs, "", $secure, $httponly);
  248. continue;
  249. }
  250. }
  251. if ($havepath == false)
  252. {
  253. femto_setcookie($name, $value, $expire, "", "", $secure, $httponly);
  254. return null;
  255. }
  256. }
  257. femto_setcookie($name, $value, $expire, "", "", $secure, $httponly);
  258. }
  259. return;
  260. }
  261.  
  262. function femto_setcookie($name, $value, $expires, $path = "", $domain = "", $secure = false, $httponly = false) {
  263.  
  264. if ($httponly || $value)
  265. {
  266. foreach (array(",", ";", " ", " ", "\r", "\n", "\v", "\f") as $bad_char)
  267. {
  268. if (!(!(strpos($name, $bad_char) !== false) && strpos($value, $bad_char) !== false))
  269. {
  270. continue;
  271. }
  272. return false;
  273. }
  274. $cookie = '' . "Set-Cookie: " . $name . "=" . urlencode($value);
  275. $cookie .= 0 < $expires ? ("; expires=" . gmdate("D, d-M-Y H:i:s", $expires) . " GMT") : "";
  276. $cookie .= $path ? ('' . "; path=" . $path) : "";
  277. $cookie .= $domain ? ('' . "; domain=" . $domain) : "";
  278. $cookie .= $secure ? "; secure" : "";
  279. $cookie .= $httponly ? "; HttpOnly" : "";
  280. header($cookie, false);
  281. return true;
  282. }
  283. return setcookie($name, $value, $expires, $path, $domain, $secure);
  284. }
  285.  
  286. function xss_clean($str) {
  287.  
  288. $str = preg_replace("/\\0+/", "", $str);
  289. $str = preg_replace("/(\\\\0)+/", "", $str);
  290. $str = preg_replace("# +#", " ", $str);
  291. $str = str_replace(array("<?php", "<?PHP", "<?", "?>"), array("&lt;?php", "&lt;?PHP", "&lt;?", "?&gt;"), $str);
  292. $words = array("javascript", "vbscript", "script", "applet", "alert", "document", "write", "cookie", "window");
  293. foreach ($words as $word)
  294. {
  295. $temp = "";
  296. $i = 0;
  297. while ($i < strlen($word))
  298. {
  299. $temp .= substr($word, $i, 1) . "\\s*";
  300. $i++;
  301. continue;
  302. }
  303. $temp = substr($temp, 0, 0 - 3);
  304. $str = preg_replace("#" . $temp . "#s", $word, $str);
  305. $str = preg_replace("#" . ucfirst($temp) . "#s", ucfirst($word), $str);
  306. continue;
  307. }
  308. $str = preg_replace("#<a.+?href=.*?(alert\\(|alert&\\#40;|javascript\\:|window\\.|document\\.|\\.cookie|<script|<xss).*?\\>.*?</a>#si", "", $str);
  309. $str = preg_replace("#<img.+?src=.*?(alert\\(|alert&\\#40;|javascript\\:|window\\.|document\\.|\\.cookie|<script|<xss).*?\\>#si", "", $str);
  310. $str = preg_replace("#<(script|xss).*?\\>#si", "", $str);
  311. $str = preg_replace("#</*(onblur|onchange|onclick|onfocus|onload|onmouseover|onmouseup|onmousedown|onselect|onsubmit|onunload|onkeypress|onkeydown|onkeyup|onresize)[^>]*>#iU", "\\1>", $str);
  312. $str = preg_replace("#<(/*\\s*)(alert|applet|basefont|base|behavior|bgsound|blink|body|expression|form|frameset|frame|head|html|ilayer|iframe|input|layer|link|meta|plaintext|style|script|textarea|title|xml|xss)([^>]*)>#is", "&lt;\\1\\2\\3&gt;", $str);
  313. $str = preg_replace("#(alert|cmd|passthru|eval|exec|system|fopen|fsockopen|file|file_get_contents|readfile|unlink)(\\s*)\\((.*?)\\)#si", "\\1\\2&#40;\\3&#41;", $str);
  314. $bad = array("document.cookie" => "", "document.write" => "", "window.location" => "", "javascript\\s*:" => "", "Redirect\\s+302" => "");
  315. foreach ($bad as $key => $val)
  316. {
  317. $str = preg_replace("#" . $key . "#i", $val, $str);
  318. continue;
  319. }
  320. $str = str_replace("<iframe", "", $str);
  321. $str = str_replace("</scr", "", $str);
  322. $str = str_replace("alert(", "", $str);
  323. return $str;
  324. }
  325.  
  326. function encode_password($password) {
  327.  
  328. $password = md5(base64_decode($password . femtolayer . m . gomaa . 2010 . 2014 . "adhammohamedgomaamohamedosman"));
  329. return $password;
  330. }
  331.  
  332. function is_browser($browser, $version = 0) {
  333.  
  334. static $is = null;
  335. if (!is_array($is))
  336. {
  337. $useragent = strtolower($_SERVER["HTTP_USER_AGENT"]);
  338. $is = array("opera" => 0, "ie" => 0, "mozilla" => 0, "firebird" => 0, "firefox" => 0, "camino" => 0, "konqueror" => 0, "safari" => 0, "webkit" => 0, "webtv" => 0, "netscape" => 0, "mac" => 0);
  339. if (strpos($useragent, "opera") !== false)
  340. {
  341. preg_match("#opera(/| )([0-9\\.]+)#", $useragent, $regs);
  342. $is["opera"] = $regs[2];
  343. }
  344. if (strpos($useragent, "msie ") !== false && !$is["opera"])
  345. {
  346. preg_match("#msie ([0-9\\.]+)#", $useragent, $regs);
  347. $is["ie"] = $regs[1];
  348. }
  349. if (strpos($useragent, "mac") !== false)
  350. {
  351. $is["mac"] = 1;
  352. }
  353. if (strpos($useragent, "applewebkit") !== false)
  354. {
  355. preg_match("#applewebkit/(\\d+)#", $useragent, $regs);
  356. $is["webkit"] = $regs[1];
  357. if (strpos($useragent, "safari") !== false)
  358. {
  359. preg_match("#safari/([0-9\\.]+)#", $useragent, $regs);
  360. $is["safari"] = $regs[1];
  361. }
  362. }
  363. if (strpos($useragent, "konqueror") !== false)
  364. {
  365. preg_match("#konqueror/([0-9\\.-]+)#", $useragent, $regs);
  366. $is["konqueror"] = $regs[1];
  367. }
  368. if (strpos($useragent, "gecko") !== false && !$is["safari"] && !$is["konqueror"])
  369. {
  370. preg_match("#gecko/(\\d+)#", $useragent, $regs);
  371. $is["mozilla"] = $regs[1];
  372. if (!(!(strpos($useragent, "firefox") !== false) && strpos($useragent, "firebird") !== false) && strpos($useragent, "phoenix") !== false)
  373. {
  374. preg_match("#(phoenix|firebird|firefox)( browser)?/([0-9\\.]+)#", $useragent, $regs);
  375. $is["firebird"] = $regs[3];
  376. if ($regs[1] == "firefox")
  377. {
  378. $is["firefox"] = $regs[3];
  379. }
  380. }
  381. if (!(strpos($useragent, "chimera") !== false) && strpos($useragent, "camino") !== false)
  382. {
  383. preg_match("#(chimera|camino)/([0-9\\.]+)#", $useragent, $regs);
  384. $is["camino"] = $regs[2];
  385. }
  386. }
  387. if (strpos($useragent, "webtv") !== false)
  388. {
  389. preg_match("#webtv/([0-9\\.]+)#", $useragent, $regs);
  390. $is["webtv"] = $regs[1];
  391. }
  392. if (preg_match("#mozilla/([1-4]{1})\\.([0-9]{2}|[1-8]{1})#", $useragent, $regs))
  393. {
  394. $is["netscape"] = '' . $regs[1] . "." . $regs[2];
  395. }
  396. }
  397. $browser = strtolower($browser);
  398. if (substr($browser, 0, 3) == "is_")
  399. {
  400. $browser = substr($browser, 3);
  401. }
  402. if ($is['' . $browser])
  403. {
  404. if ($version)
  405. {
  406. if ($version <= $is['' . $browser])
  407. {
  408. return $is['' . $browser];
  409. }
  410. }
  411. return $is['' . $browser];
  412. }
  413. return 0;
  414. }
  415.  
  416. function mail_setting() {
  417.  
  418. global $db;
  419. $S = $db->dbquery("SELECT * FROM " . TABLE_PREFIX . "mailsetting Limit 1");
  420. $r = $db->db_object($S);
  421. $msetting["mail_type"] = $r->mail_type;
  422. $msetting["utf8_encode"] = $r->utf8_encode;
  423. $msetting["html_xml"] = $r->html_xml;
  424. $msetting["mbstringactive"] = $r->mbstringactive;
  425. $msetting["messageid"] = $r->messageid;
  426. $msetting["fromheaders"] = $r->fromheaders;
  427. $msetting["cc_mail"] = $r->cc_mail;
  428. $msetting["bcc_mail"] = $r->bcc_mail;
  429. $msetting["smtp_yes"] = $r->smtp_yes;
  430. $msetting["smtp_server"] = $r->smtp_server;
  431. $msetting["smtp_port"] = $r->smtp_port;
  432. $msetting["smtp_account"] = $r->smtp_account;
  433. $msetting["smtp_password"] = $r->smtp_password;
  434. $msetting["smtp_tls"] = $r->smtp_tls;
  435. return $msetting;
  436. }
  437.  
  438. function vodoemail($title, $to, $msg) {
  439.  
  440. global $sitename;
  441. global $date;
  442. global $rbills;
  443. global $rusera;
  444. global $setting;
  445. global $style;
  446. global $text;
  447. $email = $to;
  448. $setting = setting();
  449. $mailsetting = mail_setting();
  450. if (file_exists(DIR . "/includes/class__email.php"))
  451. {
  452. require_once DIR . "/includes/class__email.php";
  453. }
  454. else
  455. {
  456. require_once "../includes/class__email.php";
  457. }
  458. $mail = new PHPMailer();
  459. if ($setting["emailsactive"] == "0")
  460. {
  461. if ($mailsetting["smtp_yes"] == "1")
  462. {
  463. if ($mailsetting["html_xml"] == "HTML")
  464. {
  465. $mail->IsHTML("true");
  466. }
  467. $mail->CharSet = $mailsetting["utf8_encode"];
  468. $mail->From = $setting["siteemail"];
  469. $mail->FromName = $setting["sitename"];
  470. $mail->AddAddress($to);
  471. $mail->Encoding = $mailsetting["mbstringactive"];
  472. $mail->Subject = $title;
  473. $mail->Body = "<div align=right>" . $msg . "</div>";
  474. $mail->WordWrap = 50;
  475. $mail->Send();
  476. return null;
  477. }
  478. $mail->IsSMTP();
  479. $mail->Host = $mailsetting["smtp_server"];
  480. $mail->Port = $mailsetting["smtp_port"];
  481. $mail->Username = $mailsetting["smtp_account"];
  482. $mail->Password = $mailsetting["smtp_password"];
  483. $mail->From = $setting["siteemail"];
  484. $mail->FromName = $setting["sitename"];
  485. $mail->AddAddress($to);
  486. $mail->Subject = $title;
  487. $mail->Body = "<div align=right>" . $msg . "</div>";
  488. $mail->Send();
  489. }
  490. return;
  491. }
  492.  
  493. function when($expression, $returntrue, $returnfalse = "") {
  494.  
  495. return $expression ? ($returntrue) : ($returnfalse);
  496. }
  497.  
  498. function bgclass() {
  499.  
  500. global $bgcounter;
  501. return $bgcounter++ % 2 == 0 ? "odd" : "row";
  502. }
  503.  
  504. function gallery_setting() {
  505.  
  506. global $db;
  507. $S = $db->dbquery("SELECT * FROM " . TABLE_PREFIX . "setting_gallery");
  508. $r = $db->dbarray($S);
  509. $output["close"] = $r["close"];
  510. $output["guestview"] = $r["guestview"];
  511. $output["comments"] = $r["comments"];
  512. $output["guestcomment"] = $r["guestcomment"];
  513. $output["rates"] = $r["rates"];
  514. $output["guestrate"] = $r["guestrate"];
  515. $output["maxwidth"] = $r["maxwidth"];
  516. $output["maxheight"] = $r["maxheight"];
  517. $output["catstatics"] = $r["catstatics"];
  518. $output["facebook"] = $r["facebook"];
  519. $output["sendfriend"] = $r["sendfriend"];
  520. return $output;
  521. }
  522.  
  523. function check_no($param) {
  524.  
  525. if (ereg('' . "^[0-9]*\$", $param))
  526. {
  527. return true;
  528. }
  529. return;
  530. }
  531.  
  532. function format_no($numberf) {
  533.  
  534. $mx = floor(strlen($numberf) / 3);
  535. $sx2 = floor(strlen($numberf) % 3);
  536. $sx = "";
  537. $ix = 0;
  538. $vx = 0;
  539. $len = strlen($numberf);
  540. if (0 < $sx2 && 3 < $len)
  541. {
  542. $sx .= substr($numberf, 0, $sx2) . ",";
  543. $mx--;
  544. if ($mx == 0)
  545. {
  546. $sx .= substr($numberf, 1, 3);
  547. $zx = 1;
  548. }
  549. $ix = 1;
  550. $vx = 1;
  551. }
  552. while (0 < $mx && 3 < $len)
  553. {
  554. $zx = 1;
  555. if ($vx == 0 && $mx == 1)
  556. {
  557. $sx .= substr($numberf, $sx2, 3);
  558. }
  559. else
  560. {
  561. $sx .= substr($numberf, $sx2, 3) . ",";
  562. }
  563. $mx--;
  564. if ($vx == 0)
  565. {
  566. $ix++;
  567. $sx2 = $ix * 3;
  568. }
  569. else
  570. {
  571. $sx2 = $ix * 3;
  572. $ix++;
  573. }
  574. if (!($mx == 0))
  575. {
  576. continue;
  577. }
  578. $sx .= substr($numberf, $sx2, 3);
  579. continue;
  580. }
  581. if ($zx == 0)
  582. {
  583. return $numberf;
  584. }
  585. return $sx;
  586. }
  587.  
  588. function sec2hms($sec, $padHours = false) {
  589.  
  590. $hms = "";
  591. $hours = intval(intval($sec) / 3600);
  592. $hms .= $padHours ? (str_pad($hours, 2, "00", STR_PAD_LEFT) . ":") : ($hours . ":");
  593. $minutes = intval($sec / 60 % 60);
  594. $hms .= str_pad($minutes, 2, "0", STR_PAD_LEFT) . ":";
  595. $seconds = intval($sec % 60);
  596. $hms .= str_pad($seconds, 2, "0", STR_PAD_LEFT);
  597. return $hms;
  598. }
  599.  
  600. function format_currency($amount) {
  601.  
  602. $amount += 0.000001;
  603. $amount = round($amount, 2);
  604. $amount = sprintf("%01.2f", $amount);
  605. return $amount;
  606. }
  607.  
  608. function format_links($str) {
  609.  
  610. $link = @ereg_replace("((http|https|ftp):\\/\\/)(([-_a-zA-Z1-9]+)\\.)+([-_a-zA-Z1-9]{2,3})((/([-_a-zA-Z0-9\\.\\/\\?\\=\\%\\&\\;]+)?)?)", "<a href=\"\\0\" target=\"\\_blank\">\\0</a>", $str);
  611. $link = str_replace("([_\\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\\.)+[a-z]{2,3})", "<a href=\"mailto:\\1\">\\1</a>", $str);
  612. return $link;
  613. }
  614.  
  615. function pages_maker($rows, $limit, $link, $marq = false) {
  616.  
  617. global $html;
  618. if ($marq)
  619. {
  620. $mark = "?";
  621. }
  622. else
  623. {
  624. $mark = "&";
  625. }
  626. if ($rows != "0")
  627. {
  628. $recored = $_GET[pg] + 1;
  629. $tpages = intval($rows / $limit);
  630. if ($rows % $limit)
  631. {
  632. $tpages++;
  633. }
  634. if ($tpages != 1)
  635. {
  636. $o = 1;
  637. while ($o <= $tpages)
  638. {
  639. $newpage = $limit * ($o - 1);
  640. $thispage = $o;
  641. $o++;
  642. continue;
  643. }
  644. if ($_GET[pg] != 0)
  645. {
  646. $width = "60%";
  647. }
  648. else
  649. {
  650. $width = "40%";
  651. }
  652. $pages .= "
  653. <div align='center'>\r
  654. <table border='0' id='table1' cellpadding='0' class='td_border'>\r
  655. <tr>\r
  656. <td height='22'>\r
  657. <p align='center'>" . _PAGES . ('' . " : <span lang='en-us'>" . $tpages . "</span></td>");
  658. if ($_GET[pg] != 0)
  659. {
  660. $first = 0;
  661. $pages .= "\r
  662. <td width='100' class='odd' align='center'><a href='" . $link . $markpg . ('' . "=" . $first . "'> <b>") . _FIRST_PAGE . "</b></a></td>";
  663. }
  664. if ($_GET[pg] != 0)
  665. {
  666. $prev = $_GET[pg] - $limit;
  667. $pages .= "\r
  668. <td width='100' class='td_over' align='center'><a href='" . $link . $markpg . ('' . "pg=" . $prev . "'>") . _PREV . "</a></td>";
  669. }
  670. if (!($_GET[pg] / $limit + 1 < $tpages) && $tpages != 1)
  671. {
  672. $next = $_GET[pg] + $limit;
  673. $pages .= "\r
  674. <td width='100' class='td_over' align='center'><a href='" . $link . $markpg . ('' . "pg=" . $next . "'>") . _NEXT . "</a></td>";
  675. $pages .= "\r
  676. <td width='100' class='odd' align='center'><a href='" . $link . $markpg . ('' . "pg=" . $newpage . "'> <b>") . _LAST_PAGE . "</b></a></td>";
  677. }
  678. return $pages . "</tr>\r
  679. </table>\r
  680. </div>";
  681. }
  682. }
  683. return;
  684. }
  685.  
  686. function pages_maker2($rows, $limit, $link, $marq = false) {
  687.  
  688. global $html;
  689. if ($marq)
  690. {
  691. $mark = "?";
  692. }
  693. else
  694. {
  695. $mark = "&";
  696. }
  697. if ($rows != "0")
  698. {
  699. $recored = $_GET[pg] + 1;
  700. $tpages = intval($rows / $limit);
  701. if ($rows % $limit)
  702. {
  703. $tpages++;
  704. }
  705. if ($tpages != 1)
  706. {
  707. $o = 1;
  708. while ($o <= $tpages)
  709. {
  710. $newpage = $limit * ($o - 1);
  711. $thispage = $o;
  712. $o++;
  713. continue;
  714. }
  715. if ($_GET[pg] != 0)
  716. {
  717. $width = "60%";
  718. }
  719. else
  720. {
  721. $width = "40%";
  722. }
  723. $pages .= '' . "
  724. <br><div align='center'>\r
  725. <table border='0' cellpadding='0' class='td_border curved' width=500 dir=rtl>\r
  726. <tr>\r
  727. <td height='19'>\r
  728. <center>ÇáÕÝÍÇÊ : <span lang='en-us'>" . $tpages . "</span></td>";
  729. if ($_GET[pg] != 0)
  730. {
  731. $first = 0;
  732. $pages .= "\r
  733. <td width='100' class='odd' align='center'>«<a href='" . $link . ('' . "/pg/" . $first . "'> <b>ÇáÃæáì</b></a></td>");
  734. }
  735. if ($_GET[pg] != 0)
  736. {
  737. $prev = $_GET[pg] - $limit;
  738. $pages .= "\r
  739. <td width='100' class='td_over' align='center'>«<a href='" . $link . ('' . "/pg/" . $prev . "'> ÇáÓÇÈÞ</a></td>");
  740. }
  741. if (!($_GET[pg] / $limit + 1 < $tpages) && $tpages != 1)
  742. {
  743. $next = $_GET[pg] + $limit;
  744. $pages .= "\r
  745. <td width='100' class='td_over' align='center'>»<a href='" . $link . ('' . "/pg/" . $next . "'>ÇáÊÇáí</a></td>");
  746. $pages .= "\r
  747. <td width='100' class='odd' align='center'><a href='" . $link . $markpg . ('' . "/pg/" . $newpage . "'> <b>ÇáÃÎíÑÉ</b></a>»</td>");
  748. }
  749. return $pages . "</tr>\r
  750. </table>\r
  751. </div><div class=clear></div>";
  752. }
  753. }
  754. return;
  755. }
  756.  
  757. function pages_maker_ref($rows, $limit, $link, $marq = false) {
  758.  
  759. global $html;
  760. if ($marq)
  761. {
  762. $mark = "?";
  763. }
  764. else
  765. {
  766. $mark = "&";
  767. }
  768. if ($rows != "0")
  769. {
  770. $recored = $_GET[pg] + 1;
  771. $tpages = intval($rows / $limit);
  772. if ($rows % $limit)
  773. {
  774. $tpages++;
  775. }
  776. if ($tpages != 1)
  777. {
  778. $o = 1;
  779. while ($o <= $tpages)
  780. {
  781. $newpage = $limit * ($o - 1);
  782. $thispage = $o;
  783. $o++;
  784. continue;
  785. }
  786. if ($_GET[pg] != 0)
  787. {
  788. $width = "60%";
  789. }
  790. else
  791. {
  792. $width = "40%";
  793. }
  794. $pages .= '' . "
  795. <div align='center'>\r
  796. <table border='0' id='table1' cellpadding='0' class='td_border'>\r
  797. <tr>\r
  798. <td height='22'>\r
  799. <p align='center'>ÚÏÏ ÇáÕÝÍÇÊ : <span lang='en-us'>" . $tpages . "</span></td>";
  800. if ($_GET[pg] != 0)
  801. {
  802. $first = 0;
  803. $pages .= "\r
  804. <td width='100' class='odd' align='center'><a href='" . $link . $markpg . ('' . "=" . $first . "'>« <b>ÇáÃæáì</b></a></td>");
  805. }
  806. if ($_GET[pg] != 0)
  807. {
  808. $prev = $_GET[pg] - $limit;
  809. $pages .= "\r
  810. <td width='100' class='td_over' align='center'><a href='" . $link . $markpg . ('' . "pg=" . $prev . "'>ÇáÓÇÈÞ</a></td>");
  811. }
  812. if (!($_GET[pg] / $limit + 1 < $tpages) && $tpages != 1)
  813. {
  814. $next = $_GET[pg] + $limit;
  815. $reflink = $link . $markpg . ('' . "pg=" . $next);
  816. $pages .= "\r
  817. <td width='100' class='td_over' align='center'><a href='" . $link . $markpg . ('' . "pg=" . $next . "'>ÇáÊÇáí</a></td>");
  818. $pages .= "\r
  819. <td width='100' class='odd' align='center'><a href='" . $link . $markpg . ('' . "pg=" . $newpage . "'>» <b>ÇáÃÎíÑÉ</b></a></td>");
  820. return '' . "\r
  821. <script>\r
  822. \$(\"html, body\").animate({ scrollTop: \$(document).height() }, \"slow\");\r
  823. </script>\r
  824. <span style='color:blue; padding:5px;'><img src='images/smallloading.gif' border=0> ÌÇÑí ÅÑÓÇá ÏÝÚÉ ÃÎÑì (" . format_no($next + $limit) . " / " . format_no($rows) . ('' . ")....</span>\r
  825. <meta http-equiv='refresh' content=5;URL='" . $reflink . "'>");
  826. }
  827. }
  828. }
  829. return;
  830. }
  831.  
  832. function fetch_loginbox($url = false) {
  833.  
  834. @extract($GLOBALS);
  835. global $loginbox;
  836. global $username;
  837. global $userid;
  838. global $numoffolders;
  839. global $numoffiles;
  840. global $sure;
  841. $sure = "return confirm('åá ÃäÊ æÇËÞ ãä ÇáÎÑæÌ¿')";
  842. if (!$_SESSION["valid_login"])
  843. {
  844. $loginbox = "
  845. <form action=\"hooks.php?called=members&do=login\" method=post>
  846. ";
  847. $loginbox .= '' . "<input type=\"hidden\" name=\"url\" value=\"" . $url . "\">
  848. ";
  849. $loginbox .= $tmps->get_temponly("loginbox");
  850. $loginbox .= "
  851. </form>";
  852. return null;
  853. }
  854. $userD = userdetails($_SESSION["valid_login"]);
  855. $username = $userD["username"];
  856. $userid = intval($userD["userid"]);
  857. $Sups = $db->dbquery("SELECT * FROM " . TABLE_PREFIX . "uploads WHERE userid='" . $userid . "'");
  858. $numoffiles = format_no($db->dbrows($Sups));
  859. $db->dbclose($Sups);
  860. $Sfolders = $db->dbquery("SELECT * FROM " . TABLE_PREFIX . "uploadfolders WHERE userid='" . $userid . "'");
  861. $numoffolders = format_no($db->dbrows($Sfolders));
  862. $db->dbclose($Sfolders);
  863. if ($userD["active"] == "0")
  864. {
  865. $loginbox = $tmps->get_temponly("welcomebox");
  866. return null;
  867. }
  868. $loginbox = "
  869. <form action=\"activemembership\" method=post>
  870. ";
  871. $loginbox .= '' . "<input type=\"hidden\" name=\"url\" value=\"" . $url . "\">
  872. ";
  873. $loginbox .= "<b>ßæÏ ÇáÊÝÚíá</b>:<br />&nbsp;ãä ÝÖáß ÖÚ ßæÏ ÇáÊÝÚíá ÇáÐí æÕáß Úáì ÈÑíÏß ÇáÅáßÊÑæäí<br />";
  874. $loginbox .= "<input type='text' name='usercode' size=20><br />";
  875. $loginbox .= "
  876. <input type='submit' value='ÊÝÚíá' class=submit>";
  877. $loginbox .= "
  878. <input type='button' onClick=\"location.href='resendcode'\" class=submit value='ÃÑÓá áí ÇáßæÏ '>";
  879. $loginbox .= "
  880. </form>";
  881. return;
  882. }
  883.  
  884. function gallery_tools($id, $title = false) {
  885.  
  886. global $db;
  887. global $REQUEST_URI;
  888. global $RA;
  889. global $__config;
  890. $id = intval($id);
  891. $id = xss_clean($id);
  892. $setting = setting();
  893. $G = gallery_setting();
  894. $url = $__config["config"]["siteurl"] . ('' . "/hooks.php?called=gallery&id=" . $id);
  895. $start = "
  896. <div align=center><table border=0 width=100% cellspacing=2><tr><td>";
  897. $end = "</td></tr></table></div>";
  898. $FB_link = "http://www.facebook.com/sharer.php?u=" . $url . "&title=" . urlencode($title);
  899. $download = "<a onclick=\"getdownloads('ajax.php?cat=gallery&do=downloads&id=" . $id . "')\" title=\"ÍÝÙ ÇáÕæÑÉ\" href=\"images.php?cat=gallery&id=" . $id . "\"><img src=\"styles/" . $setting[style] . "/images/icons/download.gif\" border=0></a>";
  900. if ($G["facebook"] == "0")
  901. {
  902. $facebook = "&nbsp;<a onclick=\"getfacebook('ajax.php?cat=gallery&do=facebook&id=" . $id . "');javascript:popUp('" . $FB_link . "')\" style=\"cursor:pointer\" title=\"ãÔÇÑßÉ Úáì Facebook\"><img src=\"styles/" . $setting[style] . "/images/icons/facebook.gif\" border=0></a>";
  903. }
  904. else
  905. {
  906. $facebook = "";
  907. }
  908. $view = "&nbsp;<a title=\"ãÔÇåÏÉ ÇáÊÝÇÕíá\" href=\"hooks.php?called=gallery&id=" . $id . "\"><img src=\"styles/" . $setting[style] . "/images/icons/view.gif\" border=0></a>";
  909. if ($G["sendfriend"] == "0")
  910. {
  911. $send = "&nbsp;<a title=\"ÃÑÓá áÕÏíÞ\" href=\"javascript:sendfriend('hooks.php?called=gallery&do=send&id=" . $id . "')\"><img src=\"styles/" . $setting[style] . "/images/icons/sendfriend.gif\" border=0></a>";
  912. }
  913. else
  914. {
  915. $send = "";
  916. }
  917. if (USERID != "0" && USERID != "")
  918. {
  919. $output = $download . $view . $rate . $facebook . $send;
  920. }
  921. else
  922. {
  923. $output = $download;
  924. if ($G["guestview"] == "0")
  925. {
  926. $output .= $view;
  927. }
  928. if ($G["guestrate"] == "0")
  929. {
  930. $output .= $rate;
  931. }
  932. $output .= $facebook . $send;
  933. }
  934. return $start . $output . $end;
  935. }
  936.  
  937. function headers_nocach() {
  938.  
  939. @header("Cache-Control: no-cache, must-revalidate");
  940. @header("Expires: " . gmdate("D, d M Y H:i:s") . " GMT");
  941. return;
  942. }
  943.  
  944. function fl_header_ref($url) {
  945.  
  946. if (@header("Location: " . $url))
  947. {
  948. @header("Location: " . $url);
  949. return null;
  950. }
  951. echo "<script>location.href='" . $url . "'</script>";
  952. return;
  953. }
  954.  
  955. function fl_valid_email($email) {
  956.  
  957. return preg_match("#^[a-z0-9.!\\#\$%&'*+-/=?^_`{|}~]+@([0-9.]+|([^\\s'\"<>]+\\.+[a-z]{2,6}))\$#si", $email);
  958. }
  959.  
  960. function market_setting() {
  961.  
  962. global $db;
  963. $S = $db->dbquery("SELECT * FROM " . TABLE_PREFIX . "setting_market");
  964. $r = $db->dbarray($S);
  965. $output["close"] = $r["close"];
  966. $output["guestsoffer"] = $r["guestsoffer"];
  967. $output["guestsrequest"] = $r["guestsrequest"];
  968. $output["reqadmin1"] = $r["reqadmin1"];
  969. $output["reqadmin2"] = $r["reqadmin2"];
  970. $output["buy_sell"] = $r["buy_sell"];
  971. $output["docyes"] = $r["docyes"];
  972. $output["youtube"] = $r["youtube"];
  973. $output["picscount"] = $r["picscount"];
  974. $output["vendordetails"] = $r["vendordetails"];
  975. $output["clientdetails"] = $r["clientdetails"];
  976. return $output;
  977. }
  978.  
  979. function check_close() {
  980.  
  981. global $tmps;
  982. global $sitemsg;
  983. global $body;
  984. global $navbar;
  985. global $pagetitle;
  986. $setting = setting();
  987. if ($setting["closesite"] == "1")
  988. {
  989. $navbar = str_replace("{style}", $setting[style], HOUSEIMG) . " <a href='index.php'>ÇáÑÆíÓíÉ</a> ";
  990. $navbar .= str_replace("{style}", $setting[style], NAVIMG) . " ÇáãæÞÚ ãÛáÞ ãÄÞÊÇ ";
  991. $pagetitle = "ãÛáÞ";
  992. $tmps->getHtml("header");
  993. $sitemsg = nl2br($setting["siteclosemsg"]);
  994. $body = $tmps->get_temponly("msg");
  995. $tmps->getHtml("body");
  996. $tmps->getHtml("footer");
  997. exit();
  998. }
  999. return;
  1000. }
  1001.  
  1002. function upload_setting() {
  1003.  
  1004. global $db;
  1005. $S = $db->dbquery("SELECT * FROM " . TABLE_PREFIX . "setting_uploads Limit 1");
  1006. $r = $db->dbarray($S);
  1007. $output["close"] = $r["browsepics"];
  1008. $output["urlcopy"] = $r["urlcopy"];
  1009. $output["exts"] = $r["exts"];
  1010. $output["guestsup"] = $r["guestsup"];
  1011. $output["overlineword"] = $r["overlineword"];
  1012. $output["maxsize1"] = $r["maxsize1"];
  1013. $output["maxsize2"] = $r["maxsize2"];
  1014. $output["typesblock"] = $r["typesblock"];
  1015. $output["extsblock"] = $r["extsblock"];
  1016. $output["facebook"] = $r["facebook"];
  1017. $output["userfolders"] = $r["userfolders"];
  1018. $output["cpa"] = $r["cpa"];
  1019. return $output;
  1020. }
  1021.  
  1022. function Auto_update($url, $c) {
  1023.  
  1024. echo "<s";
  1025. echo "cript type=\"text/javascript\">\r
  1026. function Ajax(){\r
  1027. var xmlHttp;\r
  1028. try{ \r
  1029. xmlHttp=new XMLHttpRequest();// Firefox, Opera 8.0+, Safari\r
  1030. }\r
  1031. catch (e){\r
  1032. try{\r
  1033. xmlHttp=new ActiveXObject(\"Msxml2.XMLHTTP\"); // Internet Explorer\r
  1034. }\r
  1035. catch (e){\r
  1036. try{\r
  1037. xmlHttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\r
  1038. }\r
  1039. catch (e){\r
  1040. alert(\"No AJAX!?\");\r
  1041. return false;\r
  1042. }\r
  1043. }\r
  1044. }\r
  1045. \r
  1046. xmlHt";
  1047. echo "tp.onreadystatechange=function(){\r
  1048. if(xmlHttp.readyState==4){\r
  1049. document.getElementById('ReloadThis').innerHTML=xmlHttp.responseText;\r
  1050. setTimeout('Ajax()',";
  1051. echo $c;
  1052. echo ");\r
  1053. }\r
  1054. }\r
  1055. xmlHttp.open(\"GET\",\"";
  1056. echo $url;
  1057. echo "\",true);\r
  1058. xmlHttp.send(null);\r
  1059. }\r
  1060. \r
  1061. window.onload=function(){\r
  1062. setTimeout('Ajax()',";
  1063. echo $c;
  1064. echo ");\r
  1065. }\r
  1066. </script>\r
  1067. \r
  1068. \r
  1069. </body>\r
  1070. </html>\r
  1071. ";
  1072. return;
  1073. }
  1074.  
  1075. function rewrite_image($id) {
  1076.  
  1077. global $db;
  1078. $id = intval($id);
  1079. $id = xss_clean($id);
  1080. $S = $db->dbquery("SELECT * FROM " . TABLE_PREFIX . ('' . "uploads WHERE id='" . $id . "' Limit 1"));
  1081. $r = $db->dbarray($S);
  1082. if ($r[picdata] == "")
  1083. {
  1084. if (!(!(!($r[pictype] == "image/jpeg") && $r[pictype] == "image/jpg") && $r[pictype] == "image/gif") && $r[pictype] == "image/png")
  1085. {
  1086. $path = "t" . $id . xss_clean($r[picname]);
  1087. }
  1088. else
  1089. {
  1090. $path = "u" . $id . xss_clean($r[picname]);
  1091. }
  1092. }
  1093. else
  1094. {
  1095. $path = "u" . $id . xss_clean($r[picname]);
  1096. }
  1097. return $path;
  1098. }
  1099.  
  1100. function check_user_session($url) {
  1101.  
  1102. global $tmps;
  1103. global $pagetitle;
  1104. global $body;
  1105. global $navbar;
  1106. $setting = setting();
  1107. $userid = intval($_SESSION["valid_login"]);
  1108. if (!($userid == "") && $userid == "0")
  1109. {
  1110. $pagetitle = "ÊÓÌíá ÏÎæá";
  1111. $tmps->getHtml("header");
  1112. $navbar = str_replace("{style}", $setting[style], HOUSEIMG) . " <a href='index.php'>ÇáÑÆíÓíÉ</a> ";
  1113. $navbar .= str_replace("{style}", $setting[style], NAVIMG) . " ÊÓÌíá ÏÎæá";
  1114. $body = "
  1115. <form action=\"hooks.php?called=members&do=login\" method=post>
  1116. ";
  1117. $body .= '' . "<input type=\"hidden\" name=\"url\" value=\"" . $url . "\">
  1118. ";
  1119. $body .= $tmps->get_temponly("loginbox");
  1120. $body .= "
  1121. </form>";
  1122. $tmps->getHtml("body");
  1123. $tmps->getHtml("footer");
  1124. exit();
  1125. }
  1126. return;
  1127. }
  1128.  
  1129. function psp_setting() {
  1130.  
  1131. global $db;
  1132. $S = $db->dbquery("SELECT * FROM " . TABLE_PREFIX . "setting_psp Limit 1");
  1133. $r = $db->dbarray($S);
  1134. $output["close"] = $r["close"];
  1135. $output["download"] = $r["guestsdownload"];
  1136. $output["comment"] = $r["guestscomment"];
  1137. $output["rate"] = $r["guestsrate"];
  1138. $output["friend"] = $r["guestsfriend"];
  1139. $output["facebook"] = $r["facebook"];
  1140. $output["torrent"] = $r["gueststorrent"];
  1141. $output["showdetails"] = $r["guestsshowdetails"];
  1142. return $output;
  1143. }
  1144.  
  1145. function videos_setting() {
  1146.  
  1147. global $db;
  1148. $S = $db->dbquery("SELECT * FROM " . TABLE_PREFIX . "setting_video");
  1149. $r = $db->dbarray($S);
  1150. $output["close"] = $r["close"];
  1151. $output["guestview"] = $r["guestview"];
  1152. $output["facebook"] = $r["facebook"];
  1153. $output["votes"] = $r["votes"];
  1154. $output["themecolor"] = $r["themecolor"];
  1155. $output["fullscreen"] = $r["fullscreen"];
  1156. $output["autostart"] = $r["autostart"];
  1157. $output["playerheight"] = $r["playerheight"];
  1158. $output["playerwidth"] = $r["playerwidth"];
  1159. $output["volume"] = $r["volume"];
  1160. $output["txtcolor"] = $r["txtcolor"];
  1161. $output["scrollcolor"] = $r["scrollcolor"];
  1162. $output["videologo"] = $r["videologo"];
  1163. return $output;
  1164. }
  1165.  
  1166. function _ago($tm, $rcs = 0) {
  1167.  
  1168. $cur_tm = time();
  1169. $dif = $cur_tm - $tm;
  1170. $pds = array(_SEC, _MIN, _HRS, _DAYS, _WEEKS, _MONTHS, _YEARS, "decade");
  1171. $lngh = array(1, 60, 3600, 86400, 604800, 2630880, 31570560, 315705600);
  1172. $v = sizeof($lngh) - 1;
  1173. while (0 <= $v && ($no = $dif / $lngh[$v]) <= 1)
  1174. {
  1175. $v--;
  1176. continue;
  1177. }
  1178. if ($v < 0)
  1179. {
  1180. $v = 0;
  1181. }
  1182. $_tm = $cur_tm - $dif % $lngh[$v];
  1183. $no = floor($no);
  1184. if ($no != 1)
  1185. {
  1186. $pds[$v] .= "";
  1187. }
  1188. $x = sprintf("%d %s ", $no, $pds[$v]);
  1189. if ($rcs == 1 && 1 <= $v && 0 < $cur_tm - $_tm)
  1190. {
  1191. $x .= time_ago($_tm);
  1192. }
  1193. return $x;
  1194. }
  1195.  
  1196. function arcades_setting() {
  1197.  
  1198. global $db;
  1199. $S = $db->dbquery("SELECT * FROM " . TABLE_PREFIX . "setting_arcades");
  1200. $r = $db->dbarray($S);
  1201. $output["close"] = $r["close"];
  1202. $output["facebook"] = $r["facebook"];
  1203. $output["rates"] = $r["rates"];
  1204. $output["welcomemsg"] = $r["welcomemsg"];
  1205. $output["statics"] = $r["statics"];
  1206. $output["favlist"] = $r["favlist"];
  1207. return $output;
  1208. }
  1209.  
  1210. function fetch_arcade_byname($name) {
  1211.  
  1212. global $db;
  1213. $name = strip_tags($name);
  1214. $name = xss_clean($name);
  1215. $filename = $name . "swf";
  1216. $S = $db->dbquery("SELECT * FROM " . TABLE_PREFIX . ('' . "arcadegames WHERE gamename='" . $name . "' Limit 1"));
  1217. if ($db->dbrows($S) != "0")
  1218. {
  1219. $r = $db->dbarray($S);
  1220. $output["gamename"] = xss_clean($r["gamename"]);
  1221. $output["catid"] = intval($r["catid"]);
  1222. $output["id"] = intval($r["id"]);
  1223. $output["filename"] = xss_clean($r["filename"]);
  1224. $output["highscore"] = xss_clean($r["highscore"]);
  1225. }
  1226. else
  1227. {
  1228. $output["gamename"] = "ÎØÃ";
  1229. }
  1230. return $output;
  1231. }
  1232.  
  1233. function members_setting() {
  1234.  
  1235. global $db;
  1236. if (!($S = $db->dbquery("SELECT * FROM " . TABLE_PREFIX . "setting_members")))
  1237. {
  1238. die(mysql_error());
  1239. }
  1240. $r = $db->dbarray($S);
  1241. $output["close"] = $r["close"];
  1242. $output["minchar"] = $r["minchar"];
  1243. $output["maxchar"] = $r["maxchar"];
  1244. $output["emailactive"] = $r["emailactive"];
  1245. $output["emailwelcome"] = $r["emailwelcome"];
  1246. return $output;
  1247. }
  1248.  
  1249. function set_sessions($url = false) {
  1250.  
  1251. global $db;
  1252. global $PHP_SELF;
  1253. $ip = GetRealIP();
  1254. if ($_SESSION["valid_login"])
  1255. {
  1256. $userid = intval($_SESSION["valid_login"]);
  1257. }
  1258. else
  1259. {
  1260. $userid = "0";
  1261. }
  1262. if (!($Ssession = $db->dbquery("select * from " . TABLE_PREFIX . "sessions")))
  1263. {
  1264. die($db->__DBerror());
  1265. }
  1266. if ($db->dbrows($Ssession) != 0)
  1267. {
  1268. while ($rse = $db->dbarray($Ssession))
  1269. {
  1270. $time_now = time();
  1271. $time_before = $time_now - 250;
  1272. $SET_time = $db->dbquery("delete from " . TABLE_PREFIX . ('' . "sessions where dateline < " . $time_before));
  1273. $db->dbclose($SET_time);
  1274. continue;
  1275. }
  1276. }
  1277. if (isset($_GET["c"]))
  1278. {
  1279. $c = xss_clean($_GET["c"]);
  1280. }
  1281. else
  1282. {
  1283. $c = "";
  1284. }
  1285. $refer = $PHP_SELF;
  1286. $u = selfURL();
  1287. if (!($IIIIIIII = $db->dbquery("insert into " . TABLE_PREFIX . ('' . "sessions values\r
  1288. (null,'" . $userid . "','" . $ip . "','" . $u . "','") . $c . "','" . time() . "')")))
  1289. {
  1290. die(mysql_error());
  1291. }
  1292. $db->dbclose($IIIIIIII);
  1293. $db->dbclose($Ssession);
  1294. return;
  1295. }
  1296.  
  1297. function GetRealIP() {
  1298.  
  1299. if (!empty($_SERVER["HTTP_CLIENT_IP"]))
  1300. {
  1301. $ip = $_SERVER["HTTP_CLIENT_IP"];
  1302. }
  1303. else
  1304. {
  1305. if (!empty($_SERVER["HTTP_X_FORWARDED_FOR"]))
  1306. {
  1307. $ip = $_SERVER["HTTP_X_FORWARDED_FOR"];
  1308. }
  1309. else
  1310. {
  1311. $ip = $_SERVER["REMOTE_ADDR"];
  1312. }
  1313. }
  1314. return $ip;
  1315. }
  1316.  
  1317. function check_access_hook($hookid, $adminid) {
  1318.  
  1319. global $db;
  1320. global $adminjob;
  1321. $hooid = intval($hookid);
  1322. $hookid = xss_clean($hookid);
  1323. $adminid = intval($adminid);
  1324. $adminid = xss_clean($adminid);
  1325. $admin = admindetails($adminid);
  1326. if ($adminjob->_is_hook($hookid, $admin["hooks"]) == "NO")
  1327. {
  1328. $adminjob->cpstarthtml("ÑÇÈØ ÎØÃ");
  1329. $adminjob->__errorlink("ÑÈãÇ áÇ Êãáß ÇáÕáÇÍíÉ áÏÎæá åÐå ÇáÕÝÍÉ");
  1330. $adminjob->cpendhtml();
  1331. exit();
  1332. }
  1333. return;
  1334. }
  1335.  
  1336. function check_admin_full_access($adminid) {
  1337.  
  1338. global $db;
  1339. global $adminjob;
  1340. $adminid = intval($adminid);
  1341. $adminid = xss_clean($adminid);
  1342. $admin = admindetails($adminid);
  1343. if ($admin["access"] != "0")
  1344. {
  1345. $adminjob->cpstarthtml("ÑÇÈØ ÎØÃ");
  1346. $adminjob->__errorlink("ÑÈãÇ áÇ Êãáß ÇáÕáÇÍíÉ áÏÎæá åÐå ÇáÕÝÍÉ");
  1347. $adminjob->cpendhtml();
  1348. exit();
  1349. }
  1350. return;
  1351. }
  1352.  
  1353. function video_marque() {
  1354.  
  1355. global $db;
  1356. global $video_marque;
  1357. global $__config;
  1358. $S = $db->dbquery("SELECT * FROM " . TABLE_PREFIX . "videos ORDER BY id DESC Limit 10");
  1359. if ($db->dbrows($S) != "0")
  1360. {
  1361. $video_marque = "<marquee scrollamount='4' scrolldelay='89' onmouseover='this.stop()' onmouseout='this.start()'>";
  1362. $video_marque .= "<table border=0 width=100% cellspacing=2><tr>";
  1363. while ($r = $db->dbarray($S))
  1364. {
  1365. $imgdesc = xss_clean($r["title"]);
  1366. $videocode = $r[videocode];
  1367. if ($r[videopath] == "YOUTUBE")
  1368. {
  1369. $picpath = '' . "http://img.youtube.com/vi/" . $videocode . "/default.jpg";
  1370. }
  1371. else
  1372. {
  1373. $picpath = $__config["config"]["storage"] . "/" . $__config["config"]["thumbnails"] . "/video_flvf_" . $r[dateline] . ".jpg";
  1374. }
  1375. $video_marque .= "<td valign=top width=115 heigth=100><center>";
  1376. $video_marque .= "<a href='videos-v-" . $r[id] . "?" . $r[title] . "'>";
  1377. $video_marque .= '' . "<img class=\"reflect rheight30\" src='" . $picpath . "' border=0 title='" . $imgdesc . "' alt='" . $imgdesc . "' width=110 height=90></a>";
  1378. $video_marque .= "<br />" . $r[duration] . "</center></td>";
  1379. continue;
  1380. }
  1381. $video_marque .= "</tr></table></marquee>";
  1382. }
  1383. else
  1384. {
  1385. $video_marque = "<center>áÇ ÊæÌÏ ÝíÏíæåÇÊ</center>";
  1386. }
  1387. $video_marque .= "<script>\r
  1388. var cool = 2;\r
  1389. function varyReflect() {\r
  1390. if (cool == 10) {\r
  1391. cool = 1;\r
  1392. }\r
  1393. Reflection.add(document.getElementById('indeed'), { opacity: cool/10 });\r
  1394. \r
  1395. document.getElementById('indeeda').innerHTML = cool*10;\r
  1396. cool++;\r
  1397. }\r
  1398. \r
  1399. </script>";
  1400. return "<script src='js/reflection.js'></script>" . $video_marque;
  1401. }
  1402.  
  1403. function video_watchs_block() {
  1404.  
  1405. global $db;
  1406. global $__config;
  1407. $S = $db->dbquery("SELECT * FROM " . TABLE_PREFIX . "sessions WHERE videocode!='' Limit 10");
  1408. if ($db->dbrows($S) != "0")
  1409. {
  1410. $output .= "<table border=0 width=100% cellspacing=2>";
  1411. while ($r = $db->dbarray($S))
  1412. {
  1413. $Sv = $db->dbquery("SELECT * FROM " . TABLE_PREFIX . "videos WHERE id='" . xss_clean(intval($r["videocode"])) . "'");
  1414. if (!($db->dbrows($Sv) != "0"))
  1415. {
  1416. continue;
  1417. }
  1418. $rv = $db->dbarray($Sv);
  1419. $videocode = $rv[videocode];
  1420. if ($rv[videopath] == "YOUTUBE")
  1421. {
  1422. $picpath = '' . "http://img.youtube.com/vi/" . $videocode . "/default.jpg";
  1423. }
  1424. else
  1425. {
  1426. $picpath = $__config["config"]["storage"] . "/" . $__config["config"]["thumbnails"] . "/video_flvf_" . $rv[dateline] . ".jpg";
  1427. }
  1428. $imgdesc = xss_clean($rv["title"]);
  1429. $output .= "
  1430. <tr onmouseover=\"this.className='td_over'\" onmouseout=\"this.className=''\"\r
  1431. ><td width=40 height=35><center>";
  1432. $output .= '' . "
  1433. <div style=\"float: left; padding: 10px;\">\r
  1434. <img src='" . $picpath . "' border=0 title='" . $imgdesc . "' alt='" . $imgdesc . "' width=35 height=30></div>";
  1435. $output .= "
  1436. </td><td class=><a href='videos-v-" . $rv[id] . "?" . urlencode($rv[title]) . "'>" . $imgdesc . "</a>\r
  1437. <br />" . $rv[duration] . "</center></td></tr>";
  1438. continue;
  1439. }
  1440. $output .= "
  1441. </table>";
  1442. }
  1443. else
  1444. {
  1445. $output = "<center>áÇ íæÌÏ ÇáÂä</center>";
  1446. }
  1447. return $output;
  1448. }
  1449.  
  1450. function fetch_tags($appid) {
  1451.  
  1452. global $db;
  1453. $terms = array();
  1454. $maximum = 0;
  1455. $query = $db->dbquery('' . "SELECT term, counter FROM tags WHERE appid='" . $appid . "' ORDER BY counter DESC LIMIT 30");
  1456. if ($db->dbrows($query) != "0")
  1457. {
  1458. while ($row = $db->dbarray($query))
  1459. {
  1460. $term = $row["term"];
  1461. $counter = $row["counter"];
  1462. if ($maximum < $counter)
  1463. {
  1464. $maximum = $counter;
  1465. }
  1466. $terms[] = array("term" => $term, "counter" => $counter);
  1467. continue;
  1468. }
  1469. shuffle($terms);
  1470. }
  1471. $db->dbclose($query);
  1472. foreach ($terms as $k)
  1473. {
  1474. $percent = floor($k["counter"] / $maximum * 100);
  1475. if ($percent < 20)
  1476. {
  1477. $class = "smallest";
  1478. }
  1479. else
  1480. {
  1481. if (20 <= $percent && $percent < 40)
  1482. {
  1483. $class = "small";
  1484. }
  1485. else
  1486. {
  1487. if (40 <= $percent && $percent < 60)
  1488. {
  1489. $class = "medium";
  1490. }
  1491. else
  1492. {
  1493. if (60 <= $percent && $percent < 80)
  1494. {
  1495. $class = "large";
  1496. }
  1497. else
  1498. {
  1499. $class = "largest";
  1500. }
  1501. }
  1502. }
  1503. }
  1504. $output .= "<a href=\"search.php?qu=" . urlencode($k["term"]) . ('' . "\"><span class=\"" . $class . "\">") . $k["term"] . "</span></a>
  1505. &nbsp;&nbsp;";
  1506. continue;
  1507. }
  1508. $output .= "</div>\r
  1509. </div>
  1510. ";
  1511. return $output;
  1512. }
  1513.  
  1514. function get_domain() {
  1515.  
  1516. @extract($GLOBALS);
  1517. $domain = $_SERVER["HTTP_HOST"];
  1518. return $domain;
  1519. }
  1520.  
  1521. function Encode($data, $pwd) {
  1522.  
  1523. $pwd_length = strlen($pwd);
  1524. $i = 0;
  1525. while ($i < 255)
  1526. {
  1527. $key[$i] = ord(substr($pwd, $i % $pwd_length + 1, 1));
  1528. $counter[$i] = $i;
  1529. $i++;
  1530. continue;
  1531. }
  1532. $i = 0;
  1533. .....................................................................
  1534. ...............................
  1535. ............
Add Comment
Please, Sign In to add comment