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
nier3 Offline
Member
***
Posts: 125
Joined: Jul 2012
Post: #131
RE: Thread Tooltip Preview
Arg Ouch

I use thread tooltip also on forumdisplay_thread, portal etc. If I put in all these templates only the <php> code I'll have problems? PHP will have more requests and then the site slower?

Thank you
11-07-2015 05:14 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #132
RE: Thread Tooltip Preview
Not answering your question, but if you choose to edit the threadtooltip.php, for example, you can add something like this (for search):

PHP Code:
1
2
3
4
5
6
7
8
9
10
11
12
$plugins->add_hook('search_results_thread','threadtooltip_search_results_thread');
function threadtooltip_search_results_thread(){
	global $thread,$parser;
	$thread['postpreview'] = $parser->parse_message($thread['postpreview'], array(
		'allow_html' => 0,
		'allow_mycode' => 0,
		'allow_smilies' => 1,
		'allow_imgcode' => 0,
		'filter_badwords' => 0,
		'nl2br' => 0
	));
}

Then you can disable the $plugins->add_hook('search_results_start', 'threadtooltip_search_template'); and the function (if necessary).

The bad thing is, you need to do that in each hooks where you want ti ti be parsed.


11-07-2015 05:27 AM
Find all posts by this user Quote this message in a reply
nier3 Offline
Member
***
Posts: 125
Joined: Jul 2012
Post: #133
RE: Thread Tooltip Preview
Uhm it doesn't work Frown

At the top of file I have

Code:
1
2
3
4
5
6
7
8
9
10
11
12
$plugins->add_hook('datahandler_post_insert_thread', 'threadtooltip_threadnew');
$plugins->add_hook('datahandler_post_update_thread', 'threadtooltip_threadupdate');
$plugins->add_hook('datahandler_post_insert_post', 'threadtooltip_threadlpupdate');
$plugins->add_hook('search_results_thread','threadtooltip_search_results_thread');
$plugins->add_hook('forumdisplay_thread','threadtooltip_forumdisplay_thread');
$plugins->add_hook('portal_start','threadtooltip_portal_start');

// since I really hate MyBB's find_replace_templatesets()...
$plugins->add_hook('forumdisplay_start', 'threadtooltip_forumdisplay_template');
$plugins->add_hook('search_results_start', 'threadtooltip_search_template');

$plugins->add_hook('admin_tools_recount_rebuild_start', 'threadtooltip_admin_cache');


and after

Code:
1
2
3
4
5
6
function threadtooltip_threadlpupdate(&$ph)
{
	$tid = intval($ph->data['tid']);
	if(!$tid) return;
	$GLOBALS['db']->update_query('threads', array('lastpostpreview' => threadtooltip_getpreview($ph->data['message'])), 'tid='.$tid);
}


added

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
function threadtooltip_search_results_thread(){
	global $thread,$parser;
	$thread['postpreview'] = $parser->parse_message($thread['postpreview'], array(
		'allow_html' => 0,
		'allow_mycode' => 0,
		'allow_smilies' => 1,
		'allow_imgcode' => 0,
		'filter_badwords' => 0,
		'nl2br' => 0
	));
}

function threadtooltip_forumdisplay_thread(){
	global $thread,$parser;
	$thread['postpreview'] = $parser->parse_message($thread['postpreview'], array(
		'allow_html' => 0,
		'allow_mycode' => 0,
		'allow_smilies' => 1,
		'allow_imgcode' => 0,
		'filter_badwords' => 0,
		'nl2br' => 0
	));
}

function threadtooltip_portal_start(){
	global $thread,$parser;
	$thread['postpreview'] = $parser->parse_message($thread['postpreview'], array(
		'allow_html' => 0,
		'allow_mycode' => 0,
		'allow_smilies' => 1,
		'allow_imgcode' => 0,
		'filter_badwords' => 0,
		'nl2br' => 0
	));
}


Search threads, forumdisplay_thread, portal..but again smiles like :clapping: Frown
Maybe better use <php>, at least more easy and fast to check and change

11-07-2015 10:57 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #134
RE: Thread Tooltip Preview
postpreview is for the first post preview. You need to use lastpostpreview if you want it for the last post.

But yes, parsing it directly in the templates is more easier.

11-08-2015 12:38 AM
Find all posts by this user Quote this message in a reply
babui Offline
Junior Member
**
Posts: 3
Joined: Oct 2016
Post: #135
RE: Thread Tooltip Preview
Can this plugin be modified to show excerpts of first post on the threadlist? Or is there a better way of doing it?

Thanks!
10-11-2016 08:35 AM
Find all posts by this user Quote this message in a reply
MrBrechreiz Offline
Member
***
Posts: 69
Joined: May 2012
Post: #136
RE: Thread Tooltip Preview
This plugin shows you already the first post at hover?
10-12-2016 08:43 AM
Visit this user's website Find all posts by this user Quote this message in a reply
babui Offline
Junior Member
**
Posts: 3
Joined: Oct 2016
Post: #137
RE: Thread Tooltip Preview
(10-12-2016 08:43 AM)MrBrechreiz Wrote:  This plugin shows you already the first post at hover?

Thanks, I understand that it does that. But if you look at my screenshot in this thread you'll see that I want excerpts to always be displayed. https://community.mybb.com/thread-204832.html

I am wondering if I can modify this plugin so it shows excerpts all the time instead of only when hovered.
(This post was last modified: 10-12-2016 10:03 AM by babui.)
10-12-2016 10:03 AM
Find all posts by this user Quote this message in a reply
babui Offline
Junior Member
**
Posts: 3
Joined: Oct 2016
Post: #138
RE: Thread Tooltip Preview
Just got it to work. Thanks for this fantastic plugin!
10-13-2016 12:42 PM
Find all posts by this user Quote this message in a reply
metulburr Offline
Junior Member
**
Posts: 6
Joined: Oct 2015
Post: #139
RE: Thread Tooltip Preview
IS there a way to make an option in User CP to turn on/off the tool tips, by default turned on

Also why is the max warning set at 200? Vbulletin seems to have 300 maybe 400?
(This post was last modified: 11-16-2016 07:32 AM by metulburr.)
11-16-2016 07:30 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #140
RE: Thread Tooltip Preview
(11-16-2016 07:30 AM)metulburr Wrote:  IS there a way to make an option in User CP to turn on/off the tool tips, by default turned on
Plugin doesn't have the feature, someone would have to modify it to do that.

(11-16-2016 07:30 AM)metulburr Wrote:  Also why is the max warning set at 200? Vbulletin seems to have 300 maybe 400?
200 is probably a mistake.  The columns in the table are defined to be length 255, so it'll never allow anything longer than that unless you change the table definition (if you wish to do that, change the max length of the postpreview and lastpostpreview columns of your threads table).

My Blog
04-02-2017 06:16 PM
Find all posts by this user Quote this message in a reply


Forum Jump: