Advertisement:

Author Topic: MouseOver: topic preview!  (Read 191542 times)

Offline A.M.A

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,133
  • Gender: Male
  • ..
MouseOver: topic preview!
« 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. 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.

To download the modification package, [please click here].



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]
« Last Edit: August 02, 2006, 12:18:36 AM by Jay The Code Monkey »
Really sorry .. real life is demanding my full attention .. will be back soon hopefully :)

Offline Winters

  • Jr. Member
  • **
  • Posts: 266
  • Gender: Female
    • DykesVision. Reality-based.
Re: MouseOver: topic preview!
« Reply #1 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)
« Last Edit: October 16, 2004, 01:33:39 PM by Winters »

Offline codenaught

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 14,653
  • Gender: Male
  • Formerly Known As akabugeyes
Re: MouseOver: topic preview!
« Reply #2 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.
Dev Consultant
Former SMF Doc Coordinator

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: MouseOver: topic preview!
« Reply #3 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]

Offline codenaught

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 14,653
  • Gender: Male
  • Formerly Known As akabugeyes
Re: MouseOver: topic preview!
« Reply #4 on: October 15, 2004, 04:04:02 PM »
Thank you very much. That did it. Great mod, I like it a lot.  :)
Dev Consultant
Former SMF Doc Coordinator

CarLBanks

  • Guest
Re: MouseOver: topic preview!
« Reply #5 on: October 17, 2004, 10:26:49 PM »
I did this and nothing shows up.

Offline dg

  • Semi-Newbie
  • *
  • Posts: 60
  • Gender: Male
  • N00b
    • dg.com
Re: MouseOver: topic preview!
« Reply #6 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???

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: MouseOver: topic preview!
« Reply #7 on: October 18, 2004, 12:28:32 AM »
It's not in RC1.  I never said this would work properly/well in RC1.

-[Unknown]

Offline dg

  • Semi-Newbie
  • *
  • Posts: 60
  • Gender: Male
  • N00b
    • dg.com
Re: MouseOver: topic preview!
« Reply #8 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

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: MouseOver: topic preview!
« Reply #9 on: October 18, 2004, 12:39:42 AM »
Well, no, the mod will work... just not that part of it exactly :P.

-[Unknown]

Offline dg

  • Semi-Newbie
  • *
  • Posts: 60
  • Gender: Male
  • N00b
    • dg.com
Re: MouseOver: topic preview!
« Reply #10 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!

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: MouseOver: topic preview!
« Reply #11 on: October 20, 2004, 12:09:32 AM »
Did you install the fix via the package manager?

-[Unknown]

Offline dg

  • Semi-Newbie
  • *
  • Posts: 60
  • Gender: Male
  • N00b
    • dg.com
Re: MouseOver: topic preview!
« Reply #12 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

Offline A.M.A

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,133
  • Gender: Male
  • ..
Re: MouseOver: topic preview!
« Reply #13 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.
Really sorry .. real life is demanding my full attention .. will be back soon hopefully :)

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 55,122
  • Gender: Male
    • Kindred-999 on GitHub
Re: MouseOver: topic preview!
« Reply #14 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>';
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline soapbath

  • Semi-Newbie
  • *
  • Posts: 28
Re: MouseOver: topic preview!
« Reply #15 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?

Offline soapbath

  • Semi-Newbie
  • *
  • Posts: 28
Re: MouseOver: topic preview!
« Reply #16 on: November 17, 2004, 08:02:34 PM »
Anyone?

Offline Jerry

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,903
  • Gender: Male
  • What? I can't hear you over my awesomeness!!
    • PlanetSMF
Re: MouseOver: topic preview!
« Reply #17 on: November 17, 2004, 08:50:26 PM »
yes it would be in the classic template files instead of default Themes folder.
- Jerry
Find me on:
Facebook
Twitter
PlanetSMF

"If all you look for is the negative in things, you will never see the positive."

Offline Oldiesmann

  • Developer
  • SMF Super Hero
  • *
  • Posts: 24,814
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • http://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
Re: MouseOver: topic preview!
« Reply #18 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.
Michael Eshom
Webmaster / SMF Lead Developer
oldiesmann@simplemachines.org

Offline spiros

  • Language Moderator
  • SMF Hero
  • *
  • Posts: 1,604
  • Gender: Male
  • A different point of view
    • spiros.doikas on Facebook
    • doikas on LinkedIn
    • @greektranslator on Twitter
    • Greek Translation
Re: MouseOver: topic preview!
« Reply #19 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]
« Last Edit: January 17, 2005, 08:39:28 AM by spiros »