Beispiel #1
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);
}
Beispiel #2
0
 public function build()
 {
     global $wp_query;
     switch (is_at()) {
         case 'home':
         case 'front_page':
             $pathway = $this->getHome();
             break;
         case 'single':
             $pathway = $this->getSingle();
             break;
         case 'page':
             $pathway = $this->getPage();
             break;
         case 'category':
             $pathway = $this->getCategory();
             break;
         case 'tag':
             $pathway = $this->getTag();
             break;
         case 'search':
             $pathway = $this->getSearch();
             break;
         case wpiSection::YEAR:
             $pathway = $this->getDate(wpiSection::YEAR);
             break;
         case wpiSection::MONTH:
             $pathway = $this->getDate(wpiSection::MONTH);
             break;
         case wpiSection::DAY:
             $pathway = $this->getDate(wpiSection::DAY);
             break;
         case wpiSection::AUTHOR:
             $pathway = $this->getAuthor();
             break;
         case wpiSection::PAGE404:
             $pathway = $this->getLost();
             break;
         case wpiSection::ATTACHMENT:
             $pathway = $this->getAttachment();
             break;
     }
     $htm = PHP_EOL;
     if (!has_count($pathway)) {
         return;
     }
     foreach ($pathway as $key => $value) {
         $att = $value[1];
         $att['href'] = apply_filters(wpiFilter::FILTER_LINKS, $att['href']);
         if ($key == 'home') {
             $att['href'] = trailingslashit($att['href']);
         }
         // append tooltips  class if there is title
         if (isset($att['title'])) {
             $att['class'] = $att['class'] . ' ttip';
         }
         $links = _t('a', $value[0], $att);
         $htm .= stab(4) . _t('li', $links);
         /**
          * Add trailing slash on home url 
          * correct status header 	
          * @bugs fixes 301 redirect
          * 6/27/2008 7:57:01 PM $ck 
          */
         if ($key != 'first' && $key != 'last') {
             $htm .= stab(4) . _t('li', _t('span', '›'), array('class' => 'sep'));
         }
     }
     unset($pathway);
     $htm = _t('ul', $htm . stab(3), array('class' => 'r cfl cf'));
     return $htm;
 }
Beispiel #3
0
/**
 * WP log-in, log-out, register & admin dashboard links
 *  
 */
function wpi_acl_links()
{
    $m = array();
    $acl_links = array();
    $m['register'] = array();
    // sort first.
    $m['loginout'] = array('/wp-login.php', 'log-in', 'Log-in to ' . WPI_BLOG_NAME, 'Log-in');
    if (get_option('users_can_register')) {
        $m['register'] = array('/wp-login.php?action=register', 'registration-open', 'Register an Account', 'Register');
    } else {
        $m['register'] = array('/#' . wpiTemplate::bodyID(), 'registration-closed', 'Registration is Closed', 'Registration is Closed');
    }
    if (is_user_logged_in()) {
        $m['register'] = array('/wp-admin/', 'dashboard', WPI_BLOG_NAME . ''s WP Admin Dashboard', 'Dashboard');
        $req_uri = get_req_url();
        $m['loginout'] = array('/wp-login.php?action=logout&redirect_to=' . $req_uri, 'log-out', 'Log-out from ' . WPI_BLOG_NAME, 'Log-out');
    }
    foreach ($m as $k => $v) {
        // attributes
        $attribs = array();
        $attribs['id'] = $v[1];
        $attribs['href'] = rel(WPI_URL . $v[0]);
        if ($k == 'login') {
            $attribs['href'] = apply_filters($k, $attribs['href']);
        }
        $attribs['title'] = 'Info | ' . $v[2];
        if ($k != 'register') {
            $attribs['rel'] = 'noindex noarchive';
        }
        $attribs['rev'] = 'site:relative';
        $attribs['class'] = 'ttip';
        $acl_links[] = _t('a', $v[3], $attribs);
    }
    $output = "\n";
    if (is_array($acl_links)) {
        $cnt = 1;
        foreach ($acl_links as $link) {
            $output .= stab(4) . _t('li', $link, array('id' => 'acl-' . $cnt));
            $cnt++;
        }
    }
    t('ul', $output . stab(2) . PHP_T, array('id' => 'cl-options', 'class' => 'xoxo r cfl cf'));
}
Beispiel #4
0
function wpi_content_meta_title_filter()
{
    global $wp_query;
    $title = get_the_title();
    $output = false;
    if ($wp_query->is_single || $wp_query->is_page) {
        $htm = _t('strong', $title);
        $htm .= wpi_get_subtitle();
        $output = _t('h1', $htm);
    }
    if ($wp_query->is_category) {
        $title = single_cat_title('', false);
        $htm = _t('strong', $title);
        $output = _t('h1', $htm);
        if (($desc = $wp_query->queried_object->category_description) != '') {
            $output .= _t('blockquote', _t('p', $desc . ' '), array('cite' => self_uri(), 'class' => 'entry-summary r'));
        } else {
            $desc = WPI_BLOG_NAME . ''s archive for ' . $title . ', there is ' . $wp_query->queried_object->count . ' articles for this 'main' category.';
            $output .= _t('blockquote', _t('p', $desc . ' '), array('cite' => self_uri(), 'class' => 'entry-summary r'));
        }
    }
    if ($wp_query->is_tag) {
        $title = single_tag_title('', false);
        $htm = _t('strong', $title);
        $output = _t('h1', $htm, array('title' => $title));
        $desc = WPI_BLOG_NAME . ''s taxonomy archive for ' . $title . ', there is ' . $wp_query->queried_object->count . ' article(s) for this tag.';
        $output .= _t('blockquote', _t('p', $desc . ' '), array('cite' => self_uri(), 'class' => 'entry-summary r'));
    }
    if ($wp_query->is_search) {
        $title = get_search_query();
        $htm = _t('small', __('Search results for: ', WPI_META));
        $htm .= _t('strong', $title);
        $output = _t('h1', $htm, array('title' => $title));
    }
    if ($wp_query->is_year) {
        $title = get_the_time('Y');
        $htm = _t('strong', $title);
        $output = _t('small', __('Archive for', WPI_META));
        $output .= _t('h1', $htm, array('title' => $title));
    }
    if ($wp_query->is_month) {
        $title = get_the_time('F, Y');
        $htm = _t('strong', $title);
        $output = _t('small', __('Archive for', WPI_META));
        $output .= _t('h1', $htm, array('title' => $title));
    }
    if ($wp_query->is_day) {
        $title = get_the_time('F jS, Y');
        $htm = _t('strong', $title);
        $output = _t('small', __('Archive for', WPI_META));
        $output .= _t('h1', $htm, array('title' => $title));
    }
    if ($wp_query->is_author) {
        $user = wpi_get_current_author();
        $title = $user->display_name;
        $htm = _t('strong', $title);
        $output = _t('h1', $htm, array('title' => $title));
        $desc = $user->user_description;
        $output .= _t('blockquote', _t('p', $desc . ' '), array('cite' => self_uri(), 'class' => 'entry-summary r'));
    }
    if ($wp_query->is_404) {
        $htm = _t('strong', __('404 Not Found', WPI_META));
        $output = _t('h1', $htm, array('title' => $title));
        $desc = 'Sorry, but you are looking for something that isn't here';
        $output .= _t('blockquote', _t('p', $desc . ' '), array('cite' => self_uri(), 'class' => 'entry-summary r'));
    }
    $output = wpi_google_ads_targeting_filter($output);
    if ($output) {
        echo stab(1) . $output;
    }
    //wpi_dump($wp_query); exit;
    unset($output, $section, $title, $htm);
}
Beispiel #5
0
 public function banner()
 {
     if (!self::bannerReady()) {
         return;
     }
     $output = '<dd id="wp-banner">' . PHP_EOL;
     $output .= PHP_T . '<div class="outer">' . PHP_EOL;
     $output .= stab(2) . '<div class="inner icontent c">' . PHP_EOL;
     $output .= stab(3) . '<div id="banner" class="content cb cf">' . PHP_EOL;
     if (stristr(wpi_option('banner_url'), 'animepaper.net')) {
         $output .= $this->randomAPBanner();
     }
     echo $output;
     $output = stab(3) . '</div>' . PHP_EOL;
     $output .= stab(2) . '</div>' . PHP_EOL;
     $output .= PHP_T . '</div>' . PHP_EOL;
     $output .= '</dd>' . '<!-- /#wp-banner -->' . PHP_EOL;
     echo $output;
     unset($output);
 }