Advertisement
Guest User

Untitled

a guest
Dec 14th, 2018
660
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.40 KB | None | 0 0
  1. <?php
  2. /*
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 3.5.0.0
  8. * @ Author : DeZender
  9. * @ Release on : 22.06.2018
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. if (function_exists('get_execution_time') == false) {
  15. function get_execution_time()
  16. {
  17. static $microtime_start = null;
  18.  
  19. if ($microtime_start === null) {
  20. $microtime_start = microtime(true);
  21.  
  22. return 0;
  23. }
  24.  
  25. return microtime(true) - $microtime_start;
  26. }
  27.  
  28. get_execution_time();
  29. }
  30.  
  31. define('DS', DIRECTORY_SEPARATOR);
  32. define('MUBASHIER', true);
  33. define('IFRAME_NAMES', 'facebook.com|twitter.com|slideshare.com|scribd.com|flickr.com|instagram.com|youtube-nocookie.com|youtube.com|youtu.be|vimeo.com|soundcloud.com|dailymotion.com|dai.ly|ustream.tv|vine.co|wordpress.tv|videojug.com|videofork.com|vidyomani.com|vid.me');
  34. define('IFRAME_REGEXP_SYNTAX', '/(\\/\\/)?(www\\.)?(%s)/Sui');
  35. define('IFRAME_REGEXP', sprintf(IFRAME_REGEXP_SYNTAX, IFRAME_NAMES));
  36.  
  37. final class Mubashier
  38. {
  39. public $driver_name = 'PDO';
  40. public $manager = false;
  41. public static $webpage_caching = true;
  42. public $webpage_id = null;
  43. public $live_webpage = false;
  44. protected $initialized = false;
  45. protected $sessionState = Mubashier::SESSION_STATE_UNINITIALIZED;
  46. protected $pdo = null;
  47. protected $pdo_structure = null;
  48. protected static $statsDb = null;
  49. protected $config = null;
  50. protected $cats = null;
  51. protected $featured_sliders = null;
  52. protected $user_groups = null;
  53. protected $countries = null;
  54. protected $sources = null;
  55. protected $pages = array();
  56. protected $touch_mode = false;
  57. protected $types = array('1' => 'أخبار', '2' => 'فيديوهات', '3' => 'صور', '4' => 'مقالات');
  58. protected $types_prefix = array('1' => 'index', '2' => 'videos', '3' => 'photos', '4' => 'articles', '5' => 'gif');
  59. protected $translation = array();
  60. protected $db_info = array();
  61. protected $html = array('header' => array(), 'footer' => array());
  62. protected $javascript_options = null;
  63. protected $css = null;
  64. protected $js = array();
  65. public $js_place = 'header';
  66. public $ad_sizes = array(array(160, 600), array(120, 600), array(180, 600), array(200, 200), array(250, 250), array(300, 250), array(336, 280), array(728, 90), array(468, 60), array(300, 600), array(320, 50), array(320, 75), array(180, 227), array(780, 40), array(970, 90));
  67. protected $mime_types = array('video' => array('video/mp4' => 'mp4', 'video/m4v' => 'm4v', 'video/mov' => 'mov', 'video/wmv' => 'wmv', 'video/flv|video/x-flv' => 'flv'), 'audio' => array('audio/wma' => 'wma', 'audio/m4a' => 'm4a', 'audio/mp3' => 'mp3', 'audio/wav' => 'wav', 'audio/mpeg' => 'mpeg', 'audio/flv|audio/x-flv' => 'flv'), 'image' => array('image/gif' => 'gif', 'image/jpeg' => 'jpg', 'image/jpg' => 'jpg', 'image/png' => 'png', 'image/x-ms-bmp' => 'bmp'), 'flash' => array('application/x-shockwave-flash' => 'swf'), 'compressed' => array('application/x-bzip' => 'bz', 'application/x-bzip2' => 'bz2', 'application/zip' => 'zip', 'application/x-rar-compressed' => 'rar'), 'text' => array('application/x-sql' => 'sql', 'text/plain' => 'txt', 'application/pdf' => 'pdf', 'application/force-download' => 'pdf', 'application/msword' => 'doc', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => 'docx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.template' => 'dotx'));
  68. public $inits = array();
  69. public $theme_features = array('general_scripts' => true, 'navbars' => true, 'ads' => true, 'polls' => false, 'outside_services' => false);
  70. protected $vars_data = array();
  71. public $executions_time = array();
  72. public static $final_urls = array();
  73. public static $urls_transport = array();
  74. public static $urls_response = array();
  75. public static $urls_errors = array();
  76. public static $urls_providers_loaded = array();
  77. public static $theme_path = null;
  78. public static $random_int = 0;
  79. public $lang_pakgs = array('root', 'theme');
  80. public $temp_opt_handler = 'cache';
  81. protected static $uaHttpHeaders = array('HTTP_USER_AGENT', 'HTTP_X_OPERAMINI_PHONE_UA', 'HTTP_X_DEVICE_USER_AGENT', 'HTTP_X_ORIGINAL_USER_AGENT', 'HTTP_X_SKYFIRE_PHONE', 'HTTP_X_BOLT_PHONE_UA', 'HTTP_DEVICE_STOCK_UA', 'HTTP_X_UCBROWSER_DEVICE_UA');
  82. protected $userAgent = null;
  83. public static $statics = array();
  84.  
  85. const VERSION = '1.7.89';
  86. const REQUIRED_FUNCTIONS = 'mail,mb_strlen,mb_convert_encoding,glob,ini_set,error_reporting,set_time_limit,ignore_user_abort,memory_get_usage';
  87. const NEWS_RSS = '//api.mubashier.com/news.php';
  88. const UPDATE_CHECKER = 'http://api.mubashier.com/version.php';
  89. const SOURCES_API_TABLELIST = '//api.mubashier.com/store/sources_tablelist.php';
  90. const SOURCES_API_IMPORT = 'http://api.mubashier.com/store/sources_export.php';
  91. const SOURCES_API_CHECKER = 'http://api.mubashier.com/store/sources_checker.php';
  92. const XPATH_FEEDTYPES_JSON = 'http://api.mubashier.com/json/feedtypes_xpath.json';
  93. const XPATH_IMAGES_JSON = 'http://api.mubashier.com/json/image_xpath.json';
  94. const IFRAME_REGEXP = IFRAME_REGEXP;
  95. const SESSION_STATE_UNAVAILABLE = -1;
  96. const SESSION_STATE_UNINITIALIZED = 0;
  97. const SESSION_STATE_INITIALIZED = 1;
  98. const SESSION_STATE_EXTERNAL = 2;
  99.  
  100. public function __construct($db_connection = true, $session_start = true)
  101. {
  102. Mubashier::protect();
  103. self::$random_int = rand(0, 100);
  104. $this->version = self::VERSION;
  105. self::loadClass('geo', 'Browser');
  106. self::loadClass('detect', 'Browser');
  107. $this->setUserAgent();
  108. $config_file = dirname(__FILE__) . DS . 'config.inc.php';
  109.  
  110. if (file_exists($config_file)) {
  111. if (include($config_file)) {
  112. $this->db_info = $db_info;
  113.  
  114. if (true == $session_start) {
  115. $this->session_start();
  116. }
  117.  
  118. require_once dirname(__FILE__) . '/phpfastcache/3.0.0/phpfastcache.php';
  119.  
  120. if (defined('C_STORAGE') == true) {
  121. phpFastCache::$config = array('storage' => C_STORAGE, 'htaccess' => true, 'path' => C_PATH, 'securityKey' => 'default', 'extensions' => array(), 'fallback' => 'files');
  122. } else {
  123. phpFastCache::$disabled = true;
  124. }
  125.  
  126. if (self::isCLi() == true || empty($_SERVER['REQUEST_URI'])) {
  127. self::$webpage_caching = false;
  128. } else {
  129. if (defined('C_WEBPAGE')) {
  130. self::$webpage_caching = C_WEBPAGE;
  131. }
  132.  
  133. if (strpos($_SERVER['REQUEST_URI'], 'cron') !== false || strpos($_SERVER['REQUEST_URI'], 'panel') !== false || strpos($_SERVER['REQUEST_URI'], 'ads') !== false || strpos($_SERVER['REQUEST_URI'], 'ajax') !== false || strpos($_SERVER['REQUEST_URI'], 'revision') !== false || strpos($_SERVER['REQUEST_URI'], 'auth') !== false || strpos($_SERVER['REQUEST_URI'], 'install') !== false || strpos($_SERVER['REQUEST_URI'], 'share') !== false || strpos($_SERVER['REQUEST_URI'], 'actions') !== false) {
  134. self::$webpage_caching = false;
  135. }
  136.  
  137. if ($_SERVER['REQUEST_METHOD'] == 'POST') {
  138. self::$webpage_caching = false;
  139. }
  140.  
  141. if (isset($_GET['fresh'])) {
  142. self::$webpage_caching = false;
  143. }
  144.  
  145. if ($this->isLoggedIn()) {
  146. self::$webpage_caching = false;
  147. }
  148. }
  149.  
  150. if (self::$webpage_caching === true && ($html = __c()->get($this->webpage_id())) !== null) {
  151. $this->beforeCacheActions();
  152.  
  153. exit($html);
  154. }
  155.  
  156. $this->live_webpage = true;
  157. ob_start();
  158.  
  159. if ($db_connection) {
  160. self::loadClass('NotORM', 'db');
  161.  
  162. try {
  163. $this->pdo = $this->db_connect($db_info['dsn'], $db_info['user'], $db_info['pass'], array());
  164. } catch (Exception $e) {
  165. include dirname(__FILE__) . DS . 'db' . DS . 'error.php';
  166.  
  167. exit();
  168. }
  169. $this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
  170. $this->pdo->setAttribute(PDO::ATTR_CASE, PDO::CASE_LOWER);
  171. $this->pdo_structure = new NotORM_Structure_Convention($primary = 'id', $foreign = '%s_id', $table = '%ss', $prefix = $db_info['prefix']);
  172. $this->db = new NotORM($this->pdo, $this->pdo_structure);
  173. }
  174.  
  175. self::setStatic('db', $this->db);
  176. unset($db_info);
  177.  
  178. if (defined('TEMP_OPT_HANDLER')) {
  179. $this->temp_opt_handler = TEMP_OPT_HANDLER;
  180.  
  181. return null;
  182. }
  183. }
  184. } else {
  185. exit(header('Location: install'));
  186. }
  187. }
  188.  
  189. public function __destruct()
  190. {
  191. if ($this->live_webpage && self::$webpage_caching) {
  192. $html = ob_get_contents();
  193. __c()->set($this->webpage_id(), $html, C_WEBPAGE_LIFETIME);
  194. $this->pdo = null;
  195. $this->db = null;
  196. }
  197.  
  198. if (50400 <= PHP_VERSION_ID && PHP_SESSION_ACTIVE === session_status() || PHP_VERSION_ID < 50400 && isset($_SESSION) && session_id()) {
  199. session_write_close();
  200. }
  201. }
  202.  
  203. public function webpage_id()
  204. {
  205. if ($this->webpage_id == null) {
  206. $id = 'wp_';
  207. $id .= basename($_SERVER['SCRIPT_FILENAME'], '.php') . '_';
  208. $id .= md5($_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . $_SERVER['QUERY_STRING'] . $this->getAgentDeviceType() . $this->getUserid() . Detect::getOs($this->getUserAgent()) . Geo::getCurrentCountry());
  209. $this->webpage_id = $id;
  210. }
  211.  
  212. return $this->webpage_id;
  213. }
  214.  
  215. public function beforeCacheActions()
  216. {
  217. if (defined('IS_VIEW_PAGE') && defined('DIRECT_VIEWS')) {
  218. $id = (int) $_GET['id'];
  219. $stats_db = self::getStatsDBPath();
  220.  
  221. if (self::check_user_agent('bot') == true) {
  222. self::updateStatsDBData($stats_db, $id, 'bot_views', '+1');
  223. ...........................................................................................
  224. ........................................................
  225. ...................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement