--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Extras for the Professional Theme under 1.3.11 Geeklog.
By Jon Almada (GL username on Geeklog.net is "jalmada')
Date: 1/26/2006
Version: 1.0
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
WARNING!
You are responsible for your installation, make sure that you backup your configuration and that you understand exactly what you are doing when you edit GL files and begin changing things around. There are consequences for changing configurations! Be warned! ALWAYS BACKUP YOUR SITE BEFORE EDITING!
Title:
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Finishing the job with rich-text edits for Geeklog 1.3.11 Professional Theme.
The downloadable theme codes that enable rich-text scripting are very nice, but there are a couple of points to point out with regard to making this truly a complete and usuable installation for real-world installations.
For one, there are two additional modifications that make this script shine. Before you modify either script, please back them up with extra copies, in case you have a problem.
Modification one involves the storyeditor.thtml file located under layout/professional/admin/story. The single textarea modification given with the hacked code is not complete. The existing hacks that have been uploaded only show a single box for the richtext editor, and the fix is really quite simple to make both the introtext and bodytext panels properly function as one would expect.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Edit /layout/professional/admin/story/storyeditor.thtml as follows at line 147 (Replace code as needed):
{lang_introtext}: |
|
{lang_bodytext}: |
|
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Editing the config.php file
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Next, the config.php file for GL needs some additional HTML tags entered or altered to allow the functionality of the HTML that is generated by the script to work with GL. I am quite certain that there will be active disagreement over the allowed tags or placement of one tag for users and another for admins - To this end, I encourage discussion so that group wisdom and inputs prevail. Please comment to the threads so that all will benefit from this. My aim was only to extend the functionality and remove the mystery of how to properly finish the job with the rich-text editing with GL. I created a matrix of the existing buttons and systematically worked to view the code against the buttons and then extended the array declarations for allowed HTML to match. It may not be complete, but this really is a good start and does provide a workable model to start from.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Edit the config.php file at line #631
/* This is a list of HTML tags that users are allowed to use in their posts.
* Each tag can have a list of allowed attributes (see 'a' for an example).
* Any attributes not listed will be filtered, i.e. removed.
*/
$_CONF['user_html'] = array (
'p' => array(),
'b' => array(),
'strong' => array(),
'i' => array(),
'a' => array('href' => 1, 'title' => 1),
'em' => array(),
'br' => array(),
'tt' => array(),
'hr' => array(),
'li' => array(),
'ol' => array(),
'ul' => array(),
'code' => array(),
'pre' => array(),
'div' => array('style' => 1),
'font' => array('size' => 1),
'ol' => array(),
'ul' => array(),
'li' => array(),
'h1' => array(),
'h2' => array(),
'h3' => array(),
'h4' => array(),
'h5' => array(),
'h6' => array(),
'address' => array(),
'pre' => array(),
'hr' => array('style' => 1)
);
/* This is a list of HTML tags that Admins (site admin and story admins) can
* use in their posts. It will be merged with the above list of user-allowable
* tags ($_CONF['user_html']). You can also add tags that have already been
* listed for the user-allowed HTML, so as to allow admins to use more
* attributes (see 'p' for an example).
*/
$_CONF['admin_html'] = array (
'p' => array('class' => 1, 'id' => 1, 'align' => 1),
'div' => array('class' => 1, 'id' => 1),
'span' => array('style' => 1, 'style' => 1, 'class' => 1, 'id' => 1),
'table' => array('class' => 1, 'id' => 1, 'width' => 1, 'border' => 1,
'cellspacing' => 1, 'cellpadding' => 1),
'tbody' => array(),
'img' => array('src' => 1),
'tr' => array('class' => 1, 'id' => 1, 'align' => 1, 'valign' => 1),
'th' => array('class' => 1, 'id' => 1, 'align' => 1, 'valign' => 1,
'colspan' => 1, 'rowspan' => 1),
'td' => array('class' => 1, 'id' => 1, 'align' => 1, 'valign' => 1,
'colspan' => 1, 'rowspan' => 1)
);
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
That's it! Try it out and adjust as you see fit. Enjoy!
Jon