glFusion Wiki

Site Tools


glfusion:development130notes

glFusion v1.3.0 Development Notes

This page is meant to provide a general overview of the work that has been completed to date. It is not a full list of every single change, instead a summary of the major changes or fixes.

This is a work-in-progress document - at times it may not be completely up-to-date or complete in descriptions.

glFusion v1.3.0 is not done, we are still working on more features and overall improvements.

New Features / Enhancements

New Session Handler

glFusion has implemented a new session handler that improves performance and also improves security of the site. Each user is assigned a unique session which is maintained while they browse the site. The changes are invisible to the standard user and really only of interest to plugin developers. Plugin developers can now use session variables to maintain information between page loads.

  • SESS_setVar()
  • SESS_getVar()
  • SESS_isSet()
  • SESS_unSet()

New Email Notification

glFusion has always sent one email per recipient when doing notifications. This can be very inefficient when there is a large number of recipients. We have created a new email notification API that will queue up to 10 recipients per email. This should be a little more efficient on the email server and also be within the limits of most hosting providers.

NOTE

We understand that adding subscription capabilities will grow the volume of outbound email. This could cause a problem for some hosting providers. We will look at a queuing system where you can throttle the number of emails sent per hour. It is a little lower on the priority list at the moment, but it is there.

COM_emailNotification Use

function COM_emailNotification( $msgData = array() )

COM_emailNotification() will combine upto 10 address per send.

$msgData should contain the following items:

Name Description Required
htmlmessage HTML formatted email message Must have either HTML or Text or both
textmessage Text formatted email message Must have either HTML or Text or both
subject Subject of email message X
embeddedImage An array of embedded images
from An array of from name / email X
to An array of to address X

embeddedImage is an array of images to be included in the message. Each image array must contain the following elements:

Name Description
file Full path (including filename) to the image
name Content ID of the image. Used to identify the id for accessing the image in an HTML form.
filename Filename only of the image
encoding Image encoding (always base64)
mime mime type of image (i.e.; image/jpeg)

Plugin What's New Changes

The API for returning items to the What's New block has been modified. The plugin_whatsnewsupported_{pi_name}() has been depreciated. Plugins should remove their plugin_whatsnewsupported_{pi_name} function.

The plugin_getwhatsnew_{piname}() function has been expanded so it will now return an array of the newheadlines, newbylines, and newcontent.

Return array Description
newheadlines Headline text. For example, 'DokuWiki'
newbylines Byline Text. For example, 'last 14 days'
newcontent An array of new content. For example, array('<a href=“dokuwki”>Item1</a>','<a hread=“dokuwiki”>Item2</a>)

Consistent Administrative Interface

Each bundled plugin has been updated to present a consistent administrative screen. Each admin screen will now have the standard admin menu at the top.

Forum Plugin Enhancements

Much of the forum plugin has been rewritten from scratch. Most of the code changes are invisible to the user, but result in an overall speed improvement. Specific areas that have been enhanced are:

  • File attachments now report an error when the attachment could not be uploaded
  • New posts, replies, and post edits now display the action being performed above the edit window.

The Media Gallery code has been optimized to provide a small performance improvement. Many of the Media Gallery templates are now being organized in a more intuitive manner. Administrative templates are now stored in the template/admin/ directory.

Media Gallery's submission queue is now directly integrated into the core glFusion submission queue.

Subscription System

glFusion v1.3.0 implements a core subscription system that can be utilized by plugins. Now, under the My Account settings there is a new tab labeled 'Subscriptions'. This one place allows the user to manage all of their subscriptions.

Both the Forum and Media Gallery plugins have implemented the new subscription system.

Forum Subscriptions

The Forum subscription user interface has not changed, but behind the scenes it is now using the glFusion subscription system.

Media Gallery Subscriptions

User's can now subscribe to an album so they are alerted whenever a new upload is made to that album.

Comment Subscriptions

User's can now subscribe to any comment thread and be notified via email when a new comment is entered.

New Plugin APIs for Subscription Services

(glfusion v1.3.0)

bool PLG_subscribe(string $type,string $category, string $id, int $uid = 0, string $cat_desc='', string $id_desc='')

This function will subscribe a user to a notification feed for an item.

Parameters

string $type plugin name or comment
string $category category type (i.e.; for comment it would contain filemgmt, article, etc.)
string $id item id to subscribe to (i.e.; article sid, mg album)
int $uid user to subscribe
string $cat_desc Text description of category i.e.; forum cat title
string $id_desc Text description of id, i.e.; article title

Return

Boolean true or false to note the success of the subscribe request.

bool PLG_unsubscribe(string $type, string $category, int $id,$uid = 0)

Unsubscribe user to notification feed for an item

Params

string $type plugin name or comment
string $category category type (i.e.; for comment it would contain filemgmt, article, etc.)
string $id item id to subscribe to (i.e.; article sid, mg album)
int $uid user to subscribe
bool PLG_isSubscribed( string $type, string $category, string $id, int $uid = 0 )

Check if user is subscribed

Params

string $id item id to subscribe to (i.e.; article sid, mg album)
string $type plugin name or comment
int $uid user to subscribe
bool PLG_sendSubscriptionNotification(string $type, string $category, string $track_id, string $post_id, int $post_uid)

Send new item notification emails

Params

string $type plugin name or comment
string $category category type (i.e.; for comment it would contain filemgmt, article, etc.)
string $track_id id of item being tracked
string $post_id id of new item posted (i.e.; comment id, media_id, etc.)
int $post_uid user who posted item

Notes

This function requires that the plugin has defined plugin_subscription_email_format_{piname}(). This function will format the email message body.

plugin_subscription_email_format_{piname}() is called with the following parameters:

string $category category type (i.e.; for comment it would contain filemgmt, article, etc.)
string $track_id id of item being tracked
string $post_id id of new item posted (i.e.; comment id, media_id, etc.)
int $post_uid user who posted item

It must return array of the following items:

$htmlmsg HTML formatted email body
$textmsg Text formatted email body
$imageData An imagedata array for any embedded images

Facebook Login

User's can now log into a glFusion powered site by using their Facebook login credentials.

NOTE

There is more work planned for the authentication system. Moving to OAuth v2 will probably happen before the glFusion v1.3.0 release

Autotag System

glFusion now includes all the functionality of the Autotags Plugin. This allows a site admin to create their own custom autotags. Also, you can now upload new autotags to your site using the new Autotag system. For example, if someone develops a cool autotag for their site, they can bundle up the source files and submit them to glFusion.org where others then download and easily upload it to their site.

Autotag Permissions

You can now select where an autotag can be used. For example, if would not make much sense to use the [showblock] autotag in a comment. You can now select where autotags are allowed.

Slashes

A problem that has plagued glFusion (and it's predecessor Geeklog) is how backslashes (\) where handled. Due to poor coding, or a complete misunderstanding on how PHP and MySQL handle backslashes, there were many areas in glFusion where backslashes were improperly removed. These issues no longer exist. The entire glFusion source tree has been cleansed of all the errant stripslashes() calls.

Date / Time Localization

glFusion previously relied on the web server's locale settings to format dates / times. This caused several issues for our international users. glFusion now completely controls how dates and times are displayed so they should display properly regardless of the web server's settings.

NOTE

There are new strings in the language file to define the weekday names (both full and abbreviated) and month names. Translators are needed to translate these new strings.

Code Optimizations

There have been several tweaks to the code base to improve performance and to reduce the number of SQL queries.

  • Pull complete user preferences in lib-sessions into the $_USER array
  • Initialize the $_PLUGIN variable in lib-common - this prevents an extra SQL query to determine if BB2 is installed
  • Use Location:$url in COM_refresh() - this provides a much better refresh experience.
  • Removed some unneeded file_exists() calls to reduce file system hits

Static Pages Update

A request we hear very often is how to shorten the static pages URL. With glFusion v1.3.0, we've renamed the static pages plugin to page. We didn't change the directory structure, instead, we simply created a new page.php file in the web root that will now display static pages.

In the past, a static page URL would look like this:

http://www.glfusion.org/staticpages/index.php/20100215003900439

With glFusion v1.3.0, the same URL will look like this:

http://ww.glfusion.org/page.php/20100215003900439

Much cleaner. We understand that search engines and other folks may have already bookmarked or cached your existing static pages, so to ensure that nothing breaks, the original URL will send a HTTP 301 Moved Permanently header and then redirect automatically to the new URL. This will allow existing search engine links to continue to work and make sure you don't loose any SEO points with the new URL.

Improved Upgrade / Version Checker

The upgrade / version checker has been re-written to provide information on both the glFusion CMS version status and all installed plugins too. The new upgrade checker does the following:

  • no longer goes to a glFusion.org page
  • reads a XML file from glfusion.org with the version data
  • checks the core glFusion CMS version to determine if an update is available
  • checks all installed plugins for updates (if the data is available)

There is also a hook to the main Command & Control page to check for updates, if there are updates available, it will display a message informing the admin to use the Upgrade Checker for a list of available updates.

There are 2 new configuration options:

  • update_check_interval - how often to automatically check for new updates (when on the C&C main page)
  • send_site_data - if enabled, the site URL will be passed during the update checker and logged on the glFusion.org site. This allows the glFusion team to get a better handle on how many glFusion sites are out there. Obviously, you can opt out by setting this to false and no data is passed or saved on glFusion.org.

Comment Enhancements

Comments now display the item being commented on.

I've reworked the comment entry / view code some more and I think it looks pretty good. Please test it out and let me know your opinions.

Here is a list of the comment specific changes:

  • consolidated commentform.thtml and commentform_advanced.thtml - no longer need advanced.
  • added new comment mode type of 'nobar' used when entering comments
  • removed 'threaded' comment mode
  • plugins must support the following functions
    • plugin_savecomment_
    • plugin_deletecomment_
    • plugin_displaycomment_
    • plugin_getcommenturlid_

You can now subscribe to comments for an item. You now see the item you are commenting on

Added new comment type that plugins will need to understand 'nobar'. If the plugin checks the valid modes, it will need to remove threaded and add nobar (Media Gallery does this check).

If your plugin doesn't support all the comment APIs listed above, the actual content being commented on may not be displayed.

Rating

Modified the rating system to use a generic set of classes. If you need to override a style, then wrap the rating block in a <div class=“yourclasshere”> </div> and override the style using div.stylename (see FileMgmt style.css as an example).

Output Class

I implemented the output.class.php that we have in the trunk/ branch. Specifically to use the addStyle() and addScript() features. I made a change to the htmlheader.thtml and header.thtml so we can now pass additional <style> and <script> options at any time. For example, in Media Gallery I need to pass album specific CSS for the image borders. Now I do the following:

  $nCSS = $nFrame->getCSS();
  if ( $nCSS != '' ) {
      $outputHandle = outputHandler::getInstance();
      $outputHandle->addStyle($nCSS);
  }

Menu Builder

The Menu Builder code has been significantly updated to be more efficient and to provide more control over the look / feel of the menus.

A quick summary of the changes are:

  • More efficient code
  • Improved CSS configuration and overrides
  • Improved per menu styling
  • Many bug fixes
  • Full support for the last class feature
  • Per theme styles

Development Info

  /*
   * 0 = true = top level attribute  false = child attribute
   * 1 = horizontal cascading
   * 2 = horizontal simple
   * 3 = vertical cascading
   * 4 = vertical simple
   * 5 = uses color picker
  */

Per Theme Styles

Previously, Menu Builder had hard coded styles (in lib-common.php) for the menus. Now, each theme can define their own set of styles if they do not wish to use the glFusion defaults.

For a theme to define it's own styles, add the following to the theme's functions.php

  $menuStyles = array(
      'horizontal_cascading'  => array('ulclass' => 'menu-horizontal-cascading',
                                       'liclass' => '',
                                       'parentclass' => 'parent',
                                       'lastclass' => '',
                                       'selected' => ''),
      'horizontal_simple'     => array('ulclass' => 'menu-horizontal-simple',
                                       'liclass' => '',
                                       'parentclass' => '',
                                       'lastclass' => '',
                                       'selected' => ''),
      'vertical_cascading'    => array('ulclass' => 'menu-vertical-cascading',
                                       'liclass' => '',
                                       'parentclass' => 'parent',
                                       'lastclass' => '',
                                       'selected' => ''),
      'vertical_simple'       => array('ulclass' => 'menu-vertical-simple',
                                       'liclass' => '',
                                       'parentclass' => '',
                                       'lastclass' => '',
                                       'selected' => '')
  );

This sets the styles that will be used by the menu generator. If the styles are not defined, Menu Builder will revert to the default values shown above.

glFusion builds each menu with the following structure:

  <div class="menu_MENUNAME">
    <ul class="menu-horizontal-cascading">
      <li>...</li>
    </ul>
  </ul>

Where MENUNAME is replaced by the name of the menu (not the ID).

Menu Builder now allows you to control many more menu attributes, but it is possible that the online menu configuration settings are not enough. If you need to, you can override any menu CSS class by adding the following to your public_html/layout/themename/custom.css:

.menu_MENUNAME .menu-horizontal-cascading ul li {
    override stuff here
}

Here is a real world example…

The actual height of the horizontal cascading menu is set in the style.css to use auto:

  .menu-horizontal-cascading {
     width:100%;
     height:auto;
     z-index:500;
     background:#151515 url(images/menu/menu_bg.gif) repeat;
 }

There height: style is not one of the options you can override via the Menu Builder interface. If your specific needs are to have a hard coded height, enter the following into the custom.css:

  .menu_MENUNAME .menu-horizontal-cascading {
      height: 37px;
  } 

This wil override just the one menu style for that specific menu.

Theme Style Changes

Speaking of themes - you can now override the class names for the layout styles as well by adding the following to the theme's functions.php:

  $uiStyles = array(
      'full_content'          => array('left_class' => '',
                                       'content_class' => 'content-full',
                                       'right_class' => ''),
      'left_content'          => array('left_class' => '',
                                       'content_class' => 'content-wide-left',
                                       'right_class' => ''),
      'left_content_right'    => array('left_class' => '',
                                       'content_class' => 'content',
                                       'right_class' => ''),
      'content_right'         => array('left_class' => '',
                                       'content_class' => 'content-wide-right',
                                       'right_class'  => '')
  );

In the past we typically duplicated the COM_siteHeader() and COM_siteFooter() code in the theme's functions.php if we wanted to use different class names. Now, the standard COM_siteHeader / COM_siteFooter will use this array (if defined, otherwise it uses the same hard coded values as always). This cuts down on the code needed in functions.php and allows us to not worry about any code changes getting ported to a theme's custom code.

Themes and Javascript

Many of the changes to the menu and style handling were made to better support the theming effort and to facilitate changing Javascript libraries. I have started creating a 'clean' theme that looks pretty much like Nouveau, but it does not consolidate any styles, uses more descriptive class and id names (no gl_ this or that) and attempts to do away with as many tables as possible. It is still very much work in progress. Part of this exercise is to move as much of the hard coded stuff out of the PHP code and handle it in the templates. I was amazed at just how much hard coded things we have hiding in there.

I've also created a jQuery plugin that duplicates most of the functionality that we have in MooTools. My thought is that v1.3.0 will be a transition release where our users can start to move away from MooTools and be better prepared for the next v2.0 release where it is all jQuery. I have the following items working (using much of Mark's efforts from trunk/):

  • menu animations
  • menu builder Ajax
  • image menu (moo image menu)
  • slider (mooslide)
  • rating
  • Media Gallery slide shows
  • Media Gallery SWF upload
  • tool tips
  • lightbox

Still need to work on a few other things like calendar popup, form validation, and a few minor media gallery items.

What it has proven is that we can actually completely disable MooTools now by providing a theme that supports the jQuery items. I've already coded the hooks to disable MooTools via a theme.

Bug Fixes

There have been several bug fixes implemented as well…

  • Uploads would crash if unable to determine mime type of uploaded file
  • 'All but Homepage' block setting did not display properly when topic was not empty
  • Calendar plugin would loose all entered data when an error was detected on entered information
  • Requesting a new verification email did not work properly

Template Changes

One of the goals of glFusion v1.3.0 is to consolidate as many template files as possible to make the task of theming much easier. We've also had to add some templates as well to support new features. Below is a summary of the template changes.

New Templates

Autotag System

  • nouveau/admin/autotag
  • nouveau/admin/autotag/autotag.thtml
  • nouveau/admin/autotag/autotag_upload_confirm.thtml
  • nouveau/admin/autotag/autotag_upload_form.thtml

Logo Administration

  • nouveau/admin/logo
  • nouveau/admin/logo/logo.thtml

Menu Builder Administrative Interface

  • nouveau/admin/menu
  • nouveau/admin/menu/clonemenu.thtml
  • nouveau/admin/menu/createelement.thtml
  • nouveau/admin/menu/createmenu.thtml
  • nouveau/admin/menu/editelement.thtml
  • nouveau/admin/menu/editmenu.thtml
  • nouveau/admin/menu/menuconfig.thtml
  • nouveau/admin/menu/menulist.thtml
  • nouveau/admin/menu/menutree.thtml
  • nouveau/admin/menu/mooRainbow.css

Menu Builder Menu Templates

  • nouveau/menu
  • nouveau/menu/animate.thtml
  • nouveau/menu/custom
  • nouveau/menu/custom/index.html
  • nouveau/menu/horizontal-cascading.thtml
  • nouveau/menu/horizontal-simple.thtml
  • nouveau/menu/index.html
  • nouveau/menu/vertical-cascading.thtml
  • nouveau/menu/vertical-simple.thtml

New Images

  • nouveau/images/delete.png
  • nouveau/images/down.png
  • nouveau/images/icons/autotag.png
  • nouveau/images/icons/logo.png
  • nouveau/images/icons/menubuilder.png
  • nouveau/images/moor_arrows.gif
  • nouveau/images/moor_boverlay.png
  • nouveau/images/moor_cursor.gif
  • nouveau/images/moor_woverlay.png
  • nouveau/images/rainbow.png
  • nouveau/images/up.png

Removed Templates

Bad Behavior2 Plugin

  • private/plugins/bad_behavior2/templates/logitem.thtml
    • consolidated into log.thtml

Forum Plugin

  • private/plugins/forum/templates/admin/board_categories.thtml
  • private/plugins/forum/templates/admin/board_forums.thtml
  • private/plugins/forum/templates/admin/rating_board_categories.thtml
  • private/plugins/forum/templates/admin/rating_board_forums.thtml
  • private/plugins/forum/templates/admin/rating_bottom.thtml
  • private/plugins/forum/templates/blockfooter.thtml
  • private/plugins/forum/templates/blockheader.thtml
  • private/plugins/forum/templates/blocks/centerblock_displayline.thtml
  • private/plugins/forum/templates/categorylisting.thtml
  • private/plugins/forum/templates/forum_outline_footer.thtml
  • private/plugins/forum/templates/forum_outline_header.thtml
  • private/plugins/forum/templates/forumlisting_record.thtml
  • private/plugins/forum/templates/links
  • private/plugins/forum/templates/post_topic_navbar.thtml
  • private/plugins/forum/templates/reports/blank.thtml
  • private/plugins/forum/templates/reports/email.thtml
  • private/plugins/forum/templates/reports/lastposts.thtml
  • private/plugins/forum/templates/reports/memberlist.thtml
  • private/plugins/forum/templates/reports/memberlist_line.thtml
  • private/plugins/forum/templates/reports/memberlist_link.thtml
  • private/plugins/forum/templates/reports/notifications_line.thtml
  • private/plugins/forum/templates/reports/pm.thtml
  • private/plugins/forum/templates/reports/report_record.thtml
  • private/plugins/forum/templates/reports/report_results.thtml
  • private/plugins/forum/templates/reports/website.thtml
  • private/plugins/forum/templates/singlecategorylisting.thtml
  • private/plugins/forum/templates/submissionform_anontop.thtml
  • private/plugins/forum/templates/submissionform_code.thtml
  • private/plugins/forum/templates/submissionform_main.thtml
  • private/plugins/forum/templates/submissionform_main_advanced.thtml
  • private/plugins/forum/templates/submissionform_membertop.thtml
  • private/plugins/forum/templates/submissionform_moods.thtml
  • private/plugins/forum/templates/topic.thtml
  • private/plugins/forum/templates/topic_navbar.thtml
  • private/plugins/forum/templates/topicfooter.thtml
  • private/plugins/forum/templates/topicfooter_preview.thtml
  • private/plugins/forum/templates/topiclist_record.thtml
  • private/plugins/forum/templates/topicpreview_footer.thtml
  • private/plugins/forum/templates/topicpreview_header.thtml
  • private/plugins/forum/templates/userprefs/navbar.thtml.delete
  • private/plugins/forum/templates/userprefs/user_settings.thtml
glfusion/development130notes.txt · Last modified: 2017/04/12 21:09 (external edit)

Page Tools