# This is the forum appearance template file. # It's evaluated as Perl, so you'll need to escape any $, %, @, | or \ characters in the strings # with a backslash in front, but you can call other functions etc. to construct your templates. # Basically this is a large list of "templates", into which the actual forum data is inserted # to form the displayed output of the script. It works by having strings with many "substitutions" # like [!NAMEHERE!] in them, which is where the forum information is inserted. The basic format is: # $forum_template{'templateNameHere'} = qq| # content content [!SUBSTITUTION!] content # |; # Some of the advanced substitutions have multiple options. The format for them is: # [?SUBSTITUTION^string1^string2?] # These are used as if/else substitutions, for example highlighting popular topics, when # string1 is inserted if the forum/topic is popular and string2 if it is not. # Substitutions that are commonly available in most templates are: # # [!HOMEURL!] the address of the forum index page, available everywhere. # [!NEWTOPICURL!] the address of the "Create New Topic" page for the forum. # [!FORUMNAME!], [!FORUMTEXT!], [!FORUMURL!] which describe the selected forum. # [!TOPICNAME!] and [!TOPICURL!] are available when a topic is selected. # # [?ISLOGGEDIN^abc^xyz?] will insert "abc" if a user is logged in, otherwise "xyz". # [!LOGINURL!] is the address to which a login
should be submitted. # [!LOGINFIELDS!] must be included inside a login tag. # [!USERURL!] [!ACCOUNTURL!] are the addresses of the user's account info & settings. # [!USERNAME!] is the name of the currently logged-in user. # [!LOGOUTURL!] is the URL that will logout a currently-logged-in user. # # For speed reasons, the "row" templates do not have all of these available # (e.g. you aren't able to insert a login form in the middle of search results). # If that really bothers you, edit the script source ;). # Also important are the page-listing functions used in many templates. They are: # [?HASPAGES^string1^string2?] which inserts "string1" into the output if the appropriate # forum or topic has multiple pages, or inserts "string2" otherwise. # [?PAGELIST^link format^separator1^separator2?] will write out a list of links to pages, with # "separator1" used to separate adjacent page numbers, and "separator2" between non-adjacent pages. # [?PREVPAGE^link format^otherwise?] and NEXTPAGE will write a link to the appropriate pages # if possible, otherwise will write their "otherwise" string if this is the first/last page. # All these may include [!PAGEURL!] and [!PAGENUM!] to construct links, see the examples below. # If none of that made sense, run the script and compare the "View Source" output to this file. # You may not even need to alter the default template much, just edit the .CSS file. # Here are some configuration directives you can tweak. # Most text control is done via the CSS file included in the page header, below. $forum_prefs{'topics_per_page'} = 20; $forum_prefs{'posts_per_page'} = 15; # Highlight forums that have had a post within the last X hours and topics with X or more posts. $forum_prefs{'highlight_forums'} = 36; $forum_prefs{'highlight_topics'} = 10; # Here's the row colours used as substitutions like [!ROWCOL!] in the templates below. # You can have a list of as many or few colours as you want, used alternately for each row. # You can also have hover colours used on mouseover for the row in this example script. $forum_template{'forum_norm_class'} = ['tablerow']; $forum_template{'forum_hover_class'} = ['hoverrow']; $forum_template{'topic_norm_class'}= ['tablerow', 'tablerow2']; $forum_template{'topic_hover_class'} = ['hoverrow']; $forum_template{'post_norm_class'}= ['lightpost', 'darkpost']; # There's no functionality for colourising posts on hover, as it's kind of silly :). # Header displayed at the top of all pages. I'm including some common JS functions inline # (you may wish to use a JS file) that are used by later templates, and I've included # a stylesheet (STYLE.CSS) used to format the forum text, links and forms. # I've set the charset as ISO-8859-1 (Latin-1), you may wish to use another or UTF-8 should # work, if you do use another charset you may need to edit the forum.pl "trimHTML()" function. # Also, I'm including the login/logout templates in the header (if you want, you can shift # them to the "footer" template, or just leave as-is). # Special substitutions: [!PAGETITLE!] $forum_template{'globalHeader'} = qq| [!PAGETITLE!] - Collegians Classifieds
[?ISLOGGEDIN^ Logged in as [!USERNAME!] - Edit Account - Logout ^
[!LOGINFIELDS!] - Create Account
?]
|; # Footer displayed at the bottom of every page. Please leave this crediting link intact; # either that, or if you want to make a donation for usage of the script, I'm sure I could # waive this requirement! $forum_template{'globalFooter'} = qq| |; # Top of "Forum List" page. Have a welcome message here, and set up any table headers or similar # you'll use to display the forum results later on. $forum_template{'listForumsTop'} = qq|

Collegians Classifieds

Sign up for an account, log in and enter Classifieds details.


|; # This is the format used for a "section break" row in the forum listing. # Special substitution: [!SECTIONTITLE!] $forum_template{'listForumsSection'} = qq| |; # One row of information for a forum. Note that I'm calling the JavaScript time display function # in the header: the LASTTIMESECS substitution records the raw number of seconds since 1970, # suitable for feeding to a script that outputs the result in the client's local timezone. # Alternatively, LASTTIMEGMT is a nicely formatted datestamp in Greenwich Mean Time. # Also, the HIGHLIGHTED substitution is special, you include two strings separated by hashes, # the first of which is written if the forum has ben updated in the last few hours, and the latter # if it is slightly older. This is used to bold recent forums, you may want to include small # "folder-on-fire" icon images for recently updated forums etc. # Special substitutions: [!ROWNORMCLASS!], [!ROWHOVERCLASS!], [!LASTTIMESECS!], # [!LASTTIMEGMT!], [!LASTAUTHOR!], [?HIGHLIGHTED^...^...?], [!TOPICS!], [!POSTS!]. $forum_template{'listForumsRow'} = qq| |; # The bottom of the forum list page. # Special substitutions: [!TOTALTOPICS!], [!TOTALPOSTS!] $forum_template{'listForumsBottom'} = qq|
Type of Classified Last entry Items Entries
[!SECTIONTITLE!]
[!FORUMNAME!]
[!FORUMTEXT!]
[!LASTAUTHOR!]
[!TOPICS!] [!POSTS!]
Totals: [!TOTALTOPICS!] [!TOTALPOSTS!]
|; # This "listTopics" template is dual-function: it displays regular topic lists and also # search results for a forum. Special substitutions: # [!ISSEARCH^...^...?] can be used to tell is this is a seach result or not. # [!SEARCHURL!] is the URL to which the a search form should be submitted. # [!SEARCHFIELDS!] is hidden information that must be included in a search form. # [!SEARCHKEYWORDS!] are the keywords searched for, if any. # [?HASPAGES^...^...?], [?PAGELIST^...^...^...?], [?PREVPAGE^...^...?], [?NEXTPAGE^...^...?] $forum_template{'listTopicsTop'} = qq|

[!FORUMNAME!]

Classifieds > [!FORUMNAME!] > [?ISSEARCH^Search Results: "[!SEARCHKEYWORDS!]"^Page [!PAGENUM!]?]
[?HASPAGES^
Pages: ^?] [?PREVPAGE^< < Previous -^?] [?PAGELIST^ [!PAGENUM!] ^,^...?] [?NEXTPAGE^- Next > >^?] [?HASPAGES^
^?] |; # Empty forum row -- this is written if there are no topics in the forum, or no search results. $forum_template{'listTopicsError'} = qq| |; # Otherwise, write out a row for each topic. Again, we have a special HIGHLIGHTED substitution # that has two strings in it, the first for topics with more posts than the threshold and the # second otherwise. There are also special topic "pinned" and "locked" states you can detect, I'm # labelling rows and also giving pinned rows a different CSS class. # We also have the page-list substitutions, for multi-page topics. Special substitutions: # [!ROWHOVERCLASS!], [!ROWNORMCLASS!], [!TOPICURL!], [!TOPICNAME!], [!ORIGAUTHOR!], [!ORIGTIMESECS!], # [!ORIGTIMEGMT!], [!LASTAUTHOR!], [!LASTTIMESECS!], [!LASTTIMEGMT!], [!POSTS!], # [?HIGHLIGHTED^...^...?], [?PINNED^...^...?], [?LOCKED^...^...?], # [?HASPAGES^...^...?], [?PAGELIST^...^...^...?] $forum_template{'listTopicsRow'} = qq| |; # Similar substitutions available as the topic list top template. $forum_template{'listTopicsBottom'} = qq|
Contact Item Entries Last Entry
No items found.
[!ORIGAUTHOR!] [?PINNED^Pinned:^?] [?LOCKED^Locked:^?] [!TOPICNAME!] [?HASPAGES^ - page: ^?] [?PAGELIST^ [!PAGENUM!] ^,^...?][?HASPAGES^^?] [!POSTS!]
[!LASTAUTHOR!]
[?HASPAGES^
Pages: ^?] [?PREVPAGE^< < Previous -^?] [?PAGELIST^ [!PAGENUM!] ^,^...?] [?NEXTPAGE^- Next > >^?] [?HASPAGES^
^?]
New Item
|; # The top of the "Create New Topic" page. It is followed by the message posting form. $forum_template{'newTopicTop'} = qq|

Enter new item details

Classifieds type > [!FORUMNAME!] > Enter new item

Here you can enter details of a new Classifieds item:

|; # The Message Posting form, used to post replies or create new topics. # POSTFIELDS must be included somewhere (a couple of hidden input tags). # ISNEWTOPIC is a conditional test that detects if this is a new topic or not. # Likewise ISNEWPOST will be false for users or admins re-editing an existing post. # Some other things: anonymous posters must supply an additional "author" input field, # and if posting fails, this form will be returned again along with an error message. # Special substitutions: [!POSTURL!], [!POSTFIELDS!], [?ISNEWTOPIC^...^...?], # [?ISNEWPOST^...^...?], [!TOPICNAME!], [!AUTHOR!], [!MESSAGE!] my $max_len = $forum_prefs{'max_post_len'} || ''; $forum_template{'postForm'} = qq| [?ISNEWPOST^

Add a comment or query:

^?]
[!POSTFIELDS!] [?ISLOGGEDIN^^

You are not logged in, and will be posting anonymously as a guest. If you want to post using an account, please login at the top of this page.

?] [?ISNEWTOPIC^ ^?]
|; # The "Post Error" display, if the script cannot post the user's message (too long, missed # necessary information, etc. etc.). This is written to the document and followed by the # posting form in the template above. Special substitutions: [!ERRORMESSAGE!]. $forum_template{'postError'} = qq|

Post Error!

Classifieds > [!FORUMNAME!] > Post Error
[!ERRORMESSAGE!]
|; # This forms the top of the post-display pages. Special substitutions: # [!HOMEURL!], [!FORUMURL!], [!FORUMNAME!], [!FORUMTEXT!], [!TOPICURL!], # [?HASPAGES^...^...?], [?PAGELIST^...^...^...?], [?PREVPAGE^...^...?], [?NEXTPAGE^...^...?] $forum_template{'displayTopicTop'} = qq|

[!TOPICNAME!]

Forums > [!FORUMNAME!] > [!TOPICNAME!] [?HASPAGES^> Page [!PAGENUM!]^?]
[?HASPAGES^
Pages: ^?] [?PREVPAGE^< < Previous -^?] [?PAGELIST^ [!PAGENUM!] ^,^...?] [?NEXTPAGE^- Next > >^?] [?HASPAGES^
^?]
Author
Message
|; # This formats each row in the post display, containing time/author/message/etc. # Special substitutions: # [?ISUSER^...^...?] tests if this post is by a logged-in user, or a guest. # [?USERSIG^...^...?] tests if the post author account has a signature. # [?ISEDITABLE^...^...?] tests if the current user has rights to edit/delete this post. # [!EDITURL!] is the URL to the post editing page if applicable. # [!GROUP!], [!POSTS!], [!JOINED!], [!LOCATION!] and [!SIG!] insert user information. # [!ROWNORMCLASS!], [!NUM!], [!AUTHOR!], [!TIMESECS!], [!TIMEGMT!], [!IPADDR!], [!MESSAGE!] $forum_template{'displayTopicRow'} = qq|

[!NUM!]) [!AUTHOR!] Group: [!GROUP!]
[?ISUSER^Posts: [!POSTS!] Joined: [!JOINED!] Location: [!LOCATION!] ^?] IP: [!IPADDR!]
[!MESSAGE!] [?USERSIG^
[!SIG!]
^?]
|; # The bottom of the post listing. Same substitutions available as the top of the listing. $forum_template{'displayTopicBottom'} = qq| [?HASPAGES^
Pages: ^?] [?PREVPAGE^< < Previous -^?] [?PAGELIST^ [!PAGENUM!] ^,^...?] [?NEXTPAGE^- Next > >^?] [?HASPAGES^
^?] |; # The error template, if the topic information cannot be found. $forum_template{'displayTopicError'} = qq|

Topic display error

ERROR: Item information not found.

The data associated with this item cannot be located in the Classifieds system.

It may have recently been deleted, or you may have typed in an incorrect URL to locate it.

Please return to the Classifieds listing to reselect an item.

|; # This is shown in locked topics, or topics in which the user isn't allowed to post, in place # of the "Post A Reply" form. $forum_template{'displayTopicNoPost'} = qq|

Sorry, this item is not accepting new entries.

|; # The template for editing or deleting posts. This is followed by the posting form. $forum_template{'editPost'} = qq|

Edit Post

Forums > [!FORUMNAME!] > [!TOPICNAME!] > Edit Post

Please type in your amended message, or delete it all to remove the post entirely.

|; # The topic locking/deleting template, this is shown after the post form. # It consists of a form that must contain [!HIDDENFIELDS!] and post back to the topic URL. # The PINNED and LOCKED substitutions are available to show the current topic state. $forum_template{'topicSettings'} = qq|

Topic Settings

[!HIDDENFIELDS!]
|; # The login error page, displayed if a user inputs an incorrect username/password. $forum_template{'userLoginError'} = qq|

Login Error

The username and password you provided are incorrect.

Make sure you have correctly capitalised and spelt both!

Please try again, or press "Back" to return to the previous page.

|; # The account editing / signup page. I use one template for both, with some alterations depending # on whether the user is currently logged in or not. This uses ?ISLOGGEDIN? extensively to switch # between modes, as logged-out users can never edit their own account. Special substitutions: # [!ACCOUNTUSER!] is (surprisingly) the account username being edited, if logged in. # [!ACCOUNTERROR!] contains any error messages (incorrectly filled out form etc) after submittal. # [!ACCOUNTPOSTURL!] goes in the "action" field for your form. # [!BIO!], [!LOCATION!] and [!SIG!] are the current values returned for these fields. # [?ACCEDIT^...^...?] is true if the current user has admin privileges, and is entitled to change # the privilege level of this account via the [!GROUPSELECT!] select-box. $forum_template{'userAccountEdit'} = qq|

[?ISLOGGEDIN^[!ACCOUNTUSER!]^Create Account?]

Forums > Account Setup
[!ACCOUNTERROR!]
[?ISLOGGEDIN^ ^

You don't need an account to post, but if you have one, you can edit your posts later and display more information with your messages.

Required Fields

Please choose a user name you want to use in these Classifieds. Alphanumeric characters only.

?] [?ISLOGGEDIN^

If you want to change your existing password, please enter it here, otherwise leave this field blank:

^?]

Enter your new account password here twice (they must both match)

[?ISLOGGEDIN^^

Optional Fields

?]

Where in the world are you? This gets displayed with your posts.

Say a little about yourself, include some contact information, or just leave it blank. This will be displayed on your "User Info" page.

A signature will be automatically appended to your posts (max 200 chars).

[?ACCEDIT^

ADMINS ONLY: You can change the privilege type of this account.

^?] [?ISLOGGEDIN^^

You can change all these account settings later, except for the username. Plus, you must have cookies enabled in your browser to login.

?]
|; # The account information display template. Basically it's identical to the one above, but doesn't # have any editable components. This is used to display other people's profiles. $forum_template{'userAccountView'} = qq|

[!ACCOUNTUSER!]

[?ACCEDIT^^?]
Forums > User Information

Bio:

[!BIO!]

Posts: [!POSTS!]

Joined: [!JOINED!]

Location: [!LOCATION!]

Sig:

[!SIG!]
|; # The 'not allowed' template, encountered in that rare situation when a visito tries to pull off # a stunt they're not entitled to do. [!ACTION!] tells them what went wrong. $forum_template{'userDisallowed'} = qq|

Sorry!

Forums > Error

You're currently not allowed to:

[!ACTION!]

Please login with the appropriate account.

|;