MyBB Hacks

Full Version: Thread Tooltip Preview
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
(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.
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
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)
(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:
$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

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?
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)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?
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
The first three may be resource extensive for regular use. Or any use.
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)
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Reference URL's