Дорабатываем плагин Recent Comments with Gravatar
Возникло желание несколько доработать плагин Recent Comments with Gravatar – показывать хочу “preview” сайта автора комментария при наведении мыши на его ФИО. Используем для этого решения, подсмотренные в другом плагине. Итак, хочу следующего (на рисунке справа).
Сделаем. Лезем в recent-comments-with-gravatar/recent-comments-gravatar.php.
Было (естественно – вырезка):
echo get_avatar($comment->comment_author_email, intval($options['gravatar_width'])); echo $author_has_url ? '</a>' : '</span>'; echo '</div>'; echo '<div class="rcg-text" style="padding-left:' . (intval($options['gravatar_width']) + 10) . 'px">'; if ($author_has_url) echo $url_author; echo $comment->comment_author; if ($author_has_url) echo '</a>'; echo ' ' . ($is_author ? __('answered on', $this->_folder) : __('commented on', $this->_folder)) . ' '; echo $url; echo $comment->post_title; echo '</a><br/> '; echo ' (' . $this->get_time_diff($comment->comment_date_gmt) . ' ' . __('ago', $this->_folder) . ')';
должно стать:
echo get_avatar($comment->comment_author_email, intval($options['gravatar_width'])); echo $author_has_url ? '</a>' : '</span>'; echo '</div>'; echo '<div class="rcg-text" style="padding-left:' . (intval($options['gravatar_width']) + 10) . 'px">'; if ($author_has_url) { echo '<span class="with-tooltip">'; echo $url_author; }; echo $comment->comment_author; if ($author_has_url) { echo '</a>'; echo '</span>'; }; echo ' ' . ($is_author ? __('answered on', $this->_folder) : __('commented on', $this->_folder)) . ' '; echo $url; echo $comment->post_title; echo '</a><br/> '; echo ' (' . $this->get_time_diff($comment->comment_date_gmt) . ' ' . __('ago', $this->_folder) . ')';
Вот и всё.
RSS комментарии
Обратная ссылка