mGeneral = adsho_GetOptions( ADSHO_OPTIONS_GENERAL ); $this->TplPath = ADSHO_CONTENT_PATH. $this->mGeneral['tplpath']; $this->TplUrl = ADSHO_CONTENT_URL. $this->mGeneral['tplpath']; // Set class property $this->FALLING = $this->getFilesToArray($this->TplPath.ADSHO_FALLING_DIR, '/.+\.png$|.+\.gif$|.+\.jpg$/i'); $table_name = $wpdb->prefix . ADSHO_TBLEFFECTS; $this->EFFECTS = $wpdb->get_results("SELECT * FROM $table_name GROUP BY Name ORDER BY Name;"); $table_name = $wpdb->prefix . ADSHO_TBLHOLIDAYS; $this->HOLIDAY = $wpdb->get_results("SELECT * FROM $table_name ORDER BY Name;"); if( isset( $_GET[ 'tab' ] ) ) $this->active_tab = sanitize_text_field($_GET[ 'tab' ]); else $this->active_tab = ADSHO_ID_PAGE1; ?>

icon

active_tab == ADSHO_ID_PAGE1 ) { $this->tabHolidays(); } else if ( $this->active_tab == ADSHO_ID_PAGE2 ) { $this->tabEffects(); } else if ( $this->active_tab == ADSHO_ID_PAGE3 ) { $this->tabTesting(); } ?> '; print __('Translated by: ad-software', ADSHO_TEXT_DOMAIN); print ''; ?>
prefix . ADSHO_TBLEFFECTS; $MsgOk=""; $MsgEr=""; for($i=0; $i<30; $i++) { if ($this->getPostS("delete$i") != "" ) { if ($this->getPostN("ID$i") != 0) { $Fo = "%d"; $Da = array("ID" => $this->getPostN("ID$i")); $ret = $wpdb->Delete($table_name, $Da, $Fo); if ($ret == 1) $MsgOk .= " - ".__('delete ok',ADSHO_TEXT_DOMAIN).": ".$this->getPostS("name$i")."
"; else $MsgEr .= " - ".__('delete failed',ADSHO_TEXT_DOMAIN).": ".$this->getPostS("name$i")."
"; } } else if ($this->getPostS("save$i") != "" ) { if ($this->getPostS("name$i") != "") { if ($i==0) { $Fo = array("%s","%d","%d","%s","%s","%s"); $Da = array( 'Name' => $this->getPostS("name$i"), 'Count' => $this->getPostN("count$i"), 'TimeSec' => $this->getPostN("timesec$i"), 'Size' => $this->getPostS("size$i"), 'ImgName' => $this->getPostS("imgname$i"), 'CalcType' => $this->getPostS("calctype$i") //ADD EFFEKT ); $ret = $wpdb->Insert($table_name, $Da, $Fo); if ($ret == 1) $MsgOk .= " - ".__('add ok',ADSHO_TEXT_DOMAIN).": ".$this->getPostS("name$i")."
"; else $MsgEr .= " - ".__('add failed',ADSHO_TEXT_DOMAIN).": ".$this->getPostS("name$i")."
"; } else { $Wf = array("%d"); $Wh = array("ID" => $this->getPostN("ID$i")); $Fo = array("%s","%d","%d","%s","%s","%s"); $Da = array( 'Name' => $this->getPostS("name$i"), 'Count' => $this->getPostN("count$i"), 'TimeSec' => $this->getPostN("timesec$i"), 'Size' => $this->getPostS("size$i"), 'ImgName' => $this->getPostS("imgname$i"), 'CalcType' => $this->getPostS("calctype$i")); $ret = $wpdb->Update($table_name, $Da, $Wh, $Fo, $Wf); if ($ret >= 0) $MsgOk .= " - ".__('update ok',ADSHO_TEXT_DOMAIN).": ".$this->getPostS("name$i")."
"; else $MsgEr .= " - ".__('update failed',ADSHO_TEXT_DOMAIN).": ".$this->getPostS("name$i")."
"; } } } } if ($MsgOk != '') add_settings_error('MenHoHoliday', esc_attr('settings_updated' ), $MsgOk, 'updated'); if ($MsgEr != '') add_settings_error('MenHoHoliday', esc_attr('settings_updated' ), $MsgEr, 'error'); settings_errors(); $table_name = $wpdb->prefix . ADSHO_TBLEFFECTS; $this->EFFECTS = $wpdb->get_results("SELECT * FROM $table_name ORDER BY Name;"); // get database data effects // display new record ?> EFFECTS as $ef) { $rec++; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } echo "
".__('Save',ADSHO_TEXT_DOMAIN).", "; echo "".__('Delete',ADSHO_TEXT_DOMAIN); echo ""; if ($ef->ImgName != "textmode"){ $pt = $this->TplPath. ADSHO_FALLING_DIR; $pu = $this->TplUrl. ADSHO_FALLING_DIR; $img = str_ireplace(".", "\.", "/".$ef->ImgName."/i"); $img = str_ireplace("*", ".+", $img); $img = $this->getFilesToArray($pt, $img); foreach($img as $im) echo "*"; } else { echo "* ❄ ☆"; //($ef->TextChars); } $s = $ef->CalcType == ADSHO_FUNCTION_FALLING ? "selected" : ""; echo "
"; ?>


prefix . ADSHO_TBLHOLIDAYS; $MsgOk = ""; $MsgEr = ""; for($i=0; $i<30 ; $i++) { if ($this->getPostS("hdelete$i") !="" ) { if ($this->getPostN("ID$i") != 0) { $Fo = "%d"; $Da = array("ID" => $this->getPostN("ID$i")); $ret = $wpdb->Delete($table_name, $Da, $Fo); if ($ret == 1) $MsgOk .= " - ".__('delete ok',ADSHO_TEXT_DOMAIN).": ".$this->getPostS("name$i")."
"; else $MsgEr .= " - ".__('delete failed',ADSHO_TEXT_DOMAIN).": ".$this->getPostS("name$i")."
"; } } else if ($this->getPostS("hsave$i") != "" ) { if ($this->getPostS("name$i") != "") { if ($i==0) { $Fo = array("%s","%s","%s","%s","%s","%s","%d","%d"); $Da = array( 'Name' => $this->getPostS("name$i"), 'DaFrom' => $this->getPostS("from$i"), 'DaTo' => $this->getPostS("to$i"), 'Template' => $this->getPostS("template$i"), 'Lang' => $this->getPostS("lang$i"), 'Effect' => $this->getPostS("effect$i"), 'Active' => $this->getPostN("active$i"), 'Type' => $this->getPostN("type$i"), ); $ret = $wpdb->Insert($table_name, $Da, $Fo); if ($ret == 1) $MsgOk .= " - ".__('add ok',ADSHO_TEXT_DOMAIN).": ".$this->getPostS("name$i")."
"; else $MsgEr .= " - ".__('add failed',ADSHO_TEXT_DOMAIN).": ".$this->getPostS("name$i")."
"; } else { $Fw = array("%d"); $Wh = array("ID" => $this->getPostN("ID$i")); $Fo = array("%s","%s","%s","%s","%s","%s","%d","%d"); $Da = array( 'Name' => $this->getPostS("name$i"), 'DaFrom' => $this->getPostS("from$i"), 'DaTo' => $this->getPostS("to$i"), 'Template' => $this->getPostS("template$i"), 'Lang' => $this->getPostS("lang$i"), 'Effect' => $this->getPostS("effect$i"), 'Active' => $this->getPostN("active$i"), 'Type' => $this->getPostN("type$i"), ); $ret = $wpdb->Update($table_name, $Da, $Wh, $Fo, $Fw); if ($ret >= 0) $MsgOk .= " - ".__('update ok',ADSHO_TEXT_DOMAIN).": ".$this->getPostS("name$i")."
"; else $MsgEr .= " - ".__('update failed',ADSHO_TEXT_DOMAIN).": ".$this->getPostS("name$i")."
"; } } } } if ($MsgOk != "") add_settings_error('MenHoHoliday', esc_attr( 'settings_updated' ), $MsgOk, 'updated'); if ($MsgEr != "") add_settings_error('MenHoHoliday', esc_attr( 'settings_updated' ), $MsgEr, 'updated'); settings_errors(); $table_name = $wpdb->prefix . ADSHO_TBLEFFECTS; $this->EFFECTS = $wpdb->get_results("SELECT * FROM $table_name GROUP BY Name ORDER BY Name;"); $table_name = $wpdb->prefix . ADSHO_TBLHOLIDAYS; $this->HOLIDAY = $wpdb->get_results("SELECT * FROM $table_name ORDER BY Name;"); // display new record ?> "; ?> HOLIDAY as $ho) { $rec++; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; $s = $ho->Lang == "on" ? "checked" : ""; echo ""; echo ""; echo ""; echo ""; } echo "
".__('Save',ADSHO_TEXT_DOMAIN).", "; echo "".__('Delete',ADSHO_TEXT_DOMAIN); echo ""; echo "
"; ?>
 

getPostS('localname') : ''; $localdate = isset($_POST['localdate']) ? $this->getPostS('localdate') : ''; $localshow = isset($_POST['localshow']) ? $this->getPostS('localshow') : ''; echo "
"; echo "

Test place

"; echo __('When you select "ALL" then you must set a DATE(yyyy-mm-dd).', ADSHO_TEXT_DOMAIN); echo " ".__('"ALL" use the original "active" state.', ADSHO_TEXT_DOMAIN); echo "
".__('On other test, active will be set to automatic.', ADSHO_TEXT_DOMAIN); $table_name = $wpdb->prefix . ADSHO_TBLHOLIDAYS; $HO = $wpdb->get_results("SELECT * FROM $table_name ORDER BY Name;"); echo "
".__('Select Name', ADSHO_TEXT_DOMAIN)." "; echo ""; echo "  ".__('Date', ADSHO_TEXT_DOMAIN); echo " "; echo "  ".__('Show data', ADSHO_TEXT_DOMAIN); $c = $localshow == 'on' ? "checked" : ""; echo " "; echo " "; echo '
'; if ($localdate != '') { $date = date_parse($localdate); $localdate = ''; if (checkdate($date["month"], $date["day"], $date["year"])) { $localdate = $date["year"]."-".$date["month"]."-".$date["day"]; if (!empty($date["hour"]) && !empty($date["minute"])) $localdate .= " ".$date["hour"].":".$date["minute"]; } else { echo "
WROND DATE FORMAT

"; return; } } if ($localname == 'x' ) { if ( empty($localdate) ) echo "

ENTER DATE NOW FROM 2000-01-01 TO ...

"; else { foreach($HO as $ho) { echo '
'. do_shortcode("[ads-holiday active='*' name='".$ho->Name."' localactive='".$ho->Active."' localdate='".$localdate."' localshow='".$localshow."' ]")."
"; } } } else if ($localname != '') echo '
'. do_shortcode("[ads-holiday active='*' name='".$localname."' localdate='".$localdate."' localshow='".$localshow."']")."
"; echo '
'; } // get field #================================================= public function getSetting($field) { if (isset($this->mGeneral[$field])) return $this->mGeneral[$field]; return ''; } #================================================= private function getPostS($Post) { if (isset($_POST[$Post])) return sanitize_text_field($_POST[$Post]); return ""; } #================================================= private function getPostN($Post) { if (isset($_POST[$Post])) return intval($_POST[$Post]); return 0; } #================================================= private function getFilesToArray($dir, $search = '/.+\.html$/i') { $Directory = new RecursiveDirectoryIterator($dir); //$Iterator = new RecursiveIteratorIterator($Directory, RecursiveIteratorIterator::CHILD_FIRST); $Regex = new RegexIterator($Directory, $search, RecursiveRegexIterator::GET_MATCH); $files = array(); foreach ($Regex as $file) { array_push($files, $file[0]); } return $files; } #================================================= private function getTemplates($UseLang) { $Search = $UseLang == 'on' ? '/.+\-..\.html$/i' : '/.+\.html$/i'; $Replace = $UseLang == 'on' ? '/\-..\.html$/i' : '/\.html$/i'; $TEMPLATES = array(); $TMP = $this->getFilesToArray($this->TplPath, $Search ); foreach($TMP as $tm) { $file = basename($tm); $file = preg_replace($Replace, '', $file); if (count($TEMPLATES) == 0 || !in_array($file, $TEMPLATES)) $TEMPLATES[count( $TEMPLATES )] = $file; } return $TEMPLATES; } #================================================= public function impexp_script() { ?>