boardom Forum Index boardom
b2 message board
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Title attribute in popup comments link

 
Post new topic   Reply to topic    boardom Forum Index -> Hacks
View previous topic :: View next topic  
Author Message
mikelittle



Joined: 11 May 2002
Posts: 376
Location: UK

PostPosted: Thu Aug 15, 2002 10:26 pm    Post subject: Title attribute in popup comments link Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    boardom Forum Index -> Hacks All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2 © 2001, 2002 phpBB Group