예제 #1
0
    function st_comment($comment, $args, $depth)
    {
        $GLOBALS['comment'] = $comment;
        switch ($comment->comment_type) {
            case 'comment':
                global $st_Settings;
                ?>

						<li id="comment-<?php 
                comment_ID();
                ?>
" class="comment">
	
							<?php 
                $avatar_size = '0' != $comment->comment_parent ? 50 : 75;
                $comment_author = get_the_author_meta('user_email') == $comment->comment_author_email ? ' bypostauthor' : '';
                $comment_level = '0' == $comment->comment_parent ? ' class="comment-holder comment-top-level' . $comment_author . '"' : ' class="comment-holder comment-low-level' . $comment_author . '"';
                $out = '<div' . $comment_level . '>';
                // Gravatar
                $out .= '<div class="avatar-box">' . get_avatar($comment, $avatar_size) . '</div>';
                $out .= '<div class="comment-box">';
                // Author name
                $out .= '<div class="comment-author" id="author-' . get_comment_ID() . '">' . get_comment_author_link() . '</div>';
                // Date
                $out .= '<div class="comment-date">';
                if (!empty($st_Settings['nice_time']) && $st_Settings['nice_time'] == 'yes' && function_exists('st_niceTime')) {
                    $out .= st_niceTime(get_comment_date('c', get_comment_ID()));
                } else {
                    $out .= get_comment_date() . ' ' . __('at', 'strictthemes') . ' ' . get_comment_time();
                }
                $out .= '</div>';
                // Comment
                $out .= wpautop(get_comment_text());
                if (comments_open()) {
                    // Reply/Cancel links
                    $out .= '<span class="reply non-selectable">' . '<a title="' . get_comment_ID() . '" class="quick-reply" href="' . get_permalink() . '?replytocom=' . get_comment_ID() . '#respond">' . __('Reply', 'strictthemes') . '</a>' . '<a class="quick-reply-cancel none" href="#">' . __('Cancel', 'strictthemes') . '</a>' . '</span>';
                }
                // Edit link
                if (current_user_can('manage_options')) {
                    $out .= ' - <a href="' . get_edit_comment_link() . '">' . __('Edit', 'strictthemes') . '</a>';
                }
                // Pre-moderation
                if ($comment->comment_approved == '0') {
                    $out .= '<p><em class="comment-awaiting-moderation">' . __('Your comment is awaiting moderation.', 'strictthemes') . '</em></p>';
                }
                $out .= '<div class="quick-holder" id="quick-holder-' . get_comment_ID() . '"></div></div><div class="clear"><!-- --></div>';
                // .comment-box
                $out .= '</div>';
                // .$comment_level
                $out .= '<div class="clear"><!-- --></div>';
                echo $out;
                break;
        }
    }
예제 #2
0
    function st_pingback($comment, $args, $depth)
    {
        $GLOBALS['comment'] = $comment;
        switch ($comment->comment_type) {
            case 'pingback':
                global $st_Settings;
                ?>

						<li id="comment-<?php 
                comment_ID();
                ?>
" class="pingback">
	
							<?php 
                $out = '<div class="pingback-holder">';
                $out .= '<div class="pingback-box">';
                // Title
                $out .= '<div class="pingback-author" id="author-' . get_comment_ID() . '">' . get_comment_author_link();
                // Edit link
                if (current_user_can('manage_options')) {
                    $out .= ' - <a href="' . get_edit_comment_link() . '"><small>' . __('Edit', 'strictthemes') . '</small></a>';
                }
                $out .= '</div>';
                // Date
                $out .= '<div class="pingback-date">';
                if (!empty($st_Settings['nice_time']) && $st_Settings['nice_time'] == 'yes' && function_exists('st_niceTime')) {
                    $out .= st_niceTime(get_comment_date('c', get_comment_ID()));
                } else {
                    $out .= get_comment_date() . ' ' . __('at', 'strictthemes') . ' ' . get_comment_time();
                }
                $out .= '</div>';
                $out .= '</div>';
                $out .= '<div class="clear"><!-- --></div>';
                echo $out;
                break;
        }
    }
예제 #3
0
function st_post_meta($format = true, $date = true, $category = true, $comments = true, $tags = true, $views = false, $permalink = false)
{
    global $st_Options, $st_Settings, $post;
    $st_ = array();
    // Post type names
    $st_['st_post'] = !empty($st_Settings['ctp_post']) ? $st_Settings['ctp_post'] : $st_Options['ctp']['post'];
    $st_['st_category'] = !empty($st_Settings['ctp_category']) ? $st_Settings['ctp_category'] : $st_Options['ctp']['category'];
    $st_['st_tag'] = !empty($st_Settings['ctp_tag']) ? $st_Settings['ctp_tag'] : $st_Options['ctp']['tag'];
    // Post format
    $st_['format'] = get_post_format($post->ID) && $st_Options['global']['post-formats'][get_post_format($post->ID)]['status'] ? get_post_format($post->ID) : 'standard';
    ?>

				<div class="meta">
			
					<?php 
    // If meta enabled
    if (!isset($st_Settings['post_meta']) || !empty($st_Settings['post_meta']) && $st_Settings['post_meta'] == 'yes') {
        /*-------------------------------------------
        			4.10.1 - Post format
        		-------------------------------------------*/
        if ($format == true && function_exists('st_kit')) {
            if ($st_['format'] != 'standard') {
                $st_['format_label'] = $st_Options['global']['post-formats'][$st_['format']]['label'];
                echo '<span class="ico16 ico16-' . $st_['format'] . '"><a href="' . get_post_format_link($st_['format']) . '">' . $st_['format_label'] . '</a></span>';
            }
        }
        /*-------------------------------------------
        			4.10.2 - Date
        		-------------------------------------------*/
        if ($date == true) {
            echo '<span class="ico16 ico16-calendar">';
            if (!empty($st_Settings['nice_time']) && $st_Settings['nice_time'] == 'yes' && function_exists('st_niceTime')) {
                $st_['date'] = st_niceTime($post->post_date_gmt);
            } else {
                $st_['date'] = get_the_time(get_option('date_format'), $post->ID);
            }
            if (is_single()) {
                echo $st_['date'];
            } else {
                echo '<a href="' . get_permalink() . '">' . $st_['date'] . '</a>';
            }
            echo '</span>';
        }
        /*-------------------------------------------
        			4.10.3 - Comments
        		-------------------------------------------*/
        if ($comments == true) {
            if (!empty($st_Settings['post_comments']) && $st_Settings['post_comments'] == 'yes' && comments_open() && get_comments_number() != 0) {
                ?>
									<span class="ico16 ico16-comment-2"><?php 
                if ($comments === true) {
                    comments_popup_link(__('Leave a reply', 'strictthemes'), __('1 Comment', 'strictthemes'), __('% Comments', 'strictthemes'), '', '');
                } else {
                    comments_popup_link('0', '1', '%', '', '');
                }
                ?>
									</span><?php 
            }
        }
        /*-------------------------------------------
        			4.10.4/5 - Category & Tags
        		-------------------------------------------*/
        if ($post->post_type != 'page') {
            // If project
            if (get_post_type() == $st_['st_post']) {
                if ($category == true && ($st_['posted_in'] = st_wp_get_post_terms($post->ID, $st_['st_category']))) {
                    echo '<span class="ico16 ico16-folder">' . $st_['posted_in'] . '</span>';
                }
                if ($tags == true && ($st_['tagged_by'] = st_wp_get_post_terms($post->ID, $st_['st_tag']))) {
                    echo '<span class="ico16 ico16-tag">' . $st_['tagged_by'] . '</span>';
                }
            } else {
                if ($category == true) {
                    ?>
										<span class="ico16 ico16-folder"><?php 
                    the_category(', ');
                    ?>
</span><?php 
                }
                if ($tags == true) {
                    the_tags('<span class="ico16 ico16-tag">', ', ', '</span>');
                }
            }
        }
        /*-------------------------------------------
        			4.10.6 - Views
        		-------------------------------------------*/
        if ($views == true) {
            if (!empty($st_Settings['post_views']) && $st_Settings['post_views'] == 'yes' && function_exists('st_getPostViews')) {
                echo '<span class="ico16 ico16-views">' . st_getPostViews($post->ID) . '</span>';
            }
        }
        /*-------------------------------------------
        			4.10.7 - Permalink
        		-------------------------------------------*/
        if ($permalink == true) {
            ?>
								<span class="ico16 ico16-link"><a href="<?php 
            the_permalink();
            ?>
"><?php 
            echo $permalink === true ? get_permalink() : $permalink;
            ?>
</a></span><?php 
        }
    }
    ?>
			
				</div><!-- .meta --><?php 
}