Example #1
0
function wpi_get_bookmarks()
{
    global $post;
    if (!is_object($post)) {
        return false;
    }
    $share = array();
    $max_title = 75;
    $max_text = 350;
    $share['title'] = string_len($post->post_title, 75);
    $share['url'] = get_permalink($post->ID);
    $text = $post->post_excerpt ? $post->post_excerpt : $post->post_content;
    $share['bodytext'] = string_len($text, 350);
    $share['media'] = 'news';
    unset($text);
    $share = array_map('urlencode', $share);
    $bookmarks = array();
    // http://del.icio.us/post?url=uri&title=title
    $bookmarks[] = array('name' => 'del.icio.us', 'uri' => 'http://del.icio.us/post', 'params' => array('url', 'title'));
    // http://digg.com/submit?phase=2&url=url
    /**
     * @link 	http://digg.com/tools/integrate 	
     * url		max 255 	
     * title	max 75
     * bodytext max 350
     * media	news | image |   
     */
    // title max 75
    $bookmarks[] = array('name' => 'Digg', 'uri' => 'http://digg.com/submit', 'params' => array('url', 'title', 'bodytext', 'media'));
    /**
     * @links	http://www.sphere.com
     *  
     */
    // http://www.sphere.com/search?q=sphereit:url
    $bookmarks[] = array('name' => 'Sphere it', 'uri' => 'http://www.sphere.com/search', 'params' => array('q'));
    /**
     * @links	http://www.stumbleupon.com/buttons.php
     *  
     */
    // http://www.stumbleupon.com/submit?url=uri&title=title
    $bookmarks[] = array('name' => 'StumbleUpon', 'uri' => 'http://www.stumbleupon.com/submit', 'params' => array('url', 'title'));
    $bookmarks = apply_filters(wpiFilter::FILTER_BOOKMARKS, $bookmarks);
    $output = PHP_EOL;
    foreach ($bookmarks as $key => $meta) {
        $att = $params = array();
        $uid = sanitize_title_with_dashes($meta['name']);
        $att['title'] = __('Social bookmark | Add to ', WPI_META) . $meta['name'];
        $att['rel'] = 'bookmark noarchive';
        $att['rev'] = 'vote-for';
        $att['class'] = 'ttip';
        foreach ($meta['params'] as $param) {
            if (isset($share[$param]) && $meta['name'] != 'Sphere it') {
                $params[] = $param . '=' . $share[$param];
            } elseif ($meta['name'] == 'Sphere it') {
                $params[] = $param . '=sphereit:' . $share['url'];
            }
        }
        $params = '?' . implode("&", $params);
        $att['href'] = $meta['uri'] . $params;
        $output .= _t('li', _t('a', $meta['name'], $att), array('class' => $uid));
    }
    $output = _t('ul', $output, array('class' => 'xoxo dn cfl r cf', 'id' => 'wpi-bookmarks'));
    $htm = _t('acronym', __('Share this', WPI_META), array('class' => 'show-slow share rn fl'));
    return apply_filters('wpi_get_bookmarks', $htm . $output);
}
Example #2
0
}
/* This variable is for alternating comment background */
$com_class = $comments ? 'comments' : 'comments-';
?>
<dd id="wp-comments" class="<?php 
echo $com_class;
?>
">
	<div class="outer cf">
		<div class="inner c">	
			<div id="comments" class="content cb cf append-1 prepend-1">
				<h2 class="heading-title cf"><span class="fl"><?php 
comments_number('No Responses', 'One Response', '% Responses');
?>
</span><strong class="fl">to &#8220;<?php 
echo string_len(get_the_title(), 80);
?>
&#8221;</strong></h2><?php 
if ($comments) {
    ?>
	
				<ol id="comments-list" class="commentlist xoxo r cb cf"><?php 
    $cnt = 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();
Example #3
0
 public function getAttachment()
 {
     global $wp_query;
     $title = string_len(trim(wp_title('', false)), 90);
     $pid = $wp_query->post->ID;
     $ppid = $wp_query->post->post_parent;
     $pathway = array();
     //  rss
     $pathway['first'] = array($title . ' comments feeds', array('href' => get_post_comments_feed_link($pid), 'type' => 'application/rss+xml', 'title' => __($title . ' | Subscribe to this comments feed', WPI_META), 'hreflang' => get_hreflang(), 'rel' => self::RSS_REL, 'class' => 'rtxt rss16', 'rev' => 'feed:rss2'));
     // home
     $pathway['home'] = $this->getFrontpage();
     // parent
     $att = array();
     $att['href'] = get_permalink($ppid);
     $att['title'] = 'Parent | ' . get_the_title($ppid);
     $att['class'] = 'parent-link dc-subject';
     $att['hreflang'] = get_hreflang();
     $pathway['parent'] = array(get_the_title($ppid), $att);
     //  attachments
     $att = array();
     $att['href'] = get_permalink($pid);
     $att['title'] = __('Attachment | permalink', WPI_META);
     $pathway['attachment'] = array('Attachment', $att);
     //  attachments-pid
     $att = array();
     $att['href'] = get_permalink() . '#content-top';
     $att['title'] = $title . ' | Skip to content';
     $att['hreflang'] = get_hreflang();
     $att['class'] = 'last-items ' . self::DN_ARROW;
     if (($pageno = wpi_get_post_current_paged()) != false) {
         $pathway['post'] = array($title, $att);
         $title = 'on page ' . $pageno;
         $att = array();
         $att['href'] = wpi_paged_url($pageno);
         $att['title'] = $title;
         $att['rev'] = 'site:relative';
     }
     $pathway['last'] = array($title, $att);
     return $pathway;
 }
Example #4
0
function wpi_cat_content_filter($content)
{
    $content = apply_filters('the_excerpt', $content);
    return string_len(wpi_cat_image_filter($content), 500);
}