コード例 #1
0
ファイル: readers.php プロジェクト: QQ920924960/FKWordPress
function readers_wall($outer = '1', $timer = '100', $limit = '60')
{
    global $wpdb;
    $counts = $wpdb->get_results("select count(comment_author) as cnt, comment_author, comment_author_url, comment_author_email from (select * from {$wpdb->comments} left outer join {$wpdb->posts} on ({$wpdb->posts}.id={$wpdb->comments}.comment_post_id) where comment_date > date_sub( now(), interval {$timer} month ) and user_id='0' and comment_author != '" . $outer . "' and post_password='' and comment_approved='1' and comment_type='') as tempcmt group by comment_author order by cnt desc limit {$limit}");
    foreach ($counts as $count) {
        $c_url = $count->comment_author_url;
        if (!$c_url) {
            $c_url = 'javascript:;';
        }
        $type .= '<a id="duzhe" target="_blank" href="' . $c_url . '" title="[' . $count->comment_author . ']近期评论' . $count->cnt . '次">' . get_avatar($count->comment_author_email, $size = '64', deel_avatar_default()) . '<span>' . $count->comment_author . '</span></a>';
    }
    echo $type;
}
コード例 #2
0
function mod_newcomments($limit, $outpost, $outer)
{
    global $wpdb;
    $sql = "SELECT DISTINCT ID, post_title, post_password, comment_ID, comment_post_ID, comment_author, comment_date_gmt, comment_approved,comment_author_email, comment_type,comment_author_url, SUBSTRING(comment_content,1,40) AS com_excerpt FROM {$wpdb->comments} LEFT OUTER JOIN {$wpdb->posts} ON ({$wpdb->comments}.comment_post_ID = {$wpdb->posts}.ID) WHERE comment_post_ID!='" . $outpost . "' AND user_id!='" . $outer . "' AND comment_approved = '1' AND comment_type = '' AND post_password = '' ORDER BY comment_date_gmt DESC LIMIT {$limit}";
    $comments = $wpdb->get_results($sql);
    foreach ($comments as $comment) {
        $output .= '<li><a href="' . get_permalink($comment->ID) . '#comment-' . $comment->comment_ID . '" title="' . $comment->post_title . '上的评论">' . str_replace(' src=', ' data-original=', get_avatar($comment->comment_author_email, $size = '36', deel_avatar_default())) . ' <div class="muted"><i>' . strip_tags($comment->comment_author) . '</i>' . timeago($comment->comment_date_gmt) . '说:' . str_replace(' src=', ' data-original=', convert_smilies(strip_tags($comment->com_excerpt))) . '</div></a></li>';
    }
    echo $output;
}
コード例 #3
0
    ?>
/wp-comments-post.php" method="post" id="commentform">
		
		<div class="comt-title">
			<div class="comt-avatar pull-left">
				<?php 
    global $current_user;
    get_currentuserinfo();
    if (is_user_logged_in()) {
        echo get_avatar($current_user->user_email, $size = '54', deel_avatar_default());
    } elseif (!is_user_logged_in() && get_option('require_name_email') && $comment_author_email == '') {
        echo get_avatar($current_user->user_email, $size = '54', deel_avatar_default());
    } elseif (!is_user_logged_in() && get_option('require_name_email') && $comment_author_email !== '') {
        echo get_avatar($comment->comment_author_email, $size = '54', deel_avatar_default());
    } else {
        echo get_avatar($comment->comment_author_email, $size = '54', deel_avatar_default());
    }
    ?>
			</div>
			<div class="comt-author pull-left">
			<?php 
    if (is_user_logged_in()) {
        printf($user_identity . '<span>发表我的评论</span>');
    } else {
        if (get_option('require_name_email') && !empty($comment_author_email)) {
            printf($comment_author . ' <span>发表我的评论</span> &nbsp; <a class="switch-author" href="javascript:;" data-type="switch-author" style="font-size:12px;">换个身份</a>');
        } else {
            printf('发表我的评论');
        }
    }
    ?>
コード例 #4
0
function deel_comment_list($comment, $args, $depth)
{
    echo '<li ';
    comment_class();
    echo ' id="comment-' . get_comment_ID() . '">';
    //头像
    echo '<div class="c-avatar">';
    echo str_replace(' src=', ' data-original=', get_avatar($comment->comment_author_email, $size = '54', deel_avatar_default()));
    //内容
    echo '<div class="c-main" id="div-comment-' . get_comment_ID() . '">';
    echo str_replace(' src=', ' data-original=', convert_smilies(get_comment_text()));
    if ($comment->comment_approved == '0') {
        echo '<span class="c-approved">您的评论正在排队审核中,请稍后!</span><br />';
    }
    //信息
    echo '<div class="c-meta">';
    echo '<span class="c-author">' . get_comment_author_link() . '</span>';
    echo get_comment_time('Y-m-d H:i ');
    echo time_ago();
    if ($comment->comment_approved !== '0') {
        echo comment_reply_link(array_merge($args, array('add_below' => 'div-comment', 'depth' => $depth, 'max_depth' => $args['max_depth'])));
        echo edit_comment_link(__('(编辑)'), ' - ', '');
    }
    echo '</div>';
    echo '</div></div>';
}
コード例 #5
0
function inlo_comment($comment, $args, $depth)
{
    $avatar = get_avatar($comment->comment_author_email, $size = '36', deel_avatar_default());
    echo '<li ';
    comment_class();
    echo ' id="comment-' . get_comment_ID() . '">';
    //头像
    echo '<div class="cl-avatar">';
    echo $avatar;
    echo '</div>';
    //评论主体
    echo '<div class="cl-main" id="div-comment-' . get_comment_ID() . '">';
    //信息
    echo '<div class="cl-meta">';
    if ($comment->comment_type == '') {
        $author_link = empty($comment->comment_author_url) ? null : ' href="' . $comment->comment_author_url . '"';
        $author = $comment->comment_author;
        echo <<<EOF
        <span class="cl-author"><a title="{$author}" rel="external nofollow" target="_blank" class="cl-author-url"{$author_link}>{$author}</a></span>        
EOF;
    }
    echo get_comment_time('Y-n-j H:i');
    if ($comment->comment_approved !== '0') {
        echo comment_reply_link(array_merge($args, array('add_below' => 'div-comment', 'depth' => $depth, 'max_depth' => $args['max_depth'])));
        echo edit_comment_link(__('( 编辑 )'), ' - ', '');
    }
    echo '</div>';
    //内容
    echo '<div class="cl-content" >';
    echo convert_smilies(get_comment_text());
    if ($comment->comment_approved == '0') {
        echo '<span class="cl-approved">(您的评论需要审核后才能显示!)</span><br />';
    }
    echo '</div>';
    echo '</div>';
}
コード例 #6
0
ファイル: wid-readers.php プロジェクト: xingkongtianyu/Git
function dtheme_readers($out, $tim, $lim, $addlink)
{
    global $wpdb;
    $counts = $wpdb->get_results("select count(comment_author) as cnt, comment_author, comment_author_url, comment_author_email from (select * from {$wpdb->comments} left outer join {$wpdb->posts} on ({$wpdb->posts}.id={$wpdb->comments}.comment_post_id) where comment_date > date_sub( now(), interval {$tim} day ) and user_id='0' and comment_author != '" . $out . "' and post_password='' and comment_approved='1' and comment_type='') as tempcmt group by comment_author order by cnt desc limit {$lim}");
    foreach ($counts as $count) {
        $c_url = $count->comment_author_url;
        if ($c_url == '') {
            $c_url = 'javascript:;';
        }
        if ($addlink == 'on') {
            $c_urllink = ' href="' . $c_url . '"';
        } else {
            $c_urllink = '';
        }
        $type .= '<li><a title="[' . $count->comment_author . '] 近期点评' . $count->cnt . '次" target="_blank"' . $c_urllink . '>' . get_avatar($count->comment_author_email, $size = '48', deel_avatar_default()) . '</a></li>';
    }
    echo $type;
}
コード例 #7
0
ファイル: functions.php プロジェクト: xingkongtianyu/Git
function deel_comment_list($comment, $args, $depth)
{
    echo '<li ';
    comment_class();
    echo ' id="comment-' . get_comment_ID() . '">';
    //头像
    echo '<div class="c-avatar">';
    echo str_replace(' src=', ' data-original=', get_avatar($comment->comment_author_email, $size = '54', deel_avatar_default()));
    //内容
    echo '<div class="c-main" id="div-comment-' . get_comment_ID() . '">';
    echo str_replace(' src=', ' data-original=', convert_smilies(get_comment_text()));
    if ($comment->comment_approved == '0') {
        echo '<span class="c-approved">您的评论正在排队审核中,请稍后!</span><br />';
    }
    //信息
    echo '<div class="c-meta">';
    if (git_get_option('git_autherqr_b') && !G_is_mobile()) {
        echo '<span class="c-author"><a href="' . get_comment_author_url() . '" class="weixin" style="cursor:pointer;">' . get_comment_author() . '<span class="qr weixin-popover"><img style="position:absolute;z-index:99999;" src="http://s.jiathis.com/qrcode.php?url=' . get_comment_author_url() . '"></span></a></span>';
    } else {
        echo '<span class="c-author">' . get_comment_author_link() . '</span>';
    }
    if ($comment->user_id == '1') {
        echo '<img src="' . get_bloginfo('template_directory') . '/img/webmaster.png" id="comment_is_admin" title="博主大人">&nbsp;&nbsp;';
    }
    echo get_comment_time('Y-m-d H:i ');
    echo time_ago();
    if ($comment->comment_approved !== '0') {
        echo comment_reply_link(array_merge($args, array('add_below' => 'div-comment', 'depth' => $depth, 'max_depth' => $args['max_depth'])));
        echo edit_comment_link(__('(编辑)'), ' - ', '');
        if (git_get_option('git_ua_b')) {
            echo '<span style="color: #ff6600;"> ' . user_agent($comment->comment_agent) . '</span>';
        }
    }
    echo '</div>';
    echo '</div></div>';
}