mikelittle
Joined: 11 May 2002 Posts: 376 Location: UK
|
Posted: Thu Aug 15, 2002 10:26 pm Post subject: Title attribute in popup comments link |
|
|
I've modifed the comments_popup_link function to take an achor title attribute. (Shows as a tool tip when you hover over the link in newer browsers).
The original 0.6pre4 looks like:
Code: | function comments_popup_link($zero='no comment', $one='1 comment', $more='% comments', $CSSclass='') {
global $b2commentspopupfile, $b2commentsjavascript;
echo '<a href="';
if ($b2commentsjavascript) {
comments_link($b2commentspopupfile);
echo '" onclick="b2comments(this.href); return false"';
} else {
// if comments_popup_script() is not in the template, display simple comment link
comments_link();
}
if (!empty($CSSclass)) {
echo ' class="'.$CSSclass.'"';
}
echo '>';
comments_number($zero, $one, $more);
echo '</a>';
}
|
The modifed version looks like:
Code: | function comments_popup_link($zero='no comment', $one='1 comment', $more='% comments', $CSSclass='',
$anchortitle='Read or add comments' ) {
global $b2commentspopupfile, $b2commentsjavascript;
echo '<a href="';
if ($b2commentsjavascript) {
comments_link($b2commentspopupfile);
echo '" onclick="b2comments(this.href); return false"';
} else {
// if comments_popup_script() is not in the template, display simple comment link
comments_link();
}
if (!empty($CSSclass)) {
echo ' class="'.$CSSclass.'"';
}
echo ' title="' . $anchortitle . '"';
echo '>';
comments_number($zero, $one, $more);
echo '</a>';
}
|
Hope this helps someone.
Mike |
|