Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Now Available => Topic started by: A.M.A on October 15, 2004, 02:33:24 PM

Title: MouseOver: topic preview!
Post by: A.M.A on October 15, 2004, 02:33:24 PM
Notice:
This tip has been in some way ported over to be a modification package located on the SMF modsite (http://mods.simplemachines.org/index.php?mod=263). Please note, the mod package may not do the exact same function and may not even use any of the code originally written for the tip, but should still hold the same basic functionality of the tip posted here. With the mod package for this tip, you can now let the SMF package manager make the code changes for you without you having to look at the code and edit it manually.

For documentation on using the SMF package manager, view this document (http://docs.simplemachines.org/index.php?board=49.0).

To download the modification package, [please click here (http://mods.simplemachines.org/index.php?mod=263)].



In MessageIndex.template.php find:

Code: [Select]
', $topic['first_post']['link'];
Replace:

Code: [Select]
<span title="', $topic['first_post']['preview'], '">', $topic['first_post']['link'], '</span>';
You must have 1.0 RC1 or higher to do this.

By: [Unknown]
Title: Re: MouseOver: topic preview!
Post by: Winters on October 15, 2004, 03:22:57 PM
Sigh, I seem to be bad with applying mods these days...

But, the good thing first: It does tool tips, and I've wanted this feature for a long time, so thanks!

The only thing is, they don't start from the beginning of a post, it swallows letters/ words/ the first post, is that intentional or did I do something wrong?? Oh, and also they show html entities in between.   

Here's a link to check for yourselves: 
(Link removed, solved)
Title: Re: MouseOver: topic preview!
Post by: codenaught on October 15, 2004, 03:49:16 PM
I have the same problem. The beginning of it isn't displayed.

What I noticed is that it will display the start of the second line. So when there is just one line it will display fine but when there are more then one it seems to show the start of the second line.
Title: Re: MouseOver: topic preview!
Post by: [Unknown] on October 15, 2004, 03:55:32 PM
Bloody.... grr... find, MessageIndex.php:

Code: [Select]
$row['firstBody'] = substr($row['firstBody'], 128) . '...';
$row['lastBody'] = strip_tags(strtr(doUBBC($row['lastBody'], $row['lastSmileys']), array('<br />' => '&#10;')));
if (strlen($row['lastBody']) > 128)
$row['lastBody'] = substr($row['lastBody'], 128) . '...';

Replace:

Code: [Select]
$row['firstBody'] = substr($row['firstBody'], 0, 128) . '...';
$row['lastBody'] = strip_tags(strtr(doUBBC($row['lastBody'], $row['lastSmileys']), array('<br />' => '&#10;')));
if (strlen($row['lastBody']) > 128)
$row['lastBody'] = substr($row['lastBody'], 0, 128) . '...';

Will be resolved in the next release.

-[Unknown]
Title: Re: MouseOver: topic preview!
Post by: codenaught on October 15, 2004, 04:04:02 PM
Thank you very much. That did it. Great mod, I like it a lot.  :)
Title: Re: MouseOver: topic preview!
Post by: CarLBanks on October 17, 2004, 10:26:49 PM
I did this and nothing shows up.
Title: Re: MouseOver: topic preview!
Post by: dg on October 18, 2004, 12:17:29 AM
Bloody.... grr... find, MessageIndex.php:

Code: [Select]
$row['firstBody'] = substr($row['firstBody'], 128) . '...';
$row['lastBody'] = strip_tags(strtr(doUBBC($row['lastBody'], $row['lastSmileys']), array('<br />' => '&#10;')));
if (strlen($row['lastBody']) > 128)
$row['lastBody'] = substr($row['lastBody'], 128) . '...';

Replace:

Code: [Select]
$row['firstBody'] = substr($row['firstBody'], 0, 128) . '...';
$row['lastBody'] = strip_tags(strtr(doUBBC($row['lastBody'], $row['lastSmileys']), array('<br />' => '&#10;')));
if (strlen($row['lastBody']) > 128)
$row['lastBody'] = substr($row['lastBody'], 0, 128) . '...';

Will be resolved in the next release.

-[Unknown]

I'm using RC1 and I couldn't find that code in MessageIndex.php???
Title: Re: MouseOver: topic preview!
Post by: [Unknown] on October 18, 2004, 12:28:32 AM
It's not in RC1.  I never said this would work properly/well in RC1.

-[Unknown]
Title: Re: MouseOver: topic preview!
Post by: dg on October 18, 2004, 12:33:26 AM
It's not in RC1.  I never said this would work properly/well in RC1.

-[Unknown]

Gotcha...just confused from the first post ;D
Title: Re: MouseOver: topic preview!
Post by: [Unknown] on October 18, 2004, 12:39:42 AM
Well, no, the mod will work... just not that part of it exactly :P.

-[Unknown]
Title: Re: MouseOver: topic preview!
Post by: dg on October 19, 2004, 11:47:59 PM
Bloody.... grr... find, MessageIndex.php:

Code: [Select]
$row['firstBody'] = substr($row['firstBody'], 128) . '...';
$row['lastBody'] = strip_tags(strtr(doUBBC($row['lastBody'], $row['lastSmileys']), array('<br />' => '&#10;')));
if (strlen($row['lastBody']) > 128)
$row['lastBody'] = substr($row['lastBody'], 128) . '...';

Replace:

Code: [Select]
$row['firstBody'] = substr($row['firstBody'], 0, 128) . '...';
$row['lastBody'] = strip_tags(strtr(doUBBC($row['lastBody'], $row['lastSmileys']), array('<br />' => '&#10;')));
if (strlen($row['lastBody']) > 128)
$row['lastBody'] = substr($row['lastBody'], 0, 128) . '...';

Will be resolved in the next release.

-[Unknown]

I'm using RC1 and I couldn't find that code in MessageIndex.php???

great huge quote....anyway

I'm now using RC2 and still can't find it!
Title: Re: MouseOver: topic preview!
Post by: [Unknown] on October 20, 2004, 12:09:32 AM
Did you install the fix via the package manager?

-[Unknown]
Title: Re: MouseOver: topic preview!
Post by: dg on October 20, 2004, 10:42:17 AM
Did you install the fix via the package manager?

-[Unknown]

No, I just edited the file with EditPlus...I found the first part (the $topic change) no problem, it's the second part (the $row) that I can't even find in MessageIndex.php
Title: Re: MouseOver: topic preview!
Post by: A.M.A on October 20, 2004, 02:23:05 PM
It is two lines below this:
Code: [Select]
// Limit them to 128 characters - do this FIRST because it's a lot of wasted censoring otherwise.
Title: Re: MouseOver: topic preview!
Post by: Kindred on November 01, 2004, 11:25:50 AM
And in combination with the bold (sticky) / italics (locked) mods, the line would look like this:

Code: [Select]
                        <span style="', $topic['is_sticky'] ? 'font-weight: bold;' : '', $topic['is_locked'] ? 'font-style: italic;' : '', '" title="', $topic['first_post']['preview'], '">
                                ', $topic['is_sticky'] ? 'Sticky: ' : ($topic['is_locked'] ? 'Locked: ' : ''), ' ', $topic['first_post']['link'], '
                        </span>';
Title: Re: MouseOver: topic preview!
Post by: soapbath on November 03, 2004, 04:13:42 PM
This don't work in classic template :( And I can't seem to get it to work it in.. would there be a code for classic template?
Title: Re: MouseOver: topic preview!
Post by: soapbath on November 17, 2004, 08:02:34 PM
Anyone?
Title: Re: MouseOver: topic preview!
Post by: Jerry on November 17, 2004, 08:50:26 PM
yes it would be in the classic template files instead of default Themes folder.
Title: Re: MouseOver: topic preview!
Post by: Oldiesmann on November 19, 2004, 08:39:37 PM
I wish I had thought about that when someone asked me to do this. I did it by adding the title to the first post link in MessageIndex.php. Works just as well either way though.
Title: Re: MouseOver: topic preview!
Post by: spiros on January 17, 2005, 08:36:11 AM
I have applied this change but nothing happened. I have also tried to find

Code: [Select]
', $topic['first_post']['link'];
but the most relevant string I found was

Code: [Select]
$started = $topic['first_post']['member']['id'] == $ID_MEMBER;
I am using SMF 1.0, default template

Bloody.... grr... find, MessageIndex.php:

Code: [Select]
$row['firstBody'] = substr($row['firstBody'], 128) . '...';
$row['lastBody'] = strip_tags(strtr(doUBBC($row['lastBody'], $row['lastSmileys']), array('<br />' => '&#10;')));
if (strlen($row['lastBody']) > 128)
$row['lastBody'] = substr($row['lastBody'], 128) . '...';

Replace:

Code: [Select]
$row['firstBody'] = substr($row['firstBody'], 0, 128) . '...';
$row['lastBody'] = strip_tags(strtr(doUBBC($row['lastBody'], $row['lastSmileys']), array('<br />' => '&#10;')));
if (strlen($row['lastBody']) > 128)
$row['lastBody'] = substr($row['lastBody'], 0, 128) . '...';

Will be resolved in the next release.

-[Unknown]
Title: Re: MouseOver: topic preview!
Post by: [Unknown] on January 17, 2005, 09:13:28 AM
If you're using 1.0 you definitely don't need that change you quoted.

Are you sure you're searching the MessageIndex template?

-[Unknown]
Title: Re: MouseOver: topic preview!
Post by: spiros on January 17, 2005, 09:43:03 AM
Ooops., you are right I was searching in messageindex.php.
Now it works fine, however in Mozilla I can only say one line of tooltip whereas in IE up to 4 lines... It would be interesting if one could adjust the number of lines visible....

If you're using 1.0 you definitely don't need that change you quoted.

Are you sure you're searching the MessageIndex template?

-[Unknown]
Title: Re: MouseOver: topic preview!
Post by: [Unknown] on January 17, 2005, 09:46:47 AM
Yeah... this is a bug in Firefox, and one I've tried to help fix too.

-[Unknown]
Title: Re: MouseOver: topic preview!
Post by: spiros on January 17, 2005, 09:58:31 AM
Well done! What I meant is perhaps that there is room here for a little mod  through which one could adjust size of tooltip box, colours, lines, etc. There are actually a few nice js scipts out there which do that. (i.e. http://jdstiles.com/java/alttxt/alttxt.html)

Yeah... this is a bug in Firefox, and one I've tried to help fix too.

-[Unknown]
Title: Re: MouseOver: topic preview!
Post by: Nidoking on January 17, 2005, 05:29:48 PM
I cannot find this line in MessageIndex.template.php:
Code: [Select]
', $topic['first_post']['link'];
This is the closest I found:
Code: [Select]
' . $topic['first_post']['link'] . ' ' I am running SMF 1.0.1. What is going wrong?
Title: Re: MouseOver: topic preview!
Post by: [Unknown] on January 18, 2005, 03:04:41 AM
I cannot find this line in MessageIndex.template.php:
Code: [Select]
', $topic['first_post']['link'];
This is the closest I found:
Code: [Select]
' . $topic['first_post']['link'] . ' ' I am running SMF 1.0.1. What is going wrong?

You're probably using a different template.  That's close enough, just replace  what you found with:

<span title="', $topic['first_post']['preview'], '">', $topic['first_post']['link'], '</span>'

-[Unknown]
Title: Re: MouseOver: topic preview!
Post by: double_d on January 25, 2005, 06:07:06 PM
Just wanted to say, that this mod works sweet with 1.0.1.  I really wanted something like this, started one on my own, then found this thread.

[unknown] you rock!
Title: Re: MouseOver: topic preview!
Post by: Anguz on February 24, 2005, 07:29:14 AM
Some of you may find this useful: Preview Separator (http://www.simplemachines.org/community/index.php?topic=28838.0).
Title: Re: MouseOver: topic preview!
Post by: mytreo on March 05, 2005, 05:35:53 PM
Yeah... this is a bug in Firefox, and one I've tried to help fix too.

-[Unknown]

This Popup ALT Attributes Extension (http://piro.sakura.ne.jp/xul/_popupalt.html.en) solves the Mozilla/Firefox problem, works great with this mod/tip too :)

Chris
Title: Re: MouseOver: topic preview!
Post by: [Unknown] on March 06, 2005, 01:38:51 AM
This Popup ALT Attributes Extension (http://piro.sakura.ne.jp/xul/_popupalt.html.en) solves the Mozilla/Firefox problem, works great with this mod/tip too :)

I've seen its solution, and even documented a cleaner way of doing it in the Mozilla bug, but it's still not perfect.  Mainly, it doesn't allow for large fonts on the client operating system, which is sorta a show stopper.

-[Unknown]
Title: Re: MouseOver: topic preview!
Post by: Louis (CSpotkill) on March 06, 2005, 02:01:23 AM
Oh bleh. Just insert a variation of the nicetitles javascript (or something similar) inside the head of your index.template.php file, so you can have a multi-line rich preview (including images) dynamically made from links with titles (or if you modify it right, from spans with titles, hehe.)

I already did something similar, a week ago. Perhaps I'll finish it up as a mod.
Title: Re: MouseOver: topic preview!
Post by: flapper on March 28, 2005, 04:45:16 AM
I installed the mouse over code and it works a treat, just one thing, when you click on Show unread posts since last visit.  the mouse over will not work on the threads shown.
Title: Re: MouseOver: topic preview!
Post by: [Unknown] on March 28, 2005, 07:40:15 PM
You need to, there, do it for Recent.template.php.

-[Unknown]
Title: Re: MouseOver: topic preview!
Post by: flapper on March 29, 2005, 03:11:35 AM
You need to, there, do it for Recent.template.php.

-[Unknown]


Does this look right:

Quote
<td class="windowbg2" valign="middle" align="center" width="6%">
                                        <img src="' . $settings['images_url'] . '/topic/' . $topic['class'] . '.gif" alt="" /></td>
                                <td class="windowbg2" valign="middle" align="center" width="4%">
                                        <img src="' . $settings['images_url'] . '/post/' . $topic['first_post']['icon'] . '.gif" alt="" border="0" align="middle" /></td>
                                <td class="windowbg" valign="middle" width="48%">
                                        <span title="', $topic['first_post']['preview'], '">', $topic['first_post']['link'], '</span> <a href="' . $scripturl . '?topic=' . $topic['id'] . '.from' . $topic['newtime'] . ';topicseen#new"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new.gif" alt="' . $txt[302] . '" border="0" /></a> <span class="smalltext">' . $topic['pages'] . '</span>
                                        <div class="smalltext"><i>' . $txt['smf88'] . ' ' . $topic['board']['link'] . '</i></div></td>
                                <td class="windowbg2" valign="middle" width="14%">
                                        ' . $topic['first_post']['member']['link'] . '</td>
                                <td class="windowbg" valign="middle" width="4%" align="center">
                                        ' . $topic['replies'] . '</td>
                                <td class="windowbg" valign="middle" width="4%" align="center">
                                        ' . $topic['views'] . '</td>
                                <td class="windowbg2" valign="middle" width="22%">';
Title: Re: MouseOver: topic preview!
Post by: 3fifty on March 29, 2005, 07:10:14 PM
Im in /forum/Themes/classic/MessageIndex.template.php

Using: SMF 1.0.3

I cant find
Code: [Select]
$row['firstBody'] = substr($row['firstBody'], 128) . '...';
$row['lastBody'] = strip_tags(strtr(doUBBC($row['lastBody'], $row['lastSmileys']), array('<br />' => '&#10;')));
if (strlen($row['lastBody']) > 128)
$row['lastBody'] = substr($row['lastBody'], 128) . '...';

Am I in the right area?
Title: Re: MouseOver: topic preview!
Post by: [Unknown] on March 29, 2005, 08:06:58 PM
Im in /forum/Themes/classic/MessageIndex.template.php

Using: SMF 1.0.3

I cant find
...

Am I in the right area?

You don't need to make that change in 1.0.3.

Flapper, yes that looks fine.

-[Unknown]
Title: Re: MouseOver: topic preview!
Post by: 3fifty on April 19, 2005, 11:20:40 AM
I forgot to mention that I got this to work.  Thank you.

Is there a way to do this in the most recent topics as well or no?
Title: Re: MouseOver: topic preview!
Post by: [Unknown] on April 19, 2005, 12:43:39 PM
Yes.  It's the same thing, but in the Recent template.

How do I modify files? (http://www.simplemachines.org/community/index.php?topic=24110.0)

-[Unknown]
Title: Re: MouseOver: topic preview!
Post by: nameless on May 09, 2005, 10:16:50 PM
All your suppose to do is replace the code as stated in the first post? If so, this tip and trip isn't working for me. I'm using SMF 1.0.3.

Code: [Select]
', $topic['first_post']['link'];
Replace:

Code: [Select]
<span title="', $topic['first_post']['preview'], '">', $topic['first_post']['link'], '</span>';

Title: Re: MouseOver: topic preview!
Post by: [Unknown] on May 09, 2005, 11:03:03 PM
Provide a link to the forum with it enabled, please.

-[Unknown]
Title: Re: MouseOver: topic preview!
Post by: nameless on May 09, 2005, 11:50:50 PM
Provide a link to the forum with it enabled, please.

-[Unknown]

it's on test server using loop back. Sorry no url. "Enabled?" Do you mean that I have to "enable" it in the "Admin" section?
Title: Re: MouseOver: topic preview!
Post by: A.M.A on May 10, 2005, 06:43:12 AM
No .. the code should be placed by modifying MessageIndex.template.php.

So when you hover your mouse around a topic it does not show a tool tip! What browser are you using and could you post the modification that you made.
Title: Re: MouseOver: topic preview!
Post by: nameless on May 10, 2005, 01:44:22 PM
No .. the code should be placed by modifying MessageIndex.template.php.

So when you hover your mouse around a topic it does not show a tool tip! What browser are you using and could you post the modification that you made.

Hmmm, it didn't work on my test server and I tried it on live and it works. Weird ::) I only have default and Themis theme and I modified the files in both themes. Must be the Windows test server. LOL.

Title: Re: MouseOver: topic preview!
Post by: spiros on June 22, 2005, 09:14:26 AM
I checked out your site http://sixkillerbunnies.com/forum but I only saw the standard topic previes. Could you please give us a link and perhaps a few words on how you got it working?

Oh bleh. Just insert a variation of the nicetitles javascript (or something similar) inside the head of your index.template.php file, so you can have a multi-line rich preview (including images) dynamically made from links with titles (or if you modify it right, from spans with titles, hehe.)

I already did something similar, a week ago. Perhaps I'll finish it up as a mod.
Title: Re: MouseOver: topic preview!
Post by: Metal_GunBlade on July 25, 2005, 07:41:54 AM
In MessageIndex.template.php find:

Code: [Select]
', $topic['first_post']['link'];
Replace:

Code: [Select]
<span title="', $topic['first_post']['preview'], '">', $topic['first_post']['link'], '</span>';
You must have 1.0 RC1 or higher to do this.

By: [Unknown]
Well, I'm using SMF 1.1 Beta 3 and this Mod worked perfectly...
Thanks...
Title: Re: MouseOver: topic preview!
Post by: bjp on August 20, 2005, 05:21:48 AM
I try to put this in recent template for 1.3 beta, but it's too difficult. In fact , this sould appear when mouse over new button

Here is the original code :
<a href="' . $scripturl . '?topic=' . $topic['id'] . '.from' . $topic['newtime'] . ';topicseen#new"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new.gif" alt="' . $txt[302] . '" border="0" /></a>
Title: Re: MouseOver: topic preview!
Post by: [Unknown] on August 21, 2005, 06:27:06 AM
Find:

<a href="' . $scripturl . '?topic=' . $topic['id'] . '.from' . $topic['newtime'] . ';topicseen#new"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new.gif" alt="' . $txt[302] . '" border="0" /></a>

Replace:

<a href="' . $scripturl . '?topic=' . $topic['id'] . '.from' . $topic['newtime'] . ';topicseen#new" title="', $topic['first_post']['preview'], '"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new.gif" alt="' . $txt[302] . '" border="0" /></a>

-[Unknown]
Title: Re: MouseOver: topic preview!
Post by: bjp on August 22, 2005, 07:11:58 AM
Hi
There is no error but it's not working. I found (one time) the solution :

' . $topic['first_post']['link'] . ' <a href="' . $scripturl . '?topic=' . $topic['id'] . '.from' . $topic['newtime'] . ';topicseen#new" title="', $topic['first_post']['preview'], '"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new.gif"  border="0" /></a> <span class="smalltext">' . $topic['pages'] . '

The only probleme is that it shows the firts message of the topic, not the last answer.
Title: Re: MouseOver: topic preview!
Post by: [Unknown] on August 23, 2005, 02:06:03 AM
Then use last_post instead of first_post.

-[Unknown]
Title: Re: MouseOver: topic preview!
Post by: Elmacik on September 02, 2005, 11:09:21 AM
In MessageIndex.template.php find:

Code: [Select]
', $topic['first_post']['link'];
Replace:

Code: [Select]
<span title="', $topic['first_post']['preview'], '">', $topic['first_post']['link'], '</span>';
You must have 1.0 RC1 or higher to do this.

By: [Unknown]
Well, I'm using SMF 1.1 Beta 3 and this Mod worked perfectly...
Thanks...


how did you make it work, i couldnt find the code to be replaced in MessageIndex.template.php
anyone to tell how to make it work with 1.1 beta 3?
Title: Re: MouseOver: topic preview!
Post by: DAB Empire on September 16, 2005, 03:59:09 PM
Works in the Message Index perfect.  Thanks.

I am unable to get Recent to work though.  How could this be accomplished with the Board Index as well?
Title: Re: MouseOver: topic preview!
Post by: zoidster on September 18, 2005, 05:55:38 PM
I am in 1.0.5, using Themis template, first replaced this code by hand in both the Themis MessageIndex.template and the default theme MessageIndex.template -- I only got the last part of the message in the mouseover.

Then I installed FasterParsecode 1.09 and then Preview Seperator 1.01 via the Package Manager. Nothing changed, I only get last part (last half?) of the message with mouseover. This all is consistant whether I'm using the Themis or the default template. Replied to ModMaker,  was redirected to this topic (again), and have read it 4 times now... am I missing something?
A little embarrassing for setting up a forum to have something half work.

Any advice anyone?
Any more java script links that might be better?
Title: Re: MouseOver: topic preview!
Post by: rosey on December 18, 2005, 03:05:18 PM
I'm trying to apply this in 1.0.5 to the 'classic' theme and I keep getting a parse error.  I am replacing

Code: [Select]
' . $topic['first_post']['link'] . '

with

Code: [Select]
<span title="', $topic['first_post']['preview'], '">', $topic['first_post']['link'], '</span>'
Title: Re: MouseOver: topic preview!
Post by: Elmacik on December 18, 2005, 03:08:00 PM
Remove the last apostroph after </span>
Title: Re: MouseOver: topic preview!
Post by: rosey on December 18, 2005, 03:41:13 PM
thanks!
Title: Re: MouseOver: topic preview!
Post by: kezayah on December 28, 2005, 09:01:57 AM
It's not in RC1.  I never said this would work properly/well in RC1.

-[Unknown]

search in messageindex.template.php
Code: [Select]
<a href="', $topic['new_href'], '"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" border="0" /></a>';

echo '
add after
Code: [Select]
<span class="x-smalltext"><br />', $topic['first_post']['preview'], '</span><br />
Title: Re: MouseOver: topic preview!
Post by: Goudreault on December 30, 2005, 04:40:44 PM
is there something like this for 1.1 rc1 ?
Title: Re: MouseOver: topic preview!
Post by: Owdy on December 30, 2005, 04:46:25 PM
Yes, read first post in this topic.
Title: Re: MouseOver: topic preview!
Post by: Goudreault on January 06, 2006, 11:49:19 AM
How do I adjust how much text is shown for the preview?
Title: Re: MouseOver: topic preview!
Post by: FBI on January 07, 2006, 07:37:40 AM
Work like a charm on RC2 with SAF template :)
But only at Internet Explorer & Mozilla, not Opera :(
Thanks
Title: Re: MouseOver: topic preview!
Post by: ArkServer on January 15, 2006, 07:54:58 AM
works with 1.1rc1 :D
Title: Re: MouseOver: topic preview!
Post by: Owdy on January 15, 2006, 08:30:08 AM
and rc2
Title: Re: MouseOver: topic preview!
Post by: ArkServer on January 17, 2006, 08:01:52 AM
Does anyone know how to make it work with this code:

<td class=\"{$color[$i % 2]}\"><a href=\"$scripturl?topic={$tmp['ID_TOPIC']}.0\">".$tmp['first']['subject']."</a></td>
<td class=\"{$color[$i++ % 2]}\">", $tmp['first']['member']['link'], "</td>
            

I tried $tmp['first']['subject'] with the [preview] but it doesn't work
Title: Re: MouseOver: topic preview!
Post by: snork13 on January 17, 2006, 11:41:53 PM
ok, with so many problem on such...i packaged up for easy use on 1.1RC2, i did the inline and the on mouse preview, both are not appoved yet...i love this feature!

-snork
Title: HELP?
Post by: SN95Forums on January 23, 2006, 08:13:16 PM
ok, with so many problem on such...i packaged up for easy use on 1.1RC2, i did the inline and the on mouse preview, both are not appoved yet...i love this feature!

-snork

I cant figure out how to get this to work with 1.1RC2 I've read over the tread but still am confuised.?!

Thanks
Title: Re: MouseOver: topic preview!
Post by: Owdy on January 24, 2006, 02:31:37 AM
Just do what first post says. Thats it.
Title: Re: MouseOver: topic preview!
Post by: SN95Forums on January 24, 2006, 07:32:52 PM
doesnt seem to work for me I cant find that exact code either?
Title: Re: MouseOver: topic preview!
Post by: Owdy on January 24, 2006, 11:09:20 PM
Well, code is there.
Title: Re: MouseOver: topic preview!
Post by: SN95Forums on February 03, 2006, 10:42:18 PM
humm the first code at the start of this thread? and what file do I put it in?  I tried it wont work for me  :'(
Title: Re: MouseOver: topic preview!
Post by: SN95Forums on February 09, 2006, 11:25:17 PM
I cant find that code anywhere.  I have 1.1 RC2 and am using the helios theme.  Im looking in "MessageIndex.template.php" in my "helios" folder (xxxxxxx/forum/Themes/helios/)
Title: Re: MouseOver: topic preview!
Post by: pcigre on February 18, 2006, 05:32:17 AM
I hove rc2. It works, but its always there not, no mouson over. Can this be fixed?
Title: Re: MouseOver: topic preview!
Post by: rosey on February 18, 2006, 05:28:10 PM
it's not working for me with RC2 - nothing happens. 
Title: Re: MouseOver: topic preview!
Post by: JayBachatero on February 18, 2006, 05:31:34 PM
There is a mod for this.  Take a look at these two mods.
http://mods.simplemachines.org/index.php?mod=263
http://mods.simplemachines.org/index.php?mod=262
Title: Re: MouseOver: topic preview!
Post by: rosey on February 18, 2006, 05:39:50 PM
rockin!  thanks!

now I need to decide if I want the hover or the inline...
Title: Re: MouseOver: topic preview!
Post by: JayBachatero on February 18, 2006, 05:56:14 PM
You're welcome.  Yea that would be a dilema :P
Title: Re: MouseOver: topic preview!
Post by: rosey on February 18, 2006, 06:11:36 PM
it won't work from "recent unread posts" or "all unread posts"...  do I need to edit those templates somehow?  (yes, I'm a n00b, sorry)
Title: Re: MouseOver: topic preview!
Post by: JayBachatero on February 18, 2006, 06:16:25 PM
Yea you would have to edit the Recent.template.php file.
Title: Re: MouseOver: topic preview!
Post by: rosey on February 18, 2006, 08:54:54 PM
argh I SUCK at this!  I keep getting a forking parse error!!!   :'(
Title: Re: MouseOver: topic preview!
Post by: JayBachatero on February 18, 2006, 09:04:56 PM
You need to make sure you are not putting it inside an echo stament or something.  Use a text editor with the option to highlight syntax so that you can see if you break something.  I recommend ConTEXT (http://context.cx).
Title: Re: MouseOver: topic preview!
Post by: rosey on February 18, 2006, 09:17:05 PM
I fixed it!  Um, not super sure how I did, though, but whatever.

Ok so it is working now inside of a board, and on the "recent unread" screen.  what template controls the "all unread" screen?

btw thank you so much for holding my hand through this  :)
Title: Re: MouseOver: topic preview!
Post by: JayBachatero on February 18, 2006, 09:47:05 PM
The Recent.template.php should handle all of that :)
Title: Re: MouseOver: topic preview!
Post by: rosey on February 21, 2006, 09:13:44 AM
in my recent.template.php, the only line with [first_post][link] in it is this one:

' , $topic['is_sticky'] && !empty($settings['seperate_sticky_lock']) ? '<img src="' . $settings['images_url'] . '/icons/show_sticky.gif" align="right" alt="" style="margin: 0;" />' : '', ' ', $topic['first_post']['link'], ' <a href="', $topic['new_href'], '"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" /></a> <span class="smalltext">', $topic['pages'], '


but if I use that line to put the preview stuff in, it messes up any sticky threads that show in the recent threads - it puts the preview line right there on top of the thread topic...  I really want to make this work with the 'view unread posts since last visit' feature...
Title: Re: MouseOver: topic preview!
Post by: TinaCat on February 22, 2006, 04:37:45 AM

Rosey, try this code.
I use this code in my forum.

<td class="windowbg' , $topic['is_sticky'] && !empty($settings['seperate_sticky_lock']) ? '3' : '' , '" width="48%" valign="middle" title="', $topic['first_post']['preview'], '">' , $topic['is_locked'] && !empty($settings['seperate_sticky_lock']) ? '
<img src="' . $settings['images_url'] . '/icons/quick_lock.gif" align="right" alt="" style="margin: 0;" />' : '' , $topic['is_sticky'] && !empty($settings['seperate_sticky_lock']) ? '
<img src="' . $settings['images_url'] . '/icons/show_sticky.gif" align="right" alt="" style="margin: 0;" />' : '', $topic['first_post']['link'], ' <a href="', $topic['new_href'], '"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" /></a>
Title: Re: MouseOver: topic preview!
Post by: True Knight on March 20, 2006, 11:05:05 PM
I think my code has been modified by another Mod....how can I add the code I need? Here's my code.

Code: [Select]
', $topic['first_post']['link'], ' ', $topic['new'] && $context['user']['is_logged'] ? '<a href="' . $scripturl . '?topic=' . $topic['id'] . '.msg' . $topic['new_from'] . '#new"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new.gif" alt="' . $txt[302] . '" border="0" /></a>' : '', ' <span class="smalltext">', $topic['pages'], '</span></td>

How do I edit this to use the mouseover feature...I tried the mod but it didn't fix it.

Thanks
Title: Re: MouseOver: topic preview!
Post by: TheGamer on June 17, 2006, 02:04:15 AM
I cannot get this to work in 1.1 RC2. Please help!
Title: Re: MouseOver: topic preview!
Post by: JayBachatero on June 17, 2006, 01:44:16 PM
There is a mod for this.  Do a search in the mod site.
Title: Re: MouseOver: topic preview!
Post by: JustJen on August 25, 2006, 12:49:12 PM
HELP! I applied the mod as described on pg 1 and it works, but my table is now out of allignment.

Here's a visual.
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg.photobucket.com%2Falbums%2Fv131%2Fjairving%2Fmouse.jpg&hash=be626a053430d845275266cead8edf6d)
Title: Re: MouseOver: topic preview!
Post by: snork13 on August 25, 2006, 01:20:24 PM
HELP! I applied the mod as described on pg 1 and it works, but my table is now out of allignment.

Here's a visual.
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg.photobucket.com%2Falbums%2Fv131%2Fjairving%2Fmouse.jpg&hash=be626a053430d845275266cead8edf6d)

I don't know how the colspan got messed up, but you could undo the changes made and try the mod link below via the package manager. It looks like your using a custom theme, so check the mod install on the default theme first, then you can make the same changes to your custom theme.

http://mods.simplemachines.org/index.php?mod=263 (http://mods.simplemachines.org/index.php?mod=263)

-Snork13
Title: Re: MouseOver: topic preview!
Post by: JustJen on August 25, 2006, 01:31:05 PM
Actually, it's the classic theme. I undid the changes and now have bigger text. Ugh.
Title: Re: MouseOver: topic preview!
Post by: snork13 on August 25, 2006, 06:11:59 PM
Actually, it's the classic theme. I undid the changes and now have bigger text. Ugh.
if you no other modifications, then just upload the original file to your classic theme, and try it again...
Title: Re: MouseOver: topic preview!
Post by: realdeal on September 07, 2006, 08:07:22 PM
I can't get this to work!!! I am using 1.1 RC3.
Title: Re: MouseOver: topic preview!
Post by: JustJen on September 08, 2006, 08:27:15 AM
I can get it to work in any theme except the one I'm using-YaBB Classic. Why's that?  ???
Title: Re: MouseOver: topic preview!
Post by: snork13 on September 08, 2006, 05:49:57 PM
I can get it to work in any theme except the one I'm using-YaBB Classic. Why's that?  ???

the mod only installs on the default smf theme, you will need to install on your custom theme manually. check out the modification xml.

-Snork13
Title: Re: MouseOver: topic preview!
Post by: snork13 on September 08, 2006, 05:51:43 PM
I can't get this to work!!! I am using 1.1 RC3.

doesn't help me tech you at all. i suspect you have another mod installed or are not using the default theme.

-Snork13
Title: Re: MouseOver: topic preview!
Post by: JustJen on September 08, 2006, 10:00:49 PM
I can get it to work in any theme except the one I'm using-YaBB Classic. Why's that?  ???

the mod only installs on the default smf theme, you will need to install on your custom theme manually. check out the modification xml.

-Snork13
okay, but why would it then work on another downloaded theme?
Title: Re: MouseOver: topic preview!
Post by: danskmacabre on November 09, 2006, 05:18:50 AM
I can get it to work in any theme except the one I'm using-YaBB Classic. Why's that?  ???

the mod only installs on the default smf theme, you will need to install on your custom theme manually. check out the modification xml.

-Snork13
okay, but why would it then work on another downloaded theme?

One reason why it might work on another theme is if the other theme doesn't use a file that the mod is coded into (Meaning it might not have costom code using the files hte mod changes).
If t hat is the case, the other theme will go back to the default theme files and use them, which have the mod installed.

what you need to do is find out which files are modded (check out the mod file ) and insert the new code (or change your existing code, this can be sometimes tricky depending on how complex your theme is).


Title: Re: MouseOver: topic preview!
Post by: JustJen on December 12, 2006, 08:21:12 AM
YIPPEE!! I got it to work!!
Title: Re: MouseOver: topic preview!
Post by: t.osberger on January 22, 2007, 07:59:34 PM
Hello!

I was reading this thread, downloaded the mod and installed it.  It shows in the list that it is installed.  I'll just bet the reason that is not working is that I am using an alternate theme, as opposed to the default (actually using v1.1.1 - Ancient_and_Rusty).

So, to anyone who can assist, I would like to know how to make this work with the theme I currently using (or all themes - that would work too).  Such a nice feature I would hate to find that we can't use without using the default theme.

I look forward to any form of assistance.


Title: Re: MouseOver: topic preview!
Post by: waggles on January 29, 2007, 09:45:51 PM
Very nice. Works almost too well.
Title: Re: MouseOver: topic preview!
Post by: perro88 on August 21, 2007, 11:29:59 PM
I´m using smf 1.1.3 with tinyportal but this don´t work. on the admin section the option to show the max numbers of chars is showed but when i hover a topic nothing is showed.I tried in more than one smf 1.1.3 and didn´t worked in both. it install with any errors and I give it a look to the code changed and all seems in good place but nothing showed.
I tried on the theme I have that is a copy of the default and didn´t even have modified files by the mod and tried on the default and didn´t work either. Any idea about this? would be very apreciated
Title: Re: MouseOver: topic preview!
Post by: perro88 on August 24, 2007, 10:33:32 AM
oh, sorry, I made a mistake, it´s working perfect, thanks for the mod. How I can change the style of the preview?
Title: Re: MouseOver: topic preview!
Post by: bigo on September 01, 2007, 02:59:59 PM
http://www.simplemachines.org/community/index.php?topic=187727.0

;)
Title: Re: MouseOver: topic preview!
Post by: icon on December 31, 2007, 08:25:25 PM
i really like this one,
help me so that it would work on 1.1.3 :'(
Title: Re: MouseOver: topic preview!
Post by: icon on January 18, 2008, 09:15:12 PM
Bloody.... grr... find, MessageIndex.php:

Code: [Select]
$row['firstBody'] = substr($row['firstBody'], 128) . '...';
$row['lastBody'] = strip_tags(strtr(doUBBC($row['lastBody'], $row['lastSmileys']), array('<br />' => '')));
if (strlen($row['lastBody']) > 128)
$row['lastBody'] = substr($row['lastBody'], 128) . '...';

Replace:

Code: [Select]
$row['firstBody'] = substr($row['firstBody'], 0, 128) . '...';
$row['lastBody'] = strip_tags(strtr(doUBBC($row['lastBody'], $row['lastSmileys']), array('<br />' => '')));
if (strlen($row['lastBody']) > 128)
$row['lastBody'] = substr($row['lastBody'], 0, 128) . '...';

Will be resolved in the next release.

-[Unknown]

im using 1.1.3, and i cant find this code, even at my default theme :(
Title: Re: MouseOver: topic preview!
Post by: kai920 on June 11, 2008, 10:15:41 PM
this mod works great, but does anyone know how to style the hover tooltip via CSS? It's not showing all the characters (see below:)

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg374.imageshack.us%2Fimg374%2F6880%2Fsmfai2.png&hash=7b5fe9c07cf84f266bab192f29e1f309)
 
Title: Re: MouseOver: topic preview!
Post by: avf on July 27, 2008, 07:40:02 AM
love this one !

Does it work on 1.1.5 ?
thanks
avf
Title: Re: MouseOver: topic preview!
Post by: ddabcd277 on October 22, 2011, 09:27:05 AM
Hello,

Don't like to write in very old topics but I love the idea discussed here.  :)

Can someone explain how preview topic can be achived in SMF 2.0.1.?

Many Thanks,
Title: Re: MouseOver: topic preview!
Post by: Douglas on August 19, 2012, 10:37:37 AM
Okay, I was looking to get this implemented on my own forums... and figured out how to do this.  This works for both 2.0.1 AND 2.0.2.

First, in index.template.php (must be done for each theme folder separately), find
Code: [Select]
$settings['message_index_preview'] and set false to true.

Next, in MessageIndex.template.php (must be done for each theme folder that has this file), find
Code: [Select]
<span id="msg_' . $topic['first_post']['id'] . '">
Change it to
Code: [Select]
<span id="msg_' . $topic['first_post']['id'] . '" title="', $topic['first_post']['preview'], '">
Congrats, you now have this enabled for your SMF 2.0.1 / 2.0.2 forums!
Title: Re: MouseOver: topic preview!
Post by: ForumACK on June 02, 2013, 12:58:51 AM
Okay, I was looking to get this implemented on my own forums... and figured out how to do this.  This works for both 2.0.1 AND 2.0.2.

First, in index.template.php (must be done for each theme folder separately), find
Code: [Select]
$settings['message_index_preview'] and set false to true.

Next, in MessageIndex.template.php (must be done for each theme folder that has this file), find
Code: [Select]
<span id="msg_' . $topic['first_post']['id'] . '">
Change it to
Code: [Select]
<span id="msg_' . $topic['first_post']['id'] . '" title="', $topic['first_post']['preview'], '">
Congrats, you now have this enabled for your SMF 2.0.1 / 2.0.2 forums!

thanks!
Title: Re: MouseOver: topic preview!
Post by: rallepralle on March 09, 2014, 11:12:04 AM
Okay, I was looking to get this implemented on my own forums... and figured out how to do this.  This works for both 2.0.1 AND 2.0.2.

First, in index.template.php (must be done for each theme folder separately), find
Code: [Select]
$settings['message_index_preview'] and set false to true.

Next, in MessageIndex.template.php (must be done for each theme folder that has this file), find
Code: [Select]
<span id="msg_' . $topic['first_post']['id'] . '">
Change it to
Code: [Select]
<span id="msg_' . $topic['first_post']['id'] . '" title="', $topic['first_post']['preview'], '">
Congrats, you now have this enabled for your SMF 2.0.1 / 2.0.2 forums!
Thanks it works!

Does anyone know how to display the preview in a bigger window with all elements in the thread displayed, i.e. not only text but also pictures?
Title: Re: MouseOver: topic preview!
Post by: Kindred on March 09, 2014, 01:43:19 PM
that is getting into some potential use of "real" system resources....   and defeats the purposed of a "preview", IMO.   The preview is just that... a teaser. preview - not the whole message.   Click on the message and open it up if you want to see the whole thing.
Title: Re: MouseOver: topic preview!
Post by: Douglas on July 30, 2014, 04:26:24 PM
Bumping an OLD topic... I had forgotten that I posted step by step instructions on this and needed this again today.

ROCK ON! This still works through SMF 2.0.8, guys. :D
Title: Re: MouseOver: topic preview!
Post by: Hj Ahmad Rasyid Hj Ismail on July 31, 2014, 05:35:50 AM
Nice tips Douglas. I will have a go on this soon.