(see below for a list of theme changes in recent Geeklog versions)

# Creating a Theme for Geeklog

Creating a theme for Geeklog is easy and quite fast. If you can manipulate HTML files then you can create a theme! There's no need to learn PHP.

## Creating a theme

First, copy an existing theme that is most similar to what you want to implement (if one exists). If what you will do is radically different (and we hope so!) then copying any one will do. Copy the existing theme to the name you want your theme to have (please, no spaces in the theme name):

`cp -R /path/to/geeklog/public_html/layout/professional /path/to/geeklog/public_html/layout/My_Theme_Name_No_Spaces`

Change into your new theme directory:

`cd /path/to/geeklog/public_html/layout/My_Theme_Name_No_Spaces`

Now edit the templates to suit your needs. Keep in mind that templates, generally are partial HTML files. The directory you just created holds ALL templates Geeklog needs but you will only need to modify a small few to make a huge impact on the look.

In particular these are the templates you will undoubtedly want to change:

- header.thtml
- footer.thtml
- blockheader.thtml
- blockfooter.thtml
- storytext.thtml
- storybodytext.thtml
- featuredstorytext.thtml
- featuredstorybodytext.thtml
- archivestorytext.thtml
- archivestorybodytext.thtml
- style.css

### How themes work

When rendering a theme, Geeklog starts with `header.thtml` which builds the site's header and then goes on to include the left column of blocks (look for the variable {left_blocks} and the `leftblocks.thtml` file). The middle part of a site consists of the stories which are built using the `storytext.thtml` and `storybodytext.thtml` (for normal stories) and `featuredstorytext.thtml` and `featuredstorybodytext.thtml` (for featured stories) template files. The `footer.thtml` file then builds the right column of blocks (variable {right_blocks}, file `right_blocks.thtml`) and the site's footer. Blocks themselves consist of the `blockheader.thtml` and `blockfooter.thtml` files.

The above only describes how Geeklog's main page and stories are rendered. More templates exist for the various editors and lists you will see in Geeklog, as well as for the calendar and almost every other part of Geeklog.

There is currently no complete list available that explains which template file is used for which part of Geeklog. However, in most cases the use should be obvious when you have a look at the file and directory names in your theme's layout directory. If you're unsure which template file is used to render a certain part of Geeklog, have a look at the URL. You will notice the name of a PHP file there, e.g. the `users.php` file when you view a user's profile. Open that file and search for '`.thtml`'. For the profile you will find these lines (in `function userprofile()`):

    $user_templates = new Template ($_CONF['path_layout'] . 'users');
    $user_templates->set_file (array ('profile'=>'profile.thtml', 'row'=>'commentrow.thtml', 'strow'=>'storyrow.thtml'));

You don't need to understand PHP code to see that this uses the template files `profile.thtml`, `commentrow.thtml`, and `storyrow.thtml`. The first line also indicates that these are taken from the `users` directory within the theme's layout directory.

An incomplete list of variables that can be used in templates files is also included.

### Testing a theme and further information

After you have edited your themes, you are now ready to test it out. Simply go to http://mygeeklogsite/usersettings.php?mode=preferences - in the theme drop-down select your newly created theme (note the name of your theme is the same name as the directory for your theme).

Finally, you may want to update the logo and other images in your theme's images directory.

For the template system we are using PHPLib's template class (http://phplib.sourceforge.net/). Read their documentation and, optionally, look at /path/to/geeklog/system/classes/template.class.php to see how it is implemented. Even with this knowledge it may not be clear which templates are used in conjunction with one another (i.e. `storytext.thtml` and `storybodytext.thtml` together make up the complete format of a single story). If you have questions join our mailing list at http://lists.geeklog.net/listinfo/geeklog-users or check us out in IRC at irc.freenode.net in #geeklog.

### Tips and tricks

Themes and WYSIWYG editors: The template files used by Geeklog are not complete HTML files - they contain only parts of the HTML that Geeklog puts together to build a proper HTML document. This, however, seems to confuse some WYSIWYG HTML editors and some of them tend to add the HTML which they think is missing from the file, thus making it unusable for Geeklog.
We suggest you use a simple text editor to edit your themes.

PHP in themes: You can use PHP in the header of a theme, i.e. in the `header.thtml` file. If you want to use custom PHP functions, you can put them in the file `functions.php` within your themes directory.

Different look for left and right blocks: You can give the blocks on the left and right a different look. See this story on the Geeklog homepage for details.

Polls: To use multi-colored bars in the graphical display of poll results, you can use the `{answer_counter}` and `{answer_odd}` variables in the `pollbooth/pollvotes_bar.thtml` template file. `{answer_counter}` will be replaced with a running number for each answer, hence `bar{answer_counter}.gif` would result in `bar1.gif`, `bar2.gif`, etc. Giving each of those GIFs a different color would give you a different color for each answer.
`{answer_odd}` will alternate between 0 and 1 for every answer, hence `bar{answer_odd}.gif` will result in `bar0.gif` for the first, third, fifth, etc. answer and `bar1.gif` for the second, fourth, etc. answer.

Left blocks in the right column: `$_CONF['left_blocks_in_footer']` is a rather curious option. It makes the `{left_blocks}` variable available in the site's footer (i.e. `footer.thtml`) while at the same time disabling it in the header (`header.thtml`).
The idea is that this can be used for two-column layouts (one column for the blocks and one column for the content) but when you want to have the blocks on the right side. Simply moving all blocks to the right will not work as expected, as you'd end up with no blocks at all on those pages that normally only display the left blocks (e.g. `article.php` or the admin pages). Setting `$_CONF['left_blocks_in_footer'] = 1` will fix this, so that the blocks, while internally still treated as left blocks, will actually be displayed on the right.
The theme's `header.thtml`, `footer.thtml`, and `leftblocks.thtml` will probably need some adjustments. The 'left_blocks_in_footer' option is therefore not available in the main configuration but should instead be set in the theme's `functions.php` file. That way, you can even leave your users a choice between, for example, a "normal" theme and one with the blocks on the right.

Error Message: Since Geeklog 1.4.1 it is possible to control what HTML is displayed to non-root users in the event of an error occurring (a crash bug). To do so, you need to change the function `CUSTOM_handleError` in lib-custom.php to output any HTML you like.

Adding a "permalink" to stories: Many websites offer a so-called permalink, i.e. a link to a permanent URL for the story. In Geeklog's default Professional theme, the article's headline already provides the same functionality - it links to a permanent URL for the story (pointing to article.php). However, since this is not very obvious and since visitors often expect to find a "permalink" somewhere on the page, here's how to add one yourself:

1. Find a place in the story template files. The "story-footer" section in `storytext.thtml` may be a good place since it already contains quite a few story-related links.
2. Once you've found a place to put the permalink entry, enter this piece of code:
   `<a href="{article_url}">{lang_permalink}<a>`
   This will add a link to the article (`article_url`) using the word "Permalink" from the current language file (`lang_permalink`).
3. Try it out. Be aware that at this point, your permalink entry only shows up for non-featured articles. You may want to tweak the appearance a bit (using CSS) or move the link around.
4. Add the same piece of code to the `featuredstorytext.thtml` and `archivestorytext.thtml` templates so that the link also appears for featured and archived stories.

## Theme changes in Geeklog 1.5.2

Note: Themes made for Geeklog 1.5.0 or 1.5.1 should work just fine with Geeklog 1.5.2. In this release, we only fixed a few problems in the themes (detailed below) that also affected 1.5.0 and 1.5.1. The other changes listed here are optional.

### Bugfixes

These changes are actual bugs in the template files that also exist in Geeklog 1.5.0 and 1.5.1. We recommend making these changes to all custom themes.

- The security token was missing from the trackback editor template file, `admin/trackback/trackbackeditor.thtml`
- The `{start_storylink_anchortag}` variable in the story templates was missing the closing '>'. This caused the story title to disappear on some themes. (This was a bug in Geeklog's code, so no theme changes required)
- The `{site_admin_url}` was missing from the Configuration form action in `admin/config/configuration.thtml`. This may have caused problems making configuration changes on some setups.
- Added a hidden `old_pid` input field to the polls editor template file, `plugins/polls/templates/admin/polleditor.thtml`, to fix problems when changing a poll's ID.

### Other changes

These changes are optional. They fix cosmetic issues or issues that only affect some setups.

- Cosmetics: In the Professional theme, the last menu entry isn't different from the other entries, so the `.header-navigation-container li.last` rule in `style.css` is not needed for this theme.
- Internationalisation: The language direction variable, `{direction}`, was not available in the printer-friendly templates for articles and static pages.

## Theme changes in Geeklog 1.5.1

Note: Themes made for Geeklog 1.5.0 are mostly compatible with Geeklog 1.5.1. We only made one mandatory change (for the Configuration admin panel) - all the other changes listed below are optional or adjustments for special setups (e.g. multi-language sites, right-to-left languages). See details below.

### Important change: Configuration

The JavaScript code used for the Configuration admin panel used a generic name which caused conflicts with other JavaScript code. You should update the file `admin/config/config_element.thtml` to make sure your theme works with Geeklog 1.5.1.

### Multilingual blocks

The multi-language support for blocks introduced in Geeklog 1.5.1 relies on disabled blocks being swapped in dynamically. If you are using Geeklog's multi-language support, you may need to modify the piece of PHP code in your theme's `functions.php` so that it picks the correct templates for these multilingual blocks:

    $lang = COM_getLanguageId();
    if (empty($lang)) {
        $result = DB_query("SELECT onleft,name FROM {$_TABLES['blocks']} WHERE is_enabled = 1");
    } else {
        $result = DB_query("SELECT onleft,name FROM {$_TABLES['blocks']}");
    }

Prior to Geeklog 1.5.1, you will probably only find the first SQL request in your `functions.php` file.

### Other changes

- In Geeklog 1.5.0, the behaviour of the variable `{page_title}` (in `header.thtml`) changed so that it now only contains the actual page title or the site's slogan (in earlier versions, it contained both the site's name and either the page title or the site's slogan). This was done so that the combination `{page_title}{page_site_splitter}{site_name}` could be used to place the page title before the site's name for better SEO. If you prefer to have the site's name first on the index page and the page title first on all other pages, you can now use the new variable `{page_title_and_site_name}`
- In the Links plugin, links have an icon indicating that it's an external link (taking the user away from the current site). This icon did not show up properly for RTL languages (e.g Hebrew), making the link text unreadable. Since we could not find a way to make it show up properly in this case, the icon is not displayed when the text direction is switched to 'rtl' (for now).
- Added an optional `feed-link` class to be used for links to feeds (e.g. the new Story Option entry for topic feeds). In the Professional theme, a small feed icon (`images/feed.png`) is used as a background image for these links.
- An optional change to the `comment/commentbar.thtml` template file and the `commentbar-line2` class in `style.css` to make the "Post a comment" button float to the left and easier to see. There were no changes in functionality and other commentbar layouts will continue to work as before.
- The story template files `archivestorytext.thtml`, `featuredstorytext.thtml`, and `storytext.thtml` are now using the `{story_text_no_br}` variable to refer to the story text. Template files that use `{story_introtext}` here will continue to work as before.

## Theme changes in Geeklog 1.5.0

### XHTML support

Geeklog now supports XHTML compliant themes. These themes should define the following constant in their `functions.php` file:

    define('XHTML', ' /');

This will ensure that Geeklog switches to XHTML internally. If you want your theme be working both as an HTML and an XHTML theme, you should use the `{xhtml}` variable wherever XHTML requires a self-closing tag, e.g. `<br />` would be written as `<br{xhtml}>`. If you don't plan to use the theme for HTML, feel free to hard-code your theme for XHTML only.

Note: If you're using XHTML, it is your responsibility to ensure that your site's content (stories, comments, etc.) is XHTML compliant. Geeklog does not convert your content to XHTML.

### "Contribute" - User submitted stories

Geeklog 1.5.0 supports the ability for users to specify story intro text and body text seperately rather than just the intro text. This can be turned on and off by changing the templates. The files:

- submit/submitstory.thtml
- submit/submitstory_advanced.thtml

Contain table rows containing the bodytext inputs. Simply removing these inputs returns behaviour to the original.

### Admin Menu, User Menu & Topic List

All the above mentioned items are now lists, using `ul` and `li` tags (and a new CSS class, `blocklist`, to hide the list bullets). Two new template files have been added to create these blocks:

- blockheader-list.thtml
- blockfooter-list.thtml

Please note that the `{blockid}` variable that was present in pre-release versions of Geeklog 1.5.0 has since been removed.

### Security Changes

Many forms, particularly in the admin section of the site need a new hidden form field in order for saving the form/processing the action to work. Add:

    <input type="hidden" name="{gltoken_name}" value="{gltoken}"{xhtml}>

To the following templates:

- admin/block/blockeditor.thtml
- admin/block/defaultblockeditor.thtml
- admin/config/configuration.thtml (new theme file for 1.5)
- admin/group/groupeditor.thtml
- admin/group/groupmembers.thtml
- admin/mail/mailform.thtml
- admin/plugins/editor.thtml
- admin/story/storyeditor.thtml
- admin/story/storyeditor_advanced.thtml
- admin/syndication/feededitor.thtml
- admin/topic/topiceditor.thtml
- admin/trackback/pingbackform.thtml
- admin/trackback/pingform.thtml
- admin/trackback/serviceeditor.thtml
- admin/user/edituser.thtml
- comment/reportcomment.thtml

Some plugin specific templates have also been changed, you may also need to check:

- plugins/calendar/templates/addevent.thtml
- plugins/calendar/templates/editpersonalevent.thtml
- plugins/calendar/templates/dayview/quickaddform.thtml
- plugins/calendar/templates/submitevent.thtml (`{hidden_fields}` variable)
- plugins/links/templates/admin/categoryeditor.thtml (new theme file for 1.5)
- plugins/links/templates/admin/linkeditor.thtml
- plugins/polls/templates/admin/polleditor.thtml
- plugins/staticpages/templates/admin/editor.thtml
- plugins/staticpages/templates/admin/editor_advanced.thtml

### Removed Files

The following template files have been removed and are no longer needed:

- admin/lists/menufields.thtml
- admin/lists/topmenu_nosearch.thtml
- admin/plugins/newlistitem.thtml
- admin/plugins/newpluginlist.thtml

### System Message

The previously hard-coded CSS for the System Messages has been moved to the stylesheet (new CSS class `sysmessage`).

## Theme changes in Geeklog 1.4.1

The css in 1.4.1 has been changed to a wider extent. More and more layout components are beeing moved to the stylesheet so more change in looks can be achieved with less change in the files. There is a reduction of tables and DIV, and a stronger focus on semantics and consistency. Please also notice that the styles.css includes additional documentation on the use of classes now.

As usual, any missing new theme files can simply be copied over from the default theme (Professional) that ships with Geeklog.

### Header-Tags

From now on, all headlines in blocks & stories are made with header-tags. The biggest title in a story is always h1, in a block always h2.

### Story layout

The blocks for stories have no more tables, and the classes have been renamed for consistency. There is a box now around the story called class "story" or "story-featured". The components inside that box are story-icons, story-information, story-body and story-footer. The title is a h1-tag. For featured stories, only the outer box has a different class, the rest has to be cascaded for changes.

### Blocks

The blocks changed in the same way as the stories. There are no more tables, only one div-tag as a frame around called block-box, block-box-left or block-box-right. The title is a h2-tag and the help icon for the block is a span with a class called block-helpicon. Sub-titles in blocks have the h3-tag (such such as in the What's new or Older Stories block). The changes affect (next to styles.css) the follwing files:

- blockfooter-left.thtml
- blockfooter-related.thtml
- blockfooter-right.thtml
- blockfooter.thtml
- blockheader-left.thtml
- blockheader-message.thtml
- blockheader-related.thtml
- blockheader-right.thtml
- blockheader.thtml

### Admin templates

Many of the admin template files have had minor changes to tweak appearance or functionality. If you didn't modify the admin templates in your theme, the easiest way to upgrade your theme's admin templates is to simply replace the entire 'admin' directory with the one from Geeklog's Professional theme.

- All the "delete" buttons in the admin's editors (story editor, etc.) now pop up a JavaScript confirmation box as a simple measure against accidental deletion. If you'd rather not have that confirmation box, replace the `{delete_option}` variable with `{delete_option_no_confirmation}` in the admin templates.
- The order of the save / cancel / delete buttons is now consistent across all admin template files (changed `group/groupeditor.thtml` and `user/edituser.thtml`).
- Changed the top links in `lists/topmenu_nosearch.thtml` and `topic/topiclist.thtml` to be consistent with the other admin areas (i.e. the links are no longer enclosed in square brackets).
- To enable changing the group ownership of "gldefault" blocks, the `defaultblockeditor.thtml` has to be changed to include a `{group_dropdown}` variable.

### Other theme changes

- There was a div for spreading the with of the blocks to a minimum in the files leftblocks.thtml and rightblocks.thtml. The format of those has been transferred to the stylesheet with the class name block-bg-spreader
- The template for the Polls-plugin has renamed classes block-vote-results to poll-vote-results and block-vote to poll-vote to avoid confustion with block-related classes.
- The template files used by the Calendar plugin are now located in the plugin's directory, (`/path/to/geeklog/plugins/calendar/templates`), so the entire 'calendar' directory can be removed from the theme directory.
  The `submitevent.thtml`, `editpersonalevent.thtml`, `admin/eventeditor.thtml`, and `dayview/quickaddform.thtml` have also been changed to (optionally) support entering the time in 24 hour mode: A hidden input field "hour_mode" is now required, the am/pm dropdowns are available as variables `{startampm_selection}`, `{endampm_selection}`, `{ampm_selection}`, depending on the template file), and the dropdowns for the minutes are available as variables (`{startminute_options}`, `{endminute_options}`, `{minute_options}`, depending on the template file).
- The variables `{author}` and `{owner}` are now available in every template where an object's author (e.g. story or comment author) or owner (e.g. owner of a block) name can be displayed. They will also respect the $_CONF['show_fullname'] setting, i.e. display either the user's full name or username.
- The Article Author's tag in `storytext.thtml` and `featuredstorytext.thtml` is now called `{contributedby_author}.`
- To enable a remarks field in the answer to polls, the `pollvotes_bar.thtml`, `pollansweroption.thtml` and `polleditor.thtml` were changed. The `pollvotes_bar.thtml` is now colored and has two lines, a class for color coding each line and the `{answer_text}`. The `polleditor.thtml` has an aditional field to enter the remarks, same as the `pollansweroption.thtml`.
- A user's Account Information page has been redesigned. While there were no technical changes (i.e. template files from earlier versions will still work), some options have been rearranged and a note has been added to tell the user that the current password is required to change those. Affected files in the `preferences` directory: `profile.thtml`, `username.thtml`, and `userphoto.thtml`.
- The `navbar` directory now contains four files, `menuitem.thtml`,`navbar.thtml`,`breadcrumbs.thtml`,`breadcrumb_link` as well as two images, `button.gif` and `button_over.gif`.
- A `{captcha}` variable has been added to the following files:
  - `comment/commentform.thtml`
  - `comment/commentform_advanced.thtml`
  - `profiles/contactauthorform.thtml`
  - `profiles/contactuserform.thtml`
  - `submit/submitstory.thtml`
  - `submit/submitstory_advanced.thtml`
  - `users/registrationform.thtml`
  This variable is supposed to be used by a plugin that implements CAPTCHAs and will simply be empty when no such plugin is installed.

### Professional theme

The following changes are specific to the Professional theme. There is probably no need to port them over to other themes.

- The theme now uses CSS everywhere for spacing and dividers instead of relying on a 1x1 pixel transparent GIF image (`speck.gif`).
- The amount of nested tables has been reduced, e.g. in the block headers.
- Two unused template files, `customlogin-header.thtml` and `customlogin-footer.thtml`, have been removed.

## Theme changes in Geeklog 1.4.0

As usual, any missing new theme files can simply be copied over from the default theme (Professional) that ships with Geeklog.

### Admin templates

Geeklog 1.4.0 comes with revamped Admin sections which required a lot of theme changes. We therefore suggest that you simply replace the entire `admin` directory of your theme with the `admin` directory from Geeklog's default theme (Professional) as it ships with Geeklog 1.4.0 and apply any modfications you may have made to your Admin templates again afterwards.

Note: The new icons for "Command and Control" (`moderation.php`) in the Professional theme use a white background. For themes with a dark (or other non-white) background, you can download these icons as PNGs with alpha transparency (note that Internet Explorer can not display images with alpha transparency unless you include a JavaScript "hack" into your theme, so you may want to convert those icons to normal transparency or simply set the background to that of your theme).

### Advanced editor

To use the included advanced editor (FCKeditor) you will need the following new template files:

- `comment/commentform_advanced.thtml` (for comments)
- `submit/submitstory_advanced.thtml` (for story submissions)
- `admin/story/storyeditor_advanced.thtml` (Admin's story editor)
- `staticpages/templates/admin/editor_advanced.thtml` (for the Static Pages editor, located in `/path/to/geeklog/plugins`)
- `advanced_editor_header.thtml` (included by all of the above)

You also have to add `{advanced_editor}` to the `<head>` section of your theme's `header.thtml` file.

### Other changes

- The comment templates `commentbar.thtml` and `thread.thtml` have changed due to changes in the comment handling.
- New directories `trackback` and `admin/trackback` containing several new template files have been added for the trackback support.
- New variables `{send_trackback_link}`, `{send_trackback_url}`, and `{lang_send_trackback_text}` are available in the story and article template files. They provide a complete link as well as the URL and link text allowing you to send a trackback comment for the current story.
- The `links` and `admin/link` directories have been removed. Links are now a plugin and the plugin's templates can be found in `/path/to/geeklog/plugins/links/templates`.
- The `pollbooth` and `admin/poll` directories have been removed. Polls are now a plugin and the plugin's templates can be found in `/path/to/geeklog/plugins/polls/templates`.
- The `preferences/profile.thtml` template now has additional fields for the password change (old password, confirmation field for the new password).
- The search form, `search/searchform.thtml` has a new option for the number of search results per page, while the hard-coded option to search for links has been removed (since Links are in plugin now, it will show up as part of the `{plugin_types}` option).
- An additional variable, `{services}`, has to be added to the `loginform.thtml` template file if you plan to allow users to log in to your site using remote authentication.
- If you plan to enable Trackbacks on your site, you may want to add links to a story's trackbacks section to your story template files, e.g. `{start_trackbacks_anchortag}{trackbacks_with_count}{end_trackbacks_anchortag}`. See the Professional theme's story template files for examples.
- For the site statistics, the file `stats/sitestatistics.thtml` has changed (entries for the links and poll have been removed and a new entry for the number of active users has been added). There is also a new file, `stats/singlesummary.thtml`, that is used for plugin entries.
- The `navbar` directory is now part of a Geeklog theme (previously used by some plugins, e.g. the Forum plugin). It contains two files, `menuitem.thtml` and `navbar.thtml`, as well as two images, `button.gif` and `button_over.gif`.

## Theme changes in Geeklog 1.3.11

There are no mandatory theme changes in Geeklog 1.3.11, so themes made for Geeklog 1.3.10 will work just fine without any modifications.

A few minor additions / new options have been introduced:

- A new variable, `{camera_icon}`, can now be used in the story and comment template files to display the small camera icon (the same as in the Who's Online block) to link to the author's user profile (only if they uploaded a userphoto).
- The `{layout_url}` variable is now available in the templates for the story, link, and event submission forms.
- Also in the submission forms, a variable `{separator}` is now available in addition to the misspelled `{seperator}` variable.
- A new variable, `{calendar_mode}`, can be used in the `calendar/events.thtml` template file to ensure that the "add event" link will take the user to the proper event submission form for either the site calendar or the personal calendar.

## Theme changes in Geeklog 1.3.10

General note: To upgrade your custom theme for use with Geeklog 1.3.10, you can simply copy over any new template files from the Geeklog default theme.

The biggest change in Geeklog 1.3.10 is that we now ship it with only one default theme (the Professional theme, kindly provided by Victor B. Gonzalez) and that the previously included themes are now available as a separate download.

### Admin templates

Most themes don't change the template files in the theme's `admin` directory, so you can often save yourself a bit of work by simply replacing the entire `admin` directory with the one from the Geeklog 1.3.10 distribution.

- The story editor, `admin/story/storyeditor.thtml` includes new options for the story archiving and for editable story IDs. It is recommended to make a copy of this file and re-apply any changes you may have made to your copy again afterwards!
- The list of polls, `admin/poll/polllist.thtml` now supports paging, i.e. uses the {google_paging} variable.
- The list of events uses paging and a row number now (files affected: `admin/event/eventlist.thtml` and `admin/event/listitem.thtml`).
- The plugin editor, `admin/plugins/editor.thml`, now displays 2 version numbers for the plugin: The installed version and the (possibly differing) version of the actual code. In the latter case, it will also display an update button.
  The list of plugins, `admin/plugins/pluginlist.thtml` and `admin/plugins/listitem.thtml`, also displays the 2 version numbers and now supports paging when more than 25 plugins are installed.
- The topic editor, `admin/topic/topiceditor.thtml`, contained a hard-coded "10" for the default number of stories per pages. The new variable {default_limit} provides the actual default value now.
- `admin/mail/mailform.thtml` has been changed to look slightly less ugly ...

### Other templates

- Added two new templates for the new story archive feature. This allows you to theme olderstories differently. By default Geeklog 1.3.10 ships with these template files not themed and the same as a standard story. The new template files are
  - archivestorytext.thtml
  - archivestorybodytext.thtml
- Due to various changes in the comment engine, it is recommended that you copy over all the comment template files from the `comment` directory (`comment/reportcomment.thtml` is actually a new file).
- In `calendar/dayview/dayview.thtml`, i.e. in the calendar's day view, the hard-coded am/pm times have been replaced by variables of the form {xx_hour} (where 'xx' is 0-23).
- In the event details template, i.e. in `calendar/eventdetails.thtml`, the event type and an edit icon were added (this change was only made in Geeklog 1.3.10rc3).
- A "location" field was added in the user's profile: Added {lang_location} and {user_location} in `users/profile.thtml` and {lang_location}, {lang_location_text}, and {location_value} in `preferences/profile.thtml`.

### Optional changes

The following is a list of optional changes (mostly new variables that are now available). This information is mostly of interest for those who want to develop their own themes.

- {article_url}, i.e. the full URL to an article, is now also available in `article/printable.thtml`.
- In `links/linkdetails.thtml` the new variable {link_actual_url} now contains the actual link URL (instead of a link to Geeklog's `portal.php`).
- The following variables are now available in `calendar/eventdetails.thtml`: {event_state_name} (full name of the state), {event_state_only} and {event_state_name_only} (abbreviated and full state name without the comma), {event_edit} (link to edit the event, if allowed for the current user), {edit_icon} (same, but with the edit icon instead of a text link), {lang_event_type} and {event_type} for the event type
- The topic image is now available through the {topic_image} variable in `topicoption.thtml` and `topicoption_off.thtml`
- Several class names have been introduced so that the various lists that Geeklog uses can now be styled individually: list-feed, list-new-comments, list-new-links, list-new-plugins, list-older-stories, list-personal-events, list-site-events, list-story-options, list-whats-related (the names should be self-explanatory).
  Use {list_class_name} to get the actual class name, and {list_class} to get class="classname".
- Several class names have been introduced so that the 2 small calendars in the calendar's month view can be styled: .smallcal, .smallcal-headline, .smallcal-week-even, .smallcal-week-odd, .smallcal-week-empty, .smallcal-day-even, .smallcal-day-odd, and .smallcal-day-empty

## Theme changes in Geeklog 1.3.9

- In `header.thtml`, you can now use the new variable `{allowed_menu_elements}` as an alternative to using `{menu_elements}`. The new variable takes the `$_CONF['XXXloginrequired']` settings into account, i.e. it will only list those entries that the current user has access to.
- The `admin/syndication` directory, containing `feededitor.thtml`, `listfeeds.thtml`, `listitem.thtml`, and `selecttype.thtml` has been added.
- Template files `comment/comment.thtml` and `comment/thread.thtml` have been added and `comment/startcomment.thtml` has been changed to implement template-driven comments.
  Please note that `comment/comment.thtml` was changed again in Geeklog 1.3.9rc2.
- A `{link_edit}` variable has been added to `links/linkdetails.thtml` so that admins can edit links directly from the links section.
- An "edit" icon has been added: `images/edit.gif`. The new variable `{edit_icon}` can be used as an alternative to `{edit_link}` in the story template files and in `links/linkdetails.thtml`.
- In the `calendar/calendar.thtml` file, the "mode" parameter has been added to the << and >> buttons, so that users stay in their personal calendar when browsing through months.
- A new file, `admin/group/groupmembers.thtml`, has been added and `admin/group/listitem.thtml` has been changed for the new alternative option to add users to groups.
- A new file, `admin/block/listside.thtml`, has been added and `admin/block/listitem.thtml` and `admin/block/listblocks.thtml` have been changed for the enhanced block list.
- A `{google_paging}` variable has been added to `admin/link/linklist.thtml`. Also added a column number to `linklist.thtml` and `admin/link/listitem.thtml`.
- All template files where the user can enter a URL are now using a new variable, `{max_url_length}`, instead of a hard-coded number of characters for the max. length of the URL. Files affected: `admin/block/blockeditor.thtml`, `admin/event/eventeditor.thtml`, `admin/link/linkeditor.thtml`, `admin/topic/topiceditor.thtml`, `submit/submitevent.thtml`, `submit/submitlink.thtml`.
- The hard-coded `&nbsp;` has been removed from the `{welcome_msg}` variable. The blank was then added to the `header.thtml` of the Classic, XSilver, and Yahoo themes (the other themes either look fine without it or didn't use `{welcome_msg}` in the first place).
- An extra `table` has been removed from the `users/profile.thtml` file of the XSilver theme so that the username now lines up properly with the other entries.

## Theme changes in Geeklog 1.3.8

Theme changes in Geeklog 1.3.8 were mostly aimed at moving as much of the hard-coded HTML into template files as possible. Other changes were made to give theme authors better control over the layout and a small portion of changes were done to incorporate new Geeklog features.

### New template files

This is a list of the new files. You can safely copy these over from one of the standard themes that ship with Geeklog (most of these files contain HTML that was previously hard-coded into Geeklog).

    adminoption_off.thtml
    loginform.thtml
    topicoption.thtml
    topicoption_off.thtml
    useroption_off.thtml
    admin/database/listbackups.thtml
    admin/database/listitem.thtml
    admin/user/edituser.thtml
    admin/user/plainlist.thtml
    comment/commentbar.thtml
    comment/startcomment.thtml
    pollbooth/pollanswer.thtml
    pollbooth/pollblock.thtml
    pollbooth/pollcomments.thtml
    pollbooth/pollresult.thtml
    pollbooth/pollvotes_bar.thtml
    pollbooth/pollvotes_num.thtml
    preferences/boxesblock.thtml
    preferences/commentblock.thtml
    preferences/deleteaccount.thtml
    preferences/digestblock.thtml
    preferences/displayblock.thtml
    preferences/displayprefs.thtml
    preferences/excludeblock.thtml
    preferences/language.thtml
    preferences/privacyblock.thtml
    preferences/profile.thtml
    preferences/theme.thtml
    preferences/username.thtml
    preferences/userphoto.thtml
    search/resultauthdatehits.thtml
    search/resultrowenhanced.thtml
    search/resultsummary.thtml
    search/resulttitle.thtml
    users/newpassword.thtml

Note: `preferences` and `admin/database` are new directores.

### Changed / updated template files

These files have changed since Geeklog 1.3.7, i.e. they may contain new variables, table columns, etc. If you haven't changed these files in your existing theme, it is probably best to simply copy them over from one of the themes that ship with Geeklog (with the exception of `style.css` and `header.thtml`, see below).

    style.css (see below)
    header.thtml (see below)
    admin/block/blockeditor.thtml
    admin/block/listblocks.thtml
    admin/block/listitem.thtml
    admin/event/eventeditor.thtml
    admin/event/eventlist.thtml
    admin/event/listitem.thtml
    admin/group/grouplist.thtml
    admin/group/listitem.thtml
    admin/story/liststories.thtml
    admin/topic/listitem.thtml
    admin/topic/topiceditor.thtml
    admin/topic/topiclist.thtml
    calendar/editpersonalevent.thtml
    calendar/eventdetails.thtml
    search/searchform.thtml
    search/searchresults.thtml
    submit/submitevent.thtml
    users/getpasswordform.thtml

In `style.css`, four classes have been added that are used in the new search code of Geeklog 1.3.8. Instead of copying over the entire file, you will probably only want to copy over the code for those four classes: `searchAuth`, `searchDate`, `searchHits`, `highlight`.

If the `header.thtml` of your theme is using the `{menu_elements}` variable, then you do not need to make any changes to it. If it is not using that variable, then you will need to make one change to it. In that case, search your `header.thtml` for the link to the story submission form, i.e. something like

    <a href="{site_url}/submit.php?type=story">

and change it to read

    <a href="{site_url}/submit.php?type=story{current_topic}">

### Removed template files

If you have a file named `commentheader.thtml` in your theme directory, you can safely remove it. It isn't used at all.

## Theme changes in Geeklog 1.3.7

Please note that all the following changes are optional. Themes made for Geeklog 1.3.6 will work just fine with Geeklog 1.3.7 - no changes are necessary.

### New features and improvements

- Theme-based topic icons are now supported by setting `$_THEME_URL` in the theme's `functions.php` file. The variable should point to a directory that has the same hierarchy as Geeklog's images directory (note that the path to topic images is stored relative to Geeklog's public_html directory).
  Example: `$_THEME_URL = $_CONF['layout_url'];`
- The `$_BLOCK_TEMPLATE` "hack" can now be applied to the What's Related and Story Options blocks, as well. Use `whats_related_block` and `story_options_block` as the block names.
- The What's Related and Story Options blocks are now available as separate variables using `{whats_related}` and `{story_options}`, respectively (the `{whats_related_story_options}` variable for both blocks is still available).
- Several new variables can now be used in the story templates, e.g. `{contributedby_fullname}` for the full name of a story author and `{contributedby_photo}` for his/her user photo.
- When the new config variable `$_CONF['showfirstasfeatured']` is set to 1, then the first story on every page is rendered using the template files for featured stories, even when the story is not marked as featured.

### Other changes

- The template file `admin/plugins/installform.thtml` has been removed since it isn't used any more.
- Two new optional template files, `admin/plugins/newpluginlist.thtml` and `admin/plugins/newlistitem.thml`, have been added to support formatting of the list of plugins which haven't been installed yet. If these files do not exist, hard-coded HTML is used to present the list.
- The template file `admin/link/listitem.thtml` has been changed so that all the links are clickable.
- `COM_pollResults()` doesn't use the side block templates any more when called from `pollbooth.php`. Therefore, you can now use different layouts whether the poll results are displayed in a side block or on the separate poll results and comments page.
- Removed the Normal / Archive / Refreshing drop down menus from the admin story and poll editors of the themes that ship with Geeklog. The setting of this dropdown isn't used in Geeklog anyway and has just confused users in the past ... (files `admin/story/storyeditor.thtml` and `admin/poll/polleditor.thtml`)

## Theme changes in Geeklog 1.3.6

There have been a lot of changes in the themes for 1.3.6 to get rid of the last pieces of hard-coded english texts so as to make localisation easier. Most of these changes have been made in the Admin editors (`admin` directory) and the calendar (`calendar` directory). If you created your own theme for an earlier version of Geeklog, we recommend that you copy over these two directories from one of the themes that come with Geeklog (choose one that is similar to your own theme or which it was originally based on). It seems like most Geeklog themes didn't change these files anyway, so this shouldn't be too much of a hassle ...

### Other changes

- The template file `admin/mail/mailform.thtml` has been added. This form for sending emails to other users of the site was previously hard-coded into Geeklog.
  If you followed the above advice and copied over the `admin` directory to your theme, you got this file already.
- Two new files `menuitem_last.thtml` and `menuitem_none.thtml` have been added to give theme authors better control over the items in menu bars ({menu_elements} and {plg_menu_elements} variables in `header.thtml`). The template file `menuitem.thtml` is now used to render the first and any following menu items - with the exception of the last menu item, which is rendered using `menuitem_last.thtml`. If there are no menu elements for a menu bar, `menuitem_none.thtml` is used.
- New files have been added and the existing files have been changed for the links section (`links` directory). Again, we recommend to just copy over those files from one of the themes that ship with Geeklog.
  The new files are: `categoryactivecol.thtml`, `categorycol.thtml`, `categorynavigation.thtml`, `categoryrow.thtml`, `pagenavigation.thtml`
- The user profile has been extended to include a list of the last 10 stories as well as the total numbers of stories and comments posted by that user. Have a look at the file `users/profile.thtml` to see the changes or just copy that file over from one of the themes that ship with Geeklog. You should also copy over the file `users/storyrow.thtml` which describes the block for the last 1o stories.
- The Classic theme has been updated to have an "Edit" link (for StoryAdmins) in every story now.
  Files changed: `storybodytext.thtml`, `featuredstorybodytext.thtml`
- In the Classic and Digital Monochrome themes the "contact" link now points to the form to send an email to the admin user instead of using a `mailto:` link with the site's email address from the configuration.

### CSS changes

- The underscore '_' is not a valid character in CSS. Therefore, some class names used by the Geeklog calendar have been changed to use the dash '-' instead. You may need to change your stylesheet accordingly.
  Names that changed: cal-oldday, cal-today, cal-futureday, cal-nullday, weekview-curday, weekview-offday
- A new class named pagenav can be used to format the paged navigation.
  Please note that this change was made after the release of Geeklog 1.3.6rc1 and affects the use of the paged navigation in `admin/user/userslist.thtml` and `links/links.thtml`: In 1.3.6rc1, the navigation was wrapped in <p> tags in those files. As of Geeklog 1.3.6 however, the function producing the navigation will wrap it in a <div> automatically.

Note: Theme authors are encouraged to specify a character set in the `header.thtml` of their themes like this:

    <meta http-equiv="Content-Type" content="text/html; charset={charset}">

Geeklog will replace the `{charset}` variable with the proper character set based on the currently used language file. Also make sure that you put the above line before the `<title>` tag in the `<head>` section of your `header.thtml` file.