Mouseover for recent topics, help needed!

Started by Apnomis, March 29, 2005, 03:41:53 PM

Previous topic - Next topic

Apnomis

I'm using a theme based on Bloc's Simplicity, the boardindex has a list of recent topics. Elsewhere in the theme I'm using the code that gives the first post preview in the title text when you hover over topics in messageindex, and also when you hover over a board link in the boardindex it gives the board despription (title="', $board['description'], '").

So as I have these hovering titles everywhere else I want to show a preview of the reply when you hover over a topic in the recent topics list. The recent topic list in the default Simplicity theme looks like this:


                         $rc=ssi_recentTopics($context['use_topics_max'], NULL , 'array');
                         foreach ($rc as $post){
                                 echo '<img src="'.$settings['images_url'].'/post/xx.gif" alt="*" align="middle" style="margin-right: 8px;" /><b>'.$post['link'].'</b> '. $txt[525]. ' '. $post['poster']['link'];
                               if(!$post['new'])
                                      echo ' <a href="'.$post['href'].'"><img src="'.$settings['images_url'].'/'.$context['user']['language'].'/new.gif" alt="*" align="middle" border="0" /></a>';
                                 echo '<br /><span class="smalltext">' .$post['board']['link']. ' -  '. $post['time'] .'</span>';
                                 echo '<br /><br />';


I tried doing this, adding title="', $post['body'], '" like so:


                         $rc=ssi_recentTopics($context['use_topics_max'], NULL , 'array');
                         foreach ($rc as $post){
                                 echo '<img src="'.$settings['images_url'].'/post/xx.gif" alt="*" align="middle" style="margin-right: 8px;" /><b><span title="', $post['body'], '">'.$post['link'].'</span></b> '. $txt[525]. ' '. $post['poster']['link'];


                               if(!$post['new'])
                                      echo ' <a href="'.$post['href'].'"><img src="'.$settings['images_url'].'/'.$context['user']['language'].'/new.gif" alt="*" align="middle" border="0" /></a>';
                                 echo '<br /><span class="smalltext">' .$post['board']['link']. ' -  '. $post['time'] .'</span>';
                                 echo '<br /><br />';


But this has to big problems:

1) although it does work to a fashion, it puts the entire post in the tooltip, so if the last post is really long so is the tool tip!
2) it brings back loads of validation errors

Anyway got any better suggestions on how to achieve this?

[Unknown]

#1
Hmmm... I suppose that information should be available in the context as well. I'll add it for 1.1.

! Add preview to SSI.php's recentPosts and recentTopics. (SSI.php)

-[Unknown]

Advertisement: