Module: Post Previews
Posted by Joe Curia
All files from this thread
File Name | File Size | Posted by | Date | ||
---|---|---|---|---|---|
post_previews screenshot.jpg | 50.2 KB | open | download | Joe Curia | 10/17/2008 | Read message |
post_previews mark read screenshot.jpg | 28.5 KB | open | download | Joe Curia | 04/30/2009 | Read message |
post_previews-5.2.1.07.zip | 16.2 KB | open | download | Joe Curia | 08/31/2016 | Read message |
auto_adjust_text_in_popup.txt | 3.3 KB | open | download | Skinny | 09/20/2013 | Read message |
Post Previews error.PNG | 7.7 KB | open | download | Maxim_A | 11/05/2019 | Read message |
Module: Post Previews October 17, 2008 10:26AM |
Registered: 17 years ago Posts: 1,301 |
This module adds AJAX post previews to all links which point to posts on this forum.
Special thanks go to Maurice Makaay for his wonderful AJAX api.
Installation and Usage:
This module requires Phorum 5.2.8 or greater to use the AJAX api.
By default the post previews are shown in a 500px by 50px div with the background color set to the default alternate background color (seen in every other message on the list page). Also by default, the post is shown formatted as it would be on the read page. These defaults can be changed from the settings page.
The admin can also enable the option for users to disable the previews, which they would then do from the Control Center->Forum Settings page. When this setting is enabled, the admin can also enable a help message which will appear above the message preview to explain this feature. This feature will not work in the Opera browser and thus will not be shown to visitors using Opera.
One final option for the admin is to show a vertical scrollbar in the preview area. This option fixes a FireFox display bug when a video is embedded in a message. I would recommend only enabling this option if your forum allows embedded videos in messages.
The admin can also allow logged-in users to mark the previewed message read with a CTRL+Right-Click or the previewed messages entire thread with a CTRL+Shift+Right-Click. When this setting is enabled, the admin can also enable a help message which will appear above the message preview to explain this feature. This feature will not work in the Opera browser and thus will not be shown to visitors using Opera.
The previews and the code to show the previews are all done through javascript, so there is no need to edit templates.
Todo:
- Use AJAX to update the new message flags.
- Add other options for previews. One possibility is a non-popup version which would display beneath each subject in the list page.
- Add further features as requested or as they pop into my head
Changelog:
Joe Curia (aka Azumandias)
Modules: l0Admin Mass Email00000000l000000Automatic Time Zones000ll.l00000Enhanced Custom Profiles0.00Google Calendar0000l.l000000Post Previews
000000000Admin Security Suite000000000000Check Modules for Upgrades0000External Authentication000000Group Auto-Email00000.00000Private Message Alerts
000000000Attachment Download Counter0000Custom Attachment Icons000ll.ll00Favorite Forums000000.00000Highlighted Search Terms0000Self-Delete Posts Option
000000000Attachment Watermarks0l00000000Custom Language Database00l.l.0Forum Lockdown00000.00000Ignore Forums0000000000000Threaded Tree View
000000000Automatic Message Pruning00.llll.00Easy Color Scheme Manager0l.l00Forum Subscriptions0000lll000Moderated User Group
Templates:lGeneric Integration000000000 0000Simple Rounded000000 00000000Tabbed Emerald
Edited 5 time(s). Last edit at 08/31/2016 09:21AM by Oliver Riesen-Mallmann.
Special thanks go to Maurice Makaay for his wonderful AJAX api.
Installation and Usage:
This module requires Phorum 5.2.8 or greater to use the AJAX api.
By default the post previews are shown in a 500px by 50px div with the background color set to the default alternate background color (seen in every other message on the list page). Also by default, the post is shown formatted as it would be on the read page. These defaults can be changed from the settings page.
The admin can also enable the option for users to disable the previews, which they would then do from the Control Center->Forum Settings page. When this setting is enabled, the admin can also enable a help message which will appear above the message preview to explain this feature. This feature will not work in the Opera browser and thus will not be shown to visitors using Opera.
One final option for the admin is to show a vertical scrollbar in the preview area. This option fixes a FireFox display bug when a video is embedded in a message. I would recommend only enabling this option if your forum allows embedded videos in messages.
The admin can also allow logged-in users to mark the previewed message read with a CTRL+Right-Click or the previewed messages entire thread with a CTRL+Shift+Right-Click. When this setting is enabled, the admin can also enable a help message which will appear above the message preview to explain this feature. This feature will not work in the Opera browser and thus will not be shown to visitors using Opera.
The previews and the code to show the previews are all done through javascript, so there is no need to edit templates.
Todo:
- Use AJAX to update the new message flags.
- Add other options for previews. One possibility is a non-popup version which would display beneath each subject in the list page.
- Add further features as requested or as they pop into my head
Changelog:
v5.2.1.07 Oliver Riesen-Mallmann <oliver@riesen.org> - Made XHTML 1.0 Transitional compliant. - Changed htmlspecialchars option from ENT_COMPAT to ENT_QUOTES. v5.2.1.06 Oliver Riesen (oliver@riesen.org) - Fixed PHP Notice, Undefined index: body. - German language files added. v5.2.1.05 - Enhancement: Added support for templates in the control center. Added Classic, Emerald, Lightweight, and Simple Rounded template support. - Enhancement: Added compatibility for embedded Phorum installations. v5.2.1.04 - Enhancement: Added the option to disable showing previews by default (only registered users who actively enable previews will see them). Thanks go to Phorum user Skye for suggesting this feature. - Bugfix: Added to option to display a vertical scrollbar in the preview area. Enabling this option fixes a FireFox display bug when a video is embedded in a message. Thanks go to Phorum user noe for pointing out the need for this fix. v5.2.1.03 - Enhancement: Added the ability for a logged-in user to mark the previewed message read with a CTRL+Right-click or the previewed message's entire thread with a CTRL+Shift+Right-click. A help message can be enabled to appear above the preview area and explain this feature. - Enhancement: Add the option to show an alert pop-up if an AJAX error occurs. This should only be used for debugging. - Enhancement: Message_id gathering now centralized in one function to avoid repeated code. - Bugfix: All Javascript functions are now properly named to avoid possible, if unlikely, collisions. v5.2.1.02 - Enhancement: Support added for the French language by Phorum user manuvb. - Bugfix: Post previews would not show for threads on the list page if cookies were disabled, requiring session ids to be added to the urls. Thanks go to Phorum user higphorum for reporting this bug. v5.2.1.01 - Bugfix: Sites with a dash in their address would fail to generate previews. Thanks go to Phorum user John Shallo for catching this bug. v5.2.1.00 - Initial release.
Joe Curia (aka Azumandias)
Modules: l0Admin Mass Email00000000l000000Automatic Time Zones000ll.l00000Enhanced Custom Profiles0.00Google Calendar0000l.l000000Post Previews
000000000Admin Security Suite000000000000Check Modules for Upgrades0000External Authentication000000Group Auto-Email00000.00000Private Message Alerts
000000000Attachment Download Counter0000Custom Attachment Icons000ll.ll00Favorite Forums000000.00000Highlighted Search Terms0000Self-Delete Posts Option
000000000Attachment Watermarks0l00000000Custom Language Database00l.l.0Forum Lockdown00000.00000Ignore Forums0000000000000Threaded Tree View
000000000Automatic Message Pruning00.llll.00Easy Color Scheme Manager0l.l00Forum Subscriptions0000lll000Moderated User Group
Templates:lGeneric Integration000000000 0000Simple Rounded000000 00000000Tabbed Emerald
Edited 5 time(s). Last edit at 08/31/2016 09:21AM by Oliver Riesen-Mallmann.
Re: Module: Post Previews October 17, 2008 10:35AM |
Admin Registered: 20 years ago Posts: 8,532 |
Quote
Special thanks go to Maurice Makaay for his wonderful AJAX api.
And special thanks to Azumandias for recognizing the potential! ;-) For future versions, a message handling API is planned. This API will also be made accessible using standard Ajax call implementations in include/ajax/*. By then, you could strip this module a bit by calling the core Ajax calls.
Good job!
Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Module: Post Previews October 22, 2008 10:47AM |
Registered: 15 years ago Posts: 10 |
Hi, I was excited to discover this Mod. I want to implement it on our forum, but my site Owner asked me if this will slow down the site at all? Some members have slow connections. Thanks for the Mod and all your help. (I lurk mostly and the answers here have been so great, I rarely need to ask anything.)
Re: Module: Post Previews October 22, 2008 11:25AM |
Registered: 17 years ago Posts: 1,301 |
This mod uses AJAX to display the post previews. Thus, until a user hovers over the link, no extra data is pulled onto the page. Further, the preview only displays after the full data has been retrieved. Thus, if the user's connection is slow the preview may take longer to load, but they can still simply click on the link and go to the message without waiting for the preview.
Finally, you can allow the users to disable post previews from their Control Center->Forum Settings page if they feel the previews are slowing down their personal experience, while still allowing the rest of your users to see the previews. (This, of course, only works for registered users).
Joe Curia (aka Azumandias)
Modules: l0Admin Mass Email00000000l000000Automatic Time Zones000ll.l00000Enhanced Custom Profiles0.00Google Calendar0000l.l000000Post Previews
000000000Admin Security Suite000000000000Check Modules for Upgrades0000External Authentication000000Group Auto-Email00000.00000Private Message Alerts
000000000Attachment Download Counter0000Custom Attachment Icons000ll.ll00Favorite Forums000000.00000Highlighted Search Terms0000Self-Delete Posts Option
000000000Attachment Watermarks0l00000000Custom Language Database00l.l.0Forum Lockdown00000.00000Ignore Forums0000000000000Threaded Tree View
000000000Automatic Message Pruning00.llll.00Easy Color Scheme Manager0l.l00Forum Subscriptions0000lll000Moderated User Group
Templates:lGeneric Integration000000000 0000Simple Rounded000000 00000000Tabbed Emerald
Finally, you can allow the users to disable post previews from their Control Center->Forum Settings page if they feel the previews are slowing down their personal experience, while still allowing the rest of your users to see the previews. (This, of course, only works for registered users).
Joe Curia (aka Azumandias)
Modules: l0Admin Mass Email00000000l000000Automatic Time Zones000ll.l00000Enhanced Custom Profiles0.00Google Calendar0000l.l000000Post Previews
000000000Admin Security Suite000000000000Check Modules for Upgrades0000External Authentication000000Group Auto-Email00000.00000Private Message Alerts
000000000Attachment Download Counter0000Custom Attachment Icons000ll.ll00Favorite Forums000000.00000Highlighted Search Terms0000Self-Delete Posts Option
000000000Attachment Watermarks0l00000000Custom Language Database00l.l.0Forum Lockdown00000.00000Ignore Forums0000000000000Threaded Tree View
000000000Automatic Message Pruning00.llll.00Easy Color Scheme Manager0l.l00Forum Subscriptions0000lll000Moderated User Group
Templates:lGeneric Integration000000000 0000Simple Rounded000000 00000000Tabbed Emerald
Re: Module: Post Previews October 22, 2008 11:33AM |
Registered: 15 years ago Posts: 10 |
Re: Module: Post Previews October 22, 2008 12:26PM |
Registered: 17 years ago Posts: 1,301 |
I think we all share that goal. To be clear though, unregistered users will also get the previews. Registered users are the only ones who can disable the previews if you allow it.Quote
ImpalaLove
It also gives us yet another reason to encourage users to register, which is one of our goals.
Joe Curia (aka Azumandias)
Modules: l0Admin Mass Email00000000l000000Automatic Time Zones000ll.l00000Enhanced Custom Profiles0.00Google Calendar0000l.l000000Post Previews
000000000Admin Security Suite000000000000Check Modules for Upgrades0000External Authentication000000Group Auto-Email00000.00000Private Message Alerts
000000000Attachment Download Counter0000Custom Attachment Icons000ll.ll00Favorite Forums000000.00000Highlighted Search Terms0000Self-Delete Posts Option
000000000Attachment Watermarks0l00000000Custom Language Database00l.l.0Forum Lockdown00000.00000Ignore Forums0000000000000Threaded Tree View
000000000Automatic Message Pruning00.llll.00Easy Color Scheme Manager0l.l00Forum Subscriptions0000lll000Moderated User Group
Templates:lGeneric Integration000000000 0000Simple Rounded000000 00000000Tabbed Emerald
Re: Module: Post Previews October 22, 2008 12:59PM |
Registered: 15 years ago Posts: 10 |
Yes, that part was clear. I'll be adding it into our FAQ, "If you are a registered user, you can..." Hopefully, people who like to customize their own settings will want to at least check out the different options. This feature plus the Search Phorum provides gives us an advantage over other forums in our little niche.
Re: Module: Post Previews October 31, 2008 03:09PM |
Registered: 21 years ago Posts: 687 |
I've just installed this on 5.2.9a but nothing seems to be happening. Does the AJAX API need to be turned on somewhere separately?
The module is enabled at [www.cantonese.sheik.co.uk] (excuse the colour scheme, still in the process of upgrading from 5.1 :-) )
Cheers,
/\dam
--
My notable Phorum sites:
Movie Deaths Database - "review comments" system mostly powered by Phorum
Learn Chinese! - integrated forum quiz
The module is enabled at [www.cantonese.sheik.co.uk] (excuse the colour scheme, still in the process of upgrading from 5.1 :-) )
Cheers,
/\dam
--
My notable Phorum sites:
Movie Deaths Database - "review comments" system mostly powered by Phorum
Learn Chinese! - integrated forum quiz
Re: Module: Post Previews October 31, 2008 03:19PM |
Registered: 17 years ago Posts: 1,301 |
In the header.js file for this mod, please edit this line:
This should send up an alert to let us know what is going wrong. (hmm, may need to add that to the settings page as a debug option...)
Joe Curia (aka Azumandias)
Modules: l0Admin Mass Email00000000l000000Automatic Time Zones000ll.l00000Enhanced Custom Profiles0.00Google Calendar0000l.l000000Post Previews
000000000Admin Security Suite000000000000Check Modules for Upgrades0000External Authentication000000Group Auto-Email00000.00000Private Message Alerts
000000000Attachment Download Counter0000Custom Attachment Icons000ll.ll00Favorite Forums000000.00000Highlighted Search Terms0000Self-Delete Posts Option
000000000Attachment Watermarks0l00000000Custom Language Database00l.l.0Forum Lockdown00000.00000Ignore Forums0000000000000Threaded Tree View
000000000Automatic Message Pruning00.llll.00Easy Color Scheme Manager0l.l00Forum Subscriptions0000lll000Moderated User Group
Templates:lGeneric Integration000000000 0000Simple Rounded000000 00000000Tabbed Emerald
"onFailure" : function (error) { showerror = false; if (showerror) alert("Error: " + error); }to read:
"onFailure" : function (error) { showerror = true; if (showerror) alert("Error: " + error); }
This should send up an alert to let us know what is going wrong. (hmm, may need to add that to the settings page as a debug option...)
Joe Curia (aka Azumandias)
Modules: l0Admin Mass Email00000000l000000Automatic Time Zones000ll.l00000Enhanced Custom Profiles0.00Google Calendar0000l.l000000Post Previews
000000000Admin Security Suite000000000000Check Modules for Upgrades0000External Authentication000000Group Auto-Email00000.00000Private Message Alerts
000000000Attachment Download Counter0000Custom Attachment Icons000ll.ll00Favorite Forums000000.00000Highlighted Search Terms0000Self-Delete Posts Option
000000000Attachment Watermarks0l00000000Custom Language Database00l.l.0Forum Lockdown00000.00000Ignore Forums0000000000000Threaded Tree View
000000000Automatic Message Pruning00.llll.00Easy Color Scheme Manager0l.l00Forum Subscriptions0000lll000Moderated User Group
Templates:lGeneric Integration000000000 0000Simple Rounded000000 00000000Tabbed Emerald
Re: Module: Post Previews October 31, 2008 03:25PM |
Admin Registered: 20 years ago Posts: 8,532 |
When I look at the traffic that is generated by the module (using Firebug under Firefox), I see the following response from the server:
The json PHP extension not be enabled on the server, causing the json_encode() and json_decode() functions to be missing out. I thought I had taken care of that in the json API code, but it looks like something is going wrong in there. We need some debugging here.
Please open include/api/json.php. In that file, you should see the following code:
What I'm suspecting, is that $PHORUM is not in global scope here, causing the json extension detection to get lost in the rest of the API code. Try changing this code to:
See if that makes the interface work. If it does, then I'll update the core code to represent this change.
Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
<b>Fatal error</b>: Call to undefined function: json_decode() in <b>/usr/local/home/httpd/vhtdocs/cantonese /phorum/include/api/json.php</b> on line <b>62</b><br />
The json PHP extension not be enabled on the server, causing the json_encode() and json_decode() functions to be missing out. I thought I had taken care of that in the json API code, but it looks like something is going wrong in there. We need some debugging here.
Please open include/api/json.php. In that file, you should see the following code:
if (!function_exists('json_encode')) { require_once('./include/api/json-pear.php'); $PHORUM['API']['PEARJSON'] = new Services_JSON(); }
What I'm suspecting, is that $PHORUM is not in global scope here, causing the json extension detection to get lost in the rest of the API code. Try changing this code to:
if (!function_exists('json_encode')) {
require_once('./include/api/json-pear.php');
$GLOBALS['PHORUM']['API']['PEARJSON'] = new Services_JSON();
}
See if that makes the interface work. If it does, then I'll update the core code to represent this change.
Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Sorry, only registered users may post in this forum.