示例#1
0
/**
 *  author display_name
 *  
 */
function wpi_get_author_name($type = 'hcard')
{
    global $authordata;
    $name = $display_name = apply_filters('the_author', $authordata->display_name);
    $name = $display_name = ent2ncr(htmlentities2($name));
    $author_url = $authordata->user_url;
    $author_url = $author_url != 'http://' ? $author_url : WPI_URL;
    switch ($type) {
        case 'link':
            /** simple links
             *	
             */
            $attribs = array('href' => $author_url, 'class' => 'url fn dc-creator', 'rel' => 'colleague foaf.homepage foaf.maker', 'title' => 'Visit ' . $display_name . ''s Website', 'rev' => 'author:' . $authordata->user_nicename);
            $output = _t('a', $display_name, $attribs);
            break;
        case 'hcard':
            /** convert to microformats
             *	address:a:span
             */
            // split the name
            $name = explode('name', $name);
            if (is_array($name)) {
                if (Wpi::hasCount($name)) {
                    if (isset($name[0])) {
                        $output = _t('span', $name[0], array('class' => 'nickname'));
                    }
                    if (isset($name[1])) {
                        $output = _t('span', $name[0], array('class' => 'given-name')) . ' ';
                        $output .= _t('span', $name[1], array('class' => 'family-name'));
                    }
                }
            } else {
                $output = _t('span', $author_name, array('class' => 'nickname'));
            }
            // author post url;
            $url = get_author_posts_url($authordata->ID, $authordata->user_nicename);
            $url = apply_filters(wpiFilter::FILTER_LINKS, $url);
            $attribs = array('href' => $url, 'class' => 'url fn dc-creator', 'rel' => 'colleague foaf.homepage foaf.maker', 'title' => 'Visit ' . $display_name . ''s Author page', 'rev' => 'author:' . $authordata->user_nicename);
            $output = _t('a', $output, $attribs);
            // microID sha-1 hash
            $hash = get_microid_hash($authordata->user_email, $author_url);
            // wrap hcard
            $output = _t('cite', $output, array('class' => 'vcard microid-' . $hash));
            break;
        default:
            $output = $name;
            break;
    }
    return apply_filters(wpiFilter::FILTER_AUTHOR_NAME . $type, $output);
}
示例#2
0
    foreach ($comments as $comment) {
        $alt = $cnt % 2 ? 'light' : 'normal';
        $alt .= ' list-' . $cnt;
        $alt = apply_filters(wpiFilter::FILTER_COMMENTS_SELECTOR, $alt);
        ?>
		
					<li id="comment-<?php 
        comment_ID();
        ?>
" class="<?php 
        echo $alt;
        ?>
 hreview"><?php 
        $author_uri = get_comment_author_url();
        $author_uri = $author_uri != '' && $author_uri != 'http://' ? $author_uri : get_permalink($post->ID) . '#comment-' . get_comment_ID();
        $microid = get_microid_hash(get_comment_author_email(), $author_uri);
        ?>
		
						<ul class="reviewier-column cf r">
							<li class="span-3 fl rn hcard">
								<address class="vcard microid-mailto+http:sha1:<?php 
        echo $microid;
        ?>
 dc-source"><img src="<?php 
        wpi_comment_avatar_src();
        ?>
" width="80" height="80" alt="<?php 
        comment_author();
        ?>
&apos;s photo" class="url cc rn <?php 
        echo wpiGravatar::commentGID();
示例#3
0
function author_microid()
{
    $hash = get_microid_hash(get_the_author_email(), get_the_author_url());
    echo 'microid-' . $hash;
}
示例#4
0
function wpi_comment_guide($post, $comments, $cnt)
{
    $alt = $cnt % 2 ? 'light' : 'normal';
    ?>
					
						<li id="comment-00" class="hreview <?php 
    echo $alt;
    ?>
">
			<ul class="reviewier-column cf r">
							<li class="span-3 fl rn hcard">
							<address class="vcard microid-mailto+http:sha1:<?php 
    echo get_microid_hash(get_comment_author_email(), WPI_URL);
    ?>
">
							<?php 
    $photo_url = THEME_IMG_URL . 'default-avatar.png';
    ?>
							<img src="<?php 
    echo wpi_img_url('avatar-wrap.png');
    ?>
" width="80" height="80" alt="stalker's photo" style="background-image:url('<?php 
    echo wpi_get_random_avatar_uri();
    ?>
');background-position:42% 16%;background-color:#2482B0" class="url gravatar photo rn" longdesc="#comment-<?php 
    comment_ID();
    ?>
" />				
								<a href="<?php 
    echo WPI_URL;
    ?>
" class="url fn db">
								<?php 
    echo WPI_BLOG_NAME;
    ?>
</a>
							</address>				
							</li>
							<li class="span-16 fl review-content">
							<dl class="review r cf">				
							<dt class="item title summary">	
								<a href="#comment-00" class="url fn" title="<?php 
    the_title();
    ?>
">
								<span>RE:</span> <?php 
    the_title();
    ?>
 - 'Commenting Guidlines' &darr;</a> 				
							</dt>	
							<dd class="reviewer-meta">
								<span class="date-since">						
									<?php 
    echo apply_filters(wpiFilter::FILTER_POST_DATE, $post->post_date);
    ?>
								</span> on <abbr class="dtreviewed" title="<?php 
    echo date('Y-m-dTH:i:s:Z', $post->post_date);
    ?>
">
								<?php 
    the_time('l, F jS, Y');
    ?>
 at <?php 
    the_time();
    ?>
								</abbr>	
								<span class="rating dn">5</span>
								<span class="type dn">url</span>
							</dd>
							<dd class="reviewer-entry">		
								<big class="comment-count fr">0%</big>
								<p id="comment-guidline" class="description">If you want to comment, please read the following guidelines.These are designed to protect you and other users of the site.</p>
								<ol class="xoxo">
									<li><strong>Be relevant:</strong> Your comment should be a thoughtful contribution to the subject of the entry. Keep your comments constructive and polite. </li>
									<li><strong>No advertising or spamming:</strong> Do not use the comment feature to promote commercial entities/products, affiliates services or websites. You are allowed to post a link as long as it's relevant to the entry.</li>						
									<li><strong>Keep within the law:</strong> Do not link to offensive or illegal content websites. Do not make any defamatory or disparaging comments which might damage the reputation of a person or organisation.</li>
									<li><strong>Privacy:</strong> Do not post any personal information relating to yourself or anyone else - (ie: address, place of employment, telephone or mobile number or email address).</li>
								</ol>
								<p>In order to keep these experiences enjoyable and interesting for all of our users, we ask that you follow the above guidlines. Feel free to engage, ask questions, and tell us what you are thinking! insightful comments are most welcomed.</p>
								<?php 
    if (count($comments) == false) {
        ?>
								<p class="no-comments notice rn prepend-3">be the first to comment.</p><?php 
    }
    ?>
</dd>	
							</dl>		
							</li>
			</ul>					
						</li>
			<?php 
    // wp_include_comments_adsense_banner(1);
}