Firefox PHP

Module: Threaded Tree View

Posted by Joe Curia 
Module: Threaded Tree View
December 20, 2008 04:16PM
This module displays the threaded list view with tree lines similar to those used in Phorum 3.

This module was originally created by Brian Moon. I have updated it for Phorum 5.2 and used <div>'s to draw the lines rather than images.

Installation and Usage:
This module installs like any other module.

From the settings page you can customize the color and thickness of the tree lines. Each template can have its own line color and thickness which will be displayed if you leave the settings empty.

If you have a custom template and want to use this module, you will need to create a folder in this modules's template folder and copy your template's list_threads.tpl and read_threads.tpl files into that folder. Using the supported templates as examples add the necessary lines to the template files. Those lines can be found in the supported templates after this line:
<!--  Begin the Threaded Tree View customization  -->
Depending on the Phorum template you use as a base, I would suggest starting with that template's code. Regardless, you may need to adjust the margins and height values.

You will also need to create a settings.php file in your template's folder. I would again suggest copying this file frocm one of the supported templates. You will then need to adjust the line height and width. If your template requires further tweaking (such as for messages with a special icon which changes the height of their row) you can add php code to the four alloted modifier variables in the settings.php file. Examples of this can be seen in the Classic and Emerald templates. It is important to note that if you do not use one of the modifier variables, it should still be supplied simply with an empty string.

The Classic, Emerald, and Lightweight templates are supported without any extra work on your part.

Todo:
- Add support for more templates

- Add features as requested.


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


Attachments:
open | download - treeview_v5_2_1_00.zip (21.2 KB)
Re: Module: Threaded Tree View
December 21, 2008 04:35PM
great module.
didn't check it out yet as I'm working with the older version on 5.1 but does it work correctly with moderator options enabled too, lines stretching and the like?


Thomas Seifert
Phorum Development Team / Mysnip-Solutions.de
Custom Phorum and general software development
worry-free Phorum Hosting
Re: Module: Threaded Tree View
December 21, 2008 07:47PM
It is close :-) In Emerald and Classic it isn't really a problem. The only place I really had a problem was in Lightweight on the first post in a thread. There the line starts a little lower, but I don't know that it is that bad. I've attached screenshots of each as an Admin. I have also placed a number of customizable variables in the settings.php file for each template which may be used to attemp to alleviate the problem. I may go back and try to tackle the Lightweight template again if requested.


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: Threaded Tree View
December 23, 2008 12:14AM
fantastic!

I tried to make it work with my own template (posted it on templates section), copied snippet as required but i get this error message:

Warning: filemtime() [function.filemtime]: stat failed for ./mods/treeview/templates/eastlink/read_threads.tpl in /home/eastlink/public_html/foro/include/templates.php on line 130

Fatal error: phorum_get_file_contents: file "./mods/treeview/templates/eastlink/read_threads.tpl" does not exist in /home/eastlink/public_html/foro/include/templates.php on line 741

Any ideas?

thanks!
Re: Module: Threaded Tree View
December 23, 2008 01:33AM
Did you copy your template files into the /mods/treeview/templates/eastlink folder or simply edit them in the /templates/eastlink folder? You need to copy your read_threads.tpl and list_threads.tpl files into the the module's templates folder and edit them there.


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: Threaded Tree View
December 23, 2008 11:27AM
yes I copied the templates in the right folder, get this error when i turn on the module.
Re: Module: Threaded Tree View
December 23, 2008 02:18PM
I'm not sure what to tell you. Those errors indicate that the read_threads.tpl file does not exist in the /mods/treeview/templates/eastlink folder.

On my test forum, if the file is missing, I get the same error. However, with both files in place it works fine. I have done the customizations needed for the template and have uploaded them here. Please unzip and place the attached eastlink folder into the mods/treeview/templates folder and let me know if that works for you.

I have removed the bullet icons as you requested and it uses a thin line which is the same color as the border color. You can change the color of the line either in the template's settings.php file or from the settings page of the module.

If everything looks good, I will add the eastlink folder to the module for default support. If you think anything needs changing, please let me know so I can change it on my end and add the eastlink folder to the module for default support when you have finished tweaking it.

EDIT: attached template removed and added to the module download above.


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 1 time(s). Last edit at 12/23/2008 06:17PM by Joe Curia.


Re: Module: Threaded Tree View
December 23, 2008 05:06PM
double checked and i had templates there.
I uploaded yours and work great. Only problem is when you have a superlong subject that breaks in two lines, there is a little break. I guess there is no way to avoid it, and I could live with it as it is not a big issue

thanks!!


Re: Module: Threaded Tree View
December 23, 2008 06:13PM
It's all about logic. My module allows for some great customization, but the logic can be difficult. In this case we need to determine at which subject length, smaller for each indent, the subject will wrap, then increase the margin and height of the vertical line. The other issue with this is that the font used is not monospaced, thus an l or ' will take up less space than a c or d. So the logic would need to determine the string length of the subject, then increment this by any wide characters (w, m) and reduce it by any slim characters (l, '). Then increment this length by the number of indents and compare it against the preset width for subject wrapping. If the logic indicates the subject will wrap, then the vertical line needs to change.

Further at issue is the fact that previous wraps may cause the current row to need to extend its vertical line.

As long as you can live with it for now, I will throw this into the back of my head and let it stew for a while. You will be the first to know when a final solution is cooked up.


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: Threaded Tree View
December 23, 2008 06:16PM
I know, I am aware of many variables here, and this template is fixed width, so really long threads with many responses (many in my forum have +100 replies) make this even more unpredictable. But don´t worry about it, i consider it expected behaviour in the same way a two lines subject doubles the row size and nobody should complain.

thanks again for this fantastic mod
Sorry, only registered users may post in this forum.

Click here to login