Exemple #1
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);
         }
     }
 }
Exemple #2
0
function wpi_get_comment_author()
{
    if (get_comment_type() != 'comment') {
        $author = get_host(get_comment_author_url());
        $author = str_rem("www.", $author);
    } else {
        $author = get_comment_author();
    }
    return $author;
}
Exemple #3
0
function wpi_search_box()
{
    $att = array('type' => 'text', 'value' => get_search_query(), 'name' => 's', 'id' => 's', 'title' => 'Search | Start typing. We'll figure it out', 'class' => 'ttip');
    if (is_ua('Safari')) {
        $att['type'] = 'search';
        $att['placeholder'] = 'Search';
        $att['autosave'] = str_rem('http://', WPI_URL);
        $att['results'] = '5';
    }
    echo stab(3) . _t('input', '', $att);
}
Exemple #4
0
 public function getTag()
 {
     $pathway = array();
     $tid = (int) get_query_var('tag');
     $tag = get_category($tid);
     $title = single_cat_title('', false);
     //  rss
     $pathway['first'] = array($title . ' taxonomy feeds', array('href' => get_tag_feed_link($tid), 'type' => 'application/rss+xml', 'title' => __($title . ' | Subscribe to this feed', WPI_META), 'hreflang' => get_hreflang(), 'rel' => self::RSS_REL, 'class' => 'rtxt rss16', 'rev' => 'feed:rss2'));
     // home
     $pathway['home'] = $this->getFrontpage();
     //tag_base
     $tag_base = str_rem('/', get_option('tag_base'));
     if ($tag_base) {
         $tag_base = ucfirst($tag_base);
     } else {
         $tag_base = __('Taxonomy', WPI_META);
     }
     $pathway['archive'] = array($tag_base, array('href' => '#content-top', 'title' => __($tag_base . ' | Skip to content', WPI_META)));
     $tid = get_query_var('tag_id');
     $tag = get_term($tid, 'post_tag');
     $pathway['last'] = array($tag->name, array('href' => '#content-top', 'title' => __('Skip to content | ' . $tag->name, WPI_META), 'class' => self::CAT_LINK_CLASS . ' ' . self::DN_ARROW, 'rev' => 'site:archive'));
     unset($tag);
     return $pathway;
 }
Exemple #5
0
    public function optionCache()
    {
        ?>
<ol class="r mtb options-item">
	<li class="ss"><h4 class="title-">
	<?php 
        _e('Manage Cached files', WPI_META);
        ?>
	</h4>
	<div class="dn">
	<ul class="mtb">
		<li class="last">
			<h4><?php 
        _e('Stylesheet', WPI_META);
        ?>
</h4>
			<?php 
        $css = wpi_get_dir(WPI_CACHE_CSS_DIR);
        ?>
			<?php 
        if (has_count($css) && !empty($css)) {
            ?>
			<dl>
			<?php 
            $size = 0;
            $n = 1;
            foreach ($css as $tag) {
                $s = filesize(WPI_CACHE_CSS_DIR . $tag);
                $size += $s;
                $s = format_filesize($s);
                $s = _t('small', ' - ' . $s);
                $t = str_rem('.css', $tag);
                $a = _t('a', $tag, array('href' => wpi_get_stylesheets_url($t), 'target' => '_blank'));
                $c = _t('small', $n . '. ');
                t('dd', $c . $a . $s, array('style' => 'display:block;clear:both'));
                $n++;
            }
            ?>
			<small> Cache directory size : <?php 
            echo format_filesize($size);
            ?>
			</small>
			</dl>
			<button class="sbtn" type="submit" name="wpi_flush_css" id="wpi_flush_css" value="1">Erase Cache</button>
			<?php 
        } else {
            ?>
			<p>No cached files.</p>
			<?php 
        }
        ?>
			
			
			
		</li>
	</ul>
	</div>
	</li>
</ol>					
<?php 
    }
Exemple #6
0
function wpi_stylesheet_directory_uri_filter($stylesheet_dir_uri = false, $stylesheet = false)
{
    $uri = wpi_get_stylesheets_url('css');
    $uri = str_rem('/css/', $uri);
    return $uri;
}