Guest User

Untitled

a guest
May 11th, 2016
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.54 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.4
  8. * @ Author : DeZender
  9. * @ Release on : 21.10.2015
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. if ((!defined("_VALID_CALL")))
  15. {
  16. exit("Direct Access is not allowed.");
  17. }
  18.  
  19.  
  20. class xtLink {
  21.  
  22.  
  23. public $xtLink = null;
  24. public $params = null;
  25. public $GET_PARAMS = array();
  26. public $link_url = null;
  27. public $secure_link_url = null;
  28. public function xtLink() {
  29.  
  30. global $xtPlugin;
  31. $this->amp = "&amp;";
  32. $this->show_session_id = _RMV_SESSION;
  33. ($plugin_code = $xtPlugin->PluginCode("class.link.php:link_top")) ? ('' . $plugin_code) : false;
  34. ($plugin_code = $xtPlugin->PluginCode("class.link.php:link_top")) ? ('' . $plugin_code) : false;
  35. ($plugin_code = $xtPlugin->PluginCode("class.link.php:link_top")) ? ('' . $plugin_code) : false;
  36. if (isset($plugin_return_value))
  37. {
  38. return $plugin_return_value;
  39. }
  40. return;
  41. }
  42.  
  43. public function showSessionID($val) {
  44.  
  45. $this->show_session_id = $val;
  46. return;
  47. }
  48.  
  49. public function setLinkURL($url = "") {
  50.  
  51. $this->link_url = $url;
  52. return;
  53. }
  54.  
  55. public function setSecureLinkURL($surl = "") {
  56.  
  57. $this->secure_link_url = $surl;
  58. return;
  59. }
  60.  
  61. public function unsetLinkURL() {
  62.  
  63. unset($this->link_url);
  64. return;
  65. }
  66.  
  67. public function unsetSecureLinkURL() {
  68.  
  69. unset($this->secure_link_url);
  70. return;
  71. }
  72.  
  73. /**
  74. * generate link
  75. *
  76. * @param mixed $data array with link data
  77. * @param mixed $remove_dir directory which should be removed from link (str_replace)
  78. * @param mixed $block_session set to true if no session ID should be added to the generated link
  79. * @return string
  80. */
  81. public function _link($data, $remove_dir = "", $block_session = false) {
  82.  
  83. global $xtPlugin;
  84. global $page;
  85. global $remove_session;
  86. global $language;
  87. ($plugin_code = $xtPlugin->PluginCode("class.link.php:_link_top")) ? ('' . $plugin_code) : false;
  88. ($plugin_code = $xtPlugin->PluginCode("class.link.php:_link_top")) ? ('' . $plugin_code) : false;
  89. ($plugin_code = $xtPlugin->PluginCode("class.link.php:_link_top")) ? ('' . $plugin_code) : false;
  90. if (isset($plugin_return_value))
  91. {
  92. return $plugin_return_value;
  93. }
  94. if (empty($data["default_page"]))
  95. {
  96. $default_page = "index.php";
  97. }
  98. else
  99. {
  100. $default_page = $data["default_page"];
  101. }
  102. if ($this->link_url)
  103. {
  104. $system_http_link = _SYSTEM_BASE_HTTP;
  105. }
  106. else
  107. {
  108. $system_http_link = $this->link_url;
  109. }
  110. if ($this->secure_link_url)
  111. {
  112. $system_https_link = _SYSTEM_BASE_HTTPS;
  113. }
  114. else
  115. {
  116. $system_https_link = $this->secure_link_url;
  117. }
  118. if (!isset($data["conn"]))
  119. {
  120. $data["conn"] = "NOSSL";
  121. }
  122. if ($data["conn"] == "SSL" && _SYSTEM_SSL == true)
  123. {
  124. $link_data = $system_https_link . _SRV_WEB;
  125. }
  126. else
  127. {
  128. $link_data = $system_http_link . _SRV_WEB;
  129. }
  130. $seo_url = $this->_getSeoUrl($data);
  131. if ($seo_url != false && $data["seo_url"] == "")
  132. {
  133. $data["seo_url"] = $seo_url;
  134. }
  135. if (stripos($data["params"], "next_page") !== false)
  136. {
  137. parse_str($data["params"], $output);
  138. if ($output["next_page"] == 1)
  139. {
  140. $data["params"] = $this->clean_url_qs($data["params"], "next_page");
  141. if (stripos($data["params"], "cat=") !== false && $data["seo_url"] != "")
  142. {
  143. $data["params"] = $this->clean_url_qs($data["params"], "cat");
  144. }
  145. }
  146. }
  147. if ($remove_dir != "")
  148. {
  149. $link_data = str_replace($remove_dir, "", $link_data);
  150. }
  151. if (_SYSTEM_MOD_REWRITE == "true" && $data["seo_url"] != "")
  152. {
  153. $link_data .= $data["seo_url"];
  154. if (_SYSTEM_SEO_FILE_TYPE != "")
  155. {
  156. $link_data = $link_data . "." . _SYSTEM_SEO_FILE_TYPE;
  157. }
  158. if (_RMV_SESSION == "false" && $block_session == false)
  159. {
  160. if (!isset($_COOKIE[session_name()]))
  161. {
  162. $link_data .= "?" . session_name() . "=" . session_id();
  163. }
  164. }
  165. if (!empty($data["params"]))
  166. {
  167. if (!preg_match("/\\?/", $link_data))
  168. {
  169. $data["params"] = "?" . $data["params"];
  170. }
  171. else
  172. {
  173. $data["params"] = $this->amp . $data["params"];
  174. }
  175. }
  176. $link_data .= $data["params"];
  177. return $link_data;
  178. }
  179. if (_SYSTEM_MOD_REWRITE == "true" && _SYSTEM_MOD_REWRITE_DEFAULT == "true" && $data["page"] != "callback")
  180. {
  181. if (empty($data["dl_media"]) && empty($data["default_page"]) && _SYSTEM_SEO_URL_LANG_BASED == "true")
  182. {
  183. if (trim($data["lang_code"]) != "")
  184. {
  185. $link_data .= $data["lang_code"] . "/";
  186. }
  187. else
  188. {
  189. $link_data .= $language->code . "/";
  190. }
  191. }
  192. if ($data["page"] == "dynamic")
  193. {
  194. $link_data .= $page->page_name;
  195. }
  196. else
  197. {
  198. if (empty($data["page"]) && !empty($default_page))
  199. {
  200. $link_data .= $default_page;
  201. }
  202. else
  203. {
  204. $link_data .= $data["page"];
  205. }
  206. }
  207. if ($data["page"] == "dynamic")
  208. {
  209. if (!empty($page["page_action"]))
  210. {
  211. $link_data .= "/" . $page->page_action;
  212. }
  213. }
  214. else
  215. {
  216. if (!empty($data["paction"]))
  217. {
  218. $link_data .= "/" . $data["paction"];
  219. }
  220. }
  221. if (empty($data["default_page"]) && _SYSTEM_SEO_FILE_TYPE != "")
  222. {
  223. $link_data .= "." . _SYSTEM_SEO_FILE_TYPE;
  224. }
  225. $link_data .= "?";
  226. }
  227. else
  228. {
  229. if (!empty($data["pos"]))
  230. {
  231. $link_data .= $data["pos"];
  232. }
  233. if ($data["page"] == "dynamic")
  234. {
  235. $link_data .= $default_page . "?page=" . $page->page_name;
  236. }
  237. else
  238. {
  239. $link_data .= $default_page . "?page=" . $data["page"];
  240. }
  241. if ($data["page"] == "dynamic")
  242. {
  243. if (!empty($page["page_action"]))
  244. {
  245. $link_data .= $this->amp . "page_action=" . $page->page_action;
  246. }
  247. }
  248. else
  249. {
  250. if (!empty($data["paction"]))
  251. {
  252. $link_data .= $this->amp . "page_action=" . $data["paction"];
  253. }
  254. }
  255. }
  256. $exclude_array = array();
  257. $data_exclude = array();
  258. if (!empty($data["params"]))
  259. {
  260. $data["params"] = str_replace($this->amp, "&", $data["params"]);
  261. $data["params"] = str_replace("&", $this->amp, $data["params"]);
  262. $data["params"] = $this->amp . $data["params"];
  263. }
  264. $link_data .= $data["params"];
  265. if (!empty($data["name"]) && !empty($data["type"]) && !empty($data["id"]))
  266. {
  267. $link_data .= $this->amp . $this->_linkTypes($data["type"], $data["id"], $data["name"]);
  268. }
  269. if ($this->show_session_id == "false" && $block_session == false)
  270. {
  271. if (!isset($_COOKIE[session_name()]))
  272. {
  273. $link_data .= $this->amp . session_name() . "=" . session_id();
  274. }
  275. }
  276. if ($data["conn"] == "SSL" && _SYSTEM_SSL == true)
  277. {
  278. if (!strpos($link_data, session_name()))
  279. {
  280. preg_match("@^(?:https://)?([^/]+)@i", _SYSTEM_BASE_HTTPS, $treffer);
  281. $https = $treffer[1];
  282. preg_match("@^(?:http://)?([^/]+)@i", _SYSTEM_BASE_HTTP, $treffer);
  283. $http = $treffer[1];
  284. if ($https != $http)
  285. {
  286. $link_data .= $this->amp . session_name() . "=" . session_id();
  287. }
  288. }
  289. }
  290. if ($data["page"] == "dynamic" && $language->code == _STORE_LANGUAGE && $page->page_name == "index" && _SYSTEM_MOD_REWRITE == "true")
  291. {
  292. $link_data = str_replace(_STORE_LANGUAGE . "/index", "", $link_data);
  293. }
  294. ($plugin_code = $xtPlugin->PluginCode("class.link.php:_link_bottom")) ? ('' . $plugin_code) : false;
  295. ($plugin_code = $xtPlugin->PluginCode("class.link.php:_link_bottom")) ? ('' . $plugin_code) : false;
  296. .............................................................................
  297. .......................................
  298. ..............
Advertisement
Add Comment
Please, Sign In to add comment