Advertisement
Guest User

Untitled

a guest
Feb 4th, 2021
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.07 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP7 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 4.1.0.1
  8. * @ Author : DeZender
  9. * @ Release on : 29.08.2020
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. class AdblockController extends ApplicationController
  15. {
  16. public function before_execute()
  17. {
  18. parent::before_execute();
  19.  
  20. if (!LoginHelper::validate_admin_login()) {
  21. $this->flash($this->get_message('login failed'), $this->make_url('index/index'), 0);
  22. }
  23. if (($this->get_action() == 'create') && !$_POST) {
  24. $this->license_check();
  25. }
  26.  
  27. if ($this->read_cookie_param(COOKIE_ADMIN_TYPE) == 1) {
  28. $this->flash($this->get_message('no privilege'), $this->make_url('system/todo'), 0);
  29. }
  30. }
  31.  
  32. public function create_action()
  33. {
  34. $status_php = 1;
  35. $this->set_title($this->get_label('create adblock'));
  36. $validate = [
  37. 'banner_type=>4' => [
  38. 'skin_position' => [
  39. 'notNull' => [$this->get_message('choose any position')]
  40. ]
  41. ]
  42. ];
  43. $form = $this->create_form('createadblock', $validate);
  44. $db = DAL::get_instance();
  45. $res1 = $db->execute_query('select * from ' . TABLE_PREFIX . 'banner_dimensions where status=1 AND banner_type =0');
  46. $this->set_result('res1', $res1);
  47. $res2 = $db->execute_query('select * from ' . TABLE_PREFIX . 'banner_dimensions where status=1 AND banner_type =1');
  48. $this->set_result('res2', $res2);
  49. $res3 = $db->execute_query('select * from ' . TABLE_PREFIX . 'banner_dimensions where status=1 AND banner_type =2');
  50. $this->set_result('res3', $res3);
  51. $res4 = $db->execute_query('select * from ' . TABLE_PREFIX . 'banner_dimensions where status=1 AND banner_type =3');
  52. $this->set_result('res4', $res4);
  53. $skin_enabled = $this->get_addon_status('skin-ads_enabled');
  54.  
  55. if ($_POST) {
  56. $adtype = $this->read_post_param('adtype');
  57. $adbname = $this->read_post_param('adbname');
  58. $adbname = strip_tags($adbname);
  59. $allow = $this->read_post_param('allow');
  60. $no_of_text_ads = $this->read_post_param('no_of_text_ads');
  61. $ad_orientation = $this->read_post_param('ad_orientation');
  62. $title_font = $this->read_post_param('title_font');
  63. $ad_title_size = $this->read_post_param('ad_title_size');
  64. $ad_title_font_weight = $this->read_post_param('ad_title_font_weight');
  65. $ad_title_decoration = $this->read_post_param('ad_title_decoration');
  66. $desc_font = $this->read_post_param('desc_font');
  67. $desc_size = $this->read_post_param('desc_size');
  68. $ad_desc_font_weight = $this->read_post_param('ad_desc_font_weight');
  69. $ad_desc_decoration = $this->read_post_param('ad_desc_decoration');
  70. $display_font = $this->read_post_param('display_font');
  71. $disp_url_size = $this->read_post_param('disp_url_size');
  72. $ad_disp_url_font_weight = $this->read_post_param('ad_disp_url_font_weight');
  73. $ad_disp_url_decoration = $this->read_post_param('ad_disp_url_decoration');
  74. $lseperator = $this->read_post_param('lseperator');
  75. $theight = $this->read_post_param('theight');
  76. $dheight = $this->read_post_param('dheight');
  77. $uheight = $this->read_post_param('uheight');
  78. $cheight = $this->read_post_param('cheight');
  79. if (($theight == '') || ($theight <= 0) || !is_numeric($theight)) {
  80. $theight = 15;
  81. }
  82. if (($dheight == '') || ($dheight <= 0) || !is_numeric($dheight)) {
  83. $dheight = 15;
  84. }
  85. if (($uheight == '') || ($uheight <= 0) || !is_numeric($uheight)) {
  86. $uheight = 15;
  87. }
  88. if (($cheight == '') || ($cheight <= 0) || !is_numeric($cheight)) {
  89. $cheight = 15;
  90. }
  91.  
  92. $color1 = $this->read_post_param('color1');
  93. $color2 = $this->read_post_param('color2');
  94. $color3 = $this->read_post_param('color3');
  95. $color4 = $this->read_post_param('color4');
  96. $color5 = $this->read_post_param('color5');
  97. $color6 = $this->read_post_param('color6');
  98.  
  99. if ($color1 == '') {
  100. $color1 = '#0078FF';
  101. }
  102.  
  103. if ($color2 == '') {
  104. $color2 = '#1437d7';
  105. }
  106.  
  107. if ($color3 == '') {
  108. $color3 = '#6ED166';
  109. }
  110.  
  111. if ($color4 == '') {
  112. $color4 = '#A1A1A1';
  113. }
  114.  
  115. if ($color5 == '') {
  116. $color5 = '#E9E9E9';
  117. }
  118.  
  119. if ($color6 == '') {
  120. $color6 = '#E9E9E9';
  121. }
  122.  
  123. $credittext = $this->read_post_param('credittext');
  124. $credit_text_font = $this->read_post_param('credit_text_font');
  125. $credit_size = $this->read_post_param('credit_size');
  126. $credit_text_font_weight = $this->read_post_param('credit_text_font_weight');
  127. $credit_text_decoration = $this->read_post_param('credit_text_decoration');
  128. $border = $this->read_post_param('border');
  129. $credit_text_alignment = $this->read_post_param('credit_text_alignment');
  130. $credit_text_positioning = $this->read_post_param('credit_text_positioning');
  131.  
  132. if ($adtype == 5) {
  133. $credit_text_alignment = 1;
  134. $credit_text_positioning = 1;
  135. }
  136.  
  137. $skin_column = '';
  138. $skin_column_value = '';
  139. $image_position = 0;
  140. $textimage_bannersize = 0;
  141. $arr = ValidationHelper::validate_form_data($form);
  142.  
  143. if (0 < count($arr)) {
  144. $status_php = 0;
  145. }
  146. if (($adtype == 2) || ($adtype == 3)) {
  147. if ($adtype == 2) {
  148. $banner_type = $this->read_post_param('banner_type');
  149. }
  150. else {
  151. $banner_type = 0;
  152. }
  153.  
  154. if ($banner_type == 4) {
  155. $bannersize = 0;
  156. $width = 0;
  157. $height = 0;
  158. $skin_position = [];
  159. $skin_l = intval($this->read_post_param('skin_position_l'));
  160. $skin_r = intval($this->read_post_param('skin_position_r'));
  161. $skin_t = intval($this->read_post_param('skin_position_t'));
  162. $skin_b = intval($this->read_post_param('skin_position_b'));
  163. if (($skin_l == 0) && ($skin_r == 0) && ($skin_t == 0) && ($skin_b == 0)) {
  164. $skin_l = 1;
  165. }
  166. if ((0 < $skin_l) || (0 < $skin_r) || (0 < $skin_t) || (0 < $skin_b)) {
  167. $skin_position['L'] = $skin_l;
  168. $skin_position['R'] = $skin_r;
  169. $skin_position['T'] = $skin_t;
  170. $skin_position['B'] = $skin_b;
  171. $skin_position = json_encode($skin_position);
  172. }
  173.  
  174. $skin_column = ',`skin_positions`';
  175. $skin_column_value = ',?';
  176. }
  177. else {
  178. $bannersize = $this->read_post_param('bannersize_0' . $banner_type);
  179. $res1 = $db->execute_query('select * from ' . TABLE_PREFIX . 'banner_dimensions where id=?', [$bannersize]);
  180. $result = $res1->fetch_assoc();
  181. $width = $result['width'];
  182. $height = $result['height'];
  183. }
  184. }
  185. else if (($adtype == 1) || ($adtype == 5)) {
  186. if ($adtype == 1) {
  187. $banner_type = 0;
  188. }
  189. else if ($adtype == 5) {
  190. $banner_type = 5;
  191. }
  192.  
  193. $bannersize = '';
  194. $height = $this->read_post_param('height');
  195. $width = $this->read_post_param('width');
  196. if (($height == '') || ($height <= 0) || !is_numeric($height)) {
  197. $height = 250;
  198. }
  199. if (($width == '') || ($width <= 0) || !is_numeric($width)) {
  200. $width = 250;
  201. }
  202. }
  203. else if ($adtype == 4) {
  204. $banner_type = 3;
  205. $bannersize = '';
  206. $textimage_bannersize = $this->read_post_param('bannersize_0' . $banner_type);
  207. $image_position = intval($this->read_post_param('image_position'));
  208. $height = $this->read_post_param('height');
  209. $width = $this->read_post_param('width');
  210. if (($height == '') || ($height <= 0) || !is_numeric($height)) {
  211. $height = 250;
  212. }
  213. if (($width == '') || ($width <= 0) || !is_numeric($width)) {
  214. $width = 250;
  215. }
  216. }
  217.  
  218. $title_support = 1;
  219. $desc_support = 1;
  220. $url_support = 1;
  221. if (($adtype == 1) || ($adtype == 3) || ($adtype == 4)) {
  222. $title_support = intval($this->read_post_param('title_support'));
  223. $desc_support = intval($this->read_post_param('desc_support'));
  224. $url_support = intval($this->read_post_param('url_support'));
  225. if (($title_support == 0) && ($desc_support == 0) && ($url_support == 0)) {
  226. $title_support = 1;
  227. $desc_support = 1;
  228. $url_support = 1;
  229. }
  230. }
  231. if (DEMO_MODE && (790 < $width)) {
  232. $this->flash($this->get_message('demo mode'), $this->make_url('adblock/manage'), 0);
  233. exit();
  234. }
  235. if (($adbname == '') && ($banner_type != 4)) {
  236. $adbname = 'AdBlock - ' . $width . ' x ' . $height;
  237. }
  238. else if (($adbname == '') && ($banner_type == 4)) {
  239. $adbname = 'AdBlock - Skin Ads';
  240. }
  241.  
  242. $this->set_variable('adbname', $adbname);
  243. $this->set_variable('height', $height);
  244. $this->set_variable('width', $width);
  245. $this->set_variable('adtype', $adtype);
  246. $this->set_variable('credittext', $credittext);
  247.  
  248. if ($adtype == 4) {
  249. $this->set_variable('bannersize', $textimage_bannersize);
  250. }
  251. else {
  252. $this->set_variable('bannersize', $bannersize);
  253. }
  254.  
  255. if ($status_php == 1) {
  256. $query = 'insert into ' . TABLE_PREFIX . 'adblock' . "\n\t\t\t\t" . '(`id`,`type`,`bannersize`,`width`,`height`,`textadcount`,`orientaion`,`status`,`credit_text`,`name`,' . "\n\t\t\t\t" . '`tlineheight`,`dlineheight`,`ulineheight`,`clineheight`,`tfont`,`tsize`,`tcolor`,`dfont`,`dsize`,`dcolor`,`ufont`,' . "\n\t\t\t\t" . '`usize`,`ucolor`,`bcolor`,`cfont`,`csize`,`ccolor`,`br_color`,`creditalignment`,`creditposition`,' . "\n\t\t\t\t" . '`allowpublisher`,`bordertype`,`t_weight`,`t_decoration`,`d_weight`,`d_decoration`,`u_weight`,`u_decoration`,' . "\n\t\t\t\t" . '`c_weight`,`c_decoration`,`lineseperator`,`banner_type`,`image_position`,`textimage_size`,`original_type`' . $skin_column . ') ' . "\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t" . 'values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?' . $skin_column_value . ')';
  257. $data_array = ['', $adtype, $bannersize, $width, $height, $no_of_text_ads, $ad_orientation, -1, $credittext, $adbname, $theight, $dheight, $uheight, $cheight, $title_font, $ad_title_size, $color1, $desc_font, $desc_size, $color2, $display_font, $disp_url_size, $color3, $color4, $credit_text_font, $credit_size, $color5, $color6, $credit_text_alignment, $credit_text_positioning, $allow, $border, $ad_title_font_weight, $ad_title_decoration, $ad_desc_font_weight, $ad_desc_decoration, $ad_disp_url_font_weight, $ad_disp_url_decoration, $credit_text_font_weight, $credit_text_decoration, $lseperator, $banner_type, $image_position, $textimage_bannersize, $adtype];
  258.  
  259. if ($banner_type == 4) {
  260. $data_array[] = $skin_position;
  261. }
  262.  
  263. $execute = $db->execute_query($query, $data_array);
  264.  
  265. if ($execute->error == '') {
  266. $this->flash($this->get_message('adblock create'), $this->make_url('adblock/manage'));
  267. }
  268. else {
  269. $this->set_notice('error occurred');
  270. }
  271. }
  272. }
  273. }
  274.  
  275. public function edit_action()
  276. {
  277. $status_php = 1;
  278. $this->set_title($this->get_label('edit adblock'));
  279. $validate = [
  280. 'banner_type=>4' => [
  281. 'skin_position' => [
  282. 'notNull' => [$this->get_message('choose any position')]
  283. ]
  284. ]
  285. ];
  286. $form = $this->create_form('editadblock', $validate);
  287. $db = DAL::get_instance();
  288. $mem_obj = $this->memcache_connect();
  289.  
  290. if ($_POST) {
  291. $id = $this->read_post_param('adbid');
  292. }
  293. else {
  294. $id = $this->read_page_param(1);
  295. ........................................................................
  296. .............................................
  297. ...........................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement