function b_wp_recent_comments_show($options, $wp_num = "") { $block_style = $options[0] ? $options[0] : 0; $num_of_list = empty($options[1]) ? 10 : $options[1]; $show_rss_icon = empty($options[2]) ? 0 : $options[2]; global $wpdb, $siteurl, $wp_id, $wp_inblock, $use_cache; $id = 1; $use_cache = 1; if ($wp_num == "") { $wp_id = $wp_num; $wp_inblock = 1; require dirname(__FILE__) . '/../wp-config.php'; $wp_inblock = 0; } if ($block_style == 0) { $no_comments = $num_of_list; $comment_lenth = 30; $skip_posts = 0; $request = "SELECT ID, comment_ID, comment_content, comment_author FROM {$wpdb->posts[$wp_id]}, {$wpdb->comments[$wp_id]} WHERE {$wpdb->posts[$wp_id]}.ID={$wpdb->comments[$wp_id]}.comment_post_ID AND post_status = 'publish' "; $request .= "AND comment_approved = '1' ORDER BY {$wpdb->comments[$wp_id]}.comment_date DESC LIMIT {$no_comments}"; $lcomments = $wpdb->get_results($request); $output = '<ul>'; $output = ''; if ($lcomments) { foreach ($lcomments as $lcomment) { if (preg_match('|<trackback />|', $lcomment->comment_content)) { $type = '[TrackBack]'; } elseif (preg_match('|<pingback />|', $lcomment->comment_content)) { $type = '[PingBack]'; } else { $type = '[Comment]'; } $comment_author = stripslashes($lcomment->comment_author); $comment_content = apply_filters('comment_text', $lcomment->comment_content); $comment_content = strip_tags($lcomment->comment_content); $comment_content = stripslashes($comment_content); if (function_exists('mb_substr')) { $comment_excerpt = mb_substr($comment_content, 0, $comment_lenth); } else { $comment_excerpt = substr($comment_content, 0, $comment_lenth); } $permalink = get_permalink($lcomment->ID) . "#comment-" . $lcomment->comment_ID; $output .= '<li style="list-style-type:none; list-style-position: outside; text-indext:0px; font-size:90%"><strong>' . $comment_author . ':</strong> <a href="' . $permalink; $output .= '" title="View the entire comment by ' . $comment_author . '">' . $comment_excerpt . '...</a> <span style=\\"font-size:70%\\">- ' . $type . '</span></li>'; } } $output .= '</ul>'; } else { $output = tkzy_get_recent_comments($num_of_list); } if ($show_rss_icon) { $output .= '<hr width="100%" />'; $output .= '<div style="text-align:right"> <a href="' . get_bloginfo('comments_rss2_url') . '"><img src="' . XOOPS_URL . '/modules/wordpress' . $wp_num . '/wp-images/rss_comment.gif" /></a></div>'; } $block['content'] = $output; return $block; }
function b_wp_recent_comments_show($options) { $block_style = $options[0] ? $options[0] : 0; $num_of_list = empty($options[1]) ? 10 : $options[1]; $id = 1; global $tableposts, $tablepost2cat, $tablecomments, $tablecategories; global $tablelinks, $tablelinkcategories; global $dateformat, $time_difference, $siteurl, $blogfilename; global $querystring_start, $querystring_equal, $querystring_separator, $month, $wpdb, $start_of_week; global $smilies_directory, $use_smilies, $wp_smiliessearch, $wp_smiliesreplace; global $wp_bbcode, $use_bbcode, $wp_gmcode, $use_gmcode, $use_htmltrans, $wp_htmltrans, $wp_htmltranswinuni; require_once dirname(__FILE__) . '/../wp-blog-header.php'; global $wpdb, $tablecomments, $tableposts; if ($block_style == 0) { $no_comments = $num_of_list; $comment_lenth = 30; $skip_posts = 0; $request = "SELECT ID, comment_ID, comment_content, comment_author FROM {$tableposts}, {$tablecomments} WHERE {$tableposts}.ID={$tablecomments}.comment_post_ID AND post_status = 'publish' "; $request .= "AND comment_approved = '1' ORDER BY {$tablecomments}.comment_date DESC LIMIT {$no_comments}"; $lcomments = $wpdb->get_results($request); $output = '<ul>'; $output = ''; if ($lcomments) { foreach ($lcomments as $lcomment) { if (preg_match('|<trackback />|', $lcomment->comment_content)) { $type = '[TrackBack]'; } elseif (preg_match('|<pingback />|', $lcomment->comment_content)) { $type = '[PingBack]'; } else { $type = '[Comment]'; } $comment_author = stripslashes($lcomment->comment_author); $comment_content = strip_tags($lcomment->comment_content); $comment_content = stripslashes($comment_content); if (function_exists('mb_substr')) { $comment_excerpt = mb_substr($comment_content, 0, $comment_lenth); } else { $comment_excerpt = substr($comment_content, 0, $comment_lenth); } $permalink = get_permalink($lcomment->ID) . "#comment-" . $lcomment->comment_ID; $output .= '<li style="font-size:90%"><strong>' . $comment_author . ':</strong> <a href="' . $permalink; $output .= '" title="View the entire comment by ' . $comment_author . '">' . $comment_excerpt . '...</a> <span style=\\"font-size:70%\\">- ' . $type . '</span></li>'; } } $output .= '</ul>'; } else { $output = tkzy_get_recent_comments($num_of_list); } $block['content'] = $output; return $block; }
function _b_wp_recent_comments_show($options, $wp_num = "") { $block_style = $options[0] ? $options[0] : 0; $num_of_list = !isset($options[1]) ? 10 : $options[1]; $show_rss_icon = !isset($options[2]) ? 0 : $options[2]; $cat_date = !isset($options[3]) ? $block_style ? 1 : 0 : $options[3]; $show_type = !isset($options[4]) ? 1 : $options[4]; if ($block_style == 0) { $no_comments = $num_of_list; $comment_lenth = 30; $skip_posts = 0; $request = "SELECT ID, comment_ID, comment_content, comment_author,comment_date FROM " . wp_table('posts') . ", " . wp_table('comments') . " WHERE " . wp_table('posts') . ".ID=" . wp_table('comments') . ".comment_post_ID AND post_status = 'publish' AND comment_approved = '1' "; if (get_xoops_option(wp_mod(), 'wp_use_xoops_comments') == 1) { $request .= "AND (comment_content like '<trackback />%' OR comment_content like '<pingkback />%') "; } $request .= "ORDER BY " . wp_table('comments') . ".comment_date DESC LIMIT {$no_comments}"; $lcomments = $GLOBALS['wpdb']->get_results($request); $output = ''; $pdate = ""; if ($lcomments) { if (!$cat_date) { $output .= '<ul class="wpBlockList">'; } else { $output .= '<ul class="wpBlockDateList">'; } foreach ($lcomments as $lcomment) { if ($cat_date) { $date = mysql2date("Y-n-j", $lcomment->comment_date); if ($date != $pdate) { if ($pdate != "") { $output .= '</ul></li>'; } $output .= '<li><span class="postDate">' . $date . '</span><ul class="children">'; $pdate = $date; } } if (preg_match('|<trackback />|', $lcomment->comment_content)) { $type = '[TrackBack]'; } elseif (preg_match('|<pingback />|', $lcomment->comment_content)) { $type = '[PingBack]'; } else { $type = '[Comment]'; } $comment_author = stripslashes($lcomment->comment_author); $comment_content = strip_tags($lcomment->comment_content); $comment_content = stripslashes($comment_content); if (function_exists('mb_substr')) { $comment_excerpt = mb_substr($comment_content, 0, $comment_lenth); } else { $comment_excerpt = substr($comment_content, 0, $comment_lenth); } $permalink = get_permalink($lcomment->ID) . '#comment-' . $lcomment->comment_ID; $output .= '<li><span class="comment-author">' . $comment_author . ':</span> <a href="' . $permalink; $output .= '" title="View the entire comment by ' . $comment_author . '" style="display: inline;">' . $comment_excerpt . '...</a>'; if ($show_type) { $output .= '<span style="font-size:70%">- ' . $type . '</span>'; } $output .= '</li>'; } } $output .= '</ul>'; if ($cat_date) { $output .= '</li></ul>'; } } else { $output = tkzy_get_recent_comments($num_of_list, $cat_date, $show_type); } if ($show_rss_icon) { $output .= '<hr width="100%" />'; $output .= '<div style="text-align:right"> <a href="' . get_bloginfo('comments_rss2_url') . '"><img src="' . wp_siteurl() . '/wp-images/rss_comment.gif" /></a></div>'; } ob_start(); block_style_get(); echo $output; $block['content'] = ob_get_contents(); ob_end_clean(); return $block; }
function b_wp_recent_comments_show($options, $wp_num = "") { $block_style = $options[0] ? $options[0] : 0; $num_of_list = !isset($options[1]) ? 10 : $options[1]; $show_rss_icon = !isset($options[2]) ? 0 : $options[2]; $cat_date = !isset($options[3]) ? $block_style ? 1 : 0 : $options[3]; $show_type = !isset($options[4]) ? 1 : $options[4]; global $wpdb, $siteurl, $wp_id, $wp_inblock, $use_cache, $wp_mod, $wp_base; $id = 1; $use_cache = 1; if ($wp_num == "") { $wp_id = $wp_num; $wp_inblock = 1; require dirname(__FILE__) . '/../wp-config.php'; $wp_inblock = 0; } if ($block_style == 0) { $no_comments = $num_of_list; $comment_lenth = 30; $skip_posts = 0; $request = "SELECT ID, comment_ID, comment_content, comment_author,comment_date FROM {$wpdb->posts[$wp_id]}, {$wpdb->comments[$wp_id]} WHERE {$wpdb->posts[$wp_id]}.ID={$wpdb->comments[$wp_id]}.comment_post_ID AND post_status = 'publish' AND comment_approved = '1' "; if (get_xoops_option($wp_mod[$wp_id], 'wp_use_xoops_comments') == 1) { $request .= "AND (comment_content like '<trackback />%' OR comment_content like '<pingkback />%') "; } $request .= "ORDER BY {$wpdb->comments[$wp_id]}.comment_date DESC LIMIT {$no_comments}"; $lcomments = $wpdb->get_results($request); $output = ''; $pdate = ""; if ($lcomments) { if (!$cat_date) { $output .= "<ul class='wpBlockList'>\n"; } else { $output .= "<ul class='wpBlockDateList'>\n"; } foreach ($lcomments as $lcomment) { if ($cat_date) { $date = mysql2date("Y-n-j", $lcomment->comment_date); if ($date != $pdate) { if ($pdate != "") { $output .= "</ul></li>\n"; } $output .= "<li><span class=\"postDate\">" . $date . "</span>\n<ul class=\"children\">\n"; $pdate = $date; } } if (preg_match('|<trackback />|', $lcomment->comment_content)) { $type = '[TrackBack]'; } elseif (preg_match('|<pingback />|', $lcomment->comment_content)) { $type = '[PingBack]'; } else { $type = '[Comment]'; } $comment_author = stripslashes($lcomment->comment_author); $comment_content = strip_tags($lcomment->comment_content); $comment_content = stripslashes($comment_content); if (function_exists('mb_substr')) { $comment_excerpt = mb_substr($comment_content, 0, $comment_lenth); } else { $comment_excerpt = substr($comment_content, 0, $comment_lenth); } $permalink = get_permalink($lcomment->ID) . "#comment-" . $lcomment->comment_ID; $output .= '<li><span class="comment-author">' . $comment_author . ':</span> <a href="' . $permalink; $output .= '" title="View the entire comment by ' . $comment_author . '">' . $comment_excerpt . '...</a>'; if ($show_type) { $output .= '<span style=\\"font-size:70%\\">- ' . $type . '</span>'; } $output .= "</li>\n"; } } $output .= "</ul>\n"; if ($cat_date) { $output .= "</li></ul>\n"; } } else { $output = tkzy_get_recent_comments($num_of_list, $cat_date, $show_type); } if ($show_rss_icon) { $output .= '<hr width="100%" />'; $output .= '<div style="text-align:right"> <a href="' . get_bloginfo('comments_rss2_url') . '"><img src="' . XOOPS_URL . '/modules/wordpress' . $wp_num . '/wp-images/rss_comment.gif" /></a></div>'; } ob_start(); block_style_get($wp_num); echo $output; $block['content'] = ob_get_contents(); ob_end_clean(); return $block; }