コード例 #1
0
<?php

global $is_ajax;
$is_ajax = isset($_SERVER['HTTP_X_REQUESTED_WITH']);
if (!$is_ajax) {
    get_header();
}
$wptouch_settings = bnc_wptouch_get_settings();
?>
 <?php 
if (have_posts()) {
    while (have_posts()) {
        the_post();
        ?>
 	<div class="post content" id="post-<?php 
        the_ID();
        ?>
">
	 <div class="page">
		<div class="page-title-icon">		
			<?php 
        $mypages = bnc_wp_touch_get_pages();
        if (isset($mypages[get_the_ID()])) {
            $icon_name = $mypages[get_the_ID()]['icon'];
            if (file_exists(compat_get_plugin_dir('wptouch') . '/images/icon-pool/' . $icon_name)) {
                $image = compat_get_plugin_url('wptouch') . '/images/icon-pool/' . $icon_name;
            } else {
                $image = compat_get_upload_url() . '/wptouch/custom-icons/' . $icon_name;
            }
            echo '<img class="pageicon" src="' . $image . '" alt="icon" />';
        } else {
コード例 #2
0
function wptouch_core_body_background()
{
    $wptouch_settings = bnc_wptouch_get_settings();
    echo $wptouch_settings['style-background'];
}
コード例 #3
0
 function bnc_filter_iphone()
 {
     $key = 'wptouch_switch_cookie';
     if (isset($_GET['theme_view'])) {
         if ($_GET['theme_view'] == 'mobile') {
             setcookie($key, 'mobile', 0);
         } elseif ($_GET['theme_view'] == 'normal') {
             setcookie($key, 'normal', 0);
         }
         $redirect_location = get_bloginfo('siteurl');
         // fix by cybrstudd
         if (isset($_GET['wptouch_redirect'])) {
             $protocol = $_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://';
             $redirect_location = $protocol . $_GET['wptouch_redirect'];
         }
         header('Location: ' . $redirect_location);
         die;
     }
     $settings = bnc_wptouch_get_settings();
     if (isset($_COOKIE[$key])) {
         $this->desired_view = $_COOKIE[$key];
     } else {
         if ($settings['enable-regular-default']) {
             $this->desired_view = 'normal';
         } else {
             $this->desired_view = 'mobile';
         }
     }
 }
コード例 #4
0
ファイル: wptouch.php プロジェクト: sangpena/appflex.mobi
 function bnc_filter_iphone()
 {
     $key = 'wptouch_switch_toggle';
     $time = time() + 60 * 60 * 24 * 365;
     // one year
     $url_path = '/';
     if (isset($_GET['wptouch_view'])) {
         if ($_GET['wptouch_view'] == 'mobile') {
             setcookie($key, 'mobile', $time, $url_path);
         } elseif ($_GET['wptouch_view'] == 'normal') {
             setcookie($key, 'normal', $time, $url_path);
         }
     }
     $settings = bnc_wptouch_get_settings();
     if (isset($_COOKIE[$key])) {
         $this->desired_view = $_COOKIE[$key];
     } else {
         if ($settings['enable-regular-default'] || defined('XMLRPC_REQUEST') || defined('APP_REQUEST')) {
             $this->desired_view = 'normal';
         } else {
             $this->desired_view = 'mobile';
         }
     }
     if (isset($settings['enable-twenty-eleven-footer']) && $settings['enable-twenty-eleven-footer']) {
         if (function_exists('twentyeleven_setup')) {
             add_action('twentyeleven_credits', array(&$this, 'handle_footer'));
         } else {
             if (function_exists('twentyten_setup')) {
                 add_action('twentyten_credits', array(&$this, 'handle_footer'));
             }
         }
     }
 }
コード例 #5
0
 function bnc_filter_iphone()
 {
     $key = 'wptouch_switch_cookie';
     if (isset($_GET['theme_view'])) {
         if ($_GET['theme_view'] == 'mobile') {
             setcookie($key, 'mobile', 0);
         } elseif ($_GET['theme_view'] == 'normal') {
             setcookie($key, 'normal', 0);
         }
         header('Location: ' . get_bloginfo('siteurl'));
         die;
     }
     $settings = bnc_wptouch_get_settings();
     if (isset($_COOKIE[$key])) {
         $this->desired_view = $_COOKIE[$key];
     } else {
         if ($settings['enable-regular-default']) {
             $this->desired_view = 'normal';
         } else {
             $this->desired_view = 'mobile';
         }
     }
 }
コード例 #6
0
 function bnc_filter_iphone()
 {
     $key = 'wptouch_switch_cookie';
     $time = time() + 60 * 60 * 24 * 365;
     $url_path = str_replace(array('http://' . $_SERVER['SERVER_NAME'] . '', 'https://' . $_SERVER['SERVER_NAME'] . ''), '', get_bloginfo('url') . '/');
     if (isset($_GET['theme_view'])) {
         if ($_GET['theme_view'] == 'mobile') {
             setcookie($key, 'mobile', $time, $url_path);
         } elseif ($_GET['theme_view'] == 'normal') {
             setcookie($key, 'normal', $time, $url_path);
         }
         $redirect_location = get_bloginfo('url');
         // fix by cybrstudd
         if (isset($_GET['wptouch_redirect'])) {
             $protocol = $_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://';
             $redirect_location = $protocol . $_GET['wptouch_redirect'];
         }
         header('Location: ' . $redirect_location);
         die;
     }
     $settings = bnc_wptouch_get_settings();
     if (isset($_COOKIE[$key])) {
         $this->desired_view = $_COOKIE[$key];
     } else {
         if ($settings['enable-regular-default']) {
             $this->desired_view = 'normal';
         } else {
             $this->desired_view = 'mobile';
         }
     }
 }