示例#1
0
function classic_ipad_init()
{
    if (!is_admin()) {
        $minfile = WPTOUCH_DIR . '/themes/classic/ipad/js/ipad.min.js';
        $is_ios5 = strpos($_SERVER['HTTP_USER_AGENT'], 'OS 5_');
        wp_enqueue_script('fitvids', WPTOUCH_URL . '/include/js/fitvids.js', array('classic-ipad-js'), wptouch_refreshed_files());
        if (file_exists($minfile)) {
            wp_enqueue_script('classic-ipad-js', wptouch_get_bloginfo('template_directory') . '/js/classic-ipad.min.js', array('jquery-form'), wptouch_refreshed_files());
        } else {
            wp_enqueue_script('classic-ipad-js', wptouch_get_bloginfo('template_directory') . '/js/classic-ipad.js', array('jquery-form'), wptouch_refreshed_files());
        }
        if ($is_ios5) {
        } else {
            wp_enqueue_script('iscroll', WPTOUCH_URL . '/include/js/iscroll.min.js', array('classic-ipad-js'), wptouch_refreshed_files());
        }
        if (show_webapp_notice()) {
            $minfile = WPTOUCH_DIR . '/include/js/add2home.min.js';
            if (file_exists($minfile)) {
                wp_enqueue_script('add2home', WPTOUCH_URL . '/include/js/add2home.min.js', array('classic-ipad-js'), wptouch_refreshed_files());
            } else {
                wp_enqueue_script('add2home', WPTOUCH_URL . '/include/js/add2home.js', array('classic-ipad-js'), wptouch_refreshed_files());
            }
        }
    }
    // !admin
}
示例#2
0
function wptouch_admin_get_predefined_menus($network_only = false)
{
    $available_menus = array();
    if ($network_only) {
        $available_menus = array(WPTOUCH_PRO_ADMIN_TOUCHBOARD => wptouch_admin_create_menu(WPTOUCH_PRO_ADMIN_TOUCHBOARD, __('What\'s New', 'wptouch-pro')));
    } else {
        $available_menus = array(WPTOUCH_PRO_ADMIN_TOUCHBOARD => wptouch_admin_create_menu(WPTOUCH_PRO_ADMIN_TOUCHBOARD, __('What\'s New', 'wptouch-pro')), WPTOUCH_PRO_ADMIN_GENERAL_SETTINGS => wptouch_admin_create_menu(WPTOUCH_PRO_ADMIN_GENERAL_SETTINGS, __('Core Settings', 'wptouch-pro')), WPTOUCH_PRO_ADMIN_THEMES_AND_ADDONS => wptouch_admin_create_menu(WPTOUCH_PRO_ADMIN_THEMES_AND_ADDONS, __('Themes & Extensions', 'wptouch-pro')), WPTOUCH_PRO_ADMIN_THEME_OPTIONS => wptouch_admin_create_menu(WPTOUCH_PRO_ADMIN_THEME_OPTIONS, __('Theme Settings', 'wptouch-pro'), WPTOUCH_PRO_ADMIN_SETTINGS_PAGE, sprintf(__('%s Settings', 'wptouch-pro'), wptouch_get_bloginfo('active_theme_friendly_name'))));
        $settings = wptouch_get_settings();
        if (isset($settings->active_addons) && is_array($settings->active_addons) && count($settings->active_addons)) {
            $available_menus[WPTOUCH_PRO_ADMIN_ADDON_OPTIONS] = wptouch_admin_create_menu(WPTOUCH_PRO_ADMIN_ADDON_OPTIONS, __('Extension Settings', 'wptouch-pro'));
        }
        if (wptouch_get_registered_theme_count()) {
            // Need to see if a theme has a menu available
            $available_menus[WPTOUCH_PRO_ADMIN_MENUS] = wptouch_admin_create_menu(WPTOUCH_PRO_ADMIN_MENUS, __('Menus', 'wptouch-pro'));
        } else {
            $available_menus[WPTOUCH_PRO_ADMIN_MENUS_DISABLED] = wptouch_admin_create_menu(WPTOUCH_PRO_ADMIN_MENUS_DISABLED, __('Menus', 'wptouch-pro'));
        }
    }
    // Check multisite
    if (!defined('WPTOUCH_IS_FREE') && (wptouch_can_show_license_menu() || defined('WPTOUCH_FORCE_SHOW_LICENSE_PANEL'))) {
        $available_menus[WPTOUCH_PRO_ADMIN_LICENSE] = wptouch_admin_create_menu(WPTOUCH_PRO_ADMIN_LICENSE, __('License', 'wptouch-pro'), WPTOUCH_PRO_ADMIN_CUSTOM_PAGE);
    }
    // Check multisite
    if (defined('WPTOUCH_IS_FREE')) {
        $available_menus[WPTOUCH_PRO_ADMIN_UPGRADE] = wptouch_admin_create_menu(WPTOUCH_PRO_ADMIN_UPGRADE, __('Upgrade to Pro', 'wptouch-pro'), WPTOUCH_PRO_ADMIN_CUSTOM_PAGE);
    } elseif (!defined('WPTOUCH_CLIENT_MODE') && wptouch_license_upgrade_available()) {
        $available_menus[WPTOUCH_PRO_ADMIN_UPGRADE_LICENSE] = wptouch_admin_create_menu(WPTOUCH_PRO_ADMIN_UPGRADE_LICENSE, __('Upgrade License', 'wptouch-pro'), WPTOUCH_PRO_ADMIN_CUSTOM_PAGE);
    }
    return apply_filters('wptouch_available_menus', $available_menus);
}
示例#3
0
function foundation_set_title($title)
{
    global $wptouch_pro;
    if ($wptouch_pro->showing_mobile_theme) {
        return $title . ' ' . wptouch_get_bloginfo('site_title');
    } else {
        return $title;
    }
}
function wptouch_theme_iphone_meta()
{
    $settings = wptouch_get_settings();
    $status_type = $settings->wptouch_theme_webapp_status_bar_color;
    echo "<meta name='apple-mobile-web-app-capable' content='yes' /> \n";
    echo "<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' /> \n";
    echo "<meta name='apple-mobile-web-app-status-bar-style' content='" . $status_type . "' /> \n";
    if ($settings->wptouch_theme_webapp_use_loading_img) {
        echo "<link rel='apple-touch-startup-image' href='" . wptouch_get_bloginfo('template_directory') . "/images/startup.png' /> \n";
    }
}
示例#5
0
文件: bncid.php 项目: sumwander/unyil
function wptouch_license_upgrade_available()
{
    $wptouch_license_upgrade_available = get_site_transient('wptouch_license_upgrade_available');
    if ($wptouch_license_upgrade_available === false) {
        $total_licenses = wptouch_get_bloginfo('support_licenses_total');
        if ($total_licenses < 1000) {
            $wptouch_license_upgrade_available = 1;
        } else {
            // Enterprise
            $wptouch_license_upgrade_available = 0;
        }
        set_site_transient('wptouch_license_upgrade_available', $wptouch_license_upgrade_available, 15 * 60);
    }
    if ($wptouch_license_upgrade_available == 1) {
        return true;
    } else {
        return false;
    }
}
<?php

define('BAUHAUS_THEME_VERSION', '1.0.8');
define('BAUHAUS_SETTING_DOMAIN', 'bauhaus');
define('BAUHAUS_DIR', wptouch_get_bloginfo('theme_root_directory'));
define('BAUHAUS_URL', wptouch_get_bloginfo('theme_root_url'));
// Bauhaus actions
add_action('foundation_init', 'bauhaus_theme_init');
add_action('foundation_modules_loaded', 'bauhaus_register_fonts');
add_action('admin_enqueue_scripts', 'bauhaus_enqueue_admin_scripts');
// Bauhaus filters
add_filter('wptouch_registered_setting_domains', 'bauhaus_setting_domain');
add_filter('wptouch_setting_defaults_bauhaus', 'bauhaus_setting_defaults');
add_filter('wptouch_body_classes', 'bauhaus_body_classes');
add_filter('wptouch_post_classes', 'bauhaus_post_classes');
// Bauhaus GUI Settings
add_filter('wptouch_admin_page_render_wptouch-admin-theme-settings', 'bauhaus_render_theme_settings');
add_filter('foundation_settings_blog', 'bauhaus_blog_settings');
// add_filter( 'foundation_settings_pages', 'bauhaus_page_settings' );
add_filter('wptouch_has_post_thumbnail', 'bauhaus_handle_has_thumbnail');
add_filter('wptouch_the_post_thumbnail', 'bauhaus_handle_the_thumbnail');
add_filter('wptouch_setting_version_compare', 'bauhaus_setting_version_compare', 10, 2);
function bauhaus_setting_domain($domain)
{
    $domain[] = BAUHAUS_SETTING_DOMAIN;
    return $domain;
}
function bauhaus_get_settings()
{
    return wptouch_get_settings(BAUHAUS_SETTING_DOMAIN);
}
<td class="box-table-number" id="wptouch-licenses-remaining">
	<?php 
$remaining = wptouch_get_bloginfo('support_licenses_remaining');
?>
	<?php 
if ($remaining == BNC_WPTOUCH_UNLIMITED) {
    ?>
		<a href="#" rel="licenses" class="wptouch-admin-switch">&infin;</a>
	<?php 
} else {
    ?>
		<a href="#" rel="licenses" class="wptouch-admin-switch"><?php 
    echo $remaining;
    ?>
</a>
	<?php 
}
?>
</td>
<td class="box-table-text"><a href="#" rel="licenses" class="wptouch-admin-switch"><?php 
_e("Licenses Remaining", "wptouch-pro");
?>
</a></td>
示例#8
0
function classic_mobile_com_toggle()
{
    if (!function_exists('id_activate_hooks') || !function_exists('dsq_is_installed')) {
        $comment_string1 = __('No Comments Yet', "wptouch-pro");
        $comment_string2 = __('1 Comment', "wptouch-pro");
        $comment_string3 = __('% Comments', "wptouch-pro");
        echo '<a id="comments-' . get_the_ID() . '" class="post no-ajax rounded-corners-8px com-toggle">';
        if (classic_mobile_hide_responses()) {
            echo '<img id="com-arrow" class="com-arrow" src="' . wptouch_get_bloginfo('template_directory') . '/images/com_arrow.png" alt="arrow" />';
        } else {
            echo '<img id="com-arrow" class="com-arrow-down" src="' . wptouch_get_bloginfo('template_directory') . '/images/com_arrow.png" alt="arrow" />';
        }
        comments_number($comment_string1, $comment_string2, $comment_string3);
        echo '</a>';
    }
}
示例#9
0
function classic_the_post_thumbnail($thumbnail)
{
    global $post;
    $settings = wptouch_get_settings();
    $custom_field_name = $settings->classic_custom_field_thumbnail_name;
    switch ($settings->classic_icon_type) {
        case 'thumbnails':
            if (function_exists('has_post_thumbnail') && has_post_thumbnail()) {
                return $thumbnail;
            }
            break;
        case 'simple_thumbs':
            if (function_exists('p75GetThumbnail') && p75HasThumbnail($post->ID)) {
                return p75GetThumbnail($post->ID);
            }
            break;
        case 'custom_thumbs':
            if (get_post_meta($post->ID, $custom_field_name, true)) {
                return get_post_meta($post->ID, $custom_field_name, true);
            } else {
                if (get_post_meta($post->ID, 'Thumbnail', true)) {
                    return get_post_meta($post->ID, 'Thumbnail', true);
                } else {
                    if (get_post_meta($post->ID, 'thumbnail', true)) {
                        return get_post_meta($post->ID, 'thumbnail', true);
                    }
                }
            }
            break;
    }
    // return default if none of those exist
    return wptouch_get_bloginfo('template_directory') . '/images/default-thumbnail.png';
}
示例#10
0
function foundation_set_title($title)
{
    return $title . ' ' . wptouch_get_bloginfo('site_title');
}
				</div>
			</div>
		</div>
	</div>
	
	<div id="manage-info-area">
		<h4><?php 
_e("Information + Help", "wptouch-pro");
?>
</h4>
		<h5><?php 
_e("Uploading Icons", "wptouch-pro");
?>
:</h5>
		<p><?php 
echo sprintf(__("Single images and those in .ZIP packages <em>must</em> be in .PNG format. When you upload a .ZIP you <em>must</em> name the set. The .ZIP size limit on your server is %dMB.", "wptouch-pro"), wptouch_get_bloginfo('max_upload_size'));
?>
</p>
		<h5><?php 
_e("Homescreen Icons", "wptouch-pro");
?>
:</h5>
		<p><?php 
_e("For images that will used as a Homescreen (Bookmark) icon, they should be 59x60 pixels or higher for best results on iPhone 2G, 3G and 3GS, and 113x114 pixels for iPhone 4.", "wptouch-pro");
?>
</p>
		<h5><?php 
_e("Resources", "wptouch-pro");
?>
:</h5>
		<p>
        ?>
</a>
			</div>		
		<?php 
    }
    ?>
	<?php 
} else {
    if (!$settings->admin_client_mode_hide_licenses && !wptouch_is_multisite_secondary()) {
        ?>
	
	<br class="clearer" />
	
	<div id="unlicensed-board" class="round-3">
		<strong><?php 
        echo sprintf(__("This copy of WPtouch Pro %s is unlicensed.", "wptouch-pro"), wptouch_get_bloginfo('version'));
        ?>
</strong>

		<?php 
        if (!wptouch_is_multisite_enabled() || wptouch_is_multisite_enabled() && wptouch_is_multisite_primary()) {
            ?>
			<a href="#pane-5" class="wptouch-admin-switch" rel="account"><?php 
            _e("Get started with Activation &raquo;", "wptouch-pro");
            ?>
</a>
		<?php 
        }
        ?>
	</div>
	<?php 
示例#13
0
 rounded-corners-8px">

	<div class="title-area">
		<a href="<?php 
        wptouch_the_permalink();
        ?>
" class="ipad-read-entry"></a>

		<?php 
        if (is_sticky()) {
            ?>
			<?php 
            if (is_iOS_5()) {
                echo '<img src="' . wptouch_get_bloginfo('template_directory') . '/images/retina/paperclip@2x.png" alt="paperclip" class="paperclip" />';
            } else {
                echo '<img src="' . wptouch_get_bloginfo('template_directory') . '/images/paperclip.png" alt="paperclip" class="paperclip" />';
            }
            ?>
		<?php 
        }
        ?>

		<?php 
        if (classic_use_calendar_icons() || classic_use_thumbnail_icons()) {
            ?>
			<?php 
            if (wptouch_get_comment_count()) {
                ?>
 
				<div class="comment-bubble <?php 
                wptouch_comment_bubble_size();
示例#14
0
 function add_mobile_header_info()
 {
     $settings = $this->get_settings();
     if ($this->get_active_device_class() == "ipad") {
         require_once WPTOUCH_DIR . '/include/template-tags/menu.php';
         if ($settings->glossy_bookmark_icon) {
             $bookmark_icon = "<link rel='apple-touch-icon' href='" . wptouch_get_site_menu_icon(WPTOUCH_ICON_TABLET_BOOKMARK) . "' />\n";
         } else {
             $bookmark_icon = "<link rel='apple-touch-icon-precomposed' href='" . wptouch_get_site_menu_icon(WPTOUCH_ICON_TABLET_BOOKMARK) . "' />\n";
         }
     } else {
         if ($settings->glossy_bookmark_icon) {
             $bookmark_icon = "<link rel='apple-touch-icon' href='" . wptouch_get_site_menu_icon(WPTOUCH_ICON_BOOKMARK) . "' />\n";
         } else {
             $bookmark_icon = "<link rel='apple-touch-icon-precomposed' href='" . wptouch_get_site_menu_icon(WPTOUCH_ICON_BOOKMARK) . "' />\n";
         }
     }
     echo apply_filters('wptouch_bookmark_meta', $bookmark_icon);
     // Add the default stylesheet to the end, use min if available
     $minfile = TEMPLATEPATH . '/style.min.css';
     if (file_exists($minfile)) {
         $this->css_files[] = wptouch_get_bloginfo('template_directory') . '/style.min.css?ver=' . wptouch_refreshed_files();
     } else {
         $this->css_files[] = wptouch_get_bloginfo('template_directory') . '/style.css?ver=' . wptouch_refreshed_files();
     }
     // Check for an active skin
     if ($settings->current_theme_skin != 'none') {
         $current_theme = $this->get_current_theme_info();
         if (isset($current_theme->skins[$settings->current_theme_skin])) {
             $this->css_files[] = $current_theme->skins[$settings->current_theme_skin]->skin_url;
         }
     }
     $this->css_files = apply_filters('wptouch_theme_css_files', $this->css_files);
     foreach ($this->css_files as $css) {
         echo "<link rel='stylesheet' type='text/css' media='screen' href='{$css}' />\n";
     }
 }
if (show_webapp_notice()) {
    ?>
	<div id="web-app-overlay">
		<img src="<?php 
    wptouch_bloginfo('template_directory');
    ?>
/images/bubble-arrow.png" alt="bubble-arrow" id="bubble-arrow" />
		<a href="#" id="close-wa-overlay">X</a>
		<img src="<?php 
    echo wptouch_get_site_menu_icon(WPTOUCH_ICON_BOOKMARK);
    ?>
" alt="bookmark-icon" />
		<h2><?php 
    wptouch_bloginfo('site_title');
    ?>
</h2>
		<h3><?php 
    _e("is now web-app enabled!", "wptouch-pro");
    ?>
</h3>
		<p><?php 
    echo sprintf(__("Save %s as a web-app on your Home Screen.", "wptouch-pro"), wptouch_get_bloginfo('site_title'));
    ?>
</p>
		<p><?php 
    _e("Tap the button above, then Add to Home Screen.", "wptouch-pro");
    ?>
</p>
	</div>
<?php 
}
示例#16
0
								</li>
								<li id="facebook">
									<a class="no-ajax" target="_blank" href="http://www.facebook.com/sharer.php?u=<?php 
            the_permalink();
            ?>
&t=<?php 
            the_title();
            ?>
"><?php 
            _e("Share on Facebook", "wptouch-pro");
            ?>
</a>
								</li>
								<li id="email">
									<a class="no-ajax" href="mailto:?subject=<?php 
            wptouch_get_bloginfo('site_title');
            ?>
%20-%20<?php 
            the_title_attribute();
            ?>
&body=<?php 
            _e("Check out this article:", "wptouch");
            ?>
%20<?php 
            the_permalink();
            ?>
"><?php 
            _e("Share via E-Mail", "wptouch-pro");
            ?>
</a>
								</li>
<?php

define('CLASSIC_THEME_VERSION', '1.4.3');
define('CLASSIC_SETTING_DOMAIN', 'classic-redux');
define('CLASSIC_DIR', wptouch_get_bloginfo('theme_root_directory'));
define('CLASSIC_URL', wptouch_get_bloginfo('theme_root_url'));
define('CLASSIC_PAGE_TABLETS', __('Tablets', 'wptouch-pro'));
add_action('foundation_init', 'classic_theme_init');
add_action('foundation_modules_loaded', 'classic_register_fonts');
add_action('admin_enqueue_scripts', 'classic_enqueue_admin_scripts');
add_filter('wptouch_registered_setting_domains', 'classic_setting_domain');
add_filter('wptouch_setting_defaults_classic_redux', 'classic_setting_defaults');
add_filter('wptouch_setting_defaults_foundation', 'classic_foundation_setting_defaults');
add_filter('wptouch_body_classes', 'classic_body_classes');
add_filter('wptouch_admin_page_render_wptouch-admin-theme-settings', 'classic_render_theme_settings');
add_filter('wptouch_setting_version_compare', 'classic_setting_version_compare', 10, 2);
add_filter('foundation_settings_blog', 'classic_blog_settings');
add_filter('foundation_settings_pages', 'classic_page_settings');
add_filter('wptouch_has_post_thumbnail', 'classic_handle_has_thumbnail');
add_filter('wptouch_the_post_thumbnail', 'classic_handle_the_thumbnail');
function classic_handle_has_thumbnail($does_have_it)
{
    $settings = classic_get_settings();
    if ($settings->thumbnail_type == 'custom_field') {
        if ($settings->thumbnail_custom_field) {
            global $post;
            $possible_image = get_post_meta($post->ID, $settings->thumbnail_custom_field, true);
            return strlen($possible_image);
        }
    }
    return $does_have_it;
示例#18
0
?>
</div>
					<div class="wptouch-ajax-results green-text" id="ajax-saved" style="display:none"><?php 
_e("Done", "wptouch-pro");
?>
</div>
					<div class="wptouch-ajax-results red-text" id="ajax-fail" style="display:none"><?php 
_e("Oops! Try saving again.", "wptouch-pro");
?>
</div>
					<br class="clearer" />
				</li>
			</ul>
					
			<div id="wptouch-tabbed-area"  class="round-3 <?php 
if (wptouch_get_bloginfo('support_licenses_total') >= 5) {
    echo 'developer';
}
if ($settings->admin_client_mode_hide_tools) {
    echo ' client-mode';
}
?>
">
				<?php 
wptouch_show_tab_settings();
?>
			</div>
			
			<br class="clearer" />
			
			<input type="hidden" name="wptouch-admin-tab" id="wptouch-admin-tab" value="" />
示例#19
0
function wptouch_bloginfo($setting_name)
{
    echo wptouch_get_bloginfo($setting_name);
}
示例#20
0
					<div>
						<input type="submit" name="login-submit" value="<?php 
        _e('Login Now', 'wptouch-pro');
        ?>
" id="login-submit" class="button" tabindex="7" />					
					</div>
					<?php 
        if (classic_ipad_accounts_enabled()) {
            ?>
						<div id="account-link-area">
							<p><?php 
            echo sprintf(__("Not registered yet?<br />You can %ssign-up here%s.", "wptouch-pro"), '<a class="no-ajax" href="' . wptouch_get_bloginfo('wpurl') . '/wp-register.php">', '</a>');
            ?>
</p>
							<p><?php 
            echo sprintf(__("Lost your password?<br />You can %sreset it here%s.", "wptouch-pro"), '<a class="no-ajax" href="' . wptouch_get_bloginfo('wpurl') . '/wp-login.php?action=lostpassword">', '</a>');
            ?>
</p>				</div>
					<?php 
        }
        ?>
			</form>
			<?php 
    }
    ?>
		
		</div>
		<p class="menu-pointer-arrow">&nbsp;</p>
	</div>

<!-- Search Popover -->