コード例 #1
0
    function createPagination($query)
    {
        global $wp_rewrite;
        $total = $query->max_num_pages;
        $current = max(1, ThemeHelper::getPageNumber());
        $Validation = new ThemeValidation();
        $pagination = array('base' => add_query_arg('paged', '%#%'), 'format' => '', 'current' => $current, 'total' => $total, 'next_text' => __(' >', THEME_CONTEXT), 'prev_text' => __('< ', THEME_CONTEXT));
        if ($wp_rewrite->using_permalinks()) {
            $pagination['base'] = user_trailingslashit(trailingslashit(remove_query_arg('s', get_pagenum_link(1))) . 'page/%#%/', 'paged');
        }
        if (is_search()) {
            $pagination['add_args'] = array('s' => urlencode(get_query_var('s')));
        }
        $html = paginate_links($pagination);
        if ($Validation->isNotEmpty($html)) {
            $html = '
				<div class="theme-blog-pagination-box">
					<div class="theme-blog-pagination">
						' . $html . '
					</div>
				</div>
			';
        }
        return $html;
    }
コード例 #2
0
 static function getColor($color)
 {
     $Validation = new ThemeValidation();
     if (!$Validation->isColor($color, false)) {
         return false;
     }
     if ($color === 'transparent') {
         return $color;
     }
     $length = strlen($color);
     if ($length == 6) {
         return '#' . $color;
     }
     if ($length == 8) {
         return self::HEX2RGBA($color);
     }
     return false;
 }
コード例 #3
0
 function setToStyle(&$style)
 {
     $Validation = new ThemeValidation();
     $download = array();
     $selector = array('base', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6');
     $dictionary = $this->unpack();
     foreach ($selector as $value) {
         $name = ThemeOption::getOption('font_' . $value . '_family_google');
         if ($Validation->isNotEmpty($name) && !in_array($name, $download)) {
             if (!isset($dictionary[$name])) {
                 continue;
             }
             $subset = join(',', (array) $dictionary[$name]['subset']);
             $variant = join(',', (array) $dictionary[$name]['variant']);
             $download[] = $name;
             $style['google-font-' . preg_replace('/ /', '-', strtolower($name))] = array('use' => 2, 'inc' => true, 'path' => null, 'file' => '//fonts.googleapis.com/css?family=' . urlencode($name) . ':' . $variant . '&subset=' . $subset, 'dependencies' => array());
         }
     }
 }
コード例 #4
0
 function widget($argument, $instance)
 {
     $data = array();
     $Validation = new ThemeValidation();
     if (is_array($argument['_data'])) {
         foreach ($argument['_data'] as $index => $value) {
             $data[$index] = $value;
         }
     }
     $title = apply_filters('widget_title', $instance['title']);
     $data['html']['start'] = $argument['before_widget'];
     if ($Validation->isNotEmpty($title)) {
         $data['html']['start'] .= $argument['before_title'] . $title . $argument['after_title'];
     }
     $data['html']['stop'] = $argument['after_widget'];
     $data['instance'] = $instance;
     $Template = new ThemeTemplate($data, THEME_PATH_TEMPLATE . $argument['_data']['file']);
     echo apply_filters('widget_text', $Template->output(true));
 }
コード例 #5
0
    $count = get_comments_number($post->ID);
    if ($count > 0) {
        ?>
		<h5 class="pb-header" id="comments-number">
			<span class="pb-header-content"><?php 
        echo sprintf(__('All comments (%s)', THEME_DOMAIN), $count);
        ?>
</span>
		</h5>

		<div id="comments_list" class="theme-clear-fix">

			<ul class="theme-reset-list theme-clear-fix">
<?php 
        $Comment = new ThemeComment();
        $Validation = new ThemeValidation();
        wp_list_comments(array('avatar_size' => 70, 'page' => $Comment->page, 'per_page' => $Comment->comments_per_page, 'callback' => array($Comment, 'createComment')));
        $pagination = paginate_comments_links(array('base' => '#cpage-%#%', 'format' => '', 'add_fragment' => '', 'current' => $Comment->page, 'next_text' => __('Next', THEME_DOMAIN), 'prev_text' => __('Previous', THEME_DOMAIN), 'echo' => false));
        ?>
			</ul>
<?php 
        if ($Validation->isNotEmpty($pagination)) {
            ?>
			<div class="theme-comment-pagination-box"> 
				<div class="theme-comment-pagination theme-clear-fix"><?php 
            echo $pagination;
            ?>
</div>
			</div>
<?php 
        }
コード例 #6
0
 function addComment()
 {
     global $wpdb;
     $Validation = new ThemeValidation();
     $response = array('error' => 0, 'info' => null, 'changeURL' => '');
     $data = array('author' => null, 'email' => null, 'url' => null, 'comment' => null, 'comment_post_ID' => 0, 'comment_parent' => 0);
     foreach ($data as $index => $value) {
         if (array_key_exists($index, $_POST)) {
             $data[$index] = $_POST[$index];
         }
     }
     if (!is_user_logged_in()) {
         if ($Validation->isEmpty($data['author']) && get_option('require_name_email') == 1) {
             $response['error'] = 1;
             $response['info'][] = array('fieldId' => 'author', 'message' => esc_html__('Please enter your name.', THEME_DOMAIN));
         }
         if (!$Validation->isEmailAddress($data['email']) && get_option('require_name_email') == 1) {
             $response['error'] = 1;
             $response['info'][] = array('fieldId' => 'email', 'message' => esc_html__('Please enter valid e-mail address.', THEME_DOMAIN));
         }
         if (!$Validation->isURL($data['url'], true)) {
             $response['error'] = 1;
             $response['info'][] = array('fieldId' => 'url', 'message' => esc_html__('Please enter valid URL address.', THEME_DOMAIN));
         }
     }
     if ($Validation->isEmpty($data['comment'])) {
         $response['error'] = 1;
         $response['info'][] = array('fieldId' => 'comment', 'message' => esc_html__('Please enter your message.', THEME_DOMAIN));
     }
     if ($response['error'] == 1) {
         $this->createResponse($response);
     }
     $data = ThemeHelper::stripslashesPOST($data);
     $insertData = array('comment_post_ID' => (int) $data['comment_post_ID'], 'comment_content' => $data['comment'], 'comment_parent' => (int) $data['comment_parent'], 'comment_date' => current_time('mysql'), 'comment_approved' => $this->comment_moderation);
     if (!is_user_logged_in()) {
         $insertData['comment_author'] = $data['author'];
         $insertData['comment_author_url'] = ThemeHelper::addProtocolName($data['url']);
         $insertData['comment_author_email'] = $data['email'];
     } else {
         $user = wp_get_current_user();
         $insertData['comment_author'] = $user->display_name;
         $insertData['comment_author_email'] = $user->user_email;
     }
     $commentId = wp_insert_comment($insertData);
     if ($commentId) {
         query_posts('p=' . (int) $data['comment_post_ID'] . '&post_type=post');
         if (have_posts()) {
             the_post();
             if ((int) $data['comment_parent'] == 0 || $this->thread_comments == 0) {
                 $query = 'select count(*) as count from ' . $wpdb->comments . ' where comment_approved=1 and comment_post_ID=' . (int) get_the_ID() . ($this->thread_comments == 1 ? ' and comment_parent=0' : null);
                 $parent = $wpdb->get_row($query);
                 if ($this->comments_per_page > 0) {
                     $_GET['cpage'] = ceil($parent->count / $this->comments_per_page);
                 } else {
                     $_GET['cpage'] = 1;
                 }
                 $response['changeURL'] = '#cpage-' . $_GET['cpage'];
             } else {
                 $_GET['cpage'] = (int) $_POST['cpage'];
             }
             $response['cpage'] = (int) $_GET['cpage'];
             $response['commentId'] = (int) $commentId;
             ob_start();
             comments_template();
             $response['html'] = ob_get_contents();
             ob_end_clean();
         }
         $response['comment_id'] = $commentId;
         $response['error'] = 0;
         $response['info'][] = array('fieldId' => 'submit', 'message' => esc_html__('Your comment has been added.', THEME_DOMAIN));
     } else {
         $response['error'] = 1;
         $response['info'][] = array('fieldId' => 'submit', 'message' => esc_html__('Your comment could not be added.', THEME_DOMAIN));
     }
     $this->createResponse($response);
 }
コード例 #7
0
    function createPostNavigation()
    {
        $html = null;
        $Validation = new ThemeValidation();
        $prevPost = get_previous_post();
        if (!empty($prevPost)) {
            $html .= '<a class="theme-post-navigation-prev" href="' . get_permalink($prevPost->ID) . '" title="' . sprintf(esc_attr('View post "%s"', THEME_DOMAIN), get_the_title($prevPost->ID)) . '">' . get_the_post_thumbnail($prevPost->ID) . '<span class="theme-post-navigation-arrow"></span><span class="theme-post-navigation-content">' . get_the_title($prevPost->ID) . '</span></a>';
        }
        // $prevPost2=get_previous_post(false, '', true, 'category', $prevPost);
        // if(!empty($prevPost2)) $html.='<a class="theme-post-navigation-prev" href="'.get_permalink($prevPost2->ID).'" title="'.sprintf(esc_attr('View post "%s"',THEME_DOMAIN),get_the_title($prevPost2->ID)).'">'.get_the_post_thumbnail($prevPost2->ID).'<span class="theme-post-navigation-arrow"></span><span class="theme-post-navigation-content">'.get_the_title($prevPost2->ID).'</span></a>';
        $nextPost = get_next_post();
        if (!empty($nextPost)) {
            $html .= '<a class="theme-post-navigation-next" href="' . get_permalink($nextPost->ID) . '" title="' . sprintf(esc_attr('View post "%s"', THEME_DOMAIN), get_the_title($nextPost->ID)) . '">' . get_the_post_thumbnail($nextPost->ID) . '<span class="theme-post-navigation-content">' . get_the_title($nextPost->ID) . '</span><span class="theme-post-navigation-arrow"></span></a>';
        }
        // $nextPost2=get_next_post(false, '', false, 'category', $nextPost);
        // if(!empty($nextPost2)) $html.='<a class="theme-post-navigation-next" href="'.get_permalink($nextPost2->ID).'" title="'.sprintf(esc_attr('View post "%s"',THEME_DOMAIN),get_the_title($nextPost2->ID)).'">'.get_the_post_thumbnail($nextPost2->ID).'<span class="theme-post-navigation-content">'.get_the_title($nextPost2->ID).'</span><span class="theme-post-navigation-arrow"></span></a>';
        if ($Validation->isNotEmpty($html)) {
            $html = '
				<div class="theme-post-navigation theme-clear-fix">
					' . $html . '
				</div>				
			';
        }
        return $html;
    }
コード例 #8
0
 function displayTitle($title)
 {
     $Validation = new ThemeValidation();
     global $fable_parentPost;
     $title = get_bloginfo('name');
     if (!$Validation->isEmpty($title)) {
         $title .= ' | ';
     }
     $title .= $fable_parentPost->post->post_title;
     return $title;
 }
コード例 #9
0
ファイル: header.php プロジェクト: phanhoanglong2610/anc_gvn
<?php

ob_start();
?>
<!DOCTYPE html>
<?php 
global $post, $fable_parentPost;
$Theme = new Theme();
$Post = new ThemePost();
$Page = new ThemePage();
$Menu = new ThemeMenu();
$Validation = new ThemeValidation();
if (($fable_parentPost = $Post->getPost()) === false) {
    $fable_parentPost = new stdClass();
    $fable_parentPost->post = $post;
}
$meta = ThemeOption::getPostMeta($post);
ThemeHelper::removeUIndex($meta, 'page_background_color');
?>
		<html xmlns="http://www.w3.org/1999/xhtml" <?php 
language_attributes();
?>
>

			<head>
				<title><?php 
wp_title('|');
?>
</title> 
				<meta http-equiv="Content-Type" content="<?php 
bloginfo('html_type');
コード例 #10
0
    function createPostNavigation()
    {
        $html = null;
        $Validation = new ThemeValidation();
        $prevPost = get_previous_post();
        if (!empty($prevPost)) {
            $html .= '<a class="theme-post-navigation-prev" href="' . get_permalink($prevPost->ID) . '"><span class="theme-post-navigation-arrow"></span><span class="theme-post-navigation-content">' . get_the_title($prevPost->ID) . '</span></a>';
        }
        $nextPost = get_next_post();
        if (!empty($nextPost)) {
            $html .= '<a class="theme-post-navigation-next" href="' . get_permalink($nextPost->ID) . '"><span class="theme-post-navigation-content">' . get_the_title($nextPost->ID) . '</span><span class="theme-post-navigation-arrow"></span></a>';
        }
        if ($Validation->isNotEmpty($html)) {
            $html = '
				<div class="theme-post-navigation theme-clear-fix">
					' . $html . '
				</div>				
			';
        }
        return $html;
    }
コード例 #11
0
 static function createStyleAttribute($style)
 {
     $ret = null;
     $Validation = new ThemeValidation();
     foreach ($style as $index => $value) {
         if ($Validation->isEmpty($value)) {
             continue;
         }
         $ret .= $index . ':' . $value . ';';
     }
     return $Validation->isEmpty($ret) ? null : ' style="' . $ret . '"';
 }
コード例 #12
0
 function validateProperty($property)
 {
     $data = array();
     $Validation = new ThemeValidation();
     foreach ($property as $name => $value) {
         $unit = 'px';
         if (is_array($value)) {
             if (isset($value['unit'])) {
                 $unit = $value['unit'];
             }
             if (isset($value['value'])) {
                 $value = $value['value'];
             }
         }
         switch ($name) {
             case 'left':
             case 'width':
             case 'height':
             case 'font-size':
             case 'padding-top':
             case 'padding-left':
             case 'padding-right':
             case 'padding-bottom':
             case 'border-width':
                 if ($Validation->isNumber($value, 0, 9999)) {
                     $data[$name] = $value . $unit;
                 }
                 break;
             case 'top':
             case 'margin-top':
             case 'margin-left':
             case 'margin-right':
             case 'margin-bottom':
                 if ($Validation->isNumber($value, -9999, 9999)) {
                     $data[$name] = $value . $unit;
                 }
                 break;
             case 'color':
             case 'border-color':
             case 'border-top-color':
             case 'border-right-color':
             case 'border-bottom-color':
             case 'border-left-color':
             case 'outline-color':
             case 'background-color':
                 $value = ThemeColor::getColor($value);
                 if ($Validation->isNotEmpty($value)) {
                     $data[$name] = $value;
                 }
                 break;
             case 'font-family':
                 foreach ((array) $value as $family) {
                     if ($Validation->isNotEmpty($family)) {
                         ThemeHelper::removeUIndex($data, $name);
                         if ($Validation->isNotEmpty($data[$name])) {
                             $data[$name] .= ',';
                         }
                         $data[$name] .= '\'' . $family . '\'';
                     }
                 }
                 break;
             case 'font-style':
                 if (isset($this->fontStyle[$value])) {
                     $data[$name] = $value;
                 }
                 break;
             case 'font-weight':
                 if (isset($this->fontWeight[$value])) {
                     $data[$name] = $value;
                 }
                 break;
             case 'display':
             case 'border-style':
             case 'line-height':
             case 'background':
             case 'background-repeat':
             case 'background-position':
                 if ($Validation->isNotEmpty($value)) {
                     $data[$name] = $value;
                 }
                 break;
             case 'background-image':
                 if ($Validation->isNotEmpty($value)) {
                     $data[$name] = 'url(\'' . $value . '\',THEME_CONTEXT)';
                 }
                 break;
         }
     }
     return $data;
 }
コード例 #13
0
ファイル: Theme.Menu.class.php プロジェクト: slavai/sadick
    function create()
    {
        global $fable_parentPost;
        $attribute = array();
        $attribute['menu_id'] = 0;
        $menu = wp_get_nav_menus();
        $menuLocation = get_nav_menu_locations();
        $locationId = 'menu_top';
        $Validation = new ThemeValidation();
        if (isset($menuLocation[$locationId])) {
            foreach ($menu as $m) {
                if ($m->term_id == $menuLocation[$locationId]) {
                    $attribute['menu_id'] = $m->term_id;
                }
            }
        }
        if ($attribute['menu_id'] == 0) {
            if (ThemeOption::getGlobalOption($fable_parentPost->post, 'menu_top') == 0) {
                return;
            }
        }
        if ($attribute['menu_id'] == 0) {
            $attribute['menu_id'] = ThemeOption::getGlobalOption($fable_parentPost->post, 'menu_top');
        }
        $attribute['logo_src'] = ThemeOption::getOption('menu_logo_src');
        $attribute['responsive_mode'] = ThemeOption::getOption('menu_responsive_mode');
        $attribute['sticky_enable'] = ThemeOption::getOption('menu_sticky_enable');
        $attribute['hide_scroll_enable'] = ThemeOption::getOption('menu_hide_scroll_enable');
        $attribute['menu_animation_enable'] = ThemeOption::getOption('menu_animation_enable');
        $attribute['menu_animation_speed_open'] = ThemeOption::getOption('menu_animation_speed_open');
        $attribute['menu_animation_speed_close'] = ThemeOption::getOption('menu_animation_speed_close');
        $attribute['menu_animation_delay'] = ThemeOption::getOption('menu_animation_delay');
        $attribute['scroll_animation_enable'] = ThemeOption::getOption('menu_scroll_animation_enable');
        $attribute['scroll_animation_speed'] = ThemeOption::getOption('menu_scroll_animation_speed');
        $attribute['scroll_animation_easing'] = ThemeOption::getOption('menu_scroll_animation_easing');
        $attribute['css_class'] = 'pb';
        if (!class_exists('PBComponentMenu')) {
            $html = null;
            $logoHTML = null;
            $option = array();
            $key = array('responsive_mode', 'sticky_enable', 'hide_scroll_enable', 'menu_animation_enable', 'menu_animation_speed_open', 'menu_animation_speed_close', 'menu_animation_delay', 'scroll_animation_enable', 'scroll_animation_speed', 'scroll_animation_easing');
            foreach ($key as $value) {
                $option[$value] = $attribute[$value];
            }
            $option['responsive_menu_id'] = ThemeHelper::createId('pb_menu_responsive');
            $option['responsive_menu_label'] = __('Menu');
            $id = ThemeHelper::createId('pb_menu');
            $classLogo = array('pb-logo');
            $classMenu = array('pb-menu-default');
            $classMenuResponsive = array('pb-menu-responsive');
            $class = array('pb-menu', $attribute['css_class']);
            $menuAttribute = array('menu' => $attribute['menu_id'], 'walker' => new ThemeMenuWalker(), 'menu_class' => 'sf-menu pb-reset-list pb-clear-fix', 'container' => '', 'container_class' => '', 'echo' => 0);
            $menuResponsiveAttribute = array('id' => $option['responsive_menu_id'], 'menu' => $attribute['menu_id'], 'walker' => new ThemeMenuResponsiveWalker(), 'menu_class' => 'pb-clear-fix', 'container' => '', 'container_class' => '', 'echo' => 0, 'items_wrap' => '<div id="%1$s" class="%2$s"><div id="' . $option['responsive_menu_id'] . '"><ul>%3$s</ul></div></div>');
            if ($Validation->isURL($attribute['logo_src'])) {
                $logoHTML = '
					<a href="' . get_home_url() . '">
						<img src="' . esc_attr($attribute['logo_src']) . '" alt=""/>
					</a>
				';
            }
            $html = '
				<div' . ThemeHelper::createClassAttribute($class) . ' id="' . $id . '">
					<div class="pb-main pb-clear-fix">
						<div' . ThemeHelper::createClassAttribute($classLogo) . '>
							' . $logoHTML . '
						</div>
						<div' . ThemeHelper::createClassAttribute($classMenu) . '>
							' . wp_nav_menu($menuAttribute) . '
						</div>
						<div' . ThemeHelper::createClassAttribute($classMenuResponsive) . '>
							' . wp_nav_menu($menuResponsiveAttribute) . '
						</div>	
					</div>
				</div>
				<div class="pb-script-tag">
					<script type="text/javascript">
						jQuery(document).ready(function($)
						{
							$(\'#' . $id . '\').menu(' . json_encode($option) . ');
						});
					</script>
				</div>
			';
            return $html;
        } else {
            $attributeString = null;
            foreach ($attribute as $index => $value) {
                $attributeString .= ' ' . $index . '="' . $value . '"';
            }
            $shortcode = '[' . PLUGIN_PAGE_BUILDER_SHORTCODE_PREFIX . 'menu' . $attributeString . ']';
            echo do_shortcode($shortcode);
        }
    }
コード例 #14
0
ファイル: Theme.class.php プロジェクト: slavai/sadick
    function createCSSFile()
    {
        if ($this->createMultisitePath() === false) {
            return;
        }
        $content = null;
        $CSS = new ThemeCSS();
        $Validation = new ThemeValidation();
        $ResponsiveMode = new ThemeResponsiveMode($this->responsiveMode);
        ThemeOption::refreshOption();
        $media = $ResponsiveMode->getMedia();
        if (ThemeOption::getOption('responsive_mode_enable') != 1) {
            $media = $media[1];
        }
        $selector = array('base' => array('a', 'body', 'input', 'select', 'textarea', '.theme-page .gform_wrapper select', '.theme-page .gform_wrapper textarea', '.theme-page .gform_wrapper input[type="tel"]', '.theme-page .gform_wrapper input[type="url"]', '.theme-page .gform_wrapper input[type="text"]', '.theme-page .gform_wrapper input[type="email"]', '.theme-page .gform_wrapper input[type="number"]', '.theme-page .gform_wrapper input[type="password"]'), 'h1' => array('h1', 'h1 a'), 'h2' => array('h2', 'h2 a', '.pb-counter-box ul>li>div>div.pb-counter-box-text-counter', '.pb-pricing-plan>ul>li>div .pb-pricing-plan-item-price-box .pb-pricing-plan-item-price-box-value'), 'h3' => array('h3', 'h3 a', '.pb-testimonial ul.pb-layout-100>li>div>p', '.pb-twitter-user-timeline .pb-twitter-user-timeline-text', '.pb-twitter-user-timeline .pb-twitter-user-timeline-text a'), 'h4' => array('h4', 'h4 a'), 'h5' => array('h5', 'h5 a', 'h3.comment-reply-title', '.pb-zaccordion .pb-zaccordion-caption-box .pb-zaccordion-caption-box-title'), 'h6' => array('h6', 'h6 a', '.pb-testimonial ul.pb-layout-50x50>li>div>p', '.pb-testimonial ul.pb-layout-33x33x33>li>div>p', '.pb-testimonial ul.pb-layout-25x25x25x25>li>div>p', 'div.pb-counter-list>ul>li>span.pb-counter-list-label', 'div.pb-counter-list>ul>li>span.pb-counter-list-value', '.pb-blockquote blockquote', '.pb-blockquote blockquote p'));
        foreach ($selector as $index => $value) {
            $content .= $CSS->create(array('selector' => $value, 'property' => array('font-family' => array(ThemeOption::getOption('font_' . $index . '_family_google'), ThemeOption::getOption('font_' . $index . '_family_system')), 'font-size' => ThemeOption::getOption('font_' . $index . '_size'), 'font-style' => ThemeOption::getOption('font_' . $index . '_style'), 'font-weight' => ThemeOption::getOption('font_' . $index . '_weight'), 'line-height' => ThemeOption::getOption('font_' . $index . '_line_height'))));
        }
        $content .= $CSS->create(array('selector' => array('.pb-header-subheader .pb-subheader span'), 'property' => array('font-family' => array(ThemeOption::getOption('font_base_family_google'), ThemeOption::getOption('font_base_family_system')))));
        if (count($media)) {
            foreach ($media as $mediaIndex => $mediaValue) {
                foreach ($selector as $selectorIndex => $selectorValue) {
                    $content .= $CSS->create(array('media' => $mediaValue, 'selector' => $selectorValue, 'property' => array('font-size' => ThemeOption::getOption('font_' . $selectorIndex . '_size_' . $mediaIndex))));
                }
            }
        } else {
            foreach ($selector as $selectorIndex => $selectorValue) {
                $content .= $CSS->create(array('selector' => $selectorValue, 'property' => array('font-size' => ThemeOption::getOption('font_' . $selectorIndex . '_size_1'))));
            }
        }
        if (ThemeOption::getOption('responsive_mode_enable') == 1) {
            $maxWidth = ThemeOption::getOption('menu_responsive_level') - 1;
            $content .= $CSS->create(array('media' => array('min-width' => 0, 'max-width' => $maxWidth), 'selector' => array('ul.sf-menu'), 'property' => array('display' => 'none')));
            $content .= $CSS->create(array('media' => array('min-width' => 0, 'max-width' => $maxWidth), 'selector' => array('select.dp-menu'), 'property' => array('display' => 'block')));
        }
        foreach ($media as $index => $value) {
            if ($Validation->isNotEmpty(ThemeOption::getOption('custom_css_responsive_' . $index))) {
                if (array_key_exists('min-width', $value) && array_key_exists('max-width', $value)) {
                    $content .= '
					@media only screen  and (min-width:' . $value['min-width'] . 'px) and (max-width:' . $value['max-width'] . 'px)
					{
					' . ThemeOption::getOption('custom_css_responsive_' . $index) . '
					}
					';
                } else {
                    $content .= ThemeOption::getOption('custom_css_responsive_' . $index);
                }
            }
        }
        $file = THEME_PATH_MULTISITE_SITE_STYLE . 'style.css';
        @chmod($file, 0755);
        if (file_put_contents($file, $content) === false) {
            return false;
        }
        return true;
    }
コード例 #15
0
ファイル: blog-content.php プロジェクト: slavai/sadick
<?php

global $post, $fable_parentPost;
$Blog = new ThemeBlog();
$Page = new ThemePage();
$Post = new ThemePost();
$Validation = new ThemeValidation();
$WidgetArea = new ThemeWidgetArea();
$widgetAreaData = $WidgetArea->getWidgetAreaByPost($fable_parentPost->post, true, true);
$query = $Blog->getPost();
$postCount = count($query->posts);
if ($postCount) {
    ?>
		<div class="theme-clear-fix">
			
			<ul class="theme-reset-list theme-clear-fix theme-blog">
<?php 
    while ($query->have_posts()) {
        $query->the_post();
        $excerpt = apply_filters('the_content', get_the_excerpt());
        $option = ThemeOption::getPostMeta($post);
        ThemeHelper::removeUIndex($option, 'post_type');
        $visibleOption = array();
        $visibleOption['post_tag_visible'] = ThemeOption::getGlobalOption($post, 'post_tag_visible');
        $visibleOption['post_author_visible'] = ThemeOption::getGlobalOption($post, 'post_author_visible');
        $visibleOption['post_category_visible'] = ThemeOption::getGlobalOption($post, 'post_category_visible');
        $visibleOption['post_comment_count_visible'] = ThemeOption::getGlobalOption($post, 'post_comment_count_visible') && comments_open(get_the_id());
        ?>
				<li id="post-<?php 
        the_ID();
        ?>
コード例 #16
0
ファイル: footer.php プロジェクト: phanhoanglong2610/anc_gvn
<?php

global $fable_parentPost;
$Page = new ThemePage();
$Validation = new ThemeValidation();
$WidgetArea = new ThemeWidgetArea();
$widgetAreaData = $WidgetArea->getWidgetAreaByPost($fable_parentPost->post, true, true);
$class = $WidgetArea->getWidgetAreaCSSClass($widgetAreaData);
$template = $Page->getCurrentTemplate();
$widgetAreaFooterEnable = false;
if (ThemeOption::getOption('footer_top_enable') == 1) {
    $widgetAreaData = $WidgetArea->getWidgetAreaByPost($fable_parentPost->post, false, true);
    $layout = $WidgetArea->setWidgetAreaLayout($widgetAreaData['id']);
    if ($widgetAreaData['id'] && $widgetAreaData['location']) {
        $widgetAreaFooterEnable = true;
    }
}
if (ThemeOption::getOption('footer_enable') == 1 && ($widgetAreaFooterEnable || ThemeOption::getGlobalOption($post, 'footer_bottom_enable') == 1)) {
    ?>
				<div class="theme-footer theme-clear-fix">
<?php 
    if ($widgetAreaFooterEnable) {
        $style = array();
        if ($Validation->isNotEmpty(ThemeOption::getOption('footer_top_background_image_src'))) {
            $style['background-image'] = 'url(\'' . ThemeOption::getOption('footer_top_background_image_src') . '\')';
            $style['background-repeat'] = ThemeOption::getOption('footer_top_background_image_repeat');
            if ($Validation->isNotEmpty(ThemeOption::getOption('footer_top_background_image_position'))) {
                $style['background-position'] = ThemeOption::getOption('footer_top_background_image_position');
            }
            $style['background-size'] = ThemeOption::getOption('footer_top_background_image_size_1');
            if (in_array($style['background-size'], array('length', 'percentage'))) {
コード例 #17
0
<?php

global $post, $fable_parentPost;
the_post();
$Page = new ThemePage();
$Post = new ThemePost();
$Validation = new ThemeValidation();
$WidgetArea = new ThemeWidgetArea();
$widgetAreaData = $WidgetArea->getWidgetAreaByPost($fable_parentPost->post, true, true);
$option = ThemeOption::getPostMeta($post);
ThemeHelper::removeUIndex($option, 'post_type');
$visibleOption = array();
$visibleOption['post_tag_visible'] = ThemeOption::getGlobalOption($post, 'post_tag_visible');
$visibleOption['post_author_visible'] = ThemeOption::getGlobalOption($post, 'post_author_visible');
$visibleOption['post_category_visible'] = ThemeOption::getGlobalOption($post, 'post_category_visible');
$visibleOption['post_comment_count_visible'] = ThemeOption::getGlobalOption($post, 'post_comment_count_visible') && comments_open(get_the_id());
$visibleOption['post_navigation_visible'] = ThemeOption::getGlobalOption($post, 'post_navigation_visible');
?>
		<div <?php 
post_class('theme-clear-fix theme-post theme-post-type-' . (is_sticky() ? 'sticky' : $option['post_type']));
?>
 id="post-<?php 
the_ID();
?>
">
<?php 
switch ($option['post_type']) {
    case 'audio':
    case 'video':
    case 'image_slider':
        if ($option['post_type'] == 'image_slider') {