コード例 #1
0
 public function fix_comments_pagenum_link($result)
 {
     $result = preg_replace('/#comments$/', '', $result);
     if (!preg_match('/(comment-page-\\d+|cpage=\\d+)/', $result)) {
         global $post;
         $result = ks_get_comments_list_link($post->ID);
     }
     return $result;
 }
コード例 #2
0
        case 2:
            $comments = ks_get_recent_comments(8, 'pings');
            break;
    }
    if ($comments) {
        ?>
		<dl>
		<?php 
        while ($target = array_shift($comments)) {
            $post = array_shift($target);
            ?>
<dt><br /><?php 
            echo count($target) > 1 ? $ks_settings['icon_more'] : $ks_settings['icon_one'];
            ?>
<a href="<?php 
            echo esc_url(ks_get_comments_list_link($post->ID));
            ?>
"><span style="<?php 
            echo $ks_settings['title_style'];
            ?>
"><?php 
            the_title();
            ?>
</span></a></dt>
			<dt><?php 
            if (empty($post->post_password)) {
                while ($comment = array_shift($target)) {
                    ?>
<img localsrc="319" alt="" /><a href="<?php 
                    echo esc_url(ks_get_comment_link($comment));
                    ?>
コード例 #3
0
            $comments = ks_get_recent_comments();
            break;
        case 0:
            $comments = ks_get_recent_comments(8, 'comment');
            break;
        case 2:
            $comments = ks_get_recent_comments(8, 'pings');
            break;
    }
    if ($comments) {
        ?>
		<dl>
		<?php 
        for (; $target = array_shift($comments); $ol_count++) {
            $post = array_shift($target);
            $link = ks_get_comments_list_link($post->ID);
            ?>
<dt><br /><div style="<?php 
            echo $ks_settings['title_style'];
            ?>
"><?php 
            ks_ordered_link(array('count' => $ol_count, 'max' => $ol_max, 'link' => $link, 'anchor' => '<span style="' . $ks_settings['title_style'] . '">' . get_the_title() . '</span>', 'hide_over_max' => true));
            ?>
</div>
			<?php 
            if (empty($post->post_password)) {
                while ($comment = array_shift($target)) {
                    ?>
					<font color="<?php 
                    echo $ks_settings['list_color'];
                    ?>
コード例 #4
0
function ks_comments_link()
{
    //function ks_comments_link($icon = NULL, $zero = NULL, $one = NULL, $more = NULL, $none = NULL, $sec = NULL, $accesskey = NULL) {
    global $id, $post;
    $defaults = array('icon' => '<img localsrc="86" alt="" />', 'zero' => __('No comments', 'ktai_style'), 'one' => __('One comment', 'ktai_style'), 'more' => __('% comments', 'ktai_style'), 'none' => '<img localsrc="61" alt="' . __('X ', 'ktai_style') . '" />' . __('Comments off', 'ktai_style'), 'sec' => __('View comments (Need password)', 'ktai_style'), 'accesskey' => NULL, 'before' => '', 'after' => '', 'echo' => true);
    $r = _ks_parse_arg(func_get_args(), $defaults);
    $number = get_comments_number($id);
    $output = '';
    if (0 == $number && 'closed' == $post->comment_status && 'closed' == $post->ping_status) {
        $icon = isset($r['icon_none']) ? $r['icon_none'] : '';
        $output = strlen($r['none']) < 1 ? NULL : $icon . "{$r['none']}";
    } else {
        $co_addr = ks_get_comments_list_link();
        if (!ks_post_password_required($post)) {
            if ($number == 0) {
                $icon = isset($r['icon_zero']) ? $r['icon_zero'] : $r['icon'];
                $output = strlen($r['zero']) < 1 ? NULL : $icon . $r['zero'];
            } else {
                if ($number > 1) {
                    $co_num = str_replace('%', number_format_i18n($number), $r['more']);
                    $icon = isset($r['icon_more']) ? $r['icon_more'] : $r['icon'];
                } else {
                    $co_num = $r['one'];
                    $icon = isset($r['icon_one']) ? $r['icon_one'] : $r['icon'];
                }
                $output = strlen($co_num) < 1 ? NULL : _ks_internal_link($co_addr, $r['accesskey'], $co_num, $post->post_password, $icon);
            }
            $output = apply_filters('comments_number', $output, $number);
        } else {
            $icon = isset($r['icon_sec']) ? $r['icon_sec'] : $r['icon'];
            $output = strlen($r['sec']) < 1 ? NULL : $icon . '<a href="' . htmlspecialchars($co_addr, ENT_QUOTES) . '"' . ks_accesskey_html($r['accesskey']) . '>' . $r['sec'] . '</a>';
        }
    }
    if (strlen($output)) {
        $output = $r['before'] . $output . $r['after'];
        if ($r['echo']) {
            echo $output;
        }
    }
    return $output;
}