Hallo zusammen!
Mit folgendem Code versuche ich, meine Top-Kommentatoren dreispaltig und mehrzeilig anzeigen zu lassen. Leider funktioniert das noch nicht so wirklich. Es werden nur die Zeilenumbrüche nach 3 Bildern angezeigt.
Wie bekomme ich das geregelt?
PHP
global $wpdb; ?>
<?php
$i = 0;
$topcommentator_query="SELECT comment_author, comment_author_email, comment_type, SUBSTRING_INDEX(comment_author_url, '/', 3) as top_commentator, COUNT(*) as top_num FROM $wpdb->comments
WHERE comment_approved='1'
AND comment_author_url IS NOT NULL
AND comment_author_url != ''
AND comment_author_email NOT LIKE 'webbi@themenfreund.de%' AND comment_author_email NOT LIKE 'kommentar@themenfreund.de%' AND comment_author_url NOT LIKE 'http://twitter.com/%'
AND comment_author_url NOT LIKE 'http://themenfreund.de%'
AND comment_author_url NOT LIKE 'http://facebook.com%'
AND comment_type NOT LIKE 'pingback' OR 'trackback'
GROUP BY top_commentator
Order by top_num DESC, comment_date ASC
LIMIT 30";
$topcommentator_result = $wpdb->get_results($topcommentator_query); if ( !empty($topcommentator_result) ) {
foreach ($topcommentator_result as $comment) :
echo '<table border="0" cellSpacing="3" cellPadding="5" bgColor="#eeeeee" width="60%">';
echo '<tr width="60%">';
$i=$i+1;
$co_aut = $comment->top_commentator;
$co_aut = str_ireplace("http://", "", $co_aut);
echo get_avatar( $comment, 32 ),' <a href="'.$comment->top_commentator.'/" target="_blank">'.$comment->comment_author.'</a> ('.$comment->top_num.')';
if($i%3==0) {
echo '<br /><br />';
}
endforeach;
$i++;
}
?>
</tr>
</table>
Alles anzeigen
Danke im voraus!
Marcus