示例#1
0
function get_author_avatar()
{
    global $default;
    $avatar = '';
    if (class_exists('author_image')) {
        $avatar = author_image::get();
    }
    if ($avatar == '') {
        if (in_the_loop()) {
            $author_id = get_the_author_ID();
        } elseif (is_singular()) {
            global $wp_the_query;
            $author_id = $wp_the_query->posts[0]->post_author;
        } elseif (is_author()) {
            global $wp_the_query;
            $author_id = $wp_the_query->get_queried_object_id();
        }
        $author = get_userdata($author_id);
        if (!empty($author)) {
            $avatar = get_avatar($author->user_email, 64, $default, $author->display_name);
        } else {
            $avatar = '<img src="' . esc_url($default) . '" alt="' . $author->display_name . '" />';
        }
    }
    return $avatar;
}
示例#2
0
/**
 * Load Author Boxes
 *
 * @author Bill Erickson
 * @link http://www.billerickson.net/wordpress-post-multiple-authors/
 */
function be_author_box()
{
    if (!is_single()) {
        return;
    }
    if (function_exists('get_coauthors')) {
        $authors = get_coauthors();
        foreach ($authors as $author) {
            be_do_author_box($author->data->ID);
        }
    } else {
        be_do_author_box(get_the_author_ID());
    }
}
function get_image($field, $width)
{
    $image = get_newspapermeta($field, 0);
    if (!empty($image)) {
        if ($_SERVER['SERVER_NAME'] == 'localhost') {
            echo $image . '" width="' . $width . 'px"';
        } else {
            preg_match('/[0-9]{4}\\/[0-9]{2}\\/.+\\.jpg/', $image, $matches);
            $image_scaled = get_bloginfo('url') . '/t/i/' . $width . '/' . $matches[0];
            echo $image_scaled . '" width="' . $width . 'px"';
        }
    } else {
        echo get_bloginfo('url') . '/wp-content/themes/fokus/images/portraits/' . $width . '/' . get_the_author_ID() . '.jpg"';
    }
    echo '"alt="';
    the_title_attribute();
    echo '"';
}
示例#4
0
function cfct_choose_single_template($files = array(), $filter = '*')
{
    // must be called within the_loop - cfct_choose_general_template_single() approximates a loop for this reason.
    $exec_order = array('author', 'meta', 'category', 'role', 'tag', 'parent', 'default');
    $exec_order = apply_filters('cfct_single_match_order', $exec_order);
    $filename = false;
    global $post;
    foreach ($exec_order as $type) {
        switch ($type) {
            case 'author':
                $author_files = cfct_author_templates('', $files);
                if (count($author_files)) {
                    $author = get_the_author_login();
                    $file = cfct_filename_filter('author-' . $author . '.php', $filter);
                    if (in_array($file, $author_files)) {
                        $filename = $file;
                    }
                }
                break;
            case 'meta':
                $meta_files = cfct_meta_templates('', $files);
                if (count($meta_files)) {
                    $meta = get_post_custom($post->ID);
                    if (count($meta)) {
                        // check key, value matches first
                        foreach ($meta as $k => $v) {
                            $val = $v[0];
                            $file = cfct_filename_filter('meta-' . $k . '-' . $val . '.php', $filter);
                            if (in_array($file, $meta_files)) {
                                $filename = $file;
                                break;
                            }
                        }
                        // check key matches only
                        if (!$filename) {
                            foreach ($meta as $k => $v) {
                                $file = cfct_filename_filter('meta-' . $k . '.php', $filter);
                                if (in_array($file, $meta_files)) {
                                    $filename = $file;
                                    break;
                                }
                            }
                        }
                    }
                }
                break;
            case 'category':
                $cat_files = cfct_cat_templates($type, $files);
                if (count($cat_files)) {
                    foreach ($cat_files as $file) {
                        $cat_id = cfct_cat_filename_to_id($file);
                        if (in_category($cat_id)) {
                            $filename = $file;
                            break;
                        }
                    }
                }
                break;
            case 'role':
                $role_files = cfct_role_templates($type, $files);
                if (count($role_files)) {
                    $user = new WP_User(get_the_author_ID());
                    if (count($user->roles)) {
                        foreach ($role_files as $file) {
                            foreach ($user->roles as $role) {
                                if (cfct_role_filename_to_name($file) == $role) {
                                    $filename = $file;
                                    break;
                                }
                            }
                        }
                    }
                }
                break;
            case 'tag':
                $tag_files = cfct_tag_templates($type, $files);
                if (count($tag_files)) {
                    $tags = get_the_tags($post->ID);
                    if (is_array($tags) && count($tags)) {
                        foreach ($tag_files as $file) {
                            foreach ($tags as $tag) {
                                if ($tag->slug == cfct_tag_filename_to_name($file)) {
                                    $filename = $file;
                                    break;
                                }
                            }
                        }
                    }
                }
                break;
            case 'parent':
                $parent_files = cfct_parent_templates($type, $files);
                if (count($parent_files) && $post->post_parent > 0) {
                    $parent = cfct_post_id_to_slug($post->post_parent);
                    $file = cfct_filename_filter('parent-' . $parent . '.php', $filter);
                    if (in_array($file, $parent_files)) {
                        $filename = $file;
                    }
                }
                break;
            case 'default':
                break;
        }
        if ($filename) {
            break;
        }
    }
    return apply_filters('cfct_choose_single_template', $filename);
}
示例#5
0
?>
">RSS</a></h2>
  <ul>

<?php 
if (have_posts()) {
    $previous_user_id = 0;
    while (have_posts()) {
        the_post();
        ?>

<li>

<?php 
        // Don't show the avatar if the previous post was by the same user
        $current_user_id = get_the_author_ID();
        if ($previous_user_id !== $current_user_id) {
            echo prologue_get_avatar($current_user_id, get_the_author_email(), 48);
        }
        $previous_user_id = $current_user_id;
        ?>

  <h4>
    <?php 
        the_author_posts_link();
        ?>
    <span class="meta">
      <?php 
        the_time("h:i:s a");
        ?>
 on <?php 
示例#6
0
        $email_md5 = md5(get_the_author_email());
        $default_img = urlencode('http://use.perl.org/images/pix.gif');
        ?>
<div class="sleeve_main">
<div id="postpage">
<div id="main">
	<ul id="postlist">
		<li>
			<h2 class="title">
				<?php 
        the_title();
        ?>
			</h2>
			<h4>
				<?php 
        echo prologue_get_avatar(get_the_author_ID(), get_the_author_email(), 48);
        ?>
				<?php 
        the_author_posts_link();
        ?>
				
				<span class="meta">
			<?php 
        the_time();
        ?>
 <em>on</em> <?php 
        the_time('F j, Y');
        ?>
 |
			<?php 
        comments_number(__('0'), __('1'), __('%'));
示例#7
0
</a></h2>
                                            </div>
                                            <div class="col-5 last">
                                                <div class="media mhn mtl ptm">
                                                    <div class="img-ext mlm">
                                                        <?php 
            echo get_avatar(get_the_author_id(), 38);
            ?>
                                                    </div>
                                                    <div class="bd font-small tar" style="display: block;">
                                                        <?php 
            the_time('F jS, Y');
            ?>
<br />
                                                        <?php 
            printf('<a class="wplnk-bold" href="' . get_author_posts_url(get_the_author_ID()) . '" title="' . sprintf(__("Posts by %s", "uxebu"), attribute_escape(get_the_author())) . ' ">' . get_the_author() . '</a>');
            ?>
                                                    </div>
                                                </div><!-- end media -->
                                            </div><!-- end col -->
                                        </div><!-- end hd -->
                                        <div class="bd">
                                        <?php 
            the_content('read more...');
            ?>
                                        <!--<?php 
            trackback_rdf();
            ?>
-->

                                        </div><!-- end bd -->
示例#8
0
/**
 * @package WordPress
 * @subpackage HivistaSoft_Theme
 */
?>
<div id="sidebar">
	<?php 
if (is_singular()) {
    ?>
		<div class="widget-container">
			<div class="box-author">
				<a href="<?php 
    the_author_url();
    ?>
" target="_blank"><?php 
    echo get_avatar(get_the_author_ID(), 70);
    ?>
</a>
				<div class="info">
					<span>About the author:</span>
					<p><?php 
    echo short_content(get_the_author_meta('description'), 70, '(...)');
    ?>
</p>
				</div>
			</div>
		</div>
	<?php 
}
?>
	<?php 
示例#9
0
        ?>
" rel="bookmark" title="<?php 
        _e('Permanent Link:', 'fusion');
        echo ' ';
        the_title_attribute();
        ?>
"><?php 
        the_title();
        ?>
</a></h3>
        <!-- story header -->
        <div class="postheader">
            <div class="postinfo">
            <p>
            <?php 
        printf(__('Posted by %s in %s on %s', 'fusion'), '<a href="' . get_author_posts_url(get_the_author_ID()) . '" title="' . sprintf(__("Posts by %s", "fusion"), attribute_escape(get_the_author())) . ' ">' . get_the_author() . '</a>', get_the_category_list(', '), get_the_time(__('F jS, Y', 'fusion')));
        ?>
 <span class="editlink"><?php 
        edit_post_link('');
        ?>
</span></p>
            </div>
        </div>
        <!-- /story header -->
      <div class="postbody entry clearfix">
        <?php 
        if (get_option('fusion_indexposts') == 'excerpt') {
            the_excerpt();
        } else {
            the_content(__('Read the rest of this entry &raquo;', 'fusion'));
        }
示例#10
0
function wpi_template_comment_trackback($post, $comment, $cnt)
{
    $author_id = get_the_author_ID();
    $wauthor_name = wpi_get_comment_author();
    $author_uri = get_comment_author_url();
    $author_uri = $author_uri != '' && $author_uri != 'http://' ? $author_uri : get_permalink($post->ID) . '#comment-' . get_comment_ID();
    $microid = wpi_get_microid_hash(get_comment_author_email(), $author_uri);
    ?>
	
						<li id="comment-<?php 
    comment_ID();
    ?>
" class="<?php 
    wpi_comment_root_class($cnt, get_comment_author());
    ?>
">
							<ul class="reviewier-column cf r">
								<li class="span-1 fl">&nbsp;
				<!--
				<rdf:RDF xmlns="http://web.resource.org/cc/"
				    xmlns:dc="http://purl.org/dc/elements/1.1/"
				    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
				<Work rdf:about="<?php 
    the_permalink();
    ?>
#comment-<?php 
    comment_ID();
    ?>
">
				<license rdf:resource="http://creativecommons.org/licenses/by-sa/3.0/" />
				</Work>
				<License rdf:about="http://creativecommons.org/licenses/by-sa/3.0/">
				   <requires rdf:resource="http://web.resource.org/cc/Attribution" />
				   <requires rdf:resource="http://web.resource.org/cc/ShareAlike" />
				   <permits rdf:resource="http://web.resource.org/cc/Reproduction" />
				   <permits rdf:resource="http://web.resource.org/cc/Distribution" />
				   <permits rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
				   <requires rdf:resource="http://web.resource.org/cc/Notice" />
				</License>
				</rdf:RDF>
				-->									
								</li>
								<li class="<?php 
    wpi_comment_content_width();
    ?>
 fl review-content dc-source">
								
								<dl class="review r cf">				
								<dt class="item title summary ox">
<a rel="dc:source robots-anchortext" href="#comment-<?php 
    comment_ID();
    ?>
" class="url fn" title="<?php 
    the_title();
    ?>
">permalink</a> 
								</dt>	
								<dd class="reviewer-meta vcard microid-<?php 
    echo $microid;
    ?>
 db">									<span class="note dn"><?php 
    the_title();
    ?>
</span>
									<a href="<?php 
    wpi_curie_url($author_uri);
    ?>
" class="url fn reviewer" rel="contact noarchive robots-noarchive" title="<?php 
    attribute_escape($wauthor_name);
    ?>
">
									<strong class="org" style="background-image:url('<?php 
    echo wpi_comment_pingback_favicon($comment);
    ?>
')">
									<?php 
    echo $wauthor_name;
    ?>
									</strong>
									</a>&nbsp;			
									 <abbr class="dtreviewed" title="<?php 
    comment_date('Y-m-dTH:i:s:Z');
    ?>
">
									<?php 
    wpi_comment_date();
    ?>
									</abbr>	
								<span class="rating dn">3</span>
								<span class="type dn">url</span>					
								<?php 
    edit_comment_link(__('edit', WPI_META), '&middot; <span class="edit-comment">', '</span>');
    ?>
			 				 
								</dd>
								
								<dd class="reviewer-entry">						
									<div class="description">
										<p class="br rn r">				
											<?php 
    echo nl2br(get_comment_text());
    ?>
										</p>
									</div>
								<?php 
    if ($comment->comment_approved == '0') {
        ?>
									<p class="notice rn"><?php 
        _e('Your comment is awaiting moderation.', WPI_META);
        ?>
</p>
								<?php 
    }
    ?>
									
								</dd><?php 
    $counter = $cnt + 1;
    ?>
	
								<dd class="gml cf">
								<ul class="xoxo r cf">
								<li class="cc">
									<span><?php 
    echo wpi_trackback_footer($comment);
    ?>
 </span> 
								</li> 	
								 </ul>
								</dd>
								</dl>		
								</li>
							</ul>
						</li>
<?php 
}
示例#11
0
 /**
  * Gets posts, based on the params provided
  *
  * @package Invite Anyone
  * @since 0.9
  */
 function get_posts()
 {
     global $wpdb;
     // $posts is a multidimensional array, containing all different time periods
     $posts = array();
     foreach ($this->time_periods as $tp => $period) {
         $invite = new Invite_Anyone_Invitation();
         // Will be populated out of $this->params. Defaults to none?
         $args = array('posts_per_page' => '-1', 'status' => 'pending,draft,future,publish,trash');
         // Create the date filter
         if ($tp) {
             $since = time() - $tp;
             $this->date_sql = $wpdb->prepare(" AND post_date > %s", date('Y-m-d H:i:s', $since));
             add_filter('posts_where_paged', array($this, 'where_filter'));
         }
         $invites = $invite->get($args);
         // Remove the filter
         if ($tp) {
             remove_filter('posts_where_paged', array($this, 'where_filter'));
         }
         $period['total_count'] = 0;
         $period['accepted_count'] = 0;
         $period['total_count_cs'] = 0;
         $period['accepted_count_cs'] = 0;
         $period['unique_emails'] = 0;
         $period['unique_inviters'] = 0;
         $period['unique_emails'] = array();
         $period['unique_inviters'] = array();
         if ($invites->have_posts()) {
             while ($invites->have_posts()) {
                 $invites->the_post();
                 // Increase the total count
                 $period['total_count']++;
                 $author_key = get_the_author_ID();
                 // If it's a new sender, add them to $unique_inviters
                 if (!isset($period['unique_inviters'][$author_key])) {
                     $period['unique_inviters'][$author_key] = array('overall' => array('sent' => 0, 'accepted' => 0), 'cloudsponge' => array('sent' => 0, 'accepted' => 0));
                 }
                 // Bump the inviter's count
                 $period['unique_inviters'][$author_key]['overall']['sent']++;
                 // Is it accepted?
                 $accepted = get_post_meta(get_the_ID(), 'bp_ia_accepted', true);
                 if ($accepted) {
                     // Total accepted count
                     $period['accepted_count']++;
                     // Author's accepted count
                     $period['unique_inviters'][$author_key]['overall']['accepted']++;
                 }
                 // Is it a CloudSponge invite?
                 $is_cloudsponge = get_post_meta(get_the_ID(), 'bp_ia_is_cloudsponge', true);
                 if (__('Yes', 'invite-anyone') == $is_cloudsponge) {
                     $period['total_count_cs']++;
                     // Author count
                     $period['unique_inviters'][$author_key]['cloudsponge']['sent']++;
                     if ($accepted) {
                         // Total accepted count
                         $period['accepted_count_cs']++;
                         // Author's accepted count
                         $period['unique_inviters'][$author_key]['cloudsponge']['accepted']++;
                     }
                 }
             }
         }
         // With all the data tallied, we can come up with some percentages
         // Overall acceptance rate
         if ($period['total_count']) {
             $period['acceptance_rate'] = round($period['accepted_count'] / $period['total_count'] * 100);
             $period['acceptance_rate'] .= '%';
         } else {
             $period['acceptance_rate'] = __('n/a', 'invite-anyone');
         }
         // CS percentage
         if ($period['total_count']) {
             $period['cs_percentage'] = round($period['total_count_cs'] / $period['total_count'] * 100);
             $period['cs_percentage'] .= '%';
         } else {
             $period['cs_percentage'] = __('n/a', 'invite-anyone');
         }
         // CS acceptance rate
         if ($period['total_count_cs']) {
             $period['acceptance_rate_cs'] = round($period['accepted_count_cs'] / $period['total_count_cs'] * 100);
             $period['acceptance_rate_cs'] .= '%';
         } else {
             $period['acceptance_rate_cs'] = __('n/a', 'invite-anyone');
         }
         // Find the most active user
         $leader_user_id_pct = 0;
         $leader_val_pct = 0;
         $leader_user_id_num = 0;
         $leader_val_num = 0;
         $leader_user_id_pct_cs = 0;
         $leader_val_pct_cs = 0;
         $leader_user_id_num_cs = 0;
         $leader_val_num_cs = 0;
         foreach ($period['unique_inviters'] as $user_id => $u) {
             // Overall
             if ($u['overall']['sent']) {
                 if ($u['overall']['sent'] >= $leader_val_num) {
                     $leader_user_id_num = $user_id;
                     $leader_val_num = $u['overall']['sent'];
                 }
                 if ($u['overall']['accepted'] / $u['overall']['sent'] >= $leader_val_pct) {
                     $leader_user_id_pct = $user_id;
                     $leader_val_pct = $u['overall']['accepted'] / $u['overall']['sent'] * 100;
                 }
             }
             // CloudSponge
             if ($u['cloudsponge']['sent']) {
                 if ($u['cloudsponge']['sent'] >= $leader_val_num_cs) {
                     $leader_user_id_num_cs = $user_id;
                     $leader_val_num_cs = $u['cloudsponge']['sent'];
                 }
                 if ($u['cloudsponge']['accepted'] / $u['cloudsponge']['sent'] >= $leader_val_pct_cs) {
                     $leader_user_id_pct_cs = $user_id;
                     $leader_val_pct_cs = $u['cloudsponge']['accepted'] / $u['cloudsponge']['sent'] * 100;
                 }
             }
         }
         $period['top_users']['top_user_num'] = array('user_id' => $leader_user_id_num ? $leader_user_id_num : false, 'sent' => $leader_val_num ? $leader_val_num : false);
         $period['top_users']['top_user_pct'] = array('user_id' => $leader_user_id_pct ? $leader_user_id_pct : false, 'accepted' => $leader_val_pct ? round($leader_val_pct) . '%' : '-');
         $period['top_users']['top_user_num_cs'] = array('user_id' => $leader_user_id_num_cs ? $leader_user_id_num_cs : false, 'sent' => $leader_val_num_cs ? $leader_val_num_cs : false);
         $period['top_users']['top_user_pct_cs'] = array('user_id' => $leader_user_id_pct_cs ? $leader_user_id_pct_cs : false, 'accepted' => $leader_val_pct_cs ? round($leader_val_pct_cs) . '%' : '-');
         // Fetch userlinks
         foreach ($period['top_users'] as $key => $top_user) {
             $link = bp_core_get_userlink($top_user['user_id']);
             $period['top_users'][$key]['user_link'] = $link;
         }
         $this->time_periods[$tp] = $period;
     }
 }
示例#12
0
function sa_entry_author()
{
    return '<span class="vcard author entry-author"><a href="' . get_author_posts_url(get_the_author_ID()) . '" class="url fn" title="' . sprintf('View all posts by %s', esc_attr(get_the_author())) . '">' . get_the_author() . '</a></span>';
}
示例#13
0
文件: author.php 项目: alx/pressmark
get_header();
?>

<div id="userpage">
<div id="main">

<?php 
if (have_posts()) {
    $first_post = true;
    while (have_posts()) {
        the_post();
        $author_feed_url = '';
        if (function_exists('get_author_feed_link')) {
            $author_feed_url = get_author_feed_link(get_the_author_ID());
        } else {
            $author_feed_url = get_author_rss_link(false, get_the_author_ID(), get_the_author_nickname());
        }
        ?>

<?php 
        if ($first_post === true) {
            ?>
	<h2>
		<?php 
            echo get_avatar(get_the_author_email(), 48);
            ?>
		Updates from <?php 
            the_author_posts_link();
            ?>
		<a class="rss" href="<?php 
            echo $author_feed_url;
示例#14
0
function queryposts($atts)
{
    extract(shortcode_atts(array('category_id' => '', 'category_name' => '', 'tag' => '', 'day' => '', 'month' => '', 'year' => '', 'count' => '5', 'author_id' => '', 'author_name' => '', 'order_by' => 'date'), $atts));
    $output = '';
    $query = array();
    if ($category_id != '') {
        $query[] = 'cat=' . $category_id;
    }
    if ($category_name != '') {
        $query[] = 'category_name=' . $category_name;
    }
    if ($tag != '') {
        $query[] = 'tag=' . $tag;
    }
    if ($day != '') {
        $query[] = 'day=' . $day;
    }
    if ($month != '') {
        $query[] = 'monthnum=' . $month;
    }
    if ($year != '') {
        $query[] = 'year=' . $year;
    }
    if ($count) {
        $query[] = 'posts_per_page=' . $count;
    }
    if ($author_id != '') {
        $query[] = 'author=' . $author_id;
    }
    if ($author_name != '') {
        $query[] = 'author_name=' . $author_name;
    }
    if ($order_by) {
        $query[] = 'orderby=' . $order_by;
    }
    $posts = new WP_Query(implode('&', $query));
    while ($posts->have_posts()) {
        $posts->the_post();
        $output .= '<div class="post">';
        $output .= '<div class="post-header"><h3 class="post-title"><a href="' . get_permalink() . '" rel="bookmark" title="' . __('Permanent Link:', 'arclite') . ' ' . get_the_title() . '">' . get_the_title() . '</a></h3>';
        $output .= '<p class="post-date"><span class="month">' . get_the_time(__('M', 'arclite')) . '</span><span class="day">' . get_the_time(__('j', 'arclite')) . '</span></p>';
        $output .= '<p class="post-author"><span class="info">' . sprintf(__('Posted by %s in %s', 'arclite'), '<a href="' . get_author_posts_url(get_the_author_ID()) . '" title="' . sprintf(__("Posts by %s", "arclite"), attribute_escape(get_the_author())) . ' ">' . get_the_author() . '</a>', get_the_category_list(', ')) . ' | ';
        if (comments_open()) {
            // global $id, $comment;
            $comments_number = get_comments_number();
            $output .= '<a href="' . get_permalink() . '#comments" class="';
            if ($comments_number == 0) {
                $output .= 'no ';
            }
            $output .= 'comments">';
            if ($comments_number > 1) {
                $output .= sprintf(__('%s comments'), $comments_number);
            } else {
                if ($comments_number == 1) {
                    $output .= __('1 comment');
                } else {
                    $output .= __('No comments');
                }
            }
            $output .= '</a>';
        } else {
            $output .= __("Comments Off", "arclite");
        }
        $output .= '</span></p></div>';
        $output .= '<div class="post-content clearfix">';
        $post_preview = get_arclite_option('post_preview');
        if ($post_preview == 'excerpt') {
            $output .= get_the_excerpt();
        } else {
            $output .= get_the_content(__('Read the rest of this entry &raquo;', 'arclite'));
        }
        $output .= '</div>';
        $post_tags = get_the_tags();
        if ($post_tags) {
            $output .= '<p class="tags">';
            $tags = array();
            $i = 0;
            foreach ($post_tags as $tag) {
                $tags[$i] .= '<a href="' . get_tag_link($tag->term_id) . '" rel="tag" title="' . sprintf(__('%s (%s topics)'), $tag->name, $tag->count) . '">' . $tag->name . '</a>';
                $i++;
            }
            $output .= implode(', ', $tags);
            $output .= '</p>';
        }
        $output .= '</div>';
    }
    return $output;
}
示例#15
0
	Australis Media Pty Ltd has made the contents of this file
	available under a CC-GNU-GPL license:
	
	 http://creativecommons.org/licenses/GPL/2.0/
	
	 A copy of the full license can be found as part of this
	 distribution in the file LICENSE.TXT
	
	You may use the Vanilla theme software in accordance with the
	terms of that license. You agree that you are solely responsible
	for your use of the Vanilla theme software and you represent and 
	warrant to Australis Media Pty Ltd that your use of the Vanilla
	theme software will comply with the CC-GNU-GPL.
*/
if (__FILE__ == $_SERVER['SCRIPT_FILENAME']) {
    die;
}
if (CFCT_DEBUG) {
    cfct_banner(__FILE__);
}
global $previousday, $authordata, $tpl;
$previousday = -1;
$tpl_tags_list = get_the_tag_list("", ",", "");
$tpl_edit_link = get_edit_post_link();
$tpl_pages_link = wp_link_pages('before=&after=&echo=0');
$content = get_the_content('<span class="more-link">' . __('Continued...', 'carrington') . '</span>');
$content = apply_filters('the_content', $content);
$content = str_replace(']]>', ']]&gt;', $content);
$tpl["content"] = array("tpl_file" => "content-default.html");
$tpl["entries"][] = array("id" => get_the_ID(), "class" => sandbox_post_class(false), "permalink" => get_permalink(), "title_attribute" => the_title_attribute('echo=0'), "title" => the_title("", "", false), "content" => $content, "pages_link" => $tpl_pages_link == '' ? false : $tpl_pages_link, "categories_list" => get_the_category_list(', '), "tags_list" => $tpl_tags_list == '' ? false : $tpl_tags_list, "author" => array("link" => get_author_link(false, get_the_author_ID(), $authordata->user_nicename), "name_attribute" => attribute_escape($authordata->display_name), "name" => get_the_author()), "date_time" => get_the_time('Y-m-d\\TH:i:sO'), "date" => the_date("", "", "", false), "comments_link" => vanilla_comments_popup_link(__('No comments', 'carrington'), __('1 comment', 'carrington'), __('% comments', 'carrington')), "edit_link" => $tpl_edit_link == '' ? false : $tpl_edit_link, "edit_link_text" => __('Edit This', 'carrington'));
示例#16
0
function thesis_author()
{
    global $thesis;
    if ($thesis['display']['byline']['author']['link']) {
        if ($thesis['display']['byline']['author']['nofollow']) {
            $nofollow = ' rel="nofollow"';
        }
        $author = '<a href="' . get_author_posts_url(get_the_author_ID()) . '" class="url fn"' . $nofollow . '>' . get_the_author() . '</a>';
    } else {
        $author = get_the_author();
        $fn = ' fn';
    }
    echo __('by', 'thesis') . ' <span class="author vcard' . $fn . '">' . $author . '</span>';
}
示例#17
0
function invite_anyone_settings_mi_content()
{
    // Load the pagination helper
    if (!class_exists('BBG_CPT_Pag')) {
        require_once dirname(__FILE__) . '/../lib/bbg-cpt-pag.php';
    }
    $pagination = new BBG_CPT_Pag();
    // Load the sortable helper
    if (!class_exists('BBG_CPT_Sort')) {
        require_once dirname(__FILE__) . '/../lib/bbg-cpt-sort.php';
    }
    $cols = array(array('name' => 'author', 'title' => __('Inviter', 'invite-anyone'), 'css_class' => 'ia-inviter'), array('name' => 'ia_invitees', 'title' => __('Invited Email', 'invite-anyone'), 'css_class' => 'ia-invited-email'), array('name' => 'sent', 'title' => __('Sent', 'invite-anyone'), 'css_class' => 'ia-sent', 'default_order' => 'desc', 'posts_column' => 'post_date', 'is_default' => true), array('name' => 'accepted', 'title' => __('Accepted', 'invite-anyone'), 'css_class' => 'ia-accepted', 'default_order' => 'desc'), array('name' => 'cloudsponge', 'title' => __('CloudSponge', 'invite-anyone'), 'css_class' => 'ia-cloudsponge'));
    $sortable = new BBG_CPT_Sort($cols);
    $args = array('orderby' => $sortable->get_orderby, 'order' => $sortable->get_order, 'posts_per_page' => $pagination->get_per_page, 'paged' => $pagination->get_paged, 'status' => 'trash,publish,pending,draft,future');
    // Get the invites
    $invite = new Invite_Anyone_Invitation();
    $invites = $invite->get($args);
    // Complete the pagination setup
    $pagination->setup_query($invites);
    ?>

	<?php 
    if ($invites->have_posts()) {
        ?>
		<div class="ia-admin-pagination">
			<div class="currently-viewing">
				<?php 
        $pagination->currently_viewing_text();
        ?>
			</div>

			<div class="pag-links">
				<?php 
        $pagination->paginate_links();
        ?>
			</div>
		</div>

		<table class="wp-list-table widefat ia-invite-list">

		<thead>
			<tr>
				<th scope="col" id="cb" class="check-column">
					<input type="checkbox" />
				</th>

				<?php 
        if ($sortable->have_columns()) {
            while ($sortable->have_columns()) {
                $sortable->the_column();
                ?>
					<?php 
                $sortable->the_column_th();
                ?>
				<?php 
            }
        }
        ?>

			</tr>
		</thead>

		<tbody>
			<?php 
        while ($invites->have_posts()) {
            $invites->the_post();
            ?>
			<tr>
				<th scope="row" class="check-column">
					<input type="checkbox" />
				</th>

				<td class="ia-inviter">
					<?php 
            echo bp_core_get_userlink(get_the_author_ID());
            ?>

					<div class="row-actions">
						<span class="edit"><a href="<?php 
            echo add_query_arg(array('post' => get_the_ID(), 'action' => 'edit'), admin_url('post.php'));
            ?>
"><?php 
            _e('View Invitation', 'invite-anyone');
            ?>
</a></span>
					</div>
				</td>

				<td class="ia-invited-email">
					<?php 
            $emails = wp_get_post_terms(get_the_ID(), invite_anyone_get_invitee_tax_name());
            foreach ($emails as $email) {
                // Before storing taxonomy terms in the db, we replace "+" with ".PLUSSIGN.", so we need to reverse that before displaying the email address.
                $email_address = str_replace('.PLUSSIGN.', '+', $email->name);
                echo esc_html($email_address);
            }
            ?>
				</td>

				<td class="ia-sent">
					<?php 
            global $post;
            $date_invited = invite_anyone_format_date($post->post_date);
            ?>
					<?php 
            echo esc_html($date_invited);
            ?>
				</td>

				<td class="ia-accepted">
					<?php 
            if ($accepted = get_post_meta(get_the_ID(), 'bp_ia_accepted', true)) {
                $date_joined = invite_anyone_format_date($accepted);
                $accepted = true;
            } else {
                $date_joined = '-';
                $accepted = false;
            }
            ?>
					<?php 
            echo esc_html($date_joined);
            ?>
				</td>

				<td class="ia-cloudsponge">
					<?php 
            $is_cloudsponge = get_post_meta(get_the_ID(), 'bp_ia_is_cloudsponge', true);
            if (!$is_cloudsponge) {
                $is_cloudsponge = __('(no data)', 'invite-anyone');
            }
            ?>
					<?php 
            echo esc_html($is_cloudsponge);
            ?>
				</td>
			</tr>
			<?php 
        }
        ?>
		</tbody>
		</table>

		<?php 
        if (defined('INVITE_ANYONE_CS_ENABLED') && INVITE_ANYONE_CS_ENABLED) {
            ?>
			<p class="description"><strong>Note:</strong> CloudSponge data has only been recorded since Invite Anyone v0.9.</p>
		<?php 
        }
        ?>

		<div class="ia-admin-pagination">
			<div class="currently-viewing">
				<?php 
        $pagination->currently_viewing_text();
        ?>
			</div>

			<div class="pag-links">
				<?php 
        $pagination->paginate_links();
        ?>
			</div>
		</div>

	<?php 
    } else {
        ?>
		<p><?php 
        _e('No invitations have been sent yet.', 'invite-anyone');
        ?>
</p>

	<?php 
    }
    ?>

	<?php 
}
示例#18
0
<div class="pp-project-main">
	<div class="pp-project-tabs">

<?php 
    the_post();
    ?>

		<h3>Latest Updates</h3>
	
		<ul class="pp-updates">
			<li id="pp-update-<?php 
    the_ID();
    ?>
" class="pp-update">
				<?php 
    echo get_avatar(get_the_author_ID(), 48);
    ?>
				<h4>
					<?php 
    the_author_posts_link();
    ?>
					<span class="meta">
						<?php 
    printf(__('%1$s on %2$s'), get_the_time(), the_date('', '', '', false));
    ?>
 |
						<a href="<?php 
    the_permalink();
    ?>
">#</a> |
						<?php 
示例#19
0
function cfct_choose_content_template_role($type = 'content', $files = null)
{
    $files = cfct_role_templates($type, $files);
    if (count($files)) {
        $user = new WP_User(get_the_author_ID());
        if (count($user->roles)) {
            foreach ($files as $file) {
                foreach ($user->roles as $role) {
                    if (cfct_role_filename_to_name($file) == $role) {
                        $keys = array($role);
                        return cfct_filename($type, 'role', $keys);
                    }
                }
            }
        }
    }
    return false;
}
示例#20
0
						<h3 class="entry-title"><a href="<?php 
        the_permalink();
        ?>
" rel="bookmark" title='<?php 
        printf(__('Permanent Link to "%s"', 'k2_domain'), wp_specialchars(strip_tags(the_title('', '', false)), 1));
        ?>
'><?php 
        the_title();
        ?>
</a></h3>

						<div class="entry-meta">
							<span class="chronodata">
								<?php 
        /* Date & Author */
        printf(__('Published %1$s %2$s', 'k2_domain'), $multiple_users ? sprintf(__('by %s', 'k2_domain'), '<span class="vcard author"><a href="' . get_author_posts_url(get_the_author_ID()) . '" class="url fn" title="' . sprintf(__('View all posts by %s', 'k2_domain'), attribute_escape(get_the_author())) . '">' . get_the_author() . '</a></span>') : '', '<abbr class="published" title="' . get_the_time('Y-m-d\\TH:i:sO') . '">' . (function_exists('time_since') ? sprintf(__('%s ago', 'k2_domain'), time_since(abs(strtotime($post->post_date_gmt . " GMT")), time())) : get_the_time($dateformat)) . '</abbr>');
        ?>
							</span>
						</div>
					</div> <!-- .entry-head -->

					<div class="entry-content">
						<p class="<?php 
        echo $classname;
        ?>
"><?php 
        echo $attachment_link;
        ?>
<br /><?php 
        echo basename($post->guid);
        ?>
示例#21
0
文件: index.php 项目: alx/blogsfera
        the_ID();
        ?>
">
<h2><a href="<?php 
        the_permalink();
        ?>
" rel="bookmark" title="Permanent Link to <?php 
        the_title();
        ?>
"><?php 
        the_title();
        ?>
</a></h2>
<p class="post-info">
	<img src='<?php 
        author_image_path(get_the_author_ID());
        ?>
' width='16px' height='16px'>
	<?php 
        the_time('l j \\d\\e F \\d\\e Y');
        ?>
 por <a href="<?php 
        echo get_the_author_url();
        ?>
"><?php 
        the_author_firstname();
        ?>
 <?php 
        the_author_lastname();
        ?>
</a>
示例#22
0
        echo '</div>';
        echo '</a>';
        echo '</div>';
    }
}
wp_reset_query();
?>
      </div>
	  
      <div class="row">
        <!-- end .left_menu -->
        <div class="col-xs-12 col-sm-12 col-md-6 col-lg-12">
		  <?php 
while (have_posts()) {
    the_post();
    $authId = get_the_author_ID();
    $user_info = get_userdata($authId);
    $auth_link = get_author_posts_url($authId, $authId->user_name);
    ?>
          <div class="row">
            <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
              <h1><?php 
    the_title();
    ?>
</h1>
            </div>
            <div class="col-xs-2 col-sm-2 col-md-2 col-lg-2 avatar avatar-top">
            <?php 
    echo get_avatar($authId, 90, null, null, array('class' => array('img-circle')));
    ?>
 
示例#23
0
        the_title();
        ?>
</a></h3>
           <p class="post-date">
            <span class="month"><?php 
        the_time(__('M', 'arclite'));
        ?>
</span>
            <span class="day"><?php 
        the_time(__('j', 'arclite'));
        ?>
</span>
           </p>
           <p class="post-author">
            <span class="info"><?php 
        printf(__('Posted by %s in %s', 'arclite'), '<a href="' . get_author_posts_url(get_the_author_ID()) . '" title="' . sprintf(__("Posts by %s", "arclite"), attribute_escape(get_the_author())) . ' ">' . get_the_author() . '</a>', get_the_category_list(', '));
        ?>
 | <?php 
        comments_popup_link(__('No Comments', 'arclite'), __('1 Comment', 'arclite'), __('% Comments', 'arclite'), 'comments', __('Comments off', 'arclite'));
        ?>
  <?php 
        edit_post_link(__('Edit', 'arclite'), ' | ');
        ?>
 
            </span>
   			
           </p>
          </div>

          <div class="post-content clearfix">
          <?php 
示例#24
0
link_pages('<p class="pages-link">' . __('Pages: ', 'carrington'), "</p>\n", 'number');
?>
		</div><!--/entry-content-->
		<p class="filed">
			<span class="categories"><?php 
printf(__('Posted in %s.', 'carrington'), get_the_category_list(', '));
?>
</span> 
			<?php 
the_tags(__('<span class="tags">Tagged with ', 'carrington'), ', ', '.</span>');
?>
		</p><!--/filed-->
		<div class="by-line">
			<address class="author vcard full-author">
				<?php 
printf(__('<span class="by">By</span> %s', 'carrington'), '<a class="url fn" href="' . get_author_link(false, get_the_author_ID(), $authordata->user_nicename) . '" title="View all posts by ' . attribute_escape($authordata->display_name) . '">' . get_the_author() . '</a>');
?>
			</address>
			<span class="date full-date"><abbr class="published" title="<?php 
the_time('Y-m-d\\TH:i:sO');
?>
"><?php 
the_date();
?>
</abbr></span>
		</div><!--/by-line-->
		<p class="comments-link"><?php 
comments_popup_link(__('No comments', 'carrington'), __('1 comment', 'carrington'), __('% comments', 'carrington'));
?>
</p>
		<div id="post-comments-<?php 
示例#25
0
                </ul>
        </nav>
        
</article><!-- #post-<?php 
the_ID();
?>
 -->
	<!-- about-author -->
    <article class="about-author">
            <div class="img align-left">
                <a href="<?php 
echo esc_url(get_author_posts_url(get_the_author_ID()));
?>
">
                        <?php 
$author_id = get_the_author_ID();
echo shredfast_get_avatar($author_id, 80);
?>
                </a>
            </div>
            <div class="txt">
                    <h3>
                        <strong>
                            <?php 
the_author_meta('user_firstname');
echo ' ';
the_author_meta('user_lastname');
?>
                        </strong>
                    </h3>
                    <p><?php 
示例#26
0
function the_content($linklabel)
{
    global $wpmode;
    global $wphaved;
    if ($wpmode == 'other') {
        echo content_for_layout();
        return;
    }
    global $the_post, $request, $the_author;
    $e = $the_post->FirstChild('entries');
    $title = $the_post->title;
    if (!is_microblog_theme()) {
        $current_user_id = get_the_author_ID();
        if (function_exists('prologue_get_avatar')) {
            echo prologue_get_avatar($current_user_id, get_the_author_email(), 48);
        }
    }
    $title = render_notice($title, $the_post, $the_author);
    echo "<p>" . $title . "</p>";
}
                    </a>

                </div>

                <div class="cell-8 blog-thumbs" style="padding-right: 0; padding-left: 0;">

                    <article class="post-content">
                        <div class="post-info-container">
                            <div class="post-info">
                                <h3 style="font-size: 24px; margin-top:20px; line-height: 28px;"><a><?php 
the_title();
?>
</a></h3>
                                <!--<ul class="post-meta">
                                    <li class="meta-user"><i class="fa fa-user"></i>Por: <a href="<?php 
echo get_author_posts_url(get_the_author_ID());
?>
"><?php 
echo get_the_author();
?>
</a></li>
                                    <li><i class="fa fa-folder-open"></i>Dpto<a href="<?php 
echo $home_url . 'departamentos/' . $t[0]->slug . '/';
?>
"><?php 
echo $t[0]->name;
?>
</a></li>
                                </ul>-->
                            </div>
                        </div>
示例#28
0
function prologue_latest_posts()
{
    $load_time = $_GET['load_time'];
    $frontpage = $_GET['frontpage'];
    $num_posts = 10;
    //max amount of posts to load
    $number_of_new_posts = 0;
    $prologue_query = new WP_Query('showposts=' . $num_posts . '&post_status=publish');
    ob_start();
    while ($prologue_query->have_posts()) {
        $prologue_query->the_post();
        if (get_gmt_from_date(get_the_time('Y-m-d H:i:s')) <= $load_time) {
            continue;
        }
        $number_of_new_posts++;
        if ($frontpage) {
            ?>
<li id="prologue-<?php 
            the_ID();
            ?>
" class="newupdates user_id_<?php 
            the_author_ID();
            ?>
">


<?php 
            $current_user_id = get_the_author_ID();
            echo prologue_get_avatar($current_user_id, get_the_author_email(), 48);
            ?>

<?php 
        }
    }
    $posts_html = ob_get_contents();
    ob_end_clean();
    if ($number_of_new_posts == 0) {
        echo 0;
        exit;
    } else {
        $json_data = array("numberofnewposts" => $number_of_new_posts, "html" => $posts_html, "lastposttime" => gmdate('Y-m-d H:i:s'));
        echo json_encode($json_data);
    }
    exit;
}
示例#29
0
function thesis_author()
{
    global $thesis_site;
    if ($thesis_site->display['byline']['author']['link']) {
        if ($thesis_site->display['byline']['author']['nofollow']) {
            $nofollow = ' rel="nofollow"';
        }
        $author = '<a href="' . get_author_posts_url(get_the_author_ID()) . '" class="url fn"' . $nofollow . '>' . get_the_author() . '</a>';
    } else {
        $author = get_the_author();
        $fn = ' fn';
    }
    echo __('by', 'thesis') . " <span class=\"author vcard{$fn}\">{$author}</span>";
}
/**
 * Retrieve delete posts link for post.
 *
 * Can be used within the WordPress loop or outside of it, with any post type.
 *
 * @since 2.9.0
 *
 * @param int $id Optional. Post ID.
 * @param string $deprecated Not used.
 * @param bool $force_delete Whether to bypass trash and force deletion. Default is false.
 * @return string
 */
function get_delete_post_link($id = 0, $deprecated = '', $force_delete = false)
{
    if (!empty($deprecated)) {
        _deprecated_argument(__FUNCTION__, '3.0');
    }
    if (!($post =& get_post($id))) {
        return;
    }
    $post_type_object = get_post_type_object($post->post_type);
    if (!$post_type_object) {
        return;
    }
    $action = $force_delete || !EMPTY_TRASH_DAYS ? 'delete' : 'trash';
    $owner = get_the_author_ID() == get_current_user_id();
    if (is_super_admin() && is_admin()) {
        $delete_link = add_query_arg('action', $action, admin_url(sprintf($post_type_object->_edit_link, $post->ID)));
        return apply_filters('get_delete_post_link', wp_nonce_url($delete_link, "{$action}-{$post->post_type}_{$post->ID}"), $post->ID, $force_delete);
    } else {
        if (is_super_admin() || $bp->current_action != "just-me" && $bp->is_item_admin || $owner) {
            $delete_link = '?action=' . $action;
            return '<a href="' . $delete_link . '">Delete this wish</a>';
        } else {
            if (!current_user_can($post_type_object->cap->delete_post, $post->ID)) {
                return;
            } else {
                $delete_link = add_query_arg('action', $action, admin_url(sprintf($post_type_object->_edit_link, $post->ID)));
                return apply_filters('get_delete_post_link', wp_nonce_url($delete_link, "{$action}-{$post->post_type}_{$post->ID}"), $post->ID, $force_delete);
            }
        }
    }
}