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,957
MyBB Compatibility: 1.4.x, 1.6.x, 1.8.x
Plugin License: WTFPLv2
Uploader: ZiNgA BuRgA
bugsy Offline
Junior Member
**
Posts: 2
Joined: Dec 2013
Post: #111
RE: Thread Tooltip Preview
(12-31-2013 02:17 PM)ZiNgA BuRgA Wrote:  Are you asking for images to appear in tooltips?
If so, images won't appear - browser tooltips only allow unformatted text to be displayed.

Oh, I see, I saw similar "preview tooltips" in myBB forums where pictures are displayed too.
01-01-2014 04:09 PM
Find all posts by this user Quote this message in a reply
Tux Offline
Junior Member
**
Posts: 1
Joined: May 2014
Post: #112
RE: Thread Tooltip Preview
Hello ZiNgA BuRgA

I found your tooltip mod to be the right extension to my forum. Yes
Here are my installed version(s)
MyBB 1.6.13
PHP 5.2.12-nmm4
SQL-engine MySQLi 5.1.73

Forum Size is
4500 members
19.000 topics
200.000 posts

When I enabled the plugin in Admin-CP the server tok ~2h to rebuild the cache. This is not really a problem.
But not all threads were index. Not all got a tooltip preview text. Just the ~500 latest.

(Add. info: All character fields of the table are of utf8_general_ci collation)

Why, do you think not all threads are preview'd ?
Why do you think it takes ages (2h) to go over all threads ?

Thanks for your effort
Tux Penguin
05-14-2014 10:56 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #113
RE: Thread Tooltip Preview
By default, it rebuilds 500 threads at a time (there's a textbox where you can specify the number of threads to do at a time).  Did this rebuild fully complete or only "complete" to a redirecting page?

2 hours seems unusual for that amount of threads (and even more so if it only rebuilt one batch of 500), but it's hard to say what the reason is.
If you know how to inject code into the rebuild page, you could change the form's URL to have "?debug=1" on the end - this will print out the queries performed and how long they took.

It's also possible that each stage gets slower as MySQL isn't particularly good at handling queries with a large offset, though 19k isn't really a lot of rows, and you'll find this to be the case with other MyBB rebuild functions.

Do you have any idea on how fast queries execute and what sort of concurrency your server is experiencing?  (eg number of MySQL queries running simultaneously from MySQL's process list, typical number of concurrent processes/threads of PHP executing etc)

My Blog
(This post was last modified: 05-15-2014 09:38 AM by ZiNgA BuRgA.)
05-15-2014 09:36 AM
Find all posts by this user Quote this message in a reply
nier3 Offline
Member
***
Posts: 125
Joined: Jul 2012
Post: #114
RE: Thread Tooltip Preview
(04-24-2013 10:13 AM)ZiNgA BuRgA Wrote:  If you're using UTF-8 encoding, you can replace all instances of

Code:
"\xA0"

with

Code:
utf8_encode("\xA0")


Hi, I'm using Thread Tooltip Preview in portal announcement (for preview from threads in forum).

In message I have often "?" instead of "à" for example or question marks around to the message of preview (where there are spaces in the text).


In threadtooltip.php I have edited in this way, where there were "\xA0":

PHP Code:
1
2
3
4
5
6
7
8
9
$msg = unhtmlentities(strip_tags($msg));
		// remove additional spacing added by parse_message + fix   (gets converted to \xA0)
		//$msg = trim(strtr($msg, array(utf8_encode("\xA0") => ' ', "\n" => ' ', "\r" => '', "\t" => ' ')));
	}
	
	// convert \xA0 to spaces (reverse  )
	$msg = trim(preg_replace(array('~ {2,}~', "~\n{2,}~"), array(' ', "\n"), strtr($msg, array(utf8_encode("\xA0") => ' ', "\r" => '', "\t" => ' '))));
	// newline fix for browsers which don't support them
	$msg = preg_replace("~ ?\n ?~", " \n", $msg);


but I have still "?", how can I resolve?

Thank you very much in advance

10-11-2014 09:14 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #115
RE: Thread Tooltip Preview
You may need to rebuild the tooltips cache after that change.
(I should probably fix the actual plugin some time too)

Otherwise, are you using UTF-8 encoding?  Is your database also UTF-8 encoded?

My Blog
10-13-2014 10:49 AM
Find all posts by this user Quote this message in a reply
nier3 Offline
Member
***
Posts: 125
Joined: Jul 2012
Post: #116
RE: Thread Tooltip Preview
Hi, I apologize if I have not answered before, there had been a flood here and I missed the post reply :x

I tried with Rebuild Thread Tooltips - This will rebuild the thread tooltips cache but I have always "?" in annoucements. In PhpMyAdmin, near tables of the forum, I see "utf8_general_ci".
And in first page of PhpMyAdmin I see "MySQL character sets: UTF-8 Unicode (utf8)". I have MySQL client: 5.5.38.

In ACP (status) I have almost all the tables in UTF-8, only no mybb_upgrade_data. Near mybb_upgrade_data there is a "X" in red with "convert now".

In other column, under "4-byte UTF-8 (requires MySQL 5.5.3 or higher)", I have all X red.
10-20-2014 11:18 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #117
RE: Thread Tooltip Preview
(10-20-2014 11:18 AM)nier3 Wrote:  Hi, I apologize if I have not answered before, there had been a flood here and I missed the post reply :x
I hope everything's okay over there.

(10-20-2014 11:18 AM)nier3 Wrote:  I tried with Rebuild Thread Tooltips - This will rebuild the thread tooltips cache but I have always "?" in annoucements. In PhpMyAdmin, near tables of the forum, I see "utf8_general_ci".
And in first page of PhpMyAdmin I see "MySQL character sets: UTF-8 Unicode (utf8)". I have MySQL client: 5.5.38.
Thanks for the information.  Could you try going into the threads table and taking a look at whether the ? is in the data?

My Blog
10-21-2014 05:30 PM
Find all posts by this user Quote this message in a reply
nier3 Offline
Member
***
Posts: 125
Joined: Jul 2012
Post: #118
RE: Thread Tooltip Preview
Hi, all ok here, more or less..strong wind from tomorrow Ouch

mybb_threads: 8,095 rows; MyISAM 4.0 MiB dimension

Inside the mybb_threads table there is postpreview and lastpostpreview column, but also there there is "?" in the text, for example:

[Image: AW0LQ8O.png]

If I convert database from MyISAM to InnoDB what happens? I could have errors etc o I'll resolve all?

Also, my forum is slow from 2-3 days Frown I have only 10 plugins (show avatars in threadlist and forumlist, shoutbox, mylikes, show in portal, php and template conditionals (2.0), quick advanced editor, related threads, thread tooltip preview (1.32), view unread posts, xthreads 1.64.

Thank you
10-22-2014 12:05 AM
Find all posts by this user Quote this message in a reply
Sama34 Offline
Senior Member
****
Posts: 490
Joined: May 2011
Post: #119
RE: Thread Tooltip Preview
The first three may be resource extensive for regular use. Or any use.

Support PM's will be ignored. Yipi
Plugins: Announcement Bars - Custom Reputation - Mark PM As Unread
10-23-2014 03:00 AM
Visit this user's website Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #120
RE: Thread Tooltip Preview
Okay, so it's actually putting bad data into the table itself...
Are you able to post a link to an example thread which demonstrates this behaviour?

(10-22-2014 12:05 AM)nier3 Wrote:  If I convert database from MyISAM to InnoDB what happens? I could have errors etc o I'll resolve all?
It won't make a difference.

(10-22-2014 12:05 AM)nier3 Wrote:  Also, my forum is slow from 2-3 days Frown
Unlikely this plugin, and beyond the scope of this thread, but you need to define 'slow' (slow to load pages?  slow to generate pages? (page generation time) etc)

My Blog
10-24-2014 04:27 PM
Find all posts by this user Quote this message in a reply


Forum Jump: