|
Themes |
| Note: To enable new themes, edit your
web.config file and change the Themes key to
reflect the newly added themes. The key is organized such that a semicolon
separates each theme entry, and each entry is composed of a foldername and
display name separated by a backtick.
For example: notsogrey`Not So
Grey;customtheme`My special theme;
THEME FOLDERS MAY BE NO MORE THAN 50 CHARACTERS IN LENGTH. In practice this
shouldn't be a problem. The display name can be as long as you want, but for
readability reasons I suggest keeping both the folder name and theme name under
25 characters.
|
|
Basics |
The basic theme has several files to it, but only five are strictly required by
the forum theme engine (FTE). It is important to remember that almost ANYTHING
is customizable. On one hand that makes the theme format a bit complex. On the
other, it makes it really easy to design a totally custom look.
Here are the five required files:
- DEFAULT.TXT The list of forums page, also known as the index, and is the first
thing people visiting your forums see.
- LIST.TXT The list of topics/threads for a specific forum. This file lets you
control how threads are presented.
- POST.TXT The message posting page, allowing you to customize the post form and
add your own javascript validation if you wish.
- SHOW.TXT An actual message, plus links to various admin functions and a reply
form, if the user viewing has the correct permissions.
- GENERAL.TXT This template covers any other page not listed above, like search,
prefs, msg, and so on. These comprise the bulk of the pages in the forums, but
are typically not subject to must customization in terms of content.
All other files are only present as defined by and used by the theme itself. You
could have 20 images and 5 stylesheets if you wish, or if plain HTML is all you
need you might have no extra files. The forums don't care either way. One thing
you should do is reference files by relative path as if from the root of
the forums. In other words, all paths should be similar to "themes/themefolder/file.jpg".
This makes your themes more portable.
OK, so we have the file structure down. Now how do these files work exactly?
It's easy. They function just like HTML files. In fact, for the most part they
simply ARE HTML files. How does the FTE know where to put things then? You tell
it with custom tags.
Custom tags are in the format <#tag_name#>. The first tag you will need is <#forum_id#>.
Many links to forum pages require that forumid=<#forum_id#> be specified in the
querystring. So, for example, if you want to provide your users a link to
list.aspx on SHOW.TXT, you might put something like this in:
<a href='list.aspx?forumid=<#forum_id#>'>Back
to List</a>
Another global tag is <#page_title#>, which you would typically use inside the
<TITLE></TITLE> tags on a page. You may also use <#forum_url#>, <#forum_name#>,
and <#forum_emailaddy#>. In this way you can construct URL links and such that
don't break on other forums, if you change domain names, and so on. For example:
<a href='<#forum_url#>'><#forum_name#></a>
Last but not least: all pages support ASP-style file includes with the file
keyword. (The virtual keyword is not supported.) So to include a file within
your theme, simply put <!--#include file="c:\dir\file.txt" --> somewhere in the
theme and watch the magic happen.
Also, if you would like to define includes
that are specific to certain forum IDs, you may do that as well in this format:
<!--#include file="c:\file.txt" forumid="1" -->. Now, the include line will be
handled only for forum #1. When users visit other forums that line will simply
be stripped out. You can use this to build a custom look for each forum by
defining custom headers and/or footers for each one, then putting multiple
include lines in, one for each forumid.
|
|
DEFAULT.TXT |
This page is easy, as it is very similar to general. Simply insert <#page_content#>
wherever the table of forums should go. Why not just use general? So you can
give your index a different look and insert custom links/warnings/information
and not have all that stuff appear all over the general forum pages.
Also, having a toolbar at the top of default.aspx won't do much good since you
can't return to "Forum Home" when you are staring at the index.
You also have <#footer_content#>, which is required for the free version
of Lasto so that the link to the Lasto website will be displayed. If you fail to
include this tag in your theme, it automatically revokes your license to use
Lasto!
|
|
LIST.TXT |
Pretty much all the tags on the list page are required, and there are also some
additional requirements that aren't serviced by tags.
- <#settings_msg#> - Displays a link for the user to edit their settings when
logged in, otherwise displays a register now message.
- <#login_state#> - Presents the logged in/out message, along with corresponding
link.
- <#forum_title#> - displays a link like so: Index > ForumName, to give a visual
cue as to what forum you are looking at.
- <#threads_showing#> - number of threads currently displayed
- <#threads_total#> - total number of threads in database
- <#messages_total#> - total number of messages
- <#page_showing#> - current page
- <#page_total#> - total pages given current page size
- <#page_nextmsg#> - link allowing user to advance pages
- <#alerts#> - a list of currently active alerts
Now here is where things get interesting... you have three tags used to define
thread display behavior:
<#begin_thread#>
<#messages#>
<#end_thread#>
Everything between begin and messages will be REPEATED for EVERY THREAD, at the
beginning of the thread. <#messages#> will be replaced with the threaded/nested
list of messages. Everything between messages and end will be repeated AFTER the
messages.
For example, the boxed thread look is accomplished because there is a table tag
with the proper borders between <#begin_thread#> and <#messages#>. The closing
table tags are between <#messages#> and <#end_thread#>
Lastly, it is considered good practice to place a <#bugreportlink#> and <#all_pages#>
tag somewhere at the bottom of LIST, making it easier to switch pages
from the bottom and also to let users report bugs if the admin has defined a bug
report link. (If no such link is defined the tag will simply be stripped out.)
NOTE: If your threads are not surrounded by a table, you must stick a trailing
</ul> between <#messages#> and <#end_thread#>. This is because IE will render
the threads with an extra trailing space in the table, screwing everything up
unless the final </ul> is omitted. As a result, themes that don't stick their
threads in tables will see the layout of messages climbing ever deeper as each
thread is one <ul> level higher than the last. This is a hack, but it is an
effective workaround for the rendering issues.
Gecko (mozilla/Firebird) has a different issue - it renders an extra space at
the top of tables that begin with a <ul> tag. However there is a stylesheet fix
for this, but it breaks internet explorer. Therefore place <#browsercssfix#>
inside your <HEAD></HEAD> tags and the forums will automatically insert this
style element when a user is using a gecko-based browser and will simply remove
the tag if they are using anything else. Once again, this is a hack but is
effective enough at making things look right.
|
|
POST.TXT |
You must have the correct form and
associated tags on post, in this format:
<form name="myform" action="post.aspx?<#post_action#>"
method="post">
<input type="hidden" name="forumid" value="<#forum_id#>">
<input type="hidden" name="id" value="<#msg_id#>">
These values are used for the form:
<#lc_name#> - user's stored name, used in the <input> text box for the name.
<#lc_email#> - similar
<#lc_password#> - similar
These three tags are replaced with the "disabled" or "checked" keywords when
appropriate or stripped out when not.
<#lc_emaild#> - used inside the email textbox to control its state
<#usesmileys#> - used inside the smileys checkbox to control its state
<#disablehtml#> - same as above, only for the disablehtml checkbox
In order to support the Post as [nt] feature. you simply create a second submit
button with the value="Post as [nt]", named submitnt. The forums will look for a
button named submitnt equal exactly to the value as shown to trigger an [nt]
post.
I highly recommend that you take a look at one of the included theme's post.txt
file to get a good idea of how the post form is laid out and what fields are
supported.
|
|
SHOW.TXT |
Place your content by inserting these tags
where appropriate:
<#msg_subject#> - message subject line
<#msg_id#> - the id of the current message (used for edit link, etc)
<#poster_name#> - username of poster
<#msg_date#> - date of post
<#poster_client#> - client poster is using
<#poster_ip#> - ip addy of poster
<#admin_functions#> - links shown to admins for admin-y type things
<#msg_views#> - number of views and score of post
<#modstuff#> - links shown to mods
<#msg_body#> - the actual post content + url + image + .sig
<#msg_edit#> - link to edit post based on security rights and such.
<#messages#> - other messages in this thread
The rest of the fields are the same as the POST page, such as <#lc_name#>, etc.
Just note that you should put <#msg_quoted#> inside of the <textarea></textarea>
tags.
|
|
GENERAL.TXT |
| General is easy. Just stick <#page_content#> wherever the content should go.
That's all there is to it! |