post_password) && $_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password; } } /* Assembles the log out URL for WP26 and older. @param $redirect A URL to redirect to after log out has completed. @return string Link to logout URL with an appropriate redirect parameter. */ if (!function_exists('wp_logout_url')) { // For <= WP26 function wp_logout_url($redirect = ''){ $redirect = strlen($redirect) ? "&redirect_to=$redirect" : 'redirect_to='.urlencode(get_permalink()); return get_option('siteurl')."/wp-login.php?action=logout$redirect"; } } /* Simple check to see if there are comments or not. Needed for <= WP21 @return bool */ if (!function_exists('have_comments')) { function have_comments(){ return (get_comments_number() > 0 ? true : false); } } /* There is a slight problem with wpmu 2.7 missing a class on the reply link this just adds it back in. */ global $wpmu_version; if(function_exists('comment_reply_link') && version_compare($wpmu_version, '2.7', 'eq') && !function_exists('fix_comment_reply_link')){ add_filter('comment_reply_link', 'fix_comment_reply_link', 10, 2); function fix_comment_reply_link($link){ if (stripos($link, 'class') === false) $link = preg_replace('/(]*)(>)/', '\1 class="comment-reply-link"\2', $link); return $link; } } /* Quick interpretation of the WP27 function comment_class for <= WP26 @param $class array of strings to be added to the returned class @param $ignored As the name implies this param is ignored @param $echo bool Choose to echo or return @return string standard html class attribute */ if (!function_exists('comment_class')) { // function comment_class($class = array(), $ignored = null, $ignored = null, $echo = true ){ global $comment, $comment_count, $post; $comment_count ++; // Set up the class for this comment. $class[] = get_comment_type(); $class[] = 'depth-1'; $class[] = $comment->comment_approved == 0 ? 'unapproved' : 'approved'; $class[] = $comment_count % 2 ? 'odd' : 'even'; if ($comment_count == 1) $class[] = 'first'; if ($comment->user_id == $post->post_author) $class[] = 'bypostauthor'; if (is_array($class) && count($class) > 0) $commentClass = ' class="'.implode(' ', $class).'"'; else unset ($commentClass); if ($echo) echo $commentClass; else return $commentClass; } } /* Quickly check that we're running with separated comments. Comment by type is set at the call to comments_template and there seems to be no way to force it so we need to check for it and render the comments differently for each case. @return bool True if we habe a comment_by_type array set otherwise false. */ if (!function_exists('commenting_by_type')) { function commenting_by_type() { global $wp_query; // if (property_exists($wp_query, 'comments_by_type') && $wp_query->comments_by_type) return true; else return false; } } /* Comment layout function used by WP27 walker . @return null */ if (!function_exists('comment_layout')) { function comment_layout($comment, $args = array(), $depth = null){ $GLOBALS['comment'] = $comment; extract($args, EXTR_SKIP); if ( 'div' == $style ) { $tag = 'div'; $add_below = 'comment'; } else { $tag = 'li'; $add_below = 'div-comment'; } echo "<$tag id=\"comment-".get_comment_ID().'" ' . comment_class(empty($has_children) ? '' : 'parent', get_comment_ID(), null, false).'>';?>
%s', get_comment_author_link()) ?>
0) && (is_single() || is_page()) && !post_password_required()) {?>
> = 27 comments. if (function_exists('wp_list_comments')) { if (commenting_by_type() && ($comments_by_type['pingback'] || $comments_by_type['trackback'])) {?>
'»', 'prev_text' => '«'));?>
.
/>
/>
ID)?>