/** * End Caching * * return void */ public static function end_cache() { if (!self::$turnoff_cache && !empty(self::$cache)) { self::$started--; if (self::$started == 0) { $content = ''; if (!self::check_cache(self::$cache['cache_dir'], self::$cache['time'])) { $content = ob_get_contents(); ob_end_clean(); $dir = pathinfo(self::$cache['cache_dir'], PATHINFO_DIRNAME); if (!is_dir($dir)) { wp_mkdir_p($dir); } unset($dir); $wp_filesystem = self::InitWpFile(); self::$turnoff_cache = !$wp_filesystem->put_contents(self::$cache['cache_dir'], self::minify_html($content)); } if (!self::$turnoff_cache) { readfile(self::$cache['cache_dir']); } else { echo $content; self::removeDirectory(self::get_cache_dir()); $data = themify_get_data(); $data['setting-page_builder_cache'] = 'on'; themify_set_data($data); self::$turnoff_cache = true; } self::$cache = 0; } } }
/** * Change setting name where theme settings are stored. * Runs after updater succeeded. * @since 1.7.6 */ function themify_migrate_settings_name() { $flag = 'themify_migrate_settings_name'; $change = get_option($flag); if (!isset($change) || !$change) { if ($themify_data = get_option(wp_get_theme()->display('Name') . '_themify_data')) { themify_set_data($themify_data); } update_option($flag, true); } }
$widgets = get_option("widget_recent-posts"); $widgets[1003] = array('title' => '', 'number' => 5); update_option("widget_recent-posts", $widgets); $widgets = get_option("widget_recent-comments"); $widgets[1004] = array('title' => '', 'number' => 5); update_option("widget_recent-comments", $widgets); $widgets = get_option("widget_archives"); $widgets[1005] = array('title' => '', 'count' => 0, 'dropdown' => 0); update_option("widget_archives", $widgets); $widgets = get_option("widget_categories"); $widgets[1006] = array('title' => '', 'count' => 0, 'hierarchical' => 0, 'dropdown' => 0); update_option("widget_categories", $widgets); $widgets = get_option("widget_meta"); $widgets[1007] = array('title' => ''); update_option("widget_meta", $widgets); $widgets = get_option("widget_themify-social-links"); $widgets[1008] = array('title' => '', 'show_link_name' => NULL, 'open_new_window' => NULL, 'thumb_width' => '', 'thumb_height' => '', 'icon_size' => 'icon-large', 'orientation' => 'horizontal'); update_option("widget_themify-social-links", $widgets); $sidebars_widgets = array('sidebar-main' => array(0 => 'search-1002', 1 => 'recent-posts-1003', 2 => 'recent-comments-1004', 3 => 'archives-1005', 4 => 'categories-1006', 5 => 'meta-1007'), 'social-widget' => array(0 => 'themify-social-links-1008')); update_option("sidebars_widgets", $sidebars_widgets); $homepage = get_posts(array('name' => 'home', 'post_type' => 'page')); if (is_array($homepage) && !empty($homepage)) { update_option('show_on_front', 'page'); update_option('page_on_front', $homepage[0]->ID); } ob_start(); ?> a:141:{s:15:"setting-favicon";s:0:"";s:23:"setting-custom_feed_url";s:0:"";s:19:"setting-header_html";s:0:"";s:19:"setting-footer_html";s:0:"";s:23:"setting-search_settings";s:0:"";s:21:"setting-feed_settings";s:0:"";s:24:"setting-webfonts_subsets";s:0:"";s:21:"setting-editor-gfonts";s:131:"["Cinzel","EB Garamond","Istok Web","Jura","Kameron","Lato","Lustria","Muli","Nunito","Open Sans","Oranienbaum","Oswald","PT Sans"]";s:22:"setting-default_layout";s:8:"sidebar1";s:27:"setting-default_post_layout";s:9:"list-post";s:30:"setting-default_layout_display";s:7:"content";s:25:"setting-default_more_text";s:4:"More";s:21:"setting-index_orderby";s:4:"date";s:19:"setting-index_order";s:4:"DESC";s:26:"setting-default_post_title";s:0:"";s:33:"setting-default_unlink_post_title";s:0:"";s:25:"setting-default_post_meta";s:0:"";s:32:"setting-default_post_meta_author";s:0:"";s:34:"setting-default_post_meta_category";s:0:"";s:33:"setting-default_post_meta_comment";s:0:"";s:29:"setting-default_post_meta_tag";s:0:"";s:25:"setting-default_post_date";s:0:"";s:26:"setting-default_post_image";s:0:"";s:33:"setting-default_unlink_post_image";s:0:"";s:31:"setting-image_post_feature_size";s:5:"blank";s:24:"setting-image_post_width";s:0:"";s:25:"setting-image_post_height";s:0:"";s:24:"setting-image_post_align";s:0:"";s:32:"setting-default_page_post_layout";s:8:"sidebar1";s:31:"setting-default_page_post_title";s:0:"";s:38:"setting-default_page_unlink_post_title";s:0:"";s:30:"setting-default_page_post_meta";s:0:"";s:37:"setting-default_page_post_meta_author";s:0:"";s:39:"setting-default_page_post_meta_category";s:0:"";s:38:"setting-default_page_post_meta_comment";s:0:"";s:34:"setting-default_page_post_meta_tag";s:0:"";s:30:"setting-default_page_post_date";s:0:"";s:31:"setting-default_page_post_image";s:0:"";s:38:"setting-default_page_unlink_post_image";s:0:"";s:38:"setting-image_post_single_feature_size";s:5:"blank";s:31:"setting-image_post_single_width";s:0:"";s:32:"setting-image_post_single_height";s:0:"";s:31:"setting-image_post_single_align";s:0:"";s:27:"setting-default_page_layout";s:8:"sidebar1";s:23:"setting-hide_page_title";s:0:"";s:38:"setting-default_portfolio_index_layout";s:12:"sidebar-none";s:43:"setting-default_portfolio_index_post_layout";s:0:"";s:39:"setting-default_portfolio_index_display";s:4:"none";s:37:"setting-default_portfolio_index_title";s:0:"";s:49:"setting-default_portfolio_index_unlink_post_title";s:0:"";s:50:"setting-default_portfolio_index_post_meta_category";s:3:"yes";s:41:"setting-default_portfolio_index_post_date";s:3:"yes";s:48:"setting-default_portfolio_index_image_post_width";s:0:"";s:49:"setting-default_portfolio_index_image_post_height";s:0:"";s:38:"setting-default_portfolio_single_title";s:0:"";s:50:"setting-default_portfolio_single_unlink_post_title";s:0:"";s:51:"setting-default_portfolio_single_post_meta_category";s:3:"yes";s:42:"setting-default_portfolio_single_post_date";s:0:"";s:49:"setting-default_portfolio_single_image_post_width";s:0:"";s:50:"setting-default_portfolio_single_image_post_height";s:0:"";s:22:"themify_portfolio_slug";s:7:"project";s:34:"setting-default_team_single_layout";s:12:"sidebar-none";s:38:"setting-default_team_single_hide_title";s:0:"";s:40:"setting-default_team_single_unlink_title";s:0:"";s:38:"setting-default_team_single_hide_image";s:0:"";s:40:"setting-default_team_single_unlink_image";s:0:"";s:44:"setting-default_team_single_image_post_width";s:0:"";s:45:"setting-default_team_single_image_post_height";s:0:"";s:17:"themify_team_slug";s:4:"team";s:24:"setting-gallery_lightbox";s:8:"lightbox";s:19:"setting-entries_nav";s:8:"numbered";s:40:"setting-transition_effect_mobile_exclude";s:2:"on";s:33:"setting-portfolio_slider_autoplay";s:4:"4000";s:31:"setting-portfolio_slider_effect";s:5:"slide";s:41:"setting-portfolio_slider_transition_speed";s:3:"500";s:35:"setting-testimonial_slider_autoplay";s:4:"4000";s:33:"setting-testimonial_slider_effect";s:5:"slide";s:43:"setting-testimonial_slider_transition_speed";s:3:"500";s:22:"setting-footer_widgets";s:17:"footerwidget-3col";s:24:"setting-footer_text_left";s:0:"";s:25:"setting-footer_text_right";s:0:"";s:27:"setting-global_feature_size";s:5:"large";s:28:"setting-img_settings_quality";s:0:"";s:32:"setting-img_settings_crop_option";s:0:"";s:41:"setting-img_settings_vertical_crop_option";s:0:"";s:22:"setting-link_icon_type";s:9:"font-icon";s:32:"setting-link_type_themify-link-0";s:10:"image-icon";s:33:"setting-link_title_themify-link-0";s:7:"Twitter";s:32:"setting-link_link_themify-link-0";s:26:"http://twitter.com/themify";s:31:"setting-link_img_themify-link-0";s:76:"http://themify.me/demo/themes/flat/wp-content/themes/flat/images/twitter.png";s:32:"setting-link_type_themify-link-1";s:10:"image-icon";s:33:"setting-link_title_themify-link-1";s:8:"Facebook";s:32:"setting-link_link_themify-link-1";s:32:"https://www.facebook.com/themify";s:31:"setting-link_img_themify-link-1";s:77:"http://themify.me/demo/themes/flat/wp-content/themes/flat/images/facebook.png";s:32:"setting-link_type_themify-link-2";s:10:"image-icon";s:33:"setting-link_title_themify-link-2";s:6:"Google";s:32:"setting-link_link_themify-link-2";s:24:"https://plus.google.com/";s:31:"setting-link_img_themify-link-2";s:80:"http://themify.me/demo/themes/flat/wp-content/themes/flat/images/google-plus.png";s:32:"setting-link_type_themify-link-3";s:10:"image-icon";s:33:"setting-link_title_themify-link-3";s:7:"YouTube";s:32:"setting-link_link_themify-link-3";s:18:"http://youtube.com";s:31:"setting-link_img_themify-link-3";s:76:"http://themify.me/demo/themes/flat/wp-content/themes/flat/images/youtube.png";s:32:"setting-link_type_themify-link-4";s:10:"image-icon";s:33:"setting-link_title_themify-link-4";s:9:"Pinterest";s:32:"setting-link_link_themify-link-4";s:21:"http://pinterest.com/";s:31:"setting-link_img_themify-link-4";s:78:"http://themify.me/demo/themes/flat/wp-content/themes/flat/images/pinterest.png";s:32:"setting-link_type_themify-link-5";s:9:"font-icon";s:33:"setting-link_title_themify-link-5";s:7:"Twitter";s:32:"setting-link_link_themify-link-5";s:26:"http://twitter.com/themify";s:33:"setting-link_ficon_themify-link-5";s:10:"fa-twitter";s:35:"setting-link_ficolor_themify-link-5";s:0:"";s:37:"setting-link_fibgcolor_themify-link-5";s:0:"";s:32:"setting-link_type_themify-link-6";s:9:"font-icon";s:33:"setting-link_title_themify-link-6";s:8:"Facebook";s:32:"setting-link_link_themify-link-6";s:27:"http://facebook.com/themify";s:33:"setting-link_ficon_themify-link-6";s:11:"fa-facebook";s:35:"setting-link_ficolor_themify-link-6";s:0:"";s:37:"setting-link_fibgcolor_themify-link-6";s:0:"";s:32:"setting-link_type_themify-link-7";s:9:"font-icon";s:33:"setting-link_title_themify-link-7";s:7:"Google+";s:32:"setting-link_link_themify-link-7";s:27:"https://plus.google.com/";s:33:"setting-link_ficon_themify-link-7";s:14:"fa-google-plus";s:35:"setting-link_ficolor_themify-link-7";s:0:"";s:37:"setting-link_fibgcolor_themify-link-7";s:0:"";s:32:"setting-link_type_themify-link-8";s:9:"font-icon";s:33:"setting-link_title_themify-link-8";s:7:"YouTube";s:32:"setting-link_link_themify-link-8";s:37:"http://www.youtube.com/user/themifyme";s:33:"setting-link_ficon_themify-link-8";s:10:"fa-youtube";s:35:"setting-link_ficolor_themify-link-8";s:0:"";s:37:"setting-link_fibgcolor_themify-link-8";s:0:"";s:32:"setting-link_type_themify-link-9";s:9:"font-icon";s:33:"setting-link_title_themify-link-9";s:9:"Pinterest";s:32:"setting-link_link_themify-link-9";s:20:"http://pinterest.com";s:33:"setting-link_ficon_themify-link-9";s:12:"fa-pinterest";s:35:"setting-link_ficolor_themify-link-9";s:0:"";s:37:"setting-link_fibgcolor_themify-link-9";s:0:"";s:22:"setting-link_field_ids";s:341:"{"themify-link-0":"themify-link-0","themify-link-1":"themify-link-1","themify-link-2":"themify-link-2","themify-link-3":"themify-link-3","themify-link-4":"themify-link-4","themify-link-5":"themify-link-5","themify-link-6":"themify-link-6","themify-link-7":"themify-link-7","themify-link-8":"themify-link-8","themify-link-9":"themify-link-9"}";s:23:"setting-link_field_hash";s:2:"10";s:30:"setting-page_builder_is_active";s:6:"enable";s:23:"setting-hooks_field_ids";s:2:"[]";s:4:"skin";s:0:"";}<?php $themify_data = ob_get_clean(); themify_set_data(unserialize($themify_data));
/** * AJAX - Reset Settings * @since 1.1.3 * @package themify */ function themify_reset_setting() { check_ajax_referer('ajax-nonce', 'nonce'); $data = explode("&", $_POST['data']); $temp_data = array(); foreach ($data as $a) { $v = explode("=", $a); $temp_data[$v[0]] = str_replace("+", " ", preg_replace('/%([0-9a-f]{2})/ie', "chr(hexdec('\\1'))", $v[1])); } $temp = array(); foreach ($temp_data as $key => $val) { // Don't reset if it's not a setting or the # of social links or a social link or the Hook Contents if (strpos($key, 'setting') === false || strpos($key, 'hooks') || strpos($key, 'link_field_ids') || strpos($key, 'themify-link') || strpos($key, 'twitter_settings') || strpos($key, 'custom_css')) { $temp[$key] = $val; } } print_r(themify_set_data($temp)); die; }
/** * Checks ONLY ONCE if img.php exists and if it doesn't, sets setting-img_settings_use=on. * Note that if later, for whatever reason, img.php is restored, this won't automatically enable it. * User will have to manually enable img.php again. * @since 1.6.0 */ function themify_maybe_unset_image_script() { $flag = 'themify_unset_image_script'; $noimg = get_option($flag); if (!isset($noimg) || !$noimg) { if (!file_exists(trailingslashit(THEMIFY_DIR) . 'img.php')) { $get_data = array_merge(themify_get_data(), array('setting-img_settings_use' => 'on')); $data = array(); foreach ($get_data as $key => $val) { $data[] = $key . '=' . $val; } $temp = array(); foreach ($data as $a) { $v = explode('=', $a); $temp[$v[0]] = urldecode(str_replace('+', ' ', preg_replace('/%([0-9a-f]{2})/ie', "chr(hexdec('\\1'))", urlencode($v[1])))); } themify_set_data($temp); } update_option($flag, true); } }
function themify_extract_zip($file) { $zip = zip_open($file); $dir = "temp/"; if (is_resource($zip)) { while ($zip_entry = zip_read($zip)) { // echo $dir.basename(zip_entry_name($zip_entry)); $fp = fopen($dir . basename(zip_entry_name($zip_entry)), "w"); if (zip_entry_open($zip, $zip_entry, "r")) { $buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry)); fwrite($fp, "{$buf}"); zip_entry_close($zip_entry); fclose($fp); } } zip_close($zip); } else { echo zipFileErrMsg($zip); } if (file_exists($dir . "custom-config.xml")) { unlink("../custom-config.xml"); rename($dir . "custom-config.xml", "../custom-config.xml"); } if (file_exists($dir . "custom-modules.php")) { unlink("../custom-modules.php"); rename($dir . "custom-modules.php", "../custom-modules.php"); } if (file_exists($dir . "custom-functions.php")) { unlink("../custom-functions.php"); rename($dir . "custom-functions.php", "../custom-functions.php"); } if (file_exists($dir . "data_export.txt")) { $handler = fopen($dir . "data_export.txt", "r"); $data = fread($handler, filesize($dir . "data_export.txt")); themify_set_data(unserialize($data)); fclose($handler); } }
/** * AJAX - Reset Settings * @since 1.1.3 * @package themify */ function themify_reset_setting() { check_ajax_referer('ajax-nonce', 'nonce'); $data = explode("&", $_POST['data']); $temp_data = array(); foreach ($data as $a) { $v = explode("=", $a); $temp_data[$v[0]] = str_replace("+", " ", preg_replace('/%([0-9a-f]{2})/ie', "chr(hexdec('\\1'))", $v[1])); } $temp = array(); foreach ($temp_data as $key => $val) { if (strpos($key, 'setting') === false) { $temp[$key] = $val; } } print_r(themify_set_data($temp)); die; }