Пример #1
0
function wpi_post_metaform()
{
    ?>
<h2>WP-iStalker Theme options</h2>
	<?php 
    if (wpi_option('meta_title')) {
        ?>
	<?php 
        $ptitle = __('Page Title', WPI_META);
        $ltitle = __('Title: ', WPI_META);
        ?>
	<?php 
        wpi_metabox_start($ptitle, 'maintitle');
        ?>
		<p>
			<?php 
        wpi_postmeta_label('maintitle', $ltitle);
        ?>
			<?php 
        wpi_postmeta_input('maintitle');
        ?>
					
		</p>
	<?php 
        wpi_metabox_end();
        ?>
	<?php 
    }
    ?>
	<?php 
    if (wpi_option('meta_description')) {
        ?>
	<?php 
        $ptitle = __('Meta Description', WPI_META);
        $ltitle = __('Descriptions: ', WPI_META);
        ?>
	<?php 
        wpi_metabox_start($ptitle, 'metadescription');
        ?>
		<p>
			<?php 
        wpi_postmeta_label('meta_description', $ltitle);
        ?>
			<?php 
        wpi_postmeta_input('meta_description');
        ?>
					
		</p>
	<?php 
        wpi_metabox_end();
        ?>
	
	<?php 
    }
    ?>
	
	
	<?php 
    if (wpi_option('meta_keywords')) {
        ?>
	<?php 
        $ptitle = __('Meta Keywords', WPI_META);
        $ltitle = __('Keywords: ', WPI_META);
        ?>
	<?php 
        wpi_metabox_start($ptitle, 'metakeywords');
        ?>
		<p>
			<?php 
        wpi_postmeta_label('meta_keywords', $ltitle);
        ?>
			<?php 
        wpi_postmeta_input('meta_keywords');
        ?>
					
		</p>
	<?php 
        wpi_metabox_end();
        ?>
	<?php 
    }
    ?>
	
	<?php 
    if (wpi_option('banner')) {
        ?>
	<?php 
        $ptitle = __('Banner Settings', WPI_META);
        ?>
	<?php 
        wpi_metabox_start($ptitle, 'banner', true);
        ?>
			<p> <?php 
        $ltitle = __('Show banner: ', WPI_META);
        ?>
			<?php 
        wpi_postmeta_label('banner', $ltitle);
        ?>
					<select name="wpi_banner" id="wpi_banner" size="2" class="row-4" style="height:36px">
			<?php 
        $prop = wpi_get_postmeta('banner');
        if (empty($prop)) {
            $prop = 1;
        }
        wpiAdmin::htmlOption(array('Enabled' => 1, 'Disabled' => 0), $prop);
        ?>
					</select>
			</p>		
			<p id="banner-url" style="clear:both">
				<?php 
        $ltitle = __('Image URL: ', WPI_META);
        ?>
				<?php 
        wpi_postmeta_label('banner_url', $ltitle);
        ?>
				<?php 
        wpi_postmeta_input('banner_url');
        ?>
			
			</p>
			<p id="banner-height" style="clear:both">
				<?php 
        $ltitle = __('Banner height: ', WPI_META);
        ?>
				<?php 
        wpi_postmeta_label('banner_height', $ltitle);
        ?>
				
				<?php 
        wpi_postmeta_input('banner_height', 'width:10%', '72px');
        ?>
	
			</p>			
			<p style="clear:both">			
				<?php 
        $ltitle = __('Background repeat:', WPI_META);
        ?>
				<?php 
        wpi_postmeta_label('banner_repeat', $ltitle);
        ?>
					<select name="wpi_banner_repeat" id="wpi_banner_repeat" size="2" class="row-4" style="height:68px">
			<?php 
        $prop = wpi_get_postmeta('banner_repeat');
        if (empty($prop)) {
            $prop = 'no-repeat';
        }
        wpiAdmin::htmlOption(array('None' => 'no-repeat', 'Tile' => 'repeat', 'Horizontal' => 'repeat-x', 'Vertical' => 'repeat-y'), $prop);
        ?>
		
					</select>
			</p>			
	<?php 
        wpi_metabox_end();
        ?>
	
	<?php 
    }
    ?>
	
	<?php 
    $ptitle = __('Entry sub title', WPI_META);
    ?>
	<?php 
    wpi_metabox_start($ptitle, 'subtitle', true);
    ?>
	
			<p><?php 
    $ltitle = __('Sub title:', WPI_META);
    ?>
				<?php 
    wpi_postmeta_label('subtitle', $ltitle);
    ?>
				
				<?php 
    wpi_postmeta_input('subtitle');
    ?>
	
			</p>
			<p><?php 
    _e('will also be added to header as Meta Abstract', WPI_META);
    ?>
</p>
	<?php 
    wpi_metabox_end();
    ?>
	
	<?php 
    $ptitle = __('hReview', WPI_META);
    ?>
	<?php 
    wpi_metabox_start($ptitle, 'hrating', true);
    ?>
	
			<p><?php 
    $ltitle = __('Rating', WPI_META);
    ?>
				<?php 
    wpi_postmeta_label('hrating', $ltitle);
    ?>
				
				<?php 
    wpi_postmeta_input('hrating', 'style:width:10%', 3);
    ?>
	
			</p>
			<p><?php 
    _e('hReview rating for this entry. Max is 5', WPI_META);
    ?>
</p>
	<?php 
    wpi_metabox_end();
    ?>
	
	<?php 
    $ptitle = __('Header Content', WPI_META);
    ?>
	<?php 
    wpi_metabox_start($ptitle, 'header_content', true);
    ?>
	
			<p><?php 
    $ltitle = __('Content: ', WPI_META);
    ?>
				<?php 
    wpi_postmeta_label('header_content', $ltitle);
    ?>
				
				<textarea id="wpi_header_content" name="wpi_header_content" style="width:70%;height:200px"><?php 
    echo stripslashes_deep(wpi_get_postmeta('header_content'));
    ?>
</textarea>	
			</p>
			<p><?php 
    _e('Content will be added before the &#60;&#47;head&#62; tag.', WPI_META);
    ?>
</p>
	<?php 
    wpi_metabox_end();
    ?>
	
	
	<?php 
    $ptitle = __('Footer Content', WPI_META);
    ?>
	<?php 
    wpi_metabox_start($ptitle, 'footer_content', true);
    ?>
	
			<p><?php 
    $ltitle = __('Content: ', WPI_META);
    ?>
				<?php 
    wpi_postmeta_label('footer_content', $ltitle);
    ?>
				
				<textarea id="wpi_footer_content" name="wpi_footer_content" style="width:70%"><?php 
    echo stripslashes_deep(wpi_get_postmeta('footer_content'));
    ?>
</textarea>	
			</p>
			<p><?php 
    _e('Content will be added before the &#60;&#47;body&#62; tag.', WPI_META);
    ?>
</p>
	<?php 
    wpi_metabox_end();
    ?>
		
<?php 
}
Пример #2
0
function wpi_get_hrating()
{
    $rated = 3;
    if (($is_rated = wpi_get_postmeta('hrating')) != false) {
        $rated = $is_rated ? $is_rated : $rated;
    }
    $output = _t('span', $rated, array('class' => 'rating rtxt rated-' . $rated));
    $output = _t('div', __('Rated ', WPI_META) . $output, array('class' => 'hrating rtxt'));
    return $output;
}
Пример #3
0
 public function bannerIntenalCSS()
 {
     if (!self::bannerReady()) {
         return;
     }
     $sc = is_at();
     $is_articles = $sc == wpiSection::SINGLE || $sc == wpiSection::PAGE ? true : false;
     $css = PHP_EOL;
     $burl = wpi_option('banner_url');
     $height = wpi_option('banner_height');
     $repeat = wpi_option('banner_repeat');
     // global image url
     $burl = !empty($burl) ? $burl : 'http://static.animepaper.net/upload/rotate.jpg';
     $height = !empty($height) ? $height : '72px';
     $repeat = !empty($repeat) ? $repeat : 'no-repeat';
     if ($is_articles) {
         if (($purl = wpi_get_postmeta('banner_url')) != false) {
             $burl = !empty($purl) ? $purl : $burl;
         }
         if (($pheight = wpi_get_postmeta('banner_height')) != false) {
             $height = !empty($pheight) ? $pheight : $height;
         }
         if (($prepeat = wpi_get_postmeta('banner_repeat')) != false) {
             $repeat = !empty($prepeat) ? $prepeat : $repeat;
         }
     }
     if ($sc == wpiSection::AUTHOR) {
         global $wp_query;
         $puser = $wp_query->queried_object;
         if (($url = $puser->user_banner_url) != false) {
             $burl = !empty($url) ? $url : $burl;
         }
         if (($uheight = $puser->user_banner_height) != false) {
             $height = !empty($uheight) ? $uheight : $height;
         }
         if (($urepeat = $puser->user_banner_repeat) != false) {
             $repeat = !empty($urepeat) ? $urepeat : $repeat;
         }
         unset($puser);
     }
     $css .= PHP_T . '#banner{background-color:#f9f9f9;background-image:url(';
     $css .= $burl . ');border-bottom:2px solid #ddd;';
     $css .= 'border-top:1px solid #999;height:' . $height . ';';
     $css .= 'background-position:0% 0%;background-repeat:' . $repeat;
     $css .= '}' . PHP_EOL;
     echo $css;
 }