Exemplo n.º 1
0
function foundation_social_links()
{
    $settings = foundation_get_settings();
    do_action('foundation_social_pre_output');
    if ($settings->social_twitter_url) {
        foundation_social_show_one_link($settings->social_twitter_url, 'twitter', 'Twitter');
    }
    if ($settings->social_facebook_url) {
        foundation_social_show_one_link($settings->social_facebook_url, 'facebook-sign', 'Facebook');
    }
    if ($settings->social_google_url) {
        foundation_social_show_one_link($settings->social_google_url, 'google-plus', 'Google+');
    }
    if ($settings->social_pinterest_url) {
        foundation_social_show_one_link($settings->social_pinterest_url, 'pinterest-sign', 'Pinterest');
    }
    if ($settings->social_vimeo_url) {
        foundation_social_show_one_link($settings->social_vimeo_url, 'ticket', 'Vimeo');
    }
    if ($settings->social_youtube_url) {
        foundation_social_show_one_link($settings->social_youtube_url, 'youtube', 'YouTube');
    }
    if ($settings->social_linkedin_url) {
        foundation_social_show_one_link($settings->social_linkedin_url, 'linkedin-sign', 'LinkedIn');
    }
    if ($settings->social_email_url) {
        foundation_social_show_one_link('mailto:' . $settings->social_email_url, 'envelope-alt', 'Mail');
    }
    if ($settings->social_rss_url) {
        foundation_social_show_one_link($settings->social_rss_url, 'rss-sign', 'RSS');
    }
    do_action('foundation_social_post_output');
}
Exemplo n.º 2
0
function wptouch_geolocation_set_coords()
{
    $settings = foundation_get_settings();
    if (wptouch_has_geolocation() && $settings->geolocation_html) {
        echo '<input type="hidden" id="wptouch_geolocation_coords" value="' . $settings->geolocation_geocoded . '">';
        echo '<input type="hidden" id="wptouch_geolocation_radius" value="' . $settings->geolocation_radius . '">';
        echo '<div id="wptouch_geolocation_text" style="background: rgba( 0, 0, 0, 0.5 ); display: none; padding: 30px; text-align: center; font-size: 1.3em; line-height: 1.4; color: #fff"><i class="wptouch-icon-compass"></i> ' . $settings->geolocation_html . '</div>';
    }
}
Exemplo n.º 3
0
function foundation_media_init()
{
    $settings = foundation_get_settings();
    if ($settings->new_video_handling) {
        // Load FitVids
        wp_enqueue_script('foundation_media_fitvids', foundation_get_base_module_url() . '/media/fitvids.js', array('foundation_base'), md5(FOUNDATION_VERSION), true);
        wp_enqueue_script('foundation_media_handling', foundation_get_base_module_url() . '/media/media.js', false, md5(FOUNDATION_VERSION), true);
    }
}
Exemplo n.º 4
0
function wptouch_custom_posts_pre_get_posts($query)
{
    // Only modify the custom post type information when a mobile theme is showing
    $settings = foundation_get_settings();
    if (!$settings->enable_custom_post_types) {
        return $query;
    }
    if (is_attachment()) {
        return $query;
    }
    // Right now only support custom post types on the home page and single post pages
    if (is_single() && !is_page() || is_home()) {
        // Only employ this logic for when the mobile theme is showing
        if (wptouch_is_mobile_theme_showing()) {
            $settings = foundation_get_settings();
            $post_types = wptouch_custom_posts_get_list(true);
            if ($post_types && count($post_types)) {
                $post_type_array = array();
                foreach ($post_types as $post_type) {
                    $setting_name = wptouch_custom_posts_get_name_for_post_type($post_type);
                    if (isset($settings->{$setting_name}) && $settings->{$setting_name}) {
                        $post_type_array[] = $post_type;
                    }
                }
            }
            if (count($post_type_array)) {
                // Determine the original post type in the query
                $original_post_type = false;
                if (isset($query->queried_object)) {
                    $original_post_type = $query->queried_object->post_type;
                } else {
                    if (isset($query->query_vars['post_type'])) {
                        $original_post_type = $query->query_vars['post_type'];
                    }
                }
                if ($original_post_type) {
                    $page_for_posts = get_option('page_for_posts');
                    if (isset($query->queried_object_id) && $query->queried_object_id == $page_for_posts) {
                        // we're on the posts page
                        $custom_post_types = apply_filters('wptouch_custom_posts_pre_get', array_merge(array('post'), $post_type_array));
                    } else {
                        if (!is_array($original_post_type)) {
                            $original_post_type = array($original_post_type);
                        }
                        $custom_post_types = apply_filters('wptouch_custom_posts_pre_get', array_merge($original_post_type, $post_type_array));
                    }
                    $query->set('post_type', $custom_post_types);
                } else {
                    // We're on the home page or possibly another page for a normal site
                    $custom_post_types = apply_filters('wptouch_custom_posts_pre_get', array_merge(array('post'), $post_type_array));
                    $query->set('post_type', $custom_post_types);
                }
            }
        }
    }
    return $query;
}
Exemplo n.º 5
0
function wptouch_fdn_show_login_links()
{
    $settings = foundation_get_settings();
    if ($settings->show_login_links) {
        return true;
    } else {
        return false;
    }
}
Exemplo n.º 6
0
function wptouch_fdn_show_login_links()
{
    $settings = foundation_get_settings();
    if (apply_filters('wptouch_show_login_links', $settings->show_login_links)) {
        return true;
    } else {
        return false;
    }
}
Exemplo n.º 7
0
function wptouch_fdn_is_custom_latest_posts_page()
{
    global $post;
    $settings = foundation_get_settings();
    if ($settings->latest_posts_page == 'none') {
        return false;
    } else {
        rewind_posts();
        wptouch_the_post();
        rewind_posts();
        return apply_filters('foundation_is_custom_latest_posts_page', $settings->latest_posts_page == $post->ID);
    }
}
Exemplo n.º 8
0
function wptouch_fdn_custom_latest_posts_query()
{
    if (get_query_var('paged')) {
        $paged = get_query_var('paged');
    } elseif (get_query_var('page')) {
        $paged = get_query_var('page');
    } else {
        $paged = 1;
    }
    $settings = foundation_get_settings();
    $args = array('paged' => $paged, 'posts_per_page' => $settings->posts_per_page);
    query_posts($args);
}
Exemplo n.º 9
0
function foundation_sharing_content()
{
    $settings = foundation_get_settings();
    $content = '';
    if ($settings->share_on_pages == true) {
        $is_page = is_page();
    } else {
        $is_page = '';
    }
    if ($settings->show_share && (is_single() || $is_page)) {
        $content = wptouch_capture_include_file(dirname(__FILE__) . '/sharing-html.php');
    }
    return $content;
}
Exemplo n.º 10
0
function foundation_media_init()
{
    $settings = foundation_get_settings();
    if ($settings->video_handling_type == 'fitvids') {
        // Load FitVids
        wp_enqueue_script('foundation_media_fitvids', foundation_get_base_module_url() . '/media/fitvids.js', array('foundation_base'), FOUNDATION_VERSION, true);
    } elseif ($settings->video_handling_type == 'fluidvids') {
        // Load Fluid Width Videos
        wp_enqueue_script('foundation_media_fluidvids', foundation_get_base_module_url() . '/media/fluid-width-videos.js', array('foundation_base'), FOUNDATION_VERSION, true);
    }
    if ($settings->video_handling_type != 'none') {
        wp_enqueue_script('foundation_media_handling', foundation_get_base_module_url() . '/media/media.js', false, FOUNDATION_VERSION, true);
    }
}
Exemplo n.º 11
0
function foundation_sharing_content()
{
    $settings = foundation_get_settings();
    $content = '';
    if ($settings->share_on_pages == true) {
        $is_page = is_page();
    } else {
        $is_page = '';
    }
    if ($settings->show_share && (is_single() || $is_page)) {
        $content = wptouch_capture_template_part('sharing');
    }
    return $content;
}
Exemplo n.º 12
0
function foundation_base_get_script_deps()
{
    $settings = foundation_get_settings();
    $script_deps = array('jquery');
    if (defined('WPTOUCH_MODULE_SPINJS_INSTALLED')) {
        $script_deps[] = 'foundation_spinjs_jquery';
    }
    if (defined('WPTOUCH_MODULE_FEATURED_INSTALLED') && $settings->featured_enabled) {
        $script_deps[] = 'foundation_featured';
    }
    if (defined('WPTOUCH_MODULE_MENU_INSTALLED')) {
        $script_deps[] = 'foundation_menu';
    }
    if (defined('WPTOUCH_MODULE_INFINITE_SCROLL_INSTALLED')) {
        $script_deps[] = 'foundation_infinite_scroll';
    }
    if (defined('WPTOUCH_MODULE_WEBAPP_INSTALLED') && $settings->webapp_mode_enabled) {
        $script_deps[] = 'foundation_webapp';
    }
    return $script_deps;
}
Exemplo n.º 13
0
function foundation_featured_slider($manual = false, $manual_html = false)
{
    $settings = foundation_get_settings();
    $args = foundation_featured_get_args();
    if ($manual == false && $settings->featured_enabled) {
        $slides = foundation_featured_get_slides();
        $slide_count = 0;
        if ($slides->post_count > 0) {
            echo $args['before'];
            echo "<div id='slider' class='" . implode(' ', foundation_featured_get_slider_classes()) . "'>\n";
            echo "<div class='swipe-wrap'>\n";
            while ($slides->have_posts() && $slide_count < $args['num']) {
                $slides->the_post();
                $image = foundation_featured_has_image();
                if ($image) {
                    $slide_count++;
                    get_template_part('featured-slider');
                }
            }
            echo "</div>\n";
            echo "</div>\n";
            echo $args['after'];
        }
    } else {
        // Private for now, we'll improve manual mode for customer use in 3.2
        echo $args['before'];
        echo "<div id='slider' class='" . implode(' ', foundation_featured_get_slider_classes()) . "'>\n";
        echo "<div class='swipe-wrap'>\n";
        echo $manual_html;
        echo "</div>\n";
        echo "</div>\n";
        echo $args['after'];
    }
}
Exemplo n.º 14
0
function foundation_featured_slider($manual = false, $manual_html = false)
{
    global $foundation_featured_data;
    $args = foundation_featured_get_args();
    $settings = foundation_get_settings();
    if ($manual == false && count($foundation_featured_data) >= FOUNDATION_FEATURED_MIN_NUM && $settings->featured_enabled) {
        echo $args['before'];
        echo "<div id='slider' class='" . implode(' ', foundation_featured_get_slider_classes()) . "'>\n";
        echo "<div class='swipe-wrap'>\n";
        foreach ($foundation_featured_data as $image_data) {
            echo "<div class='one-swipe-image' style='visibility: hidden;'>";
            echo "<a href='" . $image_data->link . "' class='needsclick'>";
            echo "<div class='comments-number'><span>" . $image_data->comments_number . "</span></div>";
            echo "<img src='" . $image_data->image . "' alt='" . $image_data->title . "' / >";
            if ($settings->featured_title_date) {
                echo "<p class='featured-date'>" . $image_data->date . "</p>";
                echo "<p class='featured-title'><span>" . $image_data->title . "</span></p>";
            }
            echo "</a>";
            echo "</div>";
        }
        echo "</div>\n";
        echo "</div>\n";
        echo $args['after'];
        // Private for now, we'll improve manual mode for customer use in 3.2
    } elseif ($manual == true) {
        echo $args['before'];
        echo "<div id='slider' class='" . implode(' ', foundation_featured_get_slider_classes()) . "'>\n";
        echo "<div class='swipe-wrap'>\n";
        echo $manual_html;
        echo "</div>\n";
        echo "</div>\n";
        echo $args['after'];
    }
}
Exemplo n.º 15
0
function foundation_webapp_body_classes($classes)
{
    $settings = foundation_get_settings();
    if (wptouch_fdn_is_web_app_mode() && isset($_COOKIE[WPTOUCH_WEBAPP_COOKIE . '-' . foundation_webapp_get_persistence_salt()])) {
        $classes[] = 'web-app-mode';
    }
    return $classes;
}
Exemplo n.º 16
0
function foundation_featured_slider()
{
    global $foundation_featured_data;
    $args = foundation_featured_get_args();
    $settings = foundation_get_settings();
    if (count($foundation_featured_data) >= FOUNDATION_FEATURED_MIN_NUM) {
        echo $args['before'];
        echo "<div id='slider' class='" . implode(' ', foundation_featured_get_slider_classes()) . "'>\n";
        echo "<div class='swipe-wrap'>\n";
        foreach ($foundation_featured_data as $image_data) {
            echo "<div class='one-swipe-image' style='visibility: hidden;'>";
            echo "<a href='" . $image_data->link . "' class='needsclick'>";
            echo "<div class='comments-number'><span>" . $image_data->comments_number . "</span></div>";
            echo "<img src='" . $image_data->image . "' alt='" . $image_data->title . "' / >";
            if ($settings->featured_title_date) {
                echo "<p class='featured-date'>" . $image_data->date . "</p>";
                echo "<p class='featured-title'><span>" . $image_data->title . "</span></p>";
            }
            echo "</a>";
            echo "</div>";
        }
        echo "</div>\n";
        echo "</div>\n";
        echo $args['after'];
    }
}
Exemplo n.º 17
0
function foundation_featured_settings($page_options)
{
    $settings = foundation_get_settings();
    if ($settings->featured_enabled) {
        $featured_settings = array(wptouch_add_setting('range', 'featured_max_number_of_posts', __('Maximum number of posts', 'wptouch-pro'), '', WPTOUCH_SETTING_ADVANCED, '2.0', array('min' => 1, 'max' => 10, 'step' => 1)), wptouch_add_setting('checkbox', 'featured_autoslide', __('Automatically slide', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '1.0.2'), wptouch_add_pro_setting('checkbox', 'featured_continuous', __('Continuously slide', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '1.0.2'), wptouch_add_setting('checkbox', 'featured_grayscale', __('Grayscale images (CSS 3 effect)', 'wptouch-pro'), __('Featured slider images will be in grayscale for devices that support CSS filters.', 'wptouch-pro'), WPTOUCH_SETTING_ADVANCED, '1.0'), wptouch_add_setting('checkbox', 'featured_filter_posts', __('Featured slider posts also show in listings', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '1.0.3'), wptouch_add_setting('list', 'featured_speed', __('Slide transition speed', 'wptouch-pro'), '', WPTOUCH_SETTING_ADVANCED, '1.0.2', array('slow' => __('Slow', 'wptouch-pro'), 'normal' => __('Normal', 'wptouch-pro'), 'fast' => __('Fast', 'wptouch-pro'))), wptouch_add_setting('list', 'featured_type', '', '', WPTOUCH_SETTING_BASIC, '1.0', array('latest' => __('Show latest posts', 'wptouch-pro'), 'tag' => __('Show posts from a specific tag', 'wptouch-pro'), 'category' => __('Show posts from a specific category', 'wptouch-pro'), 'post_type' => __('Show posts from a specific post type', 'wptouch-pro'), 'posts' => __('Show only specific posts or pages', 'wptouch-pro'))), wptouch_add_setting('text', 'featured_tag', __('Only this tag', 'wptouch-pro'), __('Enter the tag/category slug name', 'wptouch-pro'), WPTOUCH_SETTING_BASIC, '1.0'), wptouch_add_setting('text', 'featured_tag', __('Only this tag', 'wptouch-pro'), __('Enter the tag/category slug name', 'wptouch-pro'), WPTOUCH_SETTING_BASIC, '1.0', false), wptouch_add_setting('text', 'featured_category', __('Only this category', 'wptouch-pro'), __('Enter the tag/category slug name', 'wptouch-pro'), WPTOUCH_SETTING_BASIC, '1.0', false), wptouch_add_setting('list', 'featured_post_type', __('Only this post type', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '3.5.3', array_merge(array('Select Post Type'), wptouch_custom_posts_get_list())), wptouch_add_setting('text', 'featured_post_ids', __('Comma-separated list of post/page IDs', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '1.0'));
    } else {
        $featured_settings = array();
    }
    wptouch_add_page_section(FOUNDATION_PAGE_GENERAL, __('Featured Slider', 'wptouch-pro'), 'foundation-featured-settings', array_merge(array(wptouch_add_setting('checkbox', 'featured_enabled', __('Enable featured slider', 'wptouch-pro'), __('Requires at least 2 entries to contain featured images', 'wptouch-pro'), WPTOUCH_SETTING_BASIC, '1.0')), $featured_settings), $page_options, FOUNDATION_SETTING_DOMAIN, true);
    return $page_options;
}
Exemplo n.º 18
0
function foundation_featured_settings($page_options)
{
    $settings = foundation_get_settings();
    global $wptouch_pro;
    $posts_to_show_label = false;
    if (defined('WPTOUCH_IS_FREE')) {
        $posts_to_show_label = 'Posts to display';
    }
    if ($wptouch_pro->get_current_theme() == 'bauhaus' || $wptouch_pro->is_child_theme() && $wptouch_pro->get_parent_theme_info()->base == 'bauhaus') {
        $featured_enhanced_setting = array(wptouch_add_setting('list', 'featured_style', __('Featured slider style', 'wptouch-pro'), false, WPTOUCH_SETTING_BASIC, '2.0', array('enhanced' => __('Enhanced', 'wptouch-pro'), 'streamlined' => __('Streamlined', 'wptouch-pro'))));
    } else {
        $featured_enhanced_setting = array();
    }
    $featured_settings = array(wptouch_add_pro_setting('range', 'featured_max_number_of_posts', __('Number of posts in slider', 'wptouch-pro'), false, WPTOUCH_SETTING_BASIC, '2.0', array('min' => 1, 'max' => 10, 'step' => 1)), wptouch_add_setting('checkbox', 'featured_comments', __('Show # of comments', 'wptouch-pro'), false, WPTOUCH_SETTING_BASIC, '2.0'), wptouch_add_pro_setting('checkbox', 'featured_autoslide', __('Slide automatically', 'wptouch-pro'), false, WPTOUCH_SETTING_BASIC, '2.0'), wptouch_add_pro_setting('checkbox', 'featured_continuous', __('Slides repeat', 'wptouch-pro'), false, WPTOUCH_SETTING_BASIC, '2.0'), wptouch_add_pro_setting('checkbox', 'featured_grayscale', __('Make images grayscale', 'wptouch-pro'), false, WPTOUCH_SETTING_BASIC, '2.0'), wptouch_add_setting('checkbox', 'featured_filter_posts', __('Slider posts also show in listings', 'wptouch-pro'), false, WPTOUCH_SETTING_BASIC, '2.0'), wptouch_add_pro_setting('list', 'featured_speed', __('Slide transition speed', 'wptouch-pro'), false, WPTOUCH_SETTING_BASIC, '2.0', array('slow' => __('Slow', 'wptouch-pro'), 'normal' => __('Normal', 'wptouch-pro'), 'fast' => __('Fast', 'wptouch-pro'))), wptouch_add_setting('list', 'featured_type', $posts_to_show_label, false, WPTOUCH_SETTING_BASIC, '2.0', array('latest' => __('Show latest posts', 'wptouch-pro'), 'tag' => __('Show posts from a specific tag', 'wptouch-pro'), 'category' => __('Show posts from a specific category', 'wptouch-pro'), 'post_type' => __('Show posts from a specific post type', 'wptouch-pro'), 'posts' => __('Show only specific posts or pages', 'wptouch-pro'))), wptouch_add_setting('text', 'featured_tag', __('Only this tag', 'wptouch-pro'), __('Enter the tag/category slug name', 'wptouch-pro'), WPTOUCH_SETTING_BASIC, '2.0', false), wptouch_add_setting('text', 'featured_category', __('Only this category', 'wptouch-pro'), __('Enter the tag/category slug name', 'wptouch-pro'), WPTOUCH_SETTING_BASIC, '2.0', false), wptouch_add_setting('text', 'featured_post_ids', __('Comma-separated list of post/page IDs', 'wptouch-pro'), false, WPTOUCH_SETTING_BASIC, '2.0'));
    if (function_exists('wptouch_custom_posts_get_list')) {
        $featured_settings[] = wptouch_add_pro_setting('list', 'featured_post_type', __('Only this post type', 'wptouch-pro'), false, WPTOUCH_SETTING_BASIC, '2.0', array_merge(array('Select Post Type'), wptouch_custom_posts_get_list()));
    }
    wptouch_add_page_section(FOUNDATION_PAGE_GENERAL, __('Featured Slider', 'wptouch-pro'), 'foundation-featured-settings', array_merge(array(wptouch_add_setting('checkbox', 'featured_enabled', __('Enable featured slider', 'wptouch-pro'), false, WPTOUCH_SETTING_BASIC, '2.0')), $featured_enhanced_setting, apply_filters('wptouch_featured_slider_settings', $featured_settings)), $page_options, FOUNDATION_SETTING_DOMAIN, true, false, 30);
    return $page_options;
}
Exemplo n.º 19
0
function foundation_exclude_categories_tags($query)
{
    if (wptouch_is_mobile_theme_showing()) {
        $settings = foundation_get_settings();
        if ($settings->excluded_categories) {
            $new_cats = _foundation_explode_and_trim_taxonomy($settings->excluded_categories, 'category');
            if (!$query->is_single()) {
                $query->set('category__not_in', $new_cats);
            }
        }
        if ($settings->excluded_tags) {
            $new_tags = _foundation_explode_and_trim_taxonomy($settings->excluded_tags, 'post_tag');
            if (!$query->is_single()) {
                $query->set('tag__not_in', $new_tags);
            }
        }
    }
    return $query;
}
Exemplo n.º 20
0
function wptouch_canonical_link()
{
    $settings = foundation_get_settings();
    $wordpress_posts_page = get_option('page_for_posts');
    $wptouch_posts_page = $settings->latest_posts_page;
    $on_wptouch_posts_page = false;
    if ($wptouch_posts_page != 'none') {
        $on_wptouch_posts_page = get_permalink() == get_permalink($wptouch_posts_page);
    }
    if (is_home() && !$on_wptouch_posts_page) {
        if ($wordpress_posts_page != 0) {
            $permalink = get_permalink($wordpress_posts_page);
        } else {
            $permalink = site_url() . '/';
        }
    } else {
        $permalink = get_permalink();
    }
    echo '<link rel="canonical" href="' . $permalink . '" />';
}
Exemplo n.º 21
0
<?php

$settings = foundation_get_settings();
?>
<li class="comment clearfix" id="comment-<?php 
echo get_comment_ID();
?>
">"
	<div class="comment-top">
		<div class="comment-avatar">
			<?php 
echo get_avatar($comment);
?>
		</div>
		<div class="meta">
			<div class="comment-author"><?php 
comment_author();
?>
</div>
			<div class="comment-time"><?php 
comment_date();
?>
</div>
		</div>
	</div>

	<div class="comment-body">
		<?php 
if ($comment->comment_approved == '0') {
    ?>
			<p class="comment-awaiting-moderation"><?php 
Exemplo n.º 22
0
function foundation_handle_advertising()
{
    if (!foundation_advertising_enabled()) {
        return;
    }
    $settings = foundation_get_settings();
    if (foundation_advertising_can_show_ads()) {
        switch ($settings->advertising_type) {
            case 'admob':
                echo '<div class="wptouch-showcase">' . foundation_get_admob_ad() . '</div>';
                break;
            case 'google':
                echo '<div class="wptouch-showcase">' . foundation_get_google_ad() . '</div>';
                break;
            case 'custom':
                echo '<div class="wptouch-custom-showcase">' . $settings->custom_advertising_mobile . '</div>';
                break;
            case 'default':
                // Try to get this advertising type from a plugin
                do_action('wptouch_advertising_' . $settings->advertising_type);
                break;
        }
    }
}