Ejemplo n.º 1
0
							   <permits rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
							   <requires rdf:resource="http://web.resource.org/cc/Notice" />
							</License>
							</rdf:RDF>
							-->			
					</li><?php 
        $cnt++;
    }
    /* end for each comment */
    ?>
					<?php 
    wpi_comment_guide($post, $comments, $cnt);
    ?>
				</ol>
				<p class="mgt cb comments-feed"><a type="application/rss+xml" title="RSS 2.0 Comment Feed" href="<?php 
    echo rel(get_post_comments_feed_link());
    ?>
" rev="site:relative">RSS feed for comments in this post</a></p>
			 <?php 
} else {
    // displayed if there are no comments so far
    ?>
	
				<?php 
    if ('open' == $post->comment_status) {
        ?>
	
				<ol id="comments-list" class="commentlist r cf">				
				<?php 
        wpi_comment_guide($post, $comments, 1);
        ?>
Ejemplo n.º 2
0
/**
 * Header alternate link tag
 * @hook	wp_head
 */
function wpi_global_translator_metalinks()
{
    global $gltr_engine;
    $transl_map = $gltr_engine->get_languages_matrix();
    $translations = $transl_map[BASE_LANG];
    $options = array();
    $prefs = (array) get_option('gltr_preferred_languages');
    $_pref = array_flip($prefs);
    foreach ($_pref as $k => $v) {
        $options[$k] = $translations[$k];
    }
    unset($_prefs, $prefs, $translations);
    $output = '';
    foreach ($options as $iso => $language) {
        $attribs = array();
        $attribs['rel'] = 'alternate';
        $attribs['type'] = get_bloginfo('html_type');
        $attribs['charset'] = strtolower(get_bloginfo('charset'));
        $attribs['href'] = rel(WPI_URL_SLASHIT . $iso . '/');
        $attribs['hreflang'] = $iso;
        $attribs['lang'] = $iso;
        $attribs['xml:lang'] = $iso;
        $attribs['title'] = WPI_BLOG_NAME . '&apos;s in ' . $language;
        $output .= PHP_T . _t('link', '', $attribs);
    }
    unset($options);
    echo $output;
}
Ejemplo n.º 3
0
 public static function avatarURL()
 {
     echo rel(WPI_THEME_URL . md5(get_the_author_email()) . '.ava');
 }
Ejemplo n.º 4
0
    $global_hits += $hit;
    return $hit / ($hit + $miss);
}
print "<h2>Summary</h2>";
print "<table>";
print "<tr><td>Filename</td><td>Coverage</td></tr>";
foreach ($files as $file => $coverage) {
    $csum = coverage_summary($file, $coverage) * 100;
    printf("<tr style='background: %s'><td><a href='#%s'>%s</a></td><td>%4.2f</td></tr>", "hsl(" . max($csum - 40, 0) * 1.6 . ", 50%, 75%)", urlencode(rel($file)), rel($file), $csum);
}
if ($global_lines > 0) {
    printf("<tr><td>Total</td><td><b>%4.2f</b></td></tr>", $global_hits / $global_lines * 100);
}
print "</table>";
foreach ($files as $file => $coverage) {
    print "<h2><a name='" . urlencode(rel($file)) . "'>" . rel($file) . "</a></h2>";
    print "<pre>";
    $lines = explode("\n", file_get_contents($file));
    for ($i = 0; $i < count($lines); $i++) {
        $exes = isset($coverage[$i + 1]) ? $coverage[$i + 1] : -2;
        if ($exes == -1 && blank($lines[$i])) {
            $exes = 0;
        }
        $col = "none";
        if ($exes == -1) {
            $col = "miss";
        }
        if ($exes >= 1) {
            $col = "hit";
        }
        printf("<span class='%s'>%4d %s</span>\n", $col, $exes, htmlentities($lines[$i]));
Ejemplo n.º 5
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'));
 }
Ejemplo n.º 6
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 . '&apos;s WP Admin Dashboard', 'Dashboard');
        $req_uri = get_req_url();
        $m['loginout'] = array('/wp-login.php?action=logout&amp;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'));
}
Ejemplo n.º 7
0
 public function getHtmlBlogname()
 {
     global $wp_query;
     $attribs = array('href' => rel(trailingslashit(WPI_URL)), 'rel' => 'home', 'title' => WPI_BLOG_NAME, 'class' => 'url fn');
     $output = _t('a', WPI_BLOG_NAME, $attribs);
     $heading_type = $wp_query->is_home ? 'h1' : 'h2';
     $output = self::spacing() . _t($heading_type, _t('strong', $output), array('id' => 'blog-title'));
     return $output;
 }