[44] | 1 | <?php
|
---|
| 2 |
|
---|
| 3 | // This file is part of the Carrington Mobile Theme for WordPress
|
---|
| 4 | // http://carringtontheme.com
|
---|
| 5 | //
|
---|
| 6 | // Copyright (c) 2008-2009 Crowd Favorite, Ltd. All rights reserved.
|
---|
| 7 | // http://crowdfavorite.com
|
---|
| 8 | //
|
---|
| 9 | // Released under the GPL license
|
---|
| 10 | // http://www.opensource.org/licenses/gpl-license.php
|
---|
| 11 | //
|
---|
| 12 | // **********************************************************************
|
---|
| 13 | // This program is distributed in the hope that it will be useful, but
|
---|
| 14 | // WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
---|
| 16 | // **********************************************************************
|
---|
| 17 |
|
---|
| 18 | if (__FILE__ == $_SERVER['SCRIPT_FILENAME']) { die(); }
|
---|
| 19 | if (CFCT_DEBUG) { cfct_banner(__FILE__); }
|
---|
| 20 |
|
---|
| 21 | ?>
|
---|
| 22 | <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN"
|
---|
| 23 | "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd">
|
---|
| 24 |
|
---|
| 25 | <html xmlns="http://www.w3.org/1999/xhtml">
|
---|
| 26 | <head>
|
---|
| 27 | <title><?php wp_title('«', true, 'right'); bloginfo('name'); ?></title>
|
---|
| 28 | <meta http-equiv="content-type" content="<?php bloginfo('html_type') ?>; charset=<?php bloginfo('charset') ?>" />
|
---|
| 29 | <meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>
|
---|
| 30 | <link rel="stylesheet" href="<?php echo get_stylesheet_uri(); ?>" type="text/css" media="screen" charset="utf-8" />
|
---|
| 31 | <style type="text/css">
|
---|
| 32 | @import url(<?php echo trailingslashit(get_bloginfo('template_url')).'css/advanced.css'; ?>);
|
---|
| 33 | </style>
|
---|
| 34 | <script type="text/javascript">
|
---|
| 35 | <!--
|
---|
| 36 | <?php
|
---|
| 37 |
|
---|
| 38 | is_page() ? $page = 'true' : $page = 'false';
|
---|
| 39 | echo ' CFMOBI_IS_PAGE = '.$page.';';
|
---|
| 40 | echo " CFMOBI_PAGES_TAB = '".str_replace("'", "\'", __('Pagine', 'carrington-mobile'))."';";
|
---|
| 41 | echo " CFMOBI_POSTS_TAB = '".str_replace("'", "\'", __('News Recenti', 'carrington-mobile'))."';";
|
---|
| 42 |
|
---|
| 43 | global $cfmobi_touch_browsers;
|
---|
| 44 | if (!isset($cfmobi_touch_browsers) || !is_array($cfmobi_touch_browsers)) {
|
---|
| 45 | $cfmobi_touch_browsers = array(
|
---|
| 46 | 'iPhone',
|
---|
| 47 | 'iPod',
|
---|
| 48 | 'Android',
|
---|
| 49 | 'BlackBerry9530',
|
---|
| 50 | 'LG-TU915 Obigo', // LG touch browser
|
---|
| 51 | 'LGE VX',
|
---|
| 52 | 'webOS', // Palm Pre, etc.
|
---|
| 53 | );
|
---|
| 54 | }
|
---|
| 55 | if (count($cfmobi_touch_browsers)) {
|
---|
| 56 | $touch = array();
|
---|
| 57 | foreach ($cfmobi_touch_browsers as $browser) {
|
---|
| 58 | $touch[] = str_replace('"', '\"', trim($browser));
|
---|
| 59 | }
|
---|
| 60 |
|
---|
| 61 | ?>
|
---|
| 62 | var CFMOBI_TOUCH = ["<?php echo implode('","', $touch); ?>"];
|
---|
| 63 | for (var i = 0; i < CFMOBI_TOUCH.length; i++) {
|
---|
| 64 | if (navigator.userAgent.indexOf(CFMOBI_TOUCH[i]) != -1) {
|
---|
| 65 | document.write('<?php echo str_replace('/', '\/', '<link rel="stylesheet" href="'.trailingslashit(get_bloginfo('template_url')).'css/touch.css" type="text/css" media="screen" charset="utf-8" />'); ?>');
|
---|
| 66 | break;
|
---|
| 67 | }
|
---|
| 68 | }
|
---|
| 69 | <?php
|
---|
| 70 |
|
---|
| 71 | }
|
---|
| 72 |
|
---|
| 73 | ?>
|
---|
| 74 | document.write('<?php
|
---|
| 75 |
|
---|
| 76 | ob_start();
|
---|
| 77 | wp_print_scripts();
|
---|
| 78 | $wp_scripts = ob_get_contents();
|
---|
| 79 | ob_end_clean();
|
---|
| 80 |
|
---|
| 81 | echo trim(str_replace(
|
---|
| 82 | array("'", "\n", '/'),
|
---|
| 83 | array("\'", '', '\/'),
|
---|
| 84 | $wp_scripts
|
---|
| 85 | ));
|
---|
| 86 |
|
---|
| 87 | ?>');
|
---|
| 88 | //--></script>
|
---|
| 89 | </head>
|
---|
| 90 | <body<?php if(is_single() || is_page()) {echo '';} else { echo ' id="is-list"';} ?>>
|
---|
| 91 |
|
---|
| 92 | <h1 id="site-name"><a rel="home" href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a></h1>
|
---|
| 93 |
|
---|
| 94 | <hr />
|
---|
| 95 |
|
---|
| 96 | <p id="navigation-top" class="navigation">
|
---|
| 97 | <?php cfct_misc('main-nav'); ?>
|
---|
| 98 | </p>
|
---|
| 99 |
|
---|
| 100 | <hr />
|
---|
| 101 |
|
---|
| 102 | <?php
|
---|
| 103 | ################ google adsense
|
---|
| 104 |
|
---|
| 105 | $GLOBALS['google']['ad_type']='text_image';
|
---|
| 106 | $GLOBALS['google']['channel']='';
|
---|
| 107 | $GLOBALS['google']['client']='pub-9331412477710099';
|
---|
| 108 | $GLOBALS['google']['format']='mobile_single';
|
---|
| 109 | $GLOBALS['google']['https']=read_global('HTTPS');
|
---|
| 110 | $GLOBALS['google']['ip']=read_global('REMOTE_ADDR');
|
---|
| 111 | $GLOBALS['google']['markup']='chtml';
|
---|
| 112 | $GLOBALS['google']['oe']='utf8';
|
---|
| 113 | $GLOBALS['google']['output']='chtml';
|
---|
| 114 | $GLOBALS['google']['ref']=read_global('HTTP_REFERER');
|
---|
| 115 | $GLOBALS['google']['url']=read_global('HTTP_HOST') . read_global('REQUEST_URI');
|
---|
| 116 | $GLOBALS['google']['useragent']=read_global('HTTP_USER_AGENT');
|
---|
| 117 | $google_dt = time();
|
---|
| 118 | google_set_screen_res();
|
---|
| 119 | google_set_muid();
|
---|
| 120 |
|
---|
| 121 | function read_global($var) {
|
---|
| 122 | return isset($_SERVER[$var]) ? $_SERVER[$var]: '';
|
---|
| 123 | }
|
---|
| 124 |
|
---|
| 125 | function google_append_url(&$url, $param, $value) {
|
---|
| 126 | $url .= '&' . $param . '=' . urlencode($value);
|
---|
| 127 | }
|
---|
| 128 |
|
---|
| 129 | function google_append_globals(&$url, $param) {
|
---|
| 130 | google_append_url($url, $param, $GLOBALS['google'][$param]);
|
---|
| 131 | }
|
---|
| 132 |
|
---|
| 133 | function google_append_color(&$url, $param) {
|
---|
| 134 | global $google_dt;
|
---|
| 135 | $color_array = split(',', $GLOBALS['google'][$param]);
|
---|
| 136 | google_append_url($url, $param,
|
---|
| 137 | $color_array[$google_dt % sizeof($color_array)]);
|
---|
| 138 | }
|
---|
| 139 |
|
---|
| 140 | function google_set_screen_res() {
|
---|
| 141 | $screen_res = read_global('HTTP_UA_PIXELS');
|
---|
| 142 | if ($screen_res == '') {
|
---|
| 143 | $screen_res = read_global('HTTP_X_UP_DEVCAP_SCREENPIXELS');
|
---|
| 144 | }
|
---|
| 145 | if ($screen_res == '') {
|
---|
| 146 | $screen_res = read_global('HTTP_X_JPHONE_DISPLAY');
|
---|
| 147 | }
|
---|
| 148 | $res_array = split('[x,*]', $screen_res);
|
---|
| 149 | if (sizeof($res_array) == 2) {
|
---|
| 150 | $GLOBALS['google']['u_w'] = $res_array[0];
|
---|
| 151 | $GLOBALS['google']['u_h'] = $res_array[1];
|
---|
| 152 | }
|
---|
| 153 | }
|
---|
| 154 |
|
---|
| 155 | function google_set_muid() {
|
---|
| 156 | $muid = read_global('HTTP_X_DCMGUID');
|
---|
| 157 | if ($muid != '') {
|
---|
| 158 | $GLOBALS['google']['muid'] = $muid;
|
---|
| 159 | }
|
---|
| 160 | $muid = read_global('HTTP_X_UP_SUBNO');
|
---|
| 161 | if ($muid != '') {
|
---|
| 162 | $GLOBALS['google']['muid'] = $muid;
|
---|
| 163 | }
|
---|
| 164 | $muid = read_global('HTTP_X_JPHONE_UID');
|
---|
| 165 | if ($muid != '') {
|
---|
| 166 | $GLOBALS['google']['muid'] = $muid;
|
---|
| 167 | }
|
---|
| 168 | $muid = read_global('HTTP_X_EM_UID');
|
---|
| 169 | if ($muid != '') {
|
---|
| 170 | $GLOBALS['google']['muid'] = $muid;
|
---|
| 171 | }
|
---|
| 172 | }
|
---|
| 173 |
|
---|
| 174 | function google_get_ad_url() {
|
---|
| 175 | $google_ad_url = 'http://pagead2.googlesyndication.com/pagead/ads?';
|
---|
| 176 | foreach ($GLOBALS['google'] as $param => $value) {
|
---|
| 177 | if ($param == 'client') {
|
---|
| 178 | google_append_url($google_ad_url, $param,
|
---|
| 179 | 'ca-mb-' . $GLOBALS['google'][$param]);
|
---|
| 180 | } else if (strpos($param, 'color_') === 0) {
|
---|
| 181 | google_append_color($google_ad_url, $param);
|
---|
| 182 | } else if (strpos($param, 'url') === 0) {
|
---|
| 183 | $google_scheme = ($GLOBALS['google']['https'] == 'on')
|
---|
| 184 | ? 'https://' : 'http://';
|
---|
| 185 | google_append_url($google_ad_url, $param,
|
---|
| 186 | $google_scheme . $GLOBALS['google'][$param]);
|
---|
| 187 | } else {
|
---|
| 188 | google_append_globals($google_ad_url, $param);
|
---|
| 189 | }
|
---|
| 190 | }
|
---|
| 191 | google_append_url($google_ad_url, 'dt',
|
---|
| 192 | round(1000 * array_sum(explode(' ', microtime()))));
|
---|
| 193 | return $google_ad_url;
|
---|
| 194 | }
|
---|
| 195 |
|
---|
| 196 | $google_ad_handle = @fopen(google_get_ad_url(), 'r');
|
---|
| 197 | if ($google_ad_handle) {
|
---|
| 198 | while (!feof($google_ad_handle)) {
|
---|
| 199 | echo fread($google_ad_handle, 8192);
|
---|
| 200 | }
|
---|
| 201 | fclose($google_ad_handle);
|
---|
| 202 | }
|
---|
| 203 |
|
---|
| 204 | ?> |
---|