Log in

View Full Version : Miscellaneous Hacks - Enhanced Thread Preview


MarkFL
07-17-2016, 09:00 PM
Overview:

In certain areas of vBulletin 4.x, when you hover your mouse over a thread title, you see a tooltip that displays a truncated version of the first post content. This simple product allows you to designate areas in which the tooltip will also contain a truncated version of the last post.

https://vborg.vbsupport.ru/attachment.php?attachmentid=155209&stc=1&d=1468820031

The product settings allow you to enable/disable the product, set how guests are handled, and select the areas in which the product is active. When deciding how to handle guests, you may select for thread previews to be hidden in all areas whether they are selected as active or not, to hide them in the active areas only, to display the default preview or to allow guests to see the enhanced thread preview. I recommend not allowing guests to see the enhanced thread previews to reduce server load, as additional queries are required to get the last post content. Truncation of the last post follows the same setting affecting the default preview.

Updates:

Version 1.1:


Strip BB Codes from preview content.


Version 1.2:


Resolved fetch_array issue present for some.
Phrased the format of the new preview tooltip.


Version 1.2.1:


Ignore thread redirects.


Compatibility:

Tested and working on VB 4.2.x and may work on all 4.x versions of vBulletin.

Backup/Warning:

This product does not alter your database, however it is always good practice to make regular backups and you should make a backup before installing ANY new mod.

As always, products are USE AT YOUR OWN RISK. I will provide support and do my best to help but no absolute guarantee is offered.

To Install:


Download and extract the attached .zip file.
Follow AdminCP -> Plugins & Products -> Manage Products -> Add/Import Product.
Click on "Choose File" and browse to the product .xml file that was packaged in the .zip file.
Click "Import."
You MUST enable the product in the settings before it will function.
Configure the remaining settings to your liking. Each setting has a detailed explanation of its use.


https://vborg.vbsupport.ru/attachment.php?attachmentid=155208&stc=1&d=1468820031

Support for this product can be found here:


MHB - Enhanced Thread Preview (http://mathhelpboards.com/vbulletin-products-61/enhanced-thread-preview-21786.html)
TAZ - Enhanced Thread Preview (https://theadminzone.com/threads/enhanced-thread-preview.145027/)

Stratis
07-20-2016, 04:37 PM
Tested in vb4.2.0 pl4, works with only issue for me, that when I hover and if text field includes bbcodes I see them to.

example:

Hi [b]Mark[b], does this supposed to be like this? even I see [attach=config]xxxxxx[attach] and all other bbcodes

Thank you

MarkFL
07-20-2016, 05:19 PM
Hello Stratis,

I will fix that tonight. Thank you for alerting me to this issue. :)

MarkFL
07-20-2016, 05:44 PM
It turns out vBulletin has an intrinsic function for stripping BB Codes. :D

Update - Version 1.1:


Strip BB Codes from preview content.

Stratis
07-20-2016, 06:19 PM
Yes its ok now, Thank you very much.

MarkFL
07-20-2016, 06:42 PM
Yes its ok now, Thank you very much.

As always, thank you my friend for letting me know when I have overlooked some detail...this is very helpful to me and the vBorg community at large. :up:

Stratis
07-21-2016, 03:31 AM
Nice of you, and double nice for you :)

Please check, if you get error 500
in (search.php?do=getdaily)

Thank you

MarkFL
07-21-2016, 03:56 AM
Nice of you, and double nice for you :)

Please check, if you get error 500
in (search.php?do=getdaily)

Thank you

No, I don't get an error there. :)

Stratis
07-21-2016, 05:16 AM
I identified the issue for me.
Check "Search Results" in Active Areas and test please.
thank you

MarkFL
07-21-2016, 05:31 AM
I had that checked. :)

Stratis
07-21-2016, 05:36 AM
Ok and sorry for fuss, i will use it without checking that field :)

MarkFL
07-21-2016, 06:02 AM
Well, I don't want you to be left out of a feature, it's just that unless I can duplicate the issue I can't do much to fix it. :)

babyv0x
07-23-2016, 05:38 AM
Test with vBulletin 4.2.2 pl4

Forum Display/Subscriptions --> work fine but some threads the last post only ...

Search Results --> I get Fatal error: Call to a member function fetch_array() on a non-object in /opt/lampp/htdocs/packages/vbforum/search/result/thread.php(197) : eval()'d code on line 27

Who's Online/Profile (Current Activity) --> Not work

please fix !

babyv0x
07-23-2016, 05:46 AM
in tooltip, if you change "lastpost" become "lastpost -----------------------------" i think it look like better.

Thank you & sorry for my bad English

MarkFL
07-23-2016, 05:54 AM
Test with vBulletin 4.2.2 pl4

Forum Display/Subscriptions --> work fine but some threads the last post only ...

Search Results --> I get Fatal error: Call to a member function fetch_array() on a non-object in /opt/lampp/htdocs/packages/vbforum/search/result/thread.php(197) : eval()'d code on line 27

Who's Online/Profile (Current Activity) --> Not work

please fix !

I just now installed this on a vB 4.2.2 site (which your profle says you are using) and ran the product through all of the areas where thread previews are affected, and everything checked out.

What version of PHP are you running?

In the first line of the product's plugin hooked at "search_results_threadbit" try changing it to:

global $vbulletin, $vbphrase, $db;

Does that fix the fatal error?

babyv0x
07-23-2016, 06:11 AM
In the first line of the product's plugin hooked at "search_results_threadbit" try changing it to:

global $vbulletin, $vbphrase, $db;

Does that fix the fatal error?

Search Results is OK now :up:

MarkFL
07-23-2016, 06:17 AM
Search Results is OK now :up:

Okay, I will include that in the next update. I will also use phrasing for the format of the tooltip so you can make it whatever you want.

Look for this update within 24 hours. :D

babyv0x
07-23-2016, 06:35 AM
New bug ?

When i quote short post , "Last post" in tooltip will show both, i mean i will see quote & last post

ex:
when i quote short post
Last post z
Last post z
Last post z
Last post z"

This is my post my post My post my post My post my post My post my post

----------------------
i will see in tooltip

First post :
....
.....

Last Post:

Last post z
Last post z
Last post z
Last post z

This is my post my post My post my post ...

babyv0x
07-23-2016, 06:45 AM
New bug ?

When i quote short post , "Last post" in tooltip will show both, i mean i will see quote & last post

ex:
when i quote short post


This is my post my post My post my post My post my post My post my post

----------------------
i will see in tooltip

First post :
....
.....

Last Post:

Last post z
Last post z
Last post z
Last post z

This is my post my post My post my post ...

when i quote long post, i still get this error. I think your mod conflict with quote BBCODE

MarkFL
07-24-2016, 12:51 AM
Update - Version 1.2:


Resolved fetch_array issue present for some.
Phrased the format of the new preview tooltip.

MarkFL
07-24-2016, 02:44 AM
when i quote long post, i still get this error. I think your mod conflict with quote BBCODE

I just ran several tests on my dev site with quotes of various lengths, and didn't have any issues.

Please try version 1.2 of this product, and let me know if the error you are experiencing still exists. :)

bosanci28
07-24-2016, 11:51 AM
So if someone hoovers over and sees the post ,will that count as viewed posts? (stats)

Thanks

MarkFL
07-24-2016, 02:48 PM
So if someone hoovers over and sees the post ,will that count as viewed posts? (stats)

Thanks

No, previewing a thread via the tooltip doesn't count as actually viewing the thread. :)

Stratis
07-24-2016, 04:47 PM
I identified the issue for me.
Check "Search Results" in Active Areas and test please.
thank you
With the update, confirm error is gone. Thanks

bosanci28
07-24-2016, 10:14 PM
No, previewing a thread via the tooltip doesn't count as actually viewing the thread. :)
Thanks for that info.

babyv0x
07-24-2016, 11:28 PM
I just ran several tests on my dev site with quotes of various lengths, and didn't have any issues.

Please try version 1.2 of this product, and let me know if the error you are experiencing still exists. :)

That error still exists when i quote :mad:

New issue
With Forum Display: When I hover Redirect thread, i see tooltip with content is "First Post Last Post" . VBB default not show tooltip when hover redirect thread.

MarkFL
07-25-2016, 12:09 AM
...New issue
With Forum Display: When I hover Redirect thread, i see tooltip with content is "First Post Last Post" . VBB default not show tooltip when hover redirect thread.

That was just an oversight and very easy to fix...I will upload an update soon. :)

MarkFL
07-25-2016, 12:15 AM
Update - Version 1.2.1:


Ignore thread redirects.

alessi
07-27-2016, 07:31 PM
nice mod, i try this

Kane@airrifle
08-14-2016, 01:13 PM
Thanks Mark. Good mod, especially when used in conjunction with https://vborg.vbsupport.ru/showthread.php?t=318467 as that one does not hide BBcodes in thread previews.