Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP7 Decoder for ionCube Encoder)
- *
- * @ Version : 4.1.0.1
- * @ Author : DeZender
- * @ Release on : 29.08.2020
- * @ Official site : http://DeZender.Net
- *
- */
- class AdblockController extends ApplicationController
- {
- public function before_execute()
- {
- parent::before_execute();
- if (!LoginHelper::validate_admin_login()) {
- $this->flash($this->get_message('login failed'), $this->make_url('index/index'), 0);
- }
- if (($this->get_action() == 'create') && !$_POST) {
- $this->license_check();
- }
- if ($this->read_cookie_param(COOKIE_ADMIN_TYPE) == 1) {
- $this->flash($this->get_message('no privilege'), $this->make_url('system/todo'), 0);
- }
- }
- public function create_action()
- {
- $status_php = 1;
- $this->set_title($this->get_label('create adblock'));
- $validate = [
- 'banner_type=>4' => [
- 'skin_position' => [
- 'notNull' => [$this->get_message('choose any position')]
- ]
- ]
- ];
- $form = $this->create_form('createadblock', $validate);
- $db = DAL::get_instance();
- $res1 = $db->execute_query('select * from ' . TABLE_PREFIX . 'banner_dimensions where status=1 AND banner_type =0');
- $this->set_result('res1', $res1);
- $res2 = $db->execute_query('select * from ' . TABLE_PREFIX . 'banner_dimensions where status=1 AND banner_type =1');
- $this->set_result('res2', $res2);
- $res3 = $db->execute_query('select * from ' . TABLE_PREFIX . 'banner_dimensions where status=1 AND banner_type =2');
- $this->set_result('res3', $res3);
- $res4 = $db->execute_query('select * from ' . TABLE_PREFIX . 'banner_dimensions where status=1 AND banner_type =3');
- $this->set_result('res4', $res4);
- $skin_enabled = $this->get_addon_status('skin-ads_enabled');
- if ($_POST) {
- $adtype = $this->read_post_param('adtype');
- $adbname = $this->read_post_param('adbname');
- $adbname = strip_tags($adbname);
- $allow = $this->read_post_param('allow');
- $no_of_text_ads = $this->read_post_param('no_of_text_ads');
- $ad_orientation = $this->read_post_param('ad_orientation');
- $title_font = $this->read_post_param('title_font');
- $ad_title_size = $this->read_post_param('ad_title_size');
- $ad_title_font_weight = $this->read_post_param('ad_title_font_weight');
- $ad_title_decoration = $this->read_post_param('ad_title_decoration');
- $desc_font = $this->read_post_param('desc_font');
- $desc_size = $this->read_post_param('desc_size');
- $ad_desc_font_weight = $this->read_post_param('ad_desc_font_weight');
- $ad_desc_decoration = $this->read_post_param('ad_desc_decoration');
- $display_font = $this->read_post_param('display_font');
- $disp_url_size = $this->read_post_param('disp_url_size');
- $ad_disp_url_font_weight = $this->read_post_param('ad_disp_url_font_weight');
- $ad_disp_url_decoration = $this->read_post_param('ad_disp_url_decoration');
- $lseperator = $this->read_post_param('lseperator');
- $theight = $this->read_post_param('theight');
- $dheight = $this->read_post_param('dheight');
- $uheight = $this->read_post_param('uheight');
- $cheight = $this->read_post_param('cheight');
- if (($theight == '') || ($theight <= 0) || !is_numeric($theight)) {
- $theight = 15;
- }
- if (($dheight == '') || ($dheight <= 0) || !is_numeric($dheight)) {
- $dheight = 15;
- }
- if (($uheight == '') || ($uheight <= 0) || !is_numeric($uheight)) {
- $uheight = 15;
- }
- if (($cheight == '') || ($cheight <= 0) || !is_numeric($cheight)) {
- $cheight = 15;
- }
- $color1 = $this->read_post_param('color1');
- $color2 = $this->read_post_param('color2');
- $color3 = $this->read_post_param('color3');
- $color4 = $this->read_post_param('color4');
- $color5 = $this->read_post_param('color5');
- $color6 = $this->read_post_param('color6');
- if ($color1 == '') {
- $color1 = '#0078FF';
- }
- if ($color2 == '') {
- $color2 = '#1437d7';
- }
- if ($color3 == '') {
- $color3 = '#6ED166';
- }
- if ($color4 == '') {
- $color4 = '#A1A1A1';
- }
- if ($color5 == '') {
- $color5 = '#E9E9E9';
- }
- if ($color6 == '') {
- $color6 = '#E9E9E9';
- }
- $credittext = $this->read_post_param('credittext');
- $credit_text_font = $this->read_post_param('credit_text_font');
- $credit_size = $this->read_post_param('credit_size');
- $credit_text_font_weight = $this->read_post_param('credit_text_font_weight');
- $credit_text_decoration = $this->read_post_param('credit_text_decoration');
- $border = $this->read_post_param('border');
- $credit_text_alignment = $this->read_post_param('credit_text_alignment');
- $credit_text_positioning = $this->read_post_param('credit_text_positioning');
- if ($adtype == 5) {
- $credit_text_alignment = 1;
- $credit_text_positioning = 1;
- }
- $skin_column = '';
- $skin_column_value = '';
- $image_position = 0;
- $textimage_bannersize = 0;
- $arr = ValidationHelper::validate_form_data($form);
- if (0 < count($arr)) {
- $status_php = 0;
- }
- if (($adtype == 2) || ($adtype == 3)) {
- if ($adtype == 2) {
- $banner_type = $this->read_post_param('banner_type');
- }
- else {
- $banner_type = 0;
- }
- if ($banner_type == 4) {
- $bannersize = 0;
- $width = 0;
- $height = 0;
- $skin_position = [];
- $skin_l = intval($this->read_post_param('skin_position_l'));
- $skin_r = intval($this->read_post_param('skin_position_r'));
- $skin_t = intval($this->read_post_param('skin_position_t'));
- $skin_b = intval($this->read_post_param('skin_position_b'));
- if (($skin_l == 0) && ($skin_r == 0) && ($skin_t == 0) && ($skin_b == 0)) {
- $skin_l = 1;
- }
- if ((0 < $skin_l) || (0 < $skin_r) || (0 < $skin_t) || (0 < $skin_b)) {
- $skin_position['L'] = $skin_l;
- $skin_position['R'] = $skin_r;
- $skin_position['T'] = $skin_t;
- $skin_position['B'] = $skin_b;
- $skin_position = json_encode($skin_position);
- }
- $skin_column = ',`skin_positions`';
- $skin_column_value = ',?';
- }
- else {
- $bannersize = $this->read_post_param('bannersize_0' . $banner_type);
- $res1 = $db->execute_query('select * from ' . TABLE_PREFIX . 'banner_dimensions where id=?', [$bannersize]);
- $result = $res1->fetch_assoc();
- $width = $result['width'];
- $height = $result['height'];
- }
- }
- else if (($adtype == 1) || ($adtype == 5)) {
- if ($adtype == 1) {
- $banner_type = 0;
- }
- else if ($adtype == 5) {
- $banner_type = 5;
- }
- $bannersize = '';
- $height = $this->read_post_param('height');
- $width = $this->read_post_param('width');
- if (($height == '') || ($height <= 0) || !is_numeric($height)) {
- $height = 250;
- }
- if (($width == '') || ($width <= 0) || !is_numeric($width)) {
- $width = 250;
- }
- }
- else if ($adtype == 4) {
- $banner_type = 3;
- $bannersize = '';
- $textimage_bannersize = $this->read_post_param('bannersize_0' . $banner_type);
- $image_position = intval($this->read_post_param('image_position'));
- $height = $this->read_post_param('height');
- $width = $this->read_post_param('width');
- if (($height == '') || ($height <= 0) || !is_numeric($height)) {
- $height = 250;
- }
- if (($width == '') || ($width <= 0) || !is_numeric($width)) {
- $width = 250;
- }
- }
- $title_support = 1;
- $desc_support = 1;
- $url_support = 1;
- if (($adtype == 1) || ($adtype == 3) || ($adtype == 4)) {
- $title_support = intval($this->read_post_param('title_support'));
- $desc_support = intval($this->read_post_param('desc_support'));
- $url_support = intval($this->read_post_param('url_support'));
- if (($title_support == 0) && ($desc_support == 0) && ($url_support == 0)) {
- $title_support = 1;
- $desc_support = 1;
- $url_support = 1;
- }
- }
- if (DEMO_MODE && (790 < $width)) {
- $this->flash($this->get_message('demo mode'), $this->make_url('adblock/manage'), 0);
- exit();
- }
- if (($adbname == '') && ($banner_type != 4)) {
- $adbname = 'AdBlock - ' . $width . ' x ' . $height;
- }
- else if (($adbname == '') && ($banner_type == 4)) {
- $adbname = 'AdBlock - Skin Ads';
- }
- $this->set_variable('adbname', $adbname);
- $this->set_variable('height', $height);
- $this->set_variable('width', $width);
- $this->set_variable('adtype', $adtype);
- $this->set_variable('credittext', $credittext);
- if ($adtype == 4) {
- $this->set_variable('bannersize', $textimage_bannersize);
- }
- else {
- $this->set_variable('bannersize', $bannersize);
- }
- if ($status_php == 1) {
- $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 . ')';
- $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];
- if ($banner_type == 4) {
- $data_array[] = $skin_position;
- }
- $execute = $db->execute_query($query, $data_array);
- if ($execute->error == '') {
- $this->flash($this->get_message('adblock create'), $this->make_url('adblock/manage'));
- }
- else {
- $this->set_notice('error occurred');
- }
- }
- }
- }
- public function edit_action()
- {
- $status_php = 1;
- $this->set_title($this->get_label('edit adblock'));
- $validate = [
- 'banner_type=>4' => [
- 'skin_position' => [
- 'notNull' => [$this->get_message('choose any position')]
- ]
- ]
- ];
- $form = $this->create_form('editadblock', $validate);
- $db = DAL::get_instance();
- $mem_obj = $this->memcache_connect();
- if ($_POST) {
- $id = $this->read_post_param('adbid');
- }
- else {
- $id = $this->read_page_param(1);
- ........................................................................
- .............................................
- ...........................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement