Thread Tooltip Preview
Author Message
Displays a basic preview of a thread in forumdisplay/search in a tooltip.  The tooltip acts like any standard tooltip - it will be shown after the mouse is hovered on the table cell containing the thread title.  (will also do it for thread title text itself if the user is not a moderator, in which case, the "click and hold to edit" will override the thread tooltip)

This will also display a tooltip preview for the last post, when the user hovers the mouse on the last post cell in forumdisplay/search (note, this doesn't work for the forum index).

Note: this plugin assumes that you're using the UTF-8 character set everywhere (which MyBB somewhat assumes anyway).

As there are clearly a lot of people who don't read the above, I will say this differently.  This DOES work for moderators and administrators, however you need to hover the mouse on the TABLE CELL for it to appear (not the actual thread link).
(This post was last modified: 11-11-2014 07:16 AM by ZiNgA BuRgA.)
Find all posts by this user
Quote this message in a reply
Download: threadtooltip-1.33.7z (2.65 KB)
Plugin Version: 1.33
Last Updated: 11-11-2014, 07:14 AM

Downloads: 1,978
MyBB Compatibility: 1.4.x, 1.6.x, 1.8.x
Plugin License: WTFPLv2
Uploader: ZiNgA BuRgA
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #101
RE: Thread Tooltip Preview
(04-20-2013 12:57 AM)Destro Wrote:  No. I don't ever hover over the last post column because my theme has no last post column Wink2
Then you have nothing to worry about.

(04-20-2013 12:57 AM)Destro Wrote:  I mean, how could I modify the code so it can use the first post only. And not need query to get the last post any more.
It never queries for the first/last post, so I'm not sure what you're talking about.

My Blog
04-20-2013 12:39 PM
Find all posts by this user Quote this message in a reply
Destro Offline
Junior Member
**
Posts: 39
Joined: Nov 2012
Post: #102
RE: Thread Tooltip Preview
I mean two variables : $thread['postpreview'] and $thread['lastpostpreview'].

The code has a variable $query which get firstpost and lastpost from the database right? After that, cut off its length based on user's options in ACP.

I've just comment the modifying of template has variable $thread['lastpostpreview']. Now it works fine as I want Yes
04-20-2013 07:06 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #103
RE: Thread Tooltip Preview
(04-20-2013 07:06 PM)Destro Wrote:  The code has a variable $query which get firstpost and lastpost from the database right? After that, cut off its length based on user's options in ACP.
Oh, you're referring to the cache rebuild?
Why would you want to change that code?

My Blog
04-20-2013 09:16 PM
Find all posts by this user Quote this message in a reply
Destro Offline
Junior Member
**
Posts: 39
Joined: Nov 2012
Post: #104
RE: Thread Tooltip Preview
(04-20-2013 09:16 PM)ZiNgA BuRgA Wrote:  Oh, you're referring to the cache rebuild?
Why would you want to change that code?

Because I don't want to get the last post for preview.
04-22-2013 01:51 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #105
RE: Thread Tooltip Preview
(04-22-2013 01:51 AM)Destro Wrote:  
(04-20-2013 09:16 PM)ZiNgA BuRgA Wrote:  Oh, you're referring to the cache rebuild?
Why would you want to change that code?

Because I don't want to get the last post for preview.
To which I've stated you won't get it if it's never displayed.
I don't understand why you wish to edit cache rebuild code.

My Blog
04-22-2013 09:25 AM
Find all posts by this user Quote this message in a reply
Destro Offline
Junior Member
**
Posts: 39
Joined: Nov 2012
Post: #106
RE: Thread Tooltip Preview
(04-22-2013 09:25 AM)ZiNgA BuRgA Wrote:  To which I've stated you won't get it if it's never displayed.
I don't understand why you wish to edit cache rebuild code.

Because I get it - The last post preview displayed in my mybb!  I'm using custom tooltip, and full div mybb style (Not traditional mybb table).


Nevermind it anymore, I've removed the $thread['lastpostpreview'] from display. So it will be never displayed.

But now I have new question. How should I do to display the tooltip preview for unicode ?

For example :

Here is my post

Quote:Trước bar Barocco, nhiều vụ cháy lớn tại Sài Gòn đều do sự bất cẩn của thợ hàn. Trong đó, xỉ hàn gây ra thảm họa cháy Trung tâm thương mại quốc tế ITC vẫn còn ám ảnh người dân dù đã xảy ra từ hơn chục năm trước.

But when I hover on thread it only display

Quote:Trước bar Barocco, nhiều

Althought, I set the length is 200.

I think, this issue came from unicode character. How could we make it display correctly ?
04-23-2013 08:08 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #107
RE: Thread Tooltip Preview
If you're using UTF-8 encoding, you can replace all instances of

Code:
"\xA0"

with

Code:
utf8_encode("\xA0")


My Blog
04-24-2013 10:13 AM
Find all posts by this user Quote this message in a reply
Destro Offline
Junior Member
**
Posts: 39
Joined: Nov 2012
Post: #108
RE: Thread Tooltip Preview

PHP Code:
utf8_encode("\xA0")


It's working like a charm, my friend! Thanks for your help Biggrin

04-25-2013 04:08 AM
Find all posts by this user Quote this message in a reply
bugsy Offline
Junior Member
**
Posts: 2
Joined: Dec 2013
Post: #109
RE: Thread Tooltip Preview
I installed, activated, but I have no previews of the threads. What further actions should I apply to make previews appear? I don't even see the therad icons on which I could hover my mouse, maybe should I enable them anywhere?

In fact I see some tooltips, but I see no preview images in them.
(This post was last modified: 12-29-2013 11:54 AM by bugsy.)
12-29-2013 11:33 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #110
RE: Thread Tooltip Preview
Are you asking for images to appear in tooltips?
If so, images won't appear - browser tooltips only allow unformatted text to be displayed.

My Blog
12-31-2013 02:17 PM
Find all posts by this user Quote this message in a reply


Forum Jump: