function getPost()
 {
     $data = new stdClass();
     $categoryId = (int) get_query_var('cat');
     if (is_tag()) {
         $data->post = get_post(ThemeOption::getOption('blog_search_post_id'));
         $tagQuery = get_query_var('tag');
         $tagData = get_tags(array('slug' => $tagQuery));
         $data->post->post_title = esc_html($tagData[0]->name);
     } elseif (is_category($categoryId)) {
         $category = get_category($categoryId);
         $data->post = get_post(ThemeOption::getOption('blog_category_post_id'));
         $data->post->post_title = ThemeHelper::esc_html($category->name);
     } elseif (is_day()) {
         $data->post = get_post(ThemeOption::getOption('blog_archive_post_id'));
         $data->post->post_title = get_the_date();
     } elseif (is_archive()) {
         $data->post = get_post(ThemeOption::getOption('blog_archive_post_id'));
         $data->post->post_title = single_month_title(' ', false);
     } elseif (is_search()) {
         $data->post = get_post(ThemeOption::getOption('blog_search_post_id'));
         $data->post->post_title = sprintf(__('Search result for phrase <i>%s</i>', THEME_DOMAIN), esc_html(get_query_var('s')));
     } elseif (is_404()) {
         $data->post = get_post(ThemeOption::getOption('page_404_page_id'));
         $data->post->post_title = $data->post->post_title;
     } else {
         return false;
     }
     return $data;
 }
    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;
    }
 public function theme_settings_form()
 {
     $settings = Setting::first();
     $user = Auth::user();
     $data = array('settings' => $settings, 'admin_user' => $user, 'theme_settings' => ThemeHelper::getThemeSettings());
     return View::make('Theme::includes.settings', $data);
 }
示例#4
0
 function outputWP($format = false)
 {
     ob_start();
     include locate_template($this->path);
     $value = ob_get_clean();
     if ($format) {
         $value = ThemeHelper::formatCode($value);
     }
     return $value;
 }
示例#5
0
 function adminSaveMetaBox($postId)
 {
     if ($_POST) {
         if (ThemeHelper::checkSavePost($postId, THEME_CONTEXT . '_meta_box_widget_area_noncename', 'adminSaveMetaBox') === false) {
             return false;
         }
         $option = ThemeHelper::getPostOption('widget_area');
         update_post_meta($postId, THEME_OPTION_PREFIX, $option);
     }
 }
 public function index()
 {
     if (\Input::get('theme')) {
         \Cookie::queue('theme', \Input::get('theme'), 100);
         return Redirect::to('/')->withCookie(cookie('theme', \Input::get('theme'), 100));
     }
     $data = array('videos' => Video::where('active', '=', '1')->orderBy('created_at', 'DESC')->simplePaginate($this->videos_per_page), 'current_page' => 1, 'menu' => Menu::orderBy('order', 'ASC')->get(), 'pagination_url' => '/videos', 'video_categories' => VideoCategory::all(), 'post_categories' => PostCategory::all(), 'theme_settings' => ThemeHelper::getThemeSettings(), 'pages' => Page::all());
     //dd($data['videos']);
     return View::make('Theme::home', $data);
 }
 public function index()
 {
     $search_value = Input::get('value');
     if (empty($search_value)) {
         return Redirect::to('/');
     }
     $videos = Video::where('active', '=', 1)->where('title', 'LIKE', '%' . $search_value . '%')->orderBy('created_at', 'desc')->get();
     $posts = Post::where('active', '=', 1)->where('title', 'LIKE', '%' . $search_value . '%')->orderBy('created_at', 'desc')->get();
     $data = array('videos' => $videos, 'posts' => $posts, 'search_value' => $search_value, 'menu' => Menu::orderBy('order', 'ASC')->get(), 'video_categories' => VideoCategory::all(), 'post_categories' => PostCategory::all(), 'theme_settings' => ThemeHelper::getThemeSettings(), 'pages' => Page::all());
     return View::make('Theme::search-list', $data);
 }
 public function category($category)
 {
     $page = Input::get('page');
     if (!empty($page)) {
         $page = Input::get('page');
     } else {
         $page = 1;
     }
     $cat = PostCategory::where('slug', '=', $category)->first();
     $data = array('posts' => Post::where('active', '=', '1')->where('post_category_id', '=', $cat->id)->orderBy('created_at', 'DESC')->simplePaginate($this->posts_per_page), 'current_page' => $page, 'category' => $cat, 'page_title' => 'Posts - ' . $cat->name, 'page_description' => 'Page ' . $page, 'menu' => Menu::orderBy('order', 'ASC')->get(), 'pagination_url' => '/posts/category/' . $category, 'video_categories' => VideoCategory::all(), 'post_categories' => PostCategory::all(), 'theme_settings' => ThemeHelper::getThemeSettings(), 'pages' => Page::all());
     return View::make('Theme::post-list', $data);
 }
 function form($instance)
 {
     $data = array();
     if (is_array($instance['_data']['field'])) {
         foreach ($instance['_data']['field'] as $value) {
             ThemeHelper::removeUIndex($instance, $value);
             ThemeHelper::removeUIndex($data['option'][$value], 'id', 'name', 'value');
             $data['option'][$value]['id'] = $this->get_field_id($value);
             $data['option'][$value]['name'] = $this->get_field_name($value);
             $data['option'][$value]['value'] = $instance[$value];
         }
     }
     $Template = new ThemeTemplate($data, THEME_PATH_TEMPLATE . 'admin/' . $instance['_data']['file']);
     echo $Template->output(true);
 }
 function import()
 {
     $response = array('global' => array('error' => 1));
     $Notice = new ThemeNotice();
     $result = $this->download();
     if ($result) {
         $response['global']['error'] = 0;
     } else {
         $Notice->addError(ThemeHelper::getFormName('import_google_font', false), ThemeHelper::esc_html('Cannot import list of fonts'));
         $response['local'] = $Notice->getError();
     }
     $response['global']['notice'] = $Notice->createHTML(THEME_PATH_TEMPLATE . 'notice.php');
     echo json_encode($response);
     exit;
 }
 public function show_favorites()
 {
     if (!Auth::guest()) {
         $page = Input::get('page');
         if (empty($page)) {
             $page = 1;
         }
         $favorites = Favorite::where('user_id', '=', Auth::user()->id)->orderBy('created_at', 'desc')->get();
         $favorite_array = array();
         foreach ($favorites as $key => $fave) {
             array_push($favorite_array, $fave->video_id);
         }
         $videos = Video::where('active', '=', '1')->whereIn('id', $favorite_array)->paginate(12);
         $data = array('videos' => $videos, 'page_title' => ucfirst(Auth::user()->username) . '\'s Favorite Videos', 'current_page' => $page, 'page_description' => 'Page ' . $page, 'menu' => Menu::orderBy('order', 'ASC')->get(), 'pagination_url' => '/favorites', 'video_categories' => VideoCategory::all(), 'post_categories' => PostCategory::all(), 'theme_settings' => ThemeHelper::getThemeSettings(), 'pages' => Page::all());
         return View::make('Theme::video-list', $data);
     } else {
         return Redirect::to('videos');
     }
 }
    function start_el(&$output, $object, $depth = 0, $args = array(), $current_object_id = 0)
    {
        $this->iconClass = null;
        if ($depth == 0) {
            $this->icon = $object->icon;
            $this->mega_menu_layout_column_index = 0;
            $this->mega_menu_enable = $object->mega_menu_enable;
            $this->mega_menu_layout = $object->mega_menu_layout;
            if ($object->icon != '-1') {
                $this->iconClass = 'pb-menu-icon pb-menu-icon-' . ThemeHelper::createHash($object->icon);
            }
        }
        if ($this->mega_menu_enable == 1) {
            if ($depth == 0 || $depth == 2) {
                $output .= '<li class="' . join(' ', (array) $object->classes) . ($depth == 0 ? ' sf-mega-enable-1' : null) . ' ' . $this->iconClass . ' ' . '">';
            }
            if ($depth == 1) {
                $Layout = new ThemeLayout();
                $class = array('sf-mega-section', $Layout->getLayoutColumnCSSClass($this->mega_menu_layout, $this->mega_menu_layout_column_index, 'theme-layout-column-'));
                $output .= '
					<div' . ThemeHelper::createClassAttribute($class) . '>
				';
                $this->mega_menu_layout_column_index++;
            }
            if ($depth == 1) {
                $output .= '
					<span class="sf-mega-header">' . esc_html($object->title) . '</span>
				';
            } else {
                $output .= '
					<a href="' . esc_attr($object->url) . '"><span></span>' . $object->title . '</a>
				';
            }
        } else {
            $output .= '
				<li class="' . join(' ', (array) $object->classes) . ($depth == 0 ? ' sf-mega-enable-0' : null) . ' ' . $this->iconClass . ' ' . '">
					<a href="' . esc_attr($object->url) . '"><span></span>' . $object->title . '</a>
			';
        }
    }
 function init()
 {
     if (is_admin()) {
         return;
     }
     if (ThemeOption::getOption('maintenance_mode_enable') != 1) {
         return;
     }
     $user = wp_get_current_user();
     if (in_array($user->data->ID, (array) ThemeOption::getOption('maintenance_mode_user_id'))) {
         return;
     }
     $address = array_map('trim', mb_split("\n", ThemeOption::getOption('maintenance_mode_ip_address')));
     if (in_array(ThemeHelper::getVisitorIP(), $address)) {
         return;
     }
     $page = get_post((int) ThemeOption::getOption('maintenance_mode_post_id'));
     if (is_null($page)) {
         return;
     }
     add_action('wp_head', array($this, 'filterWPHead'));
 }
示例#14
0
$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();
        ?>
" <?php 
        post_class('theme-clear-fix theme-post theme-post-type-' . (is_sticky() ? 'sticky' : $option['post_type']));
        ?>
>
<?php 
        $Post->formatPostDate($post->post_date, $day, $month, $year);
示例#15
0
?>
</h5>
				<span class="to-legend"><?php 
esc_html_e('Line height with selected unit.', THEME_DOMAIN);
?>
</span>
				<div>
					<input type="text" name="<?php 
ThemeHelper::getFormName('font_h5_line_height');
?>
" id="<?php 
ThemeHelper::getFormName('font_h5_line_height');
?>
" value="<?php 
echo ThemeHelper::esc_attr($this->data['option']['font_h5_line_height']);
?>
" maxlength="255"/>
				</div>
			</li>
		</ul>

		<script type="text/javascript">
			jQuery(document).ready(function($)
			{
				var element=$('.to').themeOptionElement();;
				element.createGoogleFontAutocomplete('#<?php 
ThemeHelper::getFormName('font_h5_family_google');
?>
');
			});
		</script>
 function setPostMetaDefault(&$meta, $part = 'all')
 {
     if (in_array($part, array('general', 'all'))) {
         ThemeHelper::setDefaultOption($meta, 'widget_area_footer_layout', '33x33x33');
     }
 }
 /**
  * Setup the layout used by the controller.
  *
  * @return void
  */
 public function index()
 {
     $data = array('admin_user' => Auth::user(), 'themes' => ThemeHelper::get_themes(), 'active_theme' => Setting::first()->theme);
     return View::make('admin.themes.index', $data);
 }
示例#18
0
 /**
  * One stop shop for adding activate/deactivate functionality to your ActiveRecord
  *
  * @param ActiveRecord object that has 'active' in its table
  */
 public static function activatorImage($ARobject, $opts = NULL)
 {
     global $siteDomain;
     if (!is_null($opts)) {
         extract($opts);
         if ($success) {
             $success = ", " . $success;
         }
     }
     if (!in_array('active', array_keys($ARobject->getColumns()))) {
         throw new Exception('This object does not have an \'active\' column.');
     }
     if (AccelObject::backend()) {
         $activeToggleUrl = "http://" . ThemeHelper::singleton()->siteDomain() . "/accelsite/admin/?adminAction=activeToggle&adminLayout=empty";
     } else {
         $activeToggleUrl = "/?ado=genericActiveToggle&layout=empty";
     }
     $js = "\n        \$('.activeToggle').click(function() {\n            \$(this).html('" . str_replace('\'', '\\\'', self::adminIcon('activeToggleLoader')) . "');\n            \$(this).load('{$activeToggleUrl}&ajax=true&activeToggle=' + \$(this).attr('myID') + '&toggleClass=' + \$(this).attr('myClass') {$success});\n            return false;\n        });";
     AccelJS::findThis()->ready($js);
     return "<a href='#' myID='" . $ARobject->id() . "' myClass='" . $ARobject->getClass() . "' class='activeToggle'>" . self::activeImage($ARobject->active()) . "</a>";
 }
 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);
 }
示例#20
0
		<ul class="to-form-field-list">
			<li>
				<h5><?php 
esc_html_e('404 error page', THEME_DOMAIN);
?>
</h5>
				<span class="to-legend"><?php 
esc_html_e('Get settings for 404 page from selected page.', THEME_DOMAIN);
?>
</span>
				<div class="to-clear-fix">
					<select name="<?php 
ThemeHelper::getFormName('page_404_page_id');
?>
" id="<?php 
ThemeHelper::getFormName('page_404_page_id');
?>
">
<?php 
foreach ($this->data['dictionary']['page'] as $value) {
    echo '<option value="' . ThemeHelper::esc_attr($value->ID) . '" ' . ThemeHelper::selectedIf($this->data['option']['page_404_page_id'], $value->ID, false) . '>' . ThemeHelper::esc_html($value->post_title) . '</option>';
}
?>
					</select>
				</div>
			</li>
		</ul>
示例#21
0
 function dynamic_styles($theme_settings)
 {
     $hex_color = ThemeHelper::getThemeSetting(@$theme_settings->color, '');
     if (empty($hex_color)) {
         $hex_color = '#1C76B6';
     }
     $color = $hex_color;
     $lighter_color = adjustBrightness($hex_color, 20);
     $style = "";
     $style .= "#signup-form .panel-heading, .btn-primary, .navbar-default, .navbar-nav.navbar-right li.signup-desktop a, #home-hero, #subscribers_only button, .block-contents p.date .label.label-success, .post .post-img h3, .theme_color_background, .vjs-default-skin .vjs-play-progress, .vjs-default-skin .vjs-volume-level{ background:{$color}; }";
     $style .= ".form-control:focus, .btn-primary{ border-color:{$color}; }";
     $style .= "h3, .block .block-contents h2 a, footer ul li a, .page a, ul.pages li a, .home footer ul li a, .block.list .block-contents h2 a{ color:{$color}; }";
     $style .= ".btn-primary:hover, .btn-primary:active, .post .post-img h6{ background:{$lighter_color}; }";
     $style .= ".btn-primary:hover, .btn-primary:active{ border-color:{$lighter_color}; }";
     $style .= ".block .block-contents h2 a:hover, footer ul li a:hover, .page a:hover, ul.pages li a:hover, .home footer ul li a:hover{ color:{$lighter_color}; }";
     return $style;
 }
示例#22
0
foreach ($this->data['dictionary']['responsiveMedia'] as $index => $value) {
    if ($index == 1) {
        continue;
    }
    ?>
			<li>
				<h5><?php 
    echo sprintf(esc_html__('CSS styles for page width between %s px and %s px.', THEME_DOMAIN), $value['min-width'], $value['max-width']);
    ?>
</h5>
				<span class="to-legend"><?php 
    echo sprintf(esc_html__('CSS styles for page width between %s px and %s px.', THEME_DOMAIN), $value['min-width'], $value['max-width']);
    ?>
</span>
				<div>
					<textarea id="<?php 
    ThemeHelper::getFormName('custom_css_responsive_' . $index);
    ?>
" name="<?php 
    ThemeHelper::getFormName('custom_css_responsive_' . $index);
    ?>
" rows="1" cols="1" class="css-editor"><?php 
    echo ThemeHelper::esc_html($this->data['option']['custom_css_responsive_' . $index]);
    ?>
</textarea>
				</div>						
			</li>			
<?php 
}
?>
		</ul>
示例#23
0
    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'))) {
                $style['background-size'] = ThemeOption::getOption('footer_top_background_image_size_2');
            }
        }
        ?>
					<div class="theme-footer-top theme-clear-fix"<?php 
        echo ThemeHelper::createStyleAttribute($style);
        ?>
>

						<div class="theme-main <?php 
        echo $layout;
        ?>
">
							<?php 
        $WidgetArea->create($widgetAreaData, true);
        ?>
						</div>
						
					</div>
<?php 
    }
示例#24
0
					<input type="text" name="<?php 
ThemeHelper::getFormName('font_h3_line_height');
?>
" id="<?php 
ThemeHelper::getFormName('font_h3_line_height');
?>
" value="<?php 
echo ThemeHelper::esc_attr($this->data['option']['font_h3_line_height']);
?>
" maxlength="255"/>
				</div>
			</li>
		</ul>

		<script type="text/javascript">
			jQuery(document).ready(function($)
			{
				var element=$('.to').themeOptionElement();;
				element.createGoogleFontAutocomplete('#<?php 
ThemeHelper::getFormName('font_h3_family_google');
?>
');
				element.createSlider('#<?php 
ThemeHelper::getFormName('font_h3_size_1_slider');
?>
',1,100,<?php 
echo (int) $this->data['option']['font_h3_size_1'];
?>
);
			});
		</script>
示例#25
0
?>
		</div>

		<div class="clear"></div>

		<div id="comments">
			<div id="disqus_thread"></div>
		</div>
    
	</div>
	
		
	<script type="text/javascript">
        /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
        var disqus_shortname = '<?php 
echo ThemeHelper::getThemeSetting(@$theme_settings->disqus_shortname, 'hellovideo');
?>
';

        /* * * DON'T EDIT BELOW THIS LINE * * */
        (function() {
            var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
            dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
            (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
        })();
    </script>
    <noscript>Please enable JavaScript to view the comments</noscript> 

	<script src="<?php 
echo THEME_URL . '/assets/js/jquery.fitvid.js';
?>
示例#26
0
}
wp_head();
?>
			</head>

			<body <?php 
body_class($Theme->getFooterStickyClass());
?>
>
				
				<?php 
echo $Menu->create();
?>

				<div class="theme-page"<?php 
echo ThemeHelper::createStyleAttribute(array('background-color' => ThemeColor::getColor($meta['page_background_color'])));
?>
>
<?php 
echo $Page->displayHeader($fable_parentPost->post);
$template = $Page->getCurrentTemplate();
if ($template == 'main.php') {
    ?>
					<div class="theme-page-content theme-clear-fix">
<?php 
} else {
    $WidgetArea = new ThemeWidgetArea();
    $widgetAreaData = $WidgetArea->getWidgetAreaByPost($fable_parentPost->post, true, true);
    $class = $WidgetArea->getWidgetAreaCSSClass($widgetAreaData);
    ?>
					<div class="theme-page-content theme-clear-fix theme-main <?php 
示例#27
0
" value="1" <?php 
ThemeHelper::checkedIf($this->data['option']['post_navigation_visible'], 1);
?>
/>
					<label for="<?php 
ThemeHelper::getFormName('post_navigation_visible_1');
?>
"><?php 
esc_html_e('Yes', THEME_DOMAIN);
?>
</label>
					<input type="radio" name="<?php 
ThemeHelper::getFormName('post_navigation_visible');
?>
" id="<?php 
ThemeHelper::getFormName('post_navigation_visible_0');
?>
" value="0" <?php 
ThemeHelper::checkedIf($this->data['option']['post_navigation_visible'], 0);
?>
/>
					<label for="<?php 
ThemeHelper::getFormName('post_navigation_visible_0');
?>
"><?php 
esc_html_e('No', THEME_DOMAIN);
?>
</label>
				</div>
			</li>			
		</ul>
示例#28
0
    function displayHeader($post)
    {
        $html = null;
        if (is_home()) {
            return $html;
        }
        $option = ThemeOption::getPostMeta($post);
        $Validation = new ThemeValidation();
        if (ThemeOption::getGlobalOption($post, 'header_enable')) {
            ThemeHelper::removeUIndex($option, 'header_background_color', 'header_background_image_src', 'header_background_image_position', 'header_background_image_size_1', 'header_background_image_size_2', 'header_text_color', 'header_subheader_text_color', 'header_subheader');
            $subheaderHTML = null;
            $style = array(array(), array(), array());
            if ($Validation->isColor($option['header_background_color'])) {
                $style[0]['background-color'] = ThemeColor::getColor($option['header_background_color']);
            }
            if (!in_array($option['header_background_image_src'], array('-1', 'none'))) {
                if ($Validation->isNotEmpty($option['header_background_image_src'])) {
                    $style[0]['background-image'] = 'url(\'' . $option['header_background_image_src'] . '\')';
                } elseif ($Validation->isNotEmpty(ThemeOption::getGlobalOption(null, 'header_background_image_src'))) {
                    $style[0]['background-image'] = 'url(\'' . ThemeOption::getGlobalOption(null, 'header_background_image_src') . '\')';
                }
            }
            if (array_key_exists('background-image', $style[0])) {
                $style[0]['background-repeat'] = ThemeOption::getGlobalOption($post, 'header_background_image_repeat');
                if ($Validation->isNotEmpty($option['header_background_image_position'])) {
                    $style[0]['background-position'] = $option['header_background_image_position'];
                } elseif ($Validation->isNotEmpty(ThemeOption::getGlobalOption(null, 'header_background_image_position'))) {
                    $style[0]['background-position'] = ThemeOption::getGlobalOption(null, 'header_background_image_position');
                }
                $style[0]['background-size'] = ThemeOption::getGlobalOption($post, 'header_background_image_size_1');
                if (in_array($style[0]['background-size'], array('length', 'percentage'))) {
                    if ($Validation->isNotEmpty($option['header_background_image_size_2'])) {
                        $style[0]['background-size'] = $option['header_background_image_size_2'];
                    } elseif ($Validation->isNotEmpty(ThemeOption::getGlobalOption(null, 'header_background_image_size_2'))) {
                        $style[0]['background-size'] = ThemeOption::getGlobalOption(null, 'header_background_image_size_2');
                    }
                }
            }
            if ($Validation->isColor($option['header_text_color'])) {
                $style[1]['color'] = ThemeColor::getColor($option['header_text_color']);
            }
            if ($Validation->isColor($option['header_subheader_text_color'])) {
                $style[2]['color'] = ThemeColor::getColor($option['header_subheader_text_color']);
            }
            if ($Validation->isNotEmpty($option['header_subheader'])) {
                $subheaderHTML = '<h6' . ThemeHelper::createStyleAttribute($style[2]) . '>' . $option['header_subheader'] . '</h6>';
            } elseif ($post->post_type == 'post') {
                $Post = new ThemePost();
                $Post->formatPostDate($post->post_date, $day, $month, $year);
                $subheaderHTML = '<h6' . ThemeHelper::createStyleAttribute($style[2]) . '>' . $month . ' ' . $day . ', ' . $year . '</h6>';
            }
            $html = '
				<div class="theme-page-header" ' . ThemeHelper::createStyleAttribute($style[0]) . '>
					<div class="theme-main">
						<h1 ' . ThemeHelper::createStyleAttribute($style[1]) . '>' . $post->post_title . '</h1>
						' . $subheaderHTML . '
					</div>
				</div>
			';
        }
        return $html;
    }
示例#29
0
		<ul class="to-form-field-list">
			<li>
				<h5><?php 
esc_html_e('Custom javascript code', THEME_DOMAIN);
?>
</h5>
				<span class="to-legend"><?php 
esc_html_e('Don\'t enter <script> tags. These tags will be added automatically.', THEME_DOMAIN);
?>
</span>
				<div>
					<textarea id="<?php 
ThemeHelper::getFormName('custom_js_code');
?>
" name="<?php 
ThemeHelper::getFormName('custom_js_code');
?>
" rows="1" cols="1"><?php 
echo ThemeHelper::esc_html($this->data['option']['custom_js_code']);
?>
</textarea>
				</div>						
			</li>
		</ul>
 function setPostMetaDefault(&$meta, $part = 'all')
 {
     if (in_array($part, array('post', 'all'))) {
         ThemeHelper::setDefaultOption($meta, 'post_type', 'image');
         ThemeHelper::setDefaultOption($meta, 'post_type_preambule', '');
         ThemeHelper::setDefaultOption($meta, 'post_category_visible', -1);
         ThemeHelper::setDefaultOption($meta, 'post_author_visible', -1);
         ThemeHelper::setDefaultOption($meta, 'post_tag_visible', -1);
         ThemeHelper::setDefaultOption($meta, 'post_comment_count_visible', -1);
         ThemeHelper::setDefaultOption($meta, 'post_navigation_visible', -1);
     }
 }