Example #1
0
/**
 * PageLines Body Classes
 *
 * Sets up classes for controlling design and layout and is used on the body tag
 *
 */
function pagelines_body_classes()
{
    global $pagelines_addclasses, $plpg, $pl_custom_template;
    $special_body_class = pl_setting('special_body_class') ? pl_setting('special_body_class') : '';
    $classes = array();
    $classes[] = $special_body_class;
    // child theme name
    $classes[] = sanitize_html_class(strtolower(PL_CHILDTHEMENAME));
    // pro
    $classes[] = pl_is_pro() ? 'pl-pro-version' : 'pl-basic-version';
    // for backwards compatiblity, dms is:
    $classes[] = 'responsive';
    $classes[] = 'full_width';
    // externally added via global variable (string)
    if (isset($pagelines_addclasses) && $pagelines_addclasses) {
        $classes = array_merge($classes, (array) explode(' ', $pagelines_addclasses));
    }
    $template = isset($pl_custom_template['key']) ? $pl_custom_template['key'] : 'none';
    $classes[] = sprintf('template-%s', $template);
    // ensure no duplicates or empties
    $classes = array_unique(array_filter($classes));
    // filter & convert to string
    $body_classes = join(' ', (array) apply_filters('pagelines_body_classes', $classes));
    return $body_classes;
}
Example #2
0
    function section_template()
    {
        $loop = new fotosPostLoop();
        $artsep = pl_setting('ba_fotos_art_sep');
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                ?>
<article <?php 
                post_class('fotos-article');
                ?>
 id="post-<?php 
                the_ID();
                ?>
" itemscope="itemscope" itemtype="http://schema.org/BlogPosting" itemprop="blogPost"><?php 
                $loop->post_header();
                $loop->post_content();
                $loop->post_social();
                $loop->post_comments();
                ?>
</article><?php 
                if ($artsep && is_home()) {
                    echo $artsep;
                }
            }
        } else {
            echo 'Sorry no posts found';
        }
    }
Example #3
0
function pl_deprecate_v2()
{
    if (pl_setting('enable_v2')) {
        return false;
    } else {
        return true;
    }
}
Example #4
0
 function custom_less_vars($less)
 {
     // Adding a custom LESS var, use this in LESS as @my-var. In this example, its linked to a custom color picker in options. We also must set a default or else it's going to error.
     // pl_hashify must be used with color pickers so that it appends the # symbol to the hex code
     // pl_setting is being used because this is a global option used in the theme
     $less['my-var'] = pl_setting('my_custom_color') ? pl_hashify(pl_setting('my_custom_color')) : 'f7f7f7';
     return $less;
 }
Example #5
0
 function section_template()
 {
     $logo = pl_setting('ba_fotos_global_logo') ? pl_setting('ba_fotos_global_logo') : PL_CHILD_URL . '/assets/img/fotos-logo.png';
     $alt = get_bloginfo('description');
     $link = get_bloginfo('wpurl');
     $out = $this->opt('ba_fotos_logo_gohome') ? sprintf('<a href="%s"><img class="ba-basiq-logo" src="%s" alt="%s" /></a>', $link, $logo, $alt) : sprintf('<img src="%s" alt="%s" />', $logo, $alt);
     echo $out;
 }
Example #6
0
 /**
  * Section template.
  */
 function section_template()
 {
     $second_menu = pl_setting('_second_nav_menu') ? pl_setting('_second_nav_menu') : null;
     if (isset($second_menu)) {
         wp_nav_menu(array('menu_class' => 'secondnav_menu fix lcolor3', 'menu' => $second_menu, 'container' => null, 'container_class' => '', 'depth' => 1, 'fallback_cb' => 'pagelines_page_subnav'));
     } elseif (pl_setting('nav_use_hierarchy')) {
         pagelines_page_subnav();
     }
 }
Example #7
0
    function section_template()
    {
        $section_output = !$this->active_loading ? render_nested_sections($this->meta['content'], 1) : '';
        $style = '';
        $inner_style = '';
        // Use alt mode for this
        $title = $this->opt('pl_standard_title') ? sprintf('<h2 class="pl-section-title pla-from-top subtle pl-animation">%s</h2>', $this->opt('pl_standard_title')) : '';
        $inner_style .= $this->opt('pl_area_height') ? sprintf('min-height: %spx;', $this->opt('pl_area_height')) : '';
        $inner_classes = 'pl-inner area-region pl-sortable-area editor-row';
        $classes = '';
        // If there is no output, there should be no padding or else the empty area will have height.
        if ($section_output || $title != '') {
            // global
            $default_padding = pl_setting('section_area_default_pad', array('default' => '20'));
            // opt
            $padding = rtrim($this->opt('pl_area_pad', array('default' => $default_padding)), 'px');
            $padding_bottom = rtrim($this->opt('pl_area_pad_bottom', array('default' => $padding)), 'px');
            $style .= sprintf('padding-top: %spx; padding-bottom: %spx;', $padding, $padding_bottom);
            $content_class = $padding ? 'nested-section-area' : '';
            $buffer = pl_draft_mode() ? sprintf('<div class="pl-sortable pl-sortable-buffer span12 offset0"></div>') : '';
            $section_output = $buffer . $section_output . $buffer;
        } else {
            $pad_css = '';
            $content_class = '';
        }
        ?>
	<div class="pl-area-wrap <?php 
        echo $classes;
        ?>
" style="<?php 
        echo $style;
        ?>
">

		<div class="pl-content <?php 
        echo $content_class;
        ?>
">
			<?php 
        echo $title;
        ?>
			<div class="<?php 
        echo apply_filters('pl-area-inner-classes', $inner_classes, $this->meta);
        ?>
" style="<?php 
        echo apply_filters('pl-area-inner-style', $inner_style, $this->meta);
        ?>
">
				<?php 
        echo $section_output;
        ?>
			</div>
		</div>
	</div>
	<?php 
    }
Example #8
0
 function save_layout($response, $data)
 {
     $px = $data['store']['px'];
     $percent = $data['store']['percent'];
     pl_global_setting_update('content_width_px', $px);
     pl_global_setting_update('content_width_percent', $percent);
     $response['px'] = $px;
     $response['_px'] = pl_setting('content_width_px');
     return $response;
 }
 function add_google_imports()
 {
     $gcss = $this->foundry->google_import($this->import_fonts, 'link');
     $added = pl_setting('font_extra') ? pl_setting('font_extra') : '';
     if ($gcss != '') {
         $gcss .= '|' . $added;
     } else {
         $gcss .= $added;
     }
     if ($gcss != '') {
         printf("<link id='master_font_import' rel='stylesheet' type='text/css' href='//fonts.googleapis.com/css?family=%s'>\n", $gcss);
     }
 }
Example #10
0
 function fotos_less($less)
 {
     $less['fotos-header-bg-color'] = pl_setting('ba_fotos_post_header_bg_color') ? pl_hashify(pl_setting('ba_fotos_post_header_bg_color')) : '@pl-base';
     $less['fotos-post-title'] = pl_setting('ba_fotos_post_title_color') ? pl_hashify(pl_setting('ba_fotos_post_title_color')) : '@pl-text';
     $less['fotos-post-meta'] = pl_setting('ba_fotos_post_meta_color') ? pl_hashify(pl_setting('ba_fotos_post_meta_color')) : '@pl-text';
     $less['fotos-post-date'] = pl_setting('ba_fotos_post_date_color') ? pl_hashify(pl_setting('ba_fotos_post_date_color')) : '@pl-text';
     $less['fotos-post-social-txt'] = pl_setting('ba_fotos_post_social_txt_color') ? pl_hashify(pl_setting('ba_fotos_post_social_txt_color')) : '@pl-text';
     $less['fotos-post-comm-bg'] = pl_setting('ba_fotos_post_comm_bg') ? pl_hashify(pl_setting('ba_fotos_post_comm_bg')) : '@pl-base';
     $less['fotos-post-comm-bg-dr'] = pl_setting('ba_fotos_post_comm_drawer_bg') ? pl_hashify(pl_setting('ba_fotos_post_comm_drawer_bg')) : '@pl-base';
     $less['fotos-post-comm-txt'] = pl_setting('ba_fotos_post_comm_txt') ? pl_hashify(pl_setting('ba_fotos_post_comm_txt')) : '@pl-text';
     $less['fotos-widget-title-color'] = pl_setting('ba_fotos_widget_title_color') ? pl_hashify(pl_setting('ba_fotos_widget_title_color')) : '@pl-text';
     $less['fotos-box-shadow-color'] = pl_setting('ba_fotos_box_shadow_color') ? pl_hashify(pl_setting('ba_fotos_box_shadow_color')) : '#111';
     return $less;
 }
Example #11
0
    function dms_debug()
    {
        ?>
		<form id="pl-dms-debug-form" class="dms-update-setting" data-setting="enable_debug" data-type="check">
			
			<input type="checkbox" name="enable_debug" class="input_enable_debug" <?php 
        checked(pl_setting('enable_debug'), 1);
        ?>
 />
			<input class="button button-primary" type="submit" value="<?php 
        _e('Update', 'pagelines');
        ?>
			" /><span class="saving-confirm"></span>
		</form>
		<?php 
    }
Example #12
0
 function add_karma($id = false, $args = array())
 {
     $defaults = array('classes' => '', 'attr' => '');
     $atts = wp_parse_args($args, $defaults);
     global $post;
     $id = $id ? $id : $post->ID;
     $output = $this->karma_post($id);
     $class = 'pl-karma pl-social-counter pl-social-pagelines';
     $title = __('Give Karma', 'pagelines');
     if (isset($_COOKIE['pl_karma_' . $id])) {
         $class = 'pl-karma loved';
         $title = __('You already gave karma!', 'pagelines');
     }
     $karma_icon = '' != pl_setting('karma_icon') ? pl_setting('karma_icon') : 'sun';
     return sprintf('<a href="#" class="%s %s" id="pl-karma-%s" title="%s" data-social="pagelines" %s> <span class="pl-social-icon"><i class="icon icon-%s"></i></span> <span class="pl-social-count">%s</span></a>', $class, $atts['classes'], $id, $title, $atts['attr'], $karma_icon, $output);
 }
Example #13
0
 function add_google_imports()
 {
     $base_url = apply_filters('pagelines_gfont_baseurl', '//fonts.googleapis.com/css?family=');
     $gcss = $this->foundry->google_import($this->import_fonts, 'link');
     $added = pl_setting('font_extra') ? pl_setting('font_extra') : '';
     if ($added != '' && $gcss != '') {
         $gcss .= '|' . $added;
     } else {
         $gcss .= $added;
     }
     if (!$gcss) {
         return false;
     }
     $url = sprintf("%s%s", $base_url, $gcss);
     wp_enqueue_style('master_font_import', $url, false, pl_get_cache_key());
 }
Example #14
0
    function menu_template()
    {
        if (has_action('pl_no_mobile_menu')) {
            return;
        }
        $menu = pl_setting('primary_navigation_menu') ? pl_setting('primary_navigation_menu') : false;
        $menu2 = pl_setting('secondary_navigation_menu') ? pl_setting('secondary_navigation_menu') : false;
        ?>
		<div class="pl-mobile-menu">
			
			<?php 
        if ('1' !== pl_setting('mobile_menus_disable_search')) {
            pagelines_search_form(true, 'mm-search');
        }
        ?>
				
			<div class="mm-holder">
				
				
				<?php 
        if (is_array(wp_get_nav_menu_items($menu)) || has_nav_menu('mobile_nav')) {
            wp_nav_menu(array('menu_class' => 'mobile-menu primary-menu', 'menu' => $menu, 'container' => null, 'container_class' => '', 'depth' => 3, 'fallback_cb' => '', 'theme_location' => 'mobile_nav'));
        } else {
            pl_nav_fallback('mobile-menu primary-menu');
        }
        if (is_array(wp_get_nav_menu_items($menu2))) {
            wp_nav_menu(array('menu_class' => 'mobile-menu secondary-menu', 'menu' => $menu2, 'container' => null, 'container_class' => '', 'depth' => 3, 'fallback_cb' => ''));
        }
        $twitter = pl_setting('twittername');
        $facebook = pl_setting('facebook_name');
        ?>
				<div class="social-menu">
					
					<?php 
        if ($facebook) {
            printf('<a href="http://www.facebook.com/%s"><i class="mm-icon icon icon-large icon-facebook"></i></a>', $facebook);
        }
        if ($twitter) {
            printf('<a href="http://www.twitter.com/%s"><i class="mm-icon icon icon-large icon-twitter"></i></a>', $twitter);
        }
        ?>
				</div>
			</div>
		</div>
		<?php 
    }
Example #15
0
function pl_navigation($args = array())
{
    $respond = isset($args['respond']) && !$args['respond'] ? '' : 'respond';
    $menu_classes = sprintf('menu-toggle mm-toggle %s', $respond);
    if ((!isset($args['menu']) || empty($args['menu'])) && !has_nav_menu($args['theme_location'])) {
        $out = sprintf('<ul class="inline-list pl-nav"><li class="popup-nav"><a class="menu-toggle mm-toggle show-me"><i class="icon icon-reorder"></i></a></li></ul>');
    } else {
        // allow inline styles on nav ( offsets! )
        if (isset($args['attr'])) {
            $args['items_wrap'] = '<ul id="%1$s" class="%2$s" ' . $args['attr'] . '>%3$s<li class="popup-nav"><a class="' . $menu_classes . '"><i class="icon icon-reorder"></i></a></li></ul>';
        }
        $defaults = array('menu_class' => 'inline-list pl-nav', 'menu' => pl_setting('primary_navigation_menu'), 'container' => null, 'container_class' => '', 'depth' => 3, 'fallback_cb' => '', 'items_wrap' => '<ul id="%1$s" class="%2$s" style="">%3$s<li class="popup-nav"><a class="' . $menu_classes . '"><i class="icon icon-reorder"></i></a></li></ul>', 'style' => false, 'echo' => false, 'pl_behavior' => 'standard');
        $args = wp_parse_args($args, $defaults);
        $args['menu_class'] .= ' ' . $respond;
        $out = str_replace("\n", "", wp_nav_menu($args));
    }
    return $out;
}
Example #16
0
    function section_template()
    {
        $home = home_url();
        $twitter = pl_setting('twittername');
        $facebook = pl_setting('facebook_name');
        $twitter = $twitter ? $twitter : 'pagelines';
        $facebook = $facebook ? $facebook : 'pagelines';
        $twitter_url = sprintf('https://twitter.com/%s', $twitter);
        $facebook_url = sprintf('https://www.facebook.com/%s', $facebook);
        $powered = sprintf('%s %s <a href="http://www.pagelines.com">PageLines DMS</a>', get_bloginfo('name'), __('was created with', 'pagelines'));
        $watermark_image = $this->opt('watermark_image') ? $this->opt('watermark_image') : $this->base_url . '/default-watermark.png';
        $watermark_link = $this->opt('watermark_link') ? $this->opt('watermark_link') : 'http://www.pagelines.com';
        if (pl_setting('partner_link')) {
            $watermark_link = pl_setting('partner_link');
        }
        $watermark_alt = $this->opt('watermark_alt') ? $this->opt('watermark_alt') : 'Build a website with PageLines';
        if (!$this->opt('watermark_hide')) {
            $watermark = sprintf('<div class="the-watermark stack-element"><a href="%s"><img src="%s" alt="%s"/></a></div>', $watermark_link, $watermark_image, $watermark_alt);
        } else {
            $watermark = '';
        }
        ?>
	<div class="pl-watermark">
		<div class="pl_global_social stack-element">

			<?php 
        if (!$this->opt('pl_watermark_no_facebook') && !has_action('pl_watermark_no_facebook')) {
            echo do_shortcode(sprintf('[like_button type="follow" url="http://www.facebook.com/%s"]', $facebook));
        }
        if (!$this->opt('pl_watermark_no_gplus') && !has_action('pl_watermark_no_gplus')) {
            echo do_shortcode('[googleplus]');
        }
        if (!$this->opt('pl_watermark_no_twitter') && !has_action('pl_watermark_no_twitter')) {
            echo do_shortcode('[twitter_button type="follow"]');
        }
        ?>
		</div>
	
		<?php 
        echo $watermark;
        ?>
	</div>
	<?php 
    }
Example #17
0
    function custom_scripts()
    {
        ?>
		<div class="opt codetext">
			<div class="opt-box">
				<div class="codetext-meta fix">
					<label class="codetext-label"><?php 
        _e('Custom Javascript or Header HTML', 'pagelines');
        ?>
</label>
				</div>
				<form class="code-form"><textarea id="custom_scripts" class="custom-scripts" name="settings[custom_scripts]" placeholder=""><?php 
        echo stripslashes(pl_setting('custom_scripts'));
        ?>
</textarea></form>
			</div>
		</div>
		<?php 
    }
Example #18
0
    function section_template()
    {
        $align = $this->opt('align');
        if ($align == 'left') {
            $align_class = 'alignleft';
        } elseif ($align == 'right') {
            $align_class = 'alignright';
        } else {
            $align_class = '';
        }
        $txt = $this->opt('text');
        $txt = $txt ? sprintf('<div class="txt-wrap pla-from-bottom pl-animation subtle"><div class="txt">%s</div></div>', $txt) : '';
        ?>

        <div class="pl-sharebar">
            <div class="pl-sharebar-pad">
				<div class="pl-social-counters pl-animation-group <?php 
        echo $align_class;
        ?>
">
					<?php 
        $classes = 'pl-animation pla-from-top subtle icon';
        if (!pl_setting($this->id . '_disable_karma')) {
            echo do_shortcode(sprintf('[pl_karma classes="%s"]', $classes));
        }
        foreach ($this->the_icons() as $key => $icon) {
            if (!pl_setting($this->id . '_disable_' . $icon)) {
                echo pl_get_social_button(array('btn' => $icon, 'classes' => $classes));
            }
        }
        do_action('pl_sharebar_after_icons');
        ?>

				</div>
				<?php 
        echo $txt;
        ?>
                <div class="clear"></div>
            </div>
        </div>
    <?php 
    }
Example #19
0
    function date_markup()
    {
        $datestyle = pl_setting('ba_fotos_post_date_style') ? pl_setting('ba_fotos_post_date_style') : 'fotos-date-default';
        $month = 'fotos-date-minimal' == $datestyle ? get_the_time('m') : get_the_time('M');
        $day = 'fotos-date-stacked' == $datestyle || 'fotos-date-minimal' == $datestyle ? get_the_time('d') : get_the_time('j');
        $year = get_the_time('Y');
        $date = get_the_date('F jS, Y');
        // margin styles
        $getmargin = pl_setting('ba_fotos_post_date_margin');
        //date styles
        $datebgimg = pl_setting('ba_fotos_post_date_bg_img');
        $datebgimghorz = pl_setting('ba_fotos_post_date_bg_img_horz') ? pl_setting('ba_fotos_post_date_bg_img_horz') : 'center';
        $datebgimgvert = pl_setting('ba_fotos_post_date_bg_img_vert') ? pl_setting('ba_fotos_post_date_bg_img_vert') : 'center';
        $styles = $datebgimg || $getmargin ? sprintf('style="background:url(\'%s\') %s %s no-repeat;margin-top:%s;"', $datebgimg, $datebgimghorz, $datebgimgvert, $getmargin) : false;
        switch ($datestyle) {
            case 'fotos-date-default':
                $out = sprintf('<time class="fotos-entry-date" datetime="%s" itemprop="datePublished" pubdate %s>%s</time>', $date, $styles, get_the_date());
                break;
            case 'fotos-date-block':
                $out = sprintf('<time class="fotos-entry-date-block-style" %s>
 								<div class="fotos-date-block-day">%s</div>
 								<div class="fotos-date-block-monthyear">
 									<div class="fotos-date-block-month">%s</div>
 									<div class="fotos-date-block-year">%s</div>
 								</div></time>', $styles, $day, $month, $year);
                break;
            case 'fotos-date-stacked':
                $out = sprintf('<div class="fotos-entry-date-stack-style" %s>
 									<div class="fotos-date-block-month">%s</div>
 									<div class="fotos-date-block-day">%s</div>
 									<div class="fotos-date-block-year">%s</div>
 									</div>', $styles, $month, $day, $year);
                break;
            case 'fotos-date-minimal':
                $out = sprintf('<time class="fotos-entry-date" %s>%s.%s.%s</time>', $styles, $month, $day, $year);
                break;
            default:
                $out = sprintf('<time class="fotos-entry-date" %s>%s</time>', $styles, get_the_date());
        }
        return $out;
    }
Example #20
0
    function section_template($location = false)
    {
        $icons = $this->the_icons();
        $target = "target='_blank'";
        $text = $this->opt('sl_text') ? $this->opt('sl_text') : sprintf('&copy; %s %s', date("Y"), get_bloginfo('name'));
        $align = $this->opt('sl_align') ? $this->opt('sl_align') : 'sl-links-right';
        $menu = $this->opt('menu') ? $this->opt('menu') : false;
        ?>
	<div class="socialinks-wrap fix <?php 
        echo $align;
        ?>
">
		
		<?php 
        $menu_args = array('theme_location' => 'socialinks_nav', 'menu' => $menu, 'menu_class' => 'inline-list pl-nav sl-nav', 'respond' => false);
        $nav = $menu ? pl_navigation($menu_args) : '';
        echo sprintf('<div class="sl-text"><span class="sl-copy">%s</span> %s</div>', $text, $nav);
        ?>
		
		<div class="sl-links">
		<?php 
        foreach ($icons as $icon) {
            $url = pl_setting('sl_' . $icon) ? pl_setting('sl_' . $icon) : false;
            if ($url) {
                printf('<a href="%s" class="sl-link" %s><i class="icon icon-%s"></i></a>', $url, $target, $icon);
            }
        }
        if (!pl_setting('sl_web_disable')) {
            ?>
<span class="sl-web-links"><a class="sl-link"  title="CSS3 Valid"><i class="icon icon-css3"></i></a><a class="sl-link" title="HTML5 Valid"><i class="icon icon-html5"></i></a><a class="sl-link" href="http://www.pagelines.com" title="Built with PageLines DMS"><i class="icon icon-pagelines"></i></a>
			</span>
			<?php 
        }
        ?>
		</div>
	</div>
<?php 
    }
Example #21
0
 /**
  *
  *  Flush rewrites/cached css
  *
  *  @package PageLines DMS
  *  @since 2.2
  */
 static function flush_version($rules = true)
 {
     $types = array('sections', 'core', 'custom');
     $folder = trailingslashit(pl_get_css_dir('path'));
     if ('1' == pl_setting('alternative_css')) {
         $file = 'compiled-css-core.css';
     } else {
         $file = sprintf('compiled-css-core-%s.css', get_theme_mod('pl_save_version'));
     }
     if (is_file($folder . $file)) {
         @unlink($folder . $file);
     }
     if ('1' == pl_setting('alternative_css')) {
         $file = 'compiled-css-sections.css';
     } else {
         $file = sprintf('compiled-css-sections-%s.css', get_theme_mod('pl_save_version'));
     }
     if (is_file($folder . $file)) {
         @unlink($folder . $file);
     }
     // Attempt to flush super-cache and w3 cache.
     if (function_exists('prune_super_cache')) {
         global $cache_path;
         $GLOBALS["super_cache_enabled"] = 1;
         prune_super_cache($cache_path . 'supercache/', true);
         prune_super_cache($cache_path, true);
     }
     if ($rules) {
         flush_rewrite_rules(true);
     }
     set_theme_mod('pl_save_version', time());
     $types = array('sections', 'core', 'custom');
     foreach ($types as $t) {
         $compiled = get_transient("pagelines_{$t}_css");
         $backup = get_transient("pagelines_{$t}_css_backup");
         if (!is_array($backup) && is_array($compiled) && strpos($compiled[$t], 'PARSE ERROR') === false) {
             set_transient("pagelines_{$t}_css_backup", $compiled, 604800);
         }
         delete_transient("pagelines_{$t}_css");
     }
 }
Example #22
0
/**
 * PageLines Option
 *
 * Uses controls to find and retrieve the appropriate option value
 *
 * @package PageLines DMS
 *
 * @since   ...
 *
 * @link    http://www.pagelines.com/wiki/Ploption
 *
 * @param   'key' the id of the option
 * @param   array $args
 *
 * @uses    is_pagelines_special
 * @uses    plspecial
 * @uses    plmeta
 * @uses    pldefault
 * @uses    get_ploption
 * @uses    plnewkey
 *
 * @return  bool|mixed
 */
function ploption($key, $args = array())
{
    _pl_deprecated_function(__FUNCTION__, '1.1', 'pl_setting()');
    $d = array('subkey' => null, 'post_id' => null, 'setting' => null, 'clone_id' => null, 'type' => '', 'translate' => false, 'key' => $key);
    $o = wp_parse_args($args, $d);
    if (has_filter("ploption_{$key}")) {
        return apply_filters("ploption_{$key}", $key, $o);
    }
    if (class_exists('PageLinesTemplateHandler') && pl_setting($key, $o)) {
        return pagelines_magic_parse(pl_setting($key, $o), $o);
    } elseif (is_pagelines_special($o) && plspecial($key, $o)) {
        return pagelines_magic_parse(plspecial($key, $o), $o);
    } elseif (isset($o['post_id']) && plmeta($key, $args)) {
        return pagelines_magic_parse(plmeta($key, $o), $o);
    } elseif (pldefault($key, $o)) {
        return pldefault($key, $o);
    } elseif (get_ploption($key, $o)) {
        return pagelines_magic_parse(get_ploption($key, $o), $o);
    } elseif (get_ploption($key, $o) === null) {
        if ($newkey = plnewkey($key)) {
            return $newkey;
        } else {
            return false;
        }
    }
}
    function dms_scripts_template()
    {
        ?>

			<form id="pl-dms-scripts-form" class="dms-update-setting" data-setting="custom_scripts">
				<textarea id="pl-dms-scripts" name="pl-dms-scripts" class="html-textarea code_textarea input_custom_scripts large-text" data-mode="htmlmixed"><?php 
        echo stripslashes(pl_setting('custom_scripts'));
        ?>
</textarea>
				<p><input class="button button-primary" type="submit" value="<?php 
        _e('Save Scripts', 'pagelines');
        ?>
				" /><span class="saving-confirm"></span></p>
			</form>
		<?php 
    }
Example #24
0
 function background_fit()
 {
     if (!pl_setting('supersize_bg')) {
         return;
     }
     wp_enqueue_script('pagelines-supersize', PL_JS . '/script.supersize.min.js', array('jquery'), '3.1.3', false);
     wp_localize_script('pagelines-supersize', 'supersize_image', array('url' => $this->background));
 }
Example #25
0
function pl_fix_login_image()
{
    if (pl_is_wporg()) {
        return false;
    }
    $image_url = pl_setting('pl_login_image') ? pl_setting('pl_login_image') : PL_IMAGES . '/default-login-image.png';
    $css = sprintf('body #login h1 a{background: url(%s) no-repeat top center;height: 80px; background-size:auto; width:auto;}', $image_url);
    inline_css_markup('pagelines-login-css', $css);
}
Example #26
0
    /**
     * 20. Shortcode to display Facebook Like button
     *
     * @example <code>[like_button]</code> is the default usage
     * @example <code>[like_button]</code>
     */
    function pl_facebook_shortcode($args)
    {
        $defaults = array('url' => get_permalink(), 'width' => '80', 'type' => 'like');
        $a = wp_parse_args($args, $defaults);
        $app_id = '';
        if (false !== pl_setting('facebook_app_id')) {
            $app_id = sprintf('&appId=%s', pl_setting('facebook_app_id'));
        } else {
            $app_id = sprintf('&appId=%s', '244419892345248');
        }
        ob_start();
        ?>
			<div id="fb-root"></div>
			<script>(function(d, s, id) {
			  var js, fjs = d.getElementsByTagName(s)[0];
			  if (d.getElementById(id)) return;
			  js = d.createElement(s); js.id = id;
			  js.src = "//connect.facebook.net/en_GB/sdk.js#xfbml=1&<?php 
        echo $app_id;
        ?>
&version=v2.0";
			  fjs.parentNode.insertBefore(js, fjs);
			}(document, 'script', 'facebook-jssdk'));</script>
			<?php 
        $facebook_js = ob_get_clean();
        global $shortcode_js;
        $shortcode_js['facebook'] = $facebook_js;
        return sprintf('<div class="fb-%s" style="vertical-align: top;padding-right:8px" data-href="%s" data-layout="button_count" data-action="like" data-show-faces="true" data-share="false"></div>', $a['type'], $a['url'], $a['width']);
    }
Example #27
0
    function loop()
    {
        $count = 0;
        global $plpg;
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                $count++;
                $format = get_post_format();
                $linkbox = $format == 'quote' || $format == 'link' ? true : false;
                $class = array();
                $postlist = $plpg->is_blog_page_type() ? true : false;
                $class[] = is_archive() || is_search() || is_home() ? 'multi-post' : '';
                $class[] = !$postlist ? 'standard-page' : '';
                $class[] = is_single() ? 'single-post' : '';
                $class[] = 'pl-border';
                $class[] = 'pl-new-loop';
                $gallery_format = get_post_meta(get_the_ID(), '_pagelines_gallery_slider', true);
                $class[] = !empty($gallery_format) ? 'use-flex-gallery' : '';
                $thumb_size = pl_setting('thumb_size') ? pl_setting('thumb_size') : 'landscape-thumb';
                $classes = apply_filters('pagelines_get_article_post_classes', join(" ", $class));
                ?>
			<article id="post-<?php 
                the_ID();
                ?>
" <?php 
                post_class($classes);
                ?>
>

				<?php 
                if ($postlist) {
                    echo '<div class="metahead">';
                    if (get_post_type() != 'page') {
                        echo do_shortcode('[pl_author_avatar size="80"][post_author_posts_link class="pl-border"][pl_karma]');
                    } else {
                        printf('<div class="metaicon"><i class="icon icon-file icon-3x"></i></div>');
                    }
                    echo '</div>';
                }
                if (!is_singular() && !$this->opt('post_media_hide')) {
                    printf('<div class="metamedia">%s</div>', pagelines_media(array('thumb-size' => $thumb_size)));
                }
                ?>

				<?php 
                if (!$linkbox) {
                    ?>
					<header class="entry-header">
						<?php 
                    if (is_single()) {
                        the_title('<h2 class="entry-title">', '</h2>');
                    } elseif (!is_page()) {
                        the_title('<h2 class="entry-title"><a href="' . esc_url(get_permalink()) . '" rel="bookmark">', '</a></h2>');
                    }
                    $meta = pl_setting('metabar_standard') ? pl_setting('metabar_standard') : 'Posted [post_date] &middot; [post_comments] [post_edit]';
                    if ($meta && !is_page() && get_post_type() != 'page') {
                        printf('<div class="metabar"> %s </div>', do_shortcode($meta));
                    }
                    ?>
					</header><!-- .entry-header -->
				<?php 
                }
                ?>
				<div class="entry-content">
					<?php 
                if (is_single() || is_page()) {
                    printf('<div class="metamedia">%s</div>', pagelines_media(array('thumb-size' => $thumb_size)));
                    the_content(__('Continue reading <span class="meta-nav">&rarr;</span>', 'pagelines'));
                    wp_link_pages(array('before' => '<div class="page-links"><span class="page-links-title">' . __('Pages:', 'pagelines') . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>'));
                } elseif (!$linkbox) {
                    the_excerpt();
                    printf('<div class="continue_reading_link"><a class="btn" href="%s" title="%s %s">%s</a></div>', get_permalink(), __("Read More", 'pagelines'), the_title_attribute(array('echo' => 0)), __('Read More <i class="icon icon-angle-right"></i>', 'pagelines'));
                }
                ?>
				</div><!-- .entry-content -->
			</article><!-- #post-## -->
			<?php 
            }
        } else {
            $this->posts_404();
        }
    }
Example #28
0
 /**
  *
  *  Get compiled/cached CSS
  *
  *  @package PageLines DMS
  *  @since 2.2
  */
 function get_compiled_custom()
 {
     if (!pl_draft_mode() && is_array($a = get_transient('pagelines_custom_css'))) {
         return $a;
     } else {
         $start_time = microtime(true);
         $custom = stripslashes(pl_setting('custom_less'));
         $pless = new PagelinesLess();
         $custom = $pless->raw_less($custom, 'custom');
         $end_time = microtime(true);
         $a = array('custom' => $custom, 'c_time' => round($end_time - $start_time, 5), 'time' => time());
         if (strpos($custom, 'PARSE ERROR') === false) {
             set_transient('pagelines_custom_css', $a, $this->ctimeout);
             set_transient('pagelines_custom_css_backup', $a, $this->btimeout);
             return $a;
         } else {
             pl_less_save_last_error($custom, false);
             return get_transient('pagelines_custom_css_backup');
         }
     }
 }
Example #29
0
 function get_layout_mode()
 {
     $value = pl_setting('layout_mode') ? pl_setting('layout_mode') : 'pixel';
     return $value;
 }
Example #30
0
 function get_fotos_comments()
 {
     global $post, $wp_query;
     $args = array('post_id' => $post->ID, 'order' => 'ASC');
     $wp_query->comments = get_comments($args);
     $commnum = number_format_i18n(get_comments_number($post->ID));
     // this is right
     $nocommtxt = pl_setting('ba_fotos_post_no_comment_text') ? pl_setting('ba_fotos_post_no_comment_text') : __('No comments found.', 'fotos');
     printf('<div class="ba-fotos-comment-wrap"><div class="row ba-fotos-comment-drawer"><div class="span7 zmb">');
     printf('<ul class="unstyled fotos-comment-list">');
     if ($commnum == 0) {
         printf('<p class="fotos-no-comments">%s</p>', $nocommtxt);
     } else {
         wp_list_comments(array('callback' => array($this, 'fotos_comment_template')));
     }
     printf('</ul>');
     printf('</div><div class="span5 zmb">');
     $this->fotos_get_comment_form();
     printf('</div></div></div>');
 }