למי שנמאס לו מהעניינים הטכניים – סבלנות, זה עוד מעט יעבור.
לכל השאר – תסתכלו על רסס התגובות שלי – יש גראוואטאר ודגל מדינה לכל מגיב, והדגל הוא גם לינק לURL שהמגיב הכניס (אם הכניס), כך שאפשר לעבור לאתר של המגיב ישירות מרסס התגובות.
בנוסף, פרסמתי תרגום עברי לפלאגין wp-db-backup שאינו מגיע עם וורדפרס 2.1.
אני מתחיל להתלהב מהעצמאות הפתאומית שיש לי על האתר שלי.
עשיתי את זה ככה: (זהירות, קוד)
/wp-commentsrss2.php
if (is_single() || is_page()) {
$comments = $wpdb->get_results("SELECT comment_ID, comment_author, comment_author_email,
comment_author_url, comment_author_ip, comment_date, comment_date_gmt, comment_content, comment_post_ID,
$wpdb->posts.ID, $wpdb->posts.post_password FROM $wpdb->comments
LEFT JOIN $wpdb->posts ON comment_post_id = id WHERE comment_post_ID = '" . get_the_ID() . "'
AND $wpdb->comments.comment_approved = '1' AND $wpdb->posts.post_status = 'publish'
AND post_date_gmt < '" . gmdate("Y-m-d H:i:59") . "'
ORDER BY comment_date_gmt ASC" );
} else { // if no post id passed in, we'll just ue the last 10 comments.
$comments = $wpdb->get_results("SELECT comment_ID, comment_author, comment_author_email,
comment_author_url, comment_author_ip, comment_date, comment_date_gmt, comment_content, comment_post_ID,
$wpdb->posts.ID, $wpdb->posts.post_password FROM $wpdb->comments
LEFT JOIN $wpdb->posts ON comment_post_id = id WHERE $wpdb->posts.post_status = 'publish'
AND $wpdb->comments.comment_approved = '1' AND post_date_gmt < '" . gmdate("Y-m-d H:i:s") . "'
ORDER BY comment_date_gmt DESC LIMIT " . get_option('posts_per_rss') );
}
[...]
<content:encoded><![CDATA[<div dir="rtl"><p><?php if(get_comment_author_url()) {
echo "<a href=\"" . get_comment_author_url() . "\">";
}
if (ip2c_get_flag_url($comment->comment_author_ip)) {
echo ip2c_get_flag_url($comment->comment_author_ip);
if(get_comment_author_url()) {
echo "</a>";
}
}
echo "</p><p>";
if (function_exists('gravatar')) {
echo "<img class=\"gravatar\" src=\"";
gravatar($comment->comment_author_email);
echo "\" alt=\"\" />";
}
?>
</p>
<?php comment_text() ?></div>]]></content:encoded>
זה בנוי עבור EasyIP2C, אני לא יודע אם זה עובד למי שמשתמש בIP2C שמגיע עם פיירסטאטס. עמרי, זה יעבוד?
השאלה היא אם אפשר להפיץ את זה בתוך פלאגין, מבלי שיהיה צריך לחטט בקוד?


2 תגובות
רסס של התגובות עבור מאמר זה
לינק לטראקבאק