示例#1
0
function wpi_post_author_html()
{
    $author = ent2ncr(wpi_get_post_author());
    $attrib = array();
    $attrib['class'] = 'author reviewer';
    $htm = _t('cite', $author, array('class' => 'author reviewer', 'title' => $author));
    $attrib = array();
    $attrib['class'] = 'pby';
    if (!wpi_option('post_by_enable')) {
        $attrib['class'] .= ' dn';
    }
    $htm = _('by') . ' ' . $htm;
    t('span', $htm, $attrib);
}
示例#2
0
function wpi_register_widgets()
{
    global $wp_query;
    if (wpi_option('widget_treeview')) {
        wpi_overwrite_widget_cat();
    }
    if (is_active_widget('wp_widget_recent_comments')) {
        remove_filter('wp_head', 'wp_widget_recent_comments_style');
    }
    wpi_grid_sidebar_filter();
    // custom widgets
    wpi_foreach_hook(array('wpi_before_sidebar_4', 'wpi_sidebar_4_nowidget', 'wpi_before_sidebar_7'), 'wpi_widget_post_summary');
    if (wpi_option('widget_related_post')) {
        wpi_foreach_hook(array('wpi_before_sidebar_4', 'wpi_sidebar_4_nowidget'), 'wpi_widget_related_post');
    }
    wpi_foreach_hook(array('wpi_after_sidebar_4', 'wpi_sidebar_4_nowidget'), 'wpi_widget_single_nav');
    // author
    wpi_foreach_hook(array('wpi_before_sidebar_13', 'wpi_sidebar_13_nowidget'), 'wpi_widget_author_stalker_pass');
    // author info
    wpi_foreach_hook(array('wpi_before_sidebar_13', 'wpi_sidebar_13_nowidget'), 'wpi_widget_author_summary');
    add_action('wpi_after_sidebar_7', 'wpi_widget_subpages');
    add_action('wpi_before_sidebar_7', 'wpi_most_download_widget', 11);
}
示例#3
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 
}
示例#4
0
function wpi_get_related_post_tag()
{
    global $wpdb, $post, $table_prefix;
    $exclude = '';
    $limit = (int) wpi_option('related_post_widget_max');
    $limit = $limit ? $limit : 5;
    $wp_no_rp = 5;
    $show_date = wpi_option('related_post_widget_date');
    $show_comments_count = wpi_option('related_post_widget_comments_count');
    if ($exclude != '') {
        $q = "SELECT tt.term_id FROM " . $table_prefix . "term_taxonomy tt, " . $table_prefix . "term_relationships tr WHERE tt.taxonomy = 'category' AND tt.term_taxonomy_id = tr.term_taxonomy_id AND tr.object_id = {$post->ID}";
        $cats = $wpdb->get_results($q);
        foreach ($cats as $cat) {
            if (in_array($cat->term_id, $exclude) != false) {
                return;
            }
        }
    }
    if (!$post->ID) {
        return false;
    }
    $now = current_time('mysql', 1);
    $tags = wp_get_post_tags($post->ID);
    $taglist = "'" . $tags[0]->term_id . "'";
    $tagcount = count($tags);
    if ($tagcount > 1) {
        for ($i = 1, $tagcount = count($tags); $i <= $tagcount; $i++) {
            if (isset($tags[$i])) {
                $taglist = $taglist . ", '" . $tags[$i]->term_id . "'";
            }
        }
    }
    if ($limit) {
        $limitclause = "LIMIT {$limit}";
    } else {
        $limitclause = "LIMIT 10";
    }
    $q = "SELECT DISTINCT p.ID, p.post_title, p.post_date, p.comment_count, count(t_r.object_id) as cnt FROM {$wpdb->term_taxonomy} t_t, {$wpdb->term_relationships} t_r, {$wpdb->posts} p WHERE t_t.taxonomy ='post_tag' AND t_t.term_taxonomy_id = t_r.term_taxonomy_id AND t_r.object_id  = p.ID AND (t_t.term_id IN ({$taglist})) AND p.ID != {$post->ID} AND p.post_status = 'publish' AND p.post_date_gmt < '{$now}' GROUP BY t_r.object_id ORDER BY cnt DESC, p.post_date_gmt DESC {$limitclause};";
    $related_posts = $wpdb->get_results($q);
    $output = "";
    $cnt = 0;
    if (!$related_posts) {
        return false;
    }
    foreach ($related_posts as $related_post) {
        $xt = 'list-' . $cnt;
        $xt .= $cnt % 2 ? ' even' : ' odd';
        $ttitle = $ntitle = wptexturize($related_post->post_title);
        $attrib = array();
        $attrib['href'] = apply_filters(wpiFilter::FILTER_LINKS, get_permalink($related_post->ID));
        $attrib['title'] = $ttitle;
        $attrib['class'] = 'foaf-isPrimaryTopicOf dc-subject';
        $attrib['rev'] = 'site:relative';
        if ($show_comments_count) {
            $ntitle .= ' ' . _t('small', '(' . $related_post->comment_count . ')', array('title' => 'Comments Count: ' . $related_post->comment_count, 'class' => 'comment-count'));
        }
        $link = _t('a', $ntitle, $attrib);
        if ($show_date) {
            $dateformat = 'm/d';
            $date = mysql2date($dateformat, $related_post->post_date);
            $date_title = mysql2date('r', $related_post->post_date);
            $link = _t('small', $date, array('title' => 'Published on ' . $date_title)) . ' ' . $link;
        }
        $output .= _t('li', $link, array('class' => $xt));
        $cnt++;
    }
    $output = '<ul class="xoxo cf">' . $output . '</ul>';
    return $output;
}
示例#5
0
 public function registerExtraCSS()
 {
     $sc = is_at();
     $this->register($sc);
     // year, month, date will used archive as sub stylesheets
     if ($sc == wpiSection::YEAR || $sc == wpiSection::MONTH || $sc == wpiSection::DAY) {
         $this->register(wpiSection::ARCHIVE);
     }
     if ($sc == wpiSection::PAGE || $sc == wpiSection::SINGLE) {
         $this->register('comments');
         // attachment is inside single & page so it must be separated
         // from the above conditional
     } elseif ($sc == wpiSection::ATTACHMENT) {
         $this->register('comments');
     }
     $selectors = str_rem('-foaf-Document', wpi_get_body_class());
     $selectors = str_rem('archive', $selectors);
     $selectors = explode(" ", $selectors);
     foreach ($selectors as $tag) {
         $this->register($tag);
     }
     unset($selectors, $tag);
     $this->Avatar = new wpiGravatar();
     $this->Avatar->filterCSS($sc);
     if (wpi_option('text_dir') == 'rtl') {
         $this->register('rtl');
     }
     if (isset($this->section[$sc])) {
         foreach ($this->section[$sc] as $tag) {
             $this->register($tag);
         }
     }
 }
示例#6
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 
    }
示例#7
0
wpi_search_box();
?>
							<button id="searchsubmit" type="submit" class="rtxt"><?php 
_e('Search', WPI_META);
?>
							</button>
						</p>
					</form>
				</div>
<?php 
wpi_section_end();
wpi_section_start('pathway');
?>
				<ul id="pathway-column" class="r cfl">
					<?php 
if (wpi_option('pathway_enable')) {
    ?>
					<li id="breadcrumb">
						<?php 
    wpi_pathway();
    ?>
					</li>
					<?php 
}
?>
					<li id="tools">
						<?php 
wpi_acl_links();
?>
						
					</li>
示例#8
0
 /**
  * Wpi::__construct()
  * 
  * @return
  */
 public function __construct()
 {
     self::getFile(array('filters-enum', 'client', 'style', 'template', 'gravatar', 'sidebar'), 'class');
     self::getFile(array('browscap', 'body_class'), 'import');
     self::getFile(array('utils', 'formatting', 'filters', 'query', 'links', 'template', 'plugin', 'widgets', 'comments', 'author'));
     if (is_admin()) {
         add_action('admin_menu', array($this, 'setThemeOptions'));
         // post template form
         wpi_foreach_hook(array('simple_edit_form', 'edit_form_advanced', 'edit_page_form'), 'wpi_post_metaform');
         wpi_foreach_hook(array('edit_post', 'publish_post', 'save_post', 'edit_page_form'), 'wpi_update_post_form');
         // User profile form
         wpi_foreach_hook(array('profile_personal_options' => 'wpi_profile_options', 'personal_options_update' => 'wpi_profile_options_update'));
     }
     wpi_plugin_init();
     wpi_default_filters();
     // client browser
     $this->Browser = new Browscap(WPI_CACHE_DIR);
     if (is_object($this->Browser)) {
         $this->setBrowscapPref();
     }
     // section
     $this->section = is_at();
     // lost
     // scripts
     if ($this->Browser->JavaScript) {
         self::getFile('scripts', 'class');
         $this->Script = new wpiScripts();
         $js = array('jquery' => 'head', 'tooltip' => 'head', 'footer' => 'footer', 'css' => 'footer');
         if (wpi_option('client_time_styles')) {
             $js['cookie'] = 'head';
             $js['client-time'] = 'head';
         }
         // default scripts library
         $this->registerScript($js);
         if (wpi_option('widget_treeview')) {
             $this->registerScript(array('treeview' => 'head', 'f-treeview' => 'footer'));
         }
         add_action('wp_head', array($this->Script, 'printHead'), 10);
         add_action('wp_head', array($this->Script, 'embedScript'), 10);
         add_action(wpiFilter::ACTION_FOOTER_SCRIPT, array($this->Script, 'printFooter'), 10);
     }
     // stylesheets
     if ($this->Browser->supportsCSS && !is_admin() && !is_feed()) {
         $this->Style = new wpiStyle();
         $this->Style->client_css_version = $this->Browser->CssVersion;
         if (wpi_option('widget_treeview')) {
             $this->Style->register('image-treeview');
         }
         if (is_active_widget('widget_flickrRSS')) {
             // load at active section
             $widget_id = 'flickrrss';
             $active = wpi_widget_active_section($widget_id);
             foreach ($active as $k => $section) {
                 $this->Style->register($widget_id, $section);
             }
             unset($active, $widget_id);
         }
         if (wpi_is_plugin_active('global-translator/translator.php')) {
             $tag = 'translator-image';
             $this->Style->register($tag, wpiSection::SINGLE);
             $this->Style->register($tag, wpiSection::PAGE);
             $this->Style->register($tag, wpiSection::ATTACHMENT);
         }
         if (wpi_option('css_via_header')) {
             $this->Style->printStyles();
         } else {
             add_action(wpiFilter::ACTION_META_LINK, array($this->Style, 'printStyles'));
         }
     }
     // sidebar
     $this->Sidebar = new wpiSidebar();
     $this->Sidebar->setSidebar();
     // custom header
     $this->Template = new wpiTemplate();
     if (defined(WPI_DEBUG)) {
         add_action('wp_footer', array($this, 'debug'));
     }
     // self::debugDefaultFilters()
 }
示例#9
0
 public function embedScript()
 {
     global $wp_query;
     list($lang, $locale) = explode('-', get_bloginfo('language'));
     $pid = isset($wp_query->post->ID) ? $wp_query->post->ID : 0;
     $js = PHP_EOL . PHP_T;
     $js .= '/*<![CDATA[*/' . PHP_EOL . PHP_T . PHP_T;
     $js .= 'var wpi = {url:' . json_encode(WPI_URL_SLASHIT);
     $js .= ',id:' . json_encode(wpiTemplate::bodyID());
     $js .= ',blogname:' . json_encode(WPI_BLOG_NAME);
     $js .= ',theme_url:' . json_encode(WPI_THEME_URL);
     $js .= ',section:' . json_encode(is_at());
     $js .= ',permalink:' . json_encode(trailingslashit(self_uri()));
     $jspath = json_encode(rel(WPI_THEME_URL . 'public/scripts/'));
     $jsurl = json_encode(wpi_get_scripts_url('%s'));
     $js .= ',script:{path:' . $jspath . ',url:' . $jsurl . '}';
     if (wpi_option('client_time_styles')) {
         $js .= ',pid:' . $pid . ',cl_type:td};jQuery(document).ready(function(){if( $(\'#\'+wpi.id).hasClass(wpi.cl_type) == false){ $(\'#\'+wpi.id).addClass(wpi.cl_type);jQuery.cookie(\'wpi-cl\',wpi.cl_type,{duration: 1/24,path: "/"});};});' . PHP_EOL;
     } else {
         $js .= ',pid:' . $pid . '};' . PHP_EOL;
     }
     // check client cookie;
     if ($wp_query->is_search || $wp_query->is_404) {
         // google webmaster 404 widget
         $js .= PHP_T . PHP_T . 'var GOOG_FIXURL_LANG = \'' . $lang . '\';var GOOG_FIXURL_SITE = wpi.url;' . PHP_EOL;
     }
     $js .= PHP_T . '/*]]>*/' . PHP_EOL . PHP_T;
     echo PHP_T;
     t('script', $js, array('id' => 'wp-js-head-embed', 'type' => 'text/javascript', 'defer' => 'defer', 'charset' => 'utf-8'));
 }
示例#10
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;
 }