Exemple #1
0
    ?>
 checked="checked"<?php 
}
?>
 id="FA_rand_posts" /> <label for="FA_rand_posts"><?php 
_e('Random order', 'falite');
?>
</label>
	                                        </td>
	                                    </tr>
	                                </table>
	                           	</div>
	                            <?php 
$opt = $options['_fa_lite_content'];
$opt['displayed_content'] = 2;
$selected_pages = FA_get_pages($slider_id, $opt);
?>
								<div id="FA_content_2" class="FA_content_display"<?php 
if ($content != 2) {
    ?>
 style="display:none;"<?php 
}
?>
> 
	                            	<ul class="FA_sortable" id="display_pages">
	                                <?php 
foreach ($selected_pages as $k => $page) {
    ?>
	                               		<li id="FA_page_<?php 
    echo $page->ID;
    ?>
Exemple #2
0
/**
 * Returns the content list according to the settings
 */
function FA_get_content($slider_id)
{
    $options = FA_slider_options($slider_id, '_fa_lite_content');
    if ($options['displayed_content'] == 1) {
        $postslist = FA_get_posts($slider_id, $options);
    } else {
        $postslist = FA_get_pages($slider_id, $options);
    }
    $aspect_opt = FA_slider_options($slider_id, '_fa_lite_aspect');
    foreach ($postslist as $k => $v) {
        // detect post image and save it in returned array
        $image = FA_article_image($v, $slider_id, false, false);
        $postslist[$k]->FA_image = $image;
        // use custom titles if set
        if ($aspect_opt['title_custom']) {
            $title_txt = get_post_meta($v->ID, '_fa_cust_title', true);
            if ($title_txt && !empty($title_txt)) {
                $postslist[$k]->post_title = $title_txt;
            }
        }
        // check if custom read-more link is set else set it as the default for the slider
        $cust_read_more = get_post_meta($v->ID, '_fa_cust_link', true);
        if (!empty($cust_read_more)) {
            $postslist[$k]->fa_read_more = $cust_read_more;
        } else {
            $postslist[$k]->fa_read_more = $aspect_opt['read_more'];
        }
        // check if extra CSS classes are set on item
        $extra_css = get_post_meta($v->ID, '_fa_cust_class', true);
        $postslist[$k]->css_class = $extra_css ? $extra_css : '';
        // link target
        $link_target = get_post_meta($v->ID, '_fa_cust_url_blank', true);
        $postslist[$k]->link_target = $link_target == 1 ? '_blank' : '_self';
        // custom slides are displayed using the complete text entered by the user
        if ('fa_slide' == $v->post_type) {
            $postslist[$k]->FA_post_content = $v->post_content;
            continue;
        }
        // custom text for FA Lite
        if ($aspect_opt['use_custom_text']) {
            $txt = get_post_meta($v->ID, '_fa_cust_txt', true);
            if ($txt && !empty($txt)) {
                $postslist[$k]->FA_post_content = $txt;
                continue;
            }
        }
        // use excerpt if option is on
        if ($aspect_opt['use_excerpt']) {
            if (!empty($v->post_excerpt)) {
                $postslist[$k]->FA_post_content = $v->post_excerpt;
                continue;
            }
        }
        // this part is skipped if user uption for content is either custom text or excerpt and at least one is not empty
        $content = $v->post_content;
        // remove shortcodes if set
        if ($aspect_opt['strip_shortcodes']) {
            $content = strip_shortcodes($content);
        }
        $content = apply_filters('the_content', $content);
        // remove all HTML tags except what's allowed
        $allow_all_tags = $aspect_opt['allow_all_tags'];
        if (!$allow_all_tags) {
            $content = strip_tags($content, $aspect_opt['allowed_tags']);
        }
        $strlen = $image ? $aspect_opt['desc_truncate'] : $aspect_opt['desc_truncate_noimg'];
        if ($allow_all_tags || !empty($aspect_opt['allowed_tags'])) {
            $postslist[$k]->FA_post_content = FA_truncate_html($content, $strlen, $aspect_opt['end_truncate']);
        } else {
            $postslist[$k]->FA_post_content = FA_truncate_text($content, $strlen, $aspect_opt['end_truncate']);
        }
    }
    return $postslist;
}