Example #1
0
    public function optionAdvance()
    {
        $prop = self::option('xhtml_mime_type');
        ?>
<ol class="r mtb options-item">
	<li class="ss"><h4 class="title-" title="toggle view: Advance">Advanced Preferences</h4>
	<div class="dn">
	<ul class="romanNumerals mtb">
		<li>
			<label><?php 
        _e('True xhtml+xml', WPI_META);
        ?>
<small>Send real application/xhtml+xml content</small></label>
				<select name="wpi_xhtml_mime_type" id="wpi_xhtml_mime_type" size="2" class="row-2" disabled="disabled">
			<?php 
        self::htmlOption(array($this->lang['enabled'] => 1, $this->lang['disabled'] => 0), $prop);
        ?>
				</select> 	
			
		</li>
		<li><?php 
        $prop = self::option('css_via_header');
        ?>
			<label><?php 
        _e('Cloak CSS', WPI_META);
        ?>
<small>For supporting browser only.</small></label>
				<select name="wpi_css_via_header" id="wpi_css_via_header" size="2" class="row-2" disabled="disabled">
			<?php 
        self::htmlOption(array($this->lang['enabled'] => 1, $this->lang['disabled'] => 0), $prop);
        ?>
				</select> 	
			
		</li>
		<li><?php 
        $prop = self::option('text_dir');
        ?>
			<label><?php 
        _e('Text direction', WPI_META);
        ?>
			<small>refer <a href="http://www.w3.org/TR/REC-html40/struct/dirlang.html">W3C HTML Documentations</a>.</small></label>
				<select name="wpi_text_dir" id="wpi_text_dir" size="2" class="row-2">
			<?php 
        self::htmlOption(array(__('Left to Right', WPI_META) => 'ltr', __('Right to Left', WPI_META) => 'rtl'), $prop);
        ?>
				</select> 	
		</li>	
		
		<li><?php 
        $prop = self::option('browscap_autoupdate');
        ?>
			<label><?php 
        _e('Auto-update Browser Library', WPI_META);
        ?>
			<small>Refer: <a href="http://browsers.garykeith.com/">Gary Keith's Browser capabilities project Library</a>.</small>
			</label>
				<select name="wpi_browscap_autoupdate" id="wpi_browscap_autoupdate" size="2" class="row-2" disabled="disabled">
			<?php 
        self::htmlOption(array($this->lang['enabled'] => 1, $this->lang['disabled'] => 0), $prop);
        ?>
				</select> 	
			
		</li>
		<li><?php 
        $prop = self::option('relative_links');
        ?>
			<label><?php 
        _e('Make links relative', WPI_META);
        ?>
			<small>Increase relative links.</small></label>
				<select name="wpi_relative_links" id="wpi_relative_links" size="2" class="row-2">
			<?php 
        self::htmlOption(array($this->lang['enabled'] => 1, $this->lang['disabled'] => 0), $prop);
        ?>
				</select> 	
		</li>
		<li><?php 
        $prop = self::option('meta_title');
        ?>
			<label><?php 
        _e('Page title', WPI_META);
        ?>
			<small>Enable custom page title.</small></label>
				<select name="wpi_meta_title" id="wpi_meta_title" size="2" class="row-2">
			<?php 
        self::htmlOption(array($this->lang['enabled'] => 1, $this->lang['disabled'] => 0), $prop);
        ?>
				</select> 	
		</li>		
		<li><?php 
        $prop = self::option('meta_description');
        ?>
			<label>
				<?php 
        _e('Meta description', WPI_META);
        ?>
				<small>custom meta description.</small>
			</label>
				<select name="wpi_meta_description" id="wpi_meta_description" size="2" class="row-2">
			<?php 
        self::htmlOption(array($this->lang['enabled'] => 1, $this->lang['disabled'] => 0), $prop);
        ?>
				</select> 	
				<?php 
        if ($prop) {
            ?>
				<ul>
					<li class="last">
						<label for="wpi_def_meta_description">
						<?php 
            _e('Default description', WPI_META);
            ?>
	
						</label>
						
			<textarea id="wpi_def_meta_description" name="wpi_def_meta_description" style="width:50%"><?php 
            echo wpi_safe_stripslash(self::option('def_meta_description'));
            ?>
</textarea>				
				</li>
				</ul>		
				<?php 
        }
        ?>
									
		</li>
		<li><?php 
        $prop = self::option('meta_keywords');
        ?>
			<label>
				<?php 
        _e('Meta keywords', WPI_META);
        ?>
				<small>Custom meta keywords</small>
			</label>
				<select name="wpi_meta_keywords" id="wpi_meta_keywords" size="2" class="row-2">
			<?php 
        self::htmlOption(array($this->lang['enabled'] => 1, $this->lang['disabled'] => 0), $prop);
        ?>
				</select>
				<?php 
        if ($prop) {
            ?>
				<ul>
					<li class="last">
						<label for="wpi_def_meta_keywords">
						<?php 
            _e('Default keywords', WPI_META);
            ?>
	
						</label>
						
			<textarea id="wpi_def_meta_keywords" name="wpi_def_meta_keywords" style="width:50%"><?php 
            echo wpi_safe_stripslash(self::option('def_meta_keywords'));
            ?>
</textarea>				
				</li>
				</ul>		
				<?php 
        }
        ?>
					
			
		</li>	
		<li><?php 
        $prop = self::option('banner');
        ?>
			<label><?php 
        _e('Show banner:', WPI_META);
        ?>
</label>
				<select name="wpi_banner" id="wpi_banner" size="2" class="row-2">
			<?php 
        self::htmlOption(array($this->lang['enabled'] => 1, $this->lang['disabled'] => 0), $prop);
        ?>
				</select>		
				<?php 
        if ($prop) {
            ?>
				<ul>
					<li>
						<label>
							<?php 
            _e('Image URL', WPI_META);
            ?>
							<small>default: http://static.animepaper.net/upload/rotate.jpg</small>
						</label>
						<?php 
            $burl = self::option('banner_url');
            ?>
						<?php 
            if (empty($burl)) {
                $burl = 'http://static.animepaper.net/upload/rotate.jpg';
            }
            ?>
						<?php 
            t('input', '', array('type' => 'text', 'name' => 'wpi_banner_url', 'id' => 'wpi_banner_url', 'value' => $burl));
            ?>
					
					</li>
					<li>
						<label>
							<?php 
            _e('Background repeat', WPI_META);
            ?>
							<small>default: none</small>
						</label>
						<select name="wpi_banner_repeat" id="wpi_banner_repeat" size="2" class="row-4">
					<?php 
            $repeat = wpi_option('banner_repeat');
            if (empty($repeat)) {
                $repeat = 'no-repeat';
            }
            ?>
					<?php 
            self::htmlOption(array('None' => 'no-repeat', 'Tile' => 'repeat', 'Horizontal' => 'repeat-x', 'Vertical' => 'repeat-y'), $repeat);
            ?>
						</select>
					</li>
					<li>
						<label>
							<?php 
            _e('Banner height', WPI_META);
            ?>
							<small>default: 72<sub>px</sub></small>
						</label>
						<?php 
            $bheight = self::option('banner_height');
            ?>
					<?php 
            if (empty($bheight)) {
                $bheight = '72px';
            }
            ?>
						
						<?php 
            t('input', '', array('type' => 'text', 'name' => 'wpi_banner_height', 'id' => 'wpi_banner_height', 'value' => $bheight));
            ?>
					
					</li>
					<li class="last">
						<label>
							<?php 
            _e('Exclude banner', WPI_META);
            ?>
							<small>default: none</small>
						</label>
						<select name="wpi_banner_na" id="wpi_banner_na" size="2" class="row-4">
					<?php 
            $dbanner = wpi_option('banner_na');
            if (empty($dbanner)) {
                $dbanner = 'none';
            }
            ?>
					<?php 
            self::htmlOption(array('None' => 'none', 'Home' => wpiSection::HOME, 'Single' => wpiSection::SINGLE, 'Page' => wpiSection::PAGE), $dbanner);
            ?>
						</select>
					</li>															
				</ul>
				<?php 
        }
        ?>
	
		</li>						
		<li class="last"><?php 
        $prop = self::option('client_time_styles');
        ?>
			<label>
				<?php 
        _e('Client time CSS', WPI_META);
        ?>
				<small>Stylesheets switcher</small>
			</label>
				<select name="wpi_client_time_styles" id="wpi_client_time_styles" size="2" class="row-2" disabled="disabled">
			<?php 
        self::htmlOption(array($this->lang['enabled'] => 1, $this->lang['disabled'] => 0), $prop);
        ?>
				</select> 	
		</li>															
	</ul>	
	<?php 
        self::saveButton();
        ?>
	</div>		
	</li>
	
</ol>
<?php 
    }
Example #2
0
 public function meta()
 {
     global $wp_query;
     $m = array();
     $section = is_at();
     $m[] = array('name' => 'distribution', 'content' => 'global');
     $m[] = array('name' => 'rating', 'content' => 'general');
     $m[] = array('name' => 'designer', 'content' => 'Avice De&apos;v&eacute;reux; url:http://blog.kaizeku.com');
     if ($wp_query->is_singular) {
         $aid = (int) $wp_query->post->post_author;
         $user = get_userdata($aid);
         $name = ent2ncr(htmlentities2($user->display_name));
         unset($aid, $user);
         $m[] = array('name' => 'author', 'content' => $name);
     }
     if (get_option('blog_public') != '0') {
         $robots = sprintf('%s, follow', (is_home() || is_single() || is_page()) && !is_paged() ? 'index' : 'noindex');
         $m[] = array('name' => 'robots', 'content' => $robots . ', noodp');
     }
     $m[] = array('name' => 'DC.type', 'content' => 'text', 'scheme' => 'DCTERMS.DCMIType');
     $m[] = array('name' => 'DC.format', 'content' => self::getContentMIMEType(), 'scheme' => 'DCTERMS.IMT');
     $m[] = array('name' => 'DC.language', 'content' => self::getContentLanguage(), 'scheme' => 'DCTERMS.RFC3066');
     $m[] = array('name' => 'DC.identifier', 'content' => self_uri(), 'scheme' => 'DCTERMS.URI');
     $m[] = array('name' => 'DC.title', 'content' => wp_title('&#187;', false, 'right') . WPI_BLOG_NAME);
     if ($section == 'home') {
         if (wpi_option('meta_description')) {
             $prop = wpi_safe_stripslash(wpi_option('def_meta_description'));
             if ('' == $prop) {
                 $prop = attribute_escape(get_option('blogdescription'));
             }
             $m[] = array('name' => 'description', 'content' => $prop);
         }
         // keywords
         if (wpi_option('meta_keywords')) {
             $prop = wpi_safe_stripslash(wpi_option('def_meta_keywords'));
             if ('' == $prop) {
                 $prop = WPI_BLOG_NAME;
             }
             $m[] = array('name' => 'keywords', 'content' => $prop);
         }
     }
     $is_desc = wpi_option('meta_description');
     $is_keyswords = wpi_option('meta_keywords');
     if ($section == 'single' || $section == 'page') {
         global $post;
         if (($subtitle = wpi_get_postmeta('subtitle')) != false) {
             $m[] = array('name' => 'abstract', 'content' => attribute_escape($subtitle));
         }
         if ($is_desc) {
             if (($desc = wpi_get_postmeta('meta_description')) != false) {
                 $m[] = array('name' => 'description', 'content' => attribute_escape($desc));
             }
         }
         if ($is_keyswords) {
             if (($keywords = wpi_get_postmeta('meta_keywords')) != false) {
                 $m[] = array('name' => 'keywords', 'content' => attribute_escape($keywords));
             }
         }
     }
     if ($section == 'category' || $section == 'tag') {
         if ($is_desc) {
             global $cat;
             $cat = get_category($cat);
             if (($desc = $cat->category_description) != '') {
                 $m[] = array('name' => 'description', 'content' => attribute_escape($desc));
             } else {
                 $desc = WPI_BLOG_NAME . '&apos;s archive for ' . $cat->name . ', there is ' . $cat->count . ' articles in this category';
                 $m[] = array('name' => 'description', 'content' => attribute_escape($desc));
             }
         }
     }
     $geourl = wpi_get_theme_option('geourl');
     if ($geourl && !empty($geourl)) {
         $geo_position = explode(",", $geourl);
         $m[] = array('name' => 'geo.position', 'content' => $geo_position[0] . ';' . $geo_position[1]);
         $m[] = array('name' => 'ICBM', 'content' => $geourl);
     }
     $microid = wpi_get_theme_option('microid_hash');
     if ($microid && !empty($microid)) {
         $m[] = array('name' => 'microid', 'content' => $microid);
     }
     if (has_count($m)) {
         foreach ($m as $attribs) {
             echo "\t" . _t('meta', '', $attribs);
         }
     }
     unset($m, $attribs);
 }