DotAdmin User Guide
Forum Templates
The dotAdmin forum system has three distinct views depending on where the user is located within the forum hierarchy. A forum template contains each of the these views within three main outer BLOCKs of the template.
BLOCK {category_view}
 Forum category view showing forums.
The category view shows all of the forums within the current category, and is shown to users when they are located within a category at the top of the forum heirarchy.
The forum list for the category view is output into BLOCK { forums }. This BLOCK can be wrapped in an <!--IF { forums }--> conditional, and an alternative <!--ELSE--> clause which is output when no forums are available within the category:
<h1>Forums:</h1>
<!--IF {forums}-->
<table width="100%" cellpadding="4" cellspacing="0" border="1">
<tr>
<td><p><b>Title</b></p></td>
<td width="5%"><p><b>Threads</b></p></td>
<td width="5%"><p><b>Posts</b></p></td>
</tr>
<!--BLOCK {forums}-->
<!--IF {odd}--><tr bgcolor="#CCCCCC"><!--/IF {odd}-->
<!--ELSE--><tr bgcolor="#FFFFFF"><!--/ELSE-->
<td><p><a href="/content/{ id }"><b>
<!--IF {new_posts}--><span style="color: FF0000;">
<!--/IF {new_posts}-->
{title}
<!--IF {new_posts}--></span><!--/IF {new_posts}-->
</b></a></p></td>
<td width="5%"><p>{total_threads}</p></td>
<td width="5%"><p>{total_posts}</p></td>
</tr>
<!--/BLOCK {forums}-->
</table>
<!--/IF {forums}-->
<!--ELSE-->
<p align="center"><b>No are no forums available
in this category at present.</b></p></td>
<!--/ELSE-->
The category_view template block.
The following placeholders are available within the category_view block of the forum template:
|
Placeholder
|
Output
|
|
BLOCK {forums}
|
A repeating BLOCK containing the details of each forum within this category.
|
|
IF {odd}
|
Inside BLOCK {forums}, used to create display effects where alternate BLOCK {forums} rows are coloured differently for ease of readability.
|
|
IF {new_posts}
|
Inside BLOCK {forums}, this will be displayed if the viewing user is logged in, and the forum contains posts which he has not yet seen.
|
|
{title}
|
Inside BLOCK {forums}, The forum title.
|
|
{total_threads}
|
Inside BLOCK {forums}, the total number of threads in this forum.
|
|
{total_posts}
|
Inside BLOCK {forums}, the total number of user posts in this forum.
|
BLOCK {forum_view}
 Forum view showing threads.
The forum_view BLOCK is displayed when the user is viewing a specific forum, and shows all of the current threads in the forum. It also provides the user with opportunity to start a new thread:
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td valign="top"><h1>Current Threads:</h1></td>
<td valign="top" align="right">
<p><a href="/content/userpost/?forum={id}">New Thread</a></p>
</td>
</tr>
</table>
A typical heading layout in the forum_view block.
The code above produces the following output:
Current Threads: |
New Thread |
The “New Thread” link takes the user to the userpost dotAdmin site function, and passes with it the ID of the current forum.
The forum view also displays a list of threads in this forum, sorted in reverse chronological order. The thread which contains the most recent post will be displayed first, the thread with the second most recent post second, and so on. The thread list is output into BLOCK {threadlist} as in our code example below:
<table width="100%" cellpadding="4" cellspacing="0" border="1">
<tr>
<td valign="top" align="center" colspan="3">
<p><b>Threads {listfrom} to
{listto} of {total}
in this forum</b></p>
</td>
</tr>
<tr>
<td><p><b>Title</b></p></td>
<td width="5%"><p><b>Posts</b></p></td>
<td width="10%"><p><b>Author</b></p></td>
</tr>
<!--BLOCK {threadlist}-->
<!--IF {odd}--><tr bgcolor="#CCCCCC"><!--/IF {odd}-->
<!--ELSE--><tr bgcolor="#FFFFFF"><!--/ELSE-->
<td><p><a href="/content/{id}"><b>
<!--IF {new_posts}--><span style="color: FF0000;">
<!--/IF {new_posts}-->
{title}
<!--IF {new_posts}--></span><!--/IF {new_posts}-->
</b></a></p></td>
<td width="5%"><p>{total_posts}</p></td>
<td width="10%">
<p>
<!--IF {screen_name}-->{screen_name}<!--/IF {screen_name}-->
<!--ELSE-->Anonymous<!--/ELSE-->
</p>
</td>
</tr>
<!--/BLOCK {threadlist}-->
</table>
A typical threadlist in the forum_view block.
The forum view will output 25 threads per page, and will output BLOCK {paging} if the list of threads runs to more than one page. More details on using the paging block can be found on the page “Paging Navs” elsewhere in this documentation. The code sample below makes good use of the paging elements:
<table width="100%" cellpadding="4" cellspacing="0" border="1">
<tr>
<td valign="top" align="center" colspan="3">
<p><b>Threads {listfrom}
to {listto} of {total}
in this forum</b></p>
</td>
</tr>
<!--BLOCK {paging}-->
<tr>
<td valign="top" align="center" colspan="3">
<p align="center">
<!--IF {previous}-->
<<a href="/content/{id}/?forumpage={previous}"><b>
<!--/IF {previous}-->
Previous
<!--IF {previous}--></b></a><!--/IF {previous}-->
<!--BLOCK page_links-->
[<!--IF {current}--><!--/IF {current}-->
<!--ELSE--><a href="/content/{id}/?forumpage={link}"><b>
<!--/ELSE-->
{link}
<!--IF {current}--><!--/IF {current}-->
<!--ELSE--></b></a><!--/ELSE-->]
<!--/BLOCK page_links-->
<!--IF {next}-->
<a href="/content/{id}/?forumpage={next}"><b>
<!--/IF {next}-->
Next
<!--IF {next}--></b></a>><!--/IF {next}-->
</p>
</td>
</tr>
<!--/BLOCK {paging}-->
</table>
Use of paging placeholders in the forum_view block.
The following placeholders are available within the forum_view block of the forum template:
|
Placeholder
|
Output
|
|
{id}
|
The unique ID of this forum. Used when posting a new thread to the forum.
|
|
{total}
|
The total number of threads in this forum.
|
|
{listfrom}
|
The number of the first thread displayed on the current page.
|
|
{listo}
|
The number of the last thread displayed on the current page.
|
|
BLOCK {threadlist}
|
A repeating BLOCK containing the details of each thread within this forum.
|
|
IF {odd}
|
Inside BLOCK {threadlist}, used to create display effects where alternate BLOCK {threadlist} rows are coloured differently for ease of readability.
|
|
IF {new_posts}
|
Inside BLOCK {threadlist}, this will be displayed if the viewing user is logged in, and the thread contains posts which he has not yet seen.
|
|
{title}
|
Inside BLOCK {threadlist}, The thread title.
|
|
{total_posts}
|
Inside BLOCK {threadlist}, the total number of user posts in this thread.
|
|
{screen_name}
|
Inside BLOCK {threadlist}, the screen name of the user who started this thread. Often this is surrounded by a conditional IF {screen_name}, and an ELSE clause which displays “Anonymous” when the poster does not have a screen name.
|
|
BLOCK {paging}
|
Contains links to other pages of threads, if threads are spread across more than one page.
|
|
{previous}
|
Inside BLOCK {paging}, numeric ID of the previous page of threads, if a previous page exists.
|
|
{next}
|
Inside BLOCK {paging}, numeric ID of the next page of threads, if there is a subsequent page to link to.
|
|
BLOCK {page_links}
|
Inside BLOCK {paging}, repeatable block containing links to individual pages of thread display.
|
|
{link}
|
Inside BLOCK {page_links}, numeric ID for each page of threads.
|
|
{current}
|
Inside BLOCK {page_links}, used in a conditional instruction (IF) to format the current page link differently from other repetitions of the block.
|
BLOCK {thread_view}
 Forum thread view showing user posts.
The thread_view BLOCK is displayed when a user is viewing a particular thread. It shows a list of user posts in chronological order, offers the opportunity to post a new post to the thread, and logged in site users are offered the opportunity to start or stop watching the current thread:
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td valign="top"><h1>{title}:</h1></td>
<td valign="top" align="right">
<p><a href="/content/userpost/?parent={id}">New Post</a>
<!-- BLOCK {watched} -->|
<!-- IF {yes} -->
<a href="/content/{id}/?watch=no">Stop watching this thread</a>
<!-- /IF {yes} -->
<!-- ELSE -->
<a href="/content/{id}/?watch=yes">Watch this thread</a>
<!-- /ELSE -->
<!-- /BLOCK {watched} --></p></td>
</tr>
</table>
A typical heading layout in the thread_view block.
For a logged in user viewing a “watched” thread entitled “Hello everybody”, the code above would produce the folowing display:
Hello everybody: |
New Post |
Stop watching this thread |
The thread view also displays the content of posts in chronological order. The posts are output to BLOCK {postlist} as shown in the code sample below:
<table width="100%" cellpadding="4" cellspacing="0" border="1">
<tr>
<td valign="top" align="center" colspan="2">
<p><b>Posts {listfrom}
to {listto} of {total}
in this thread</b></p>
</td>
</tr>
<!--BLOCK {postlist}-->
<tr>
<td valign="top" rowspan="2" width="20%">
<p><!--IF {screen_name}-->{screen_name}<!--/IF {screen_name}-->
<!--ELSE-->Anonymous<!--/ELSE--></p>
</td>
<td valign="top">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td><p><b>{title}</b></p></td>
<td valign="top" align="right">
<p><a href="/content/userpost/?parent={id}">Reply</a> |
<a href="/content/userpost/?parent={id}&quote={id}">Quote</a>
<!-- IF {edit} -->
| <a href="/content/userpost/?edit={id}">Edit</a>
<!-- /IF {edit} -->
</p>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top">{literal display_content}</td>
</tr>
<!--/BLOCK {postlist}-->
</table>
A typical postlist in the thread_view block.
The thread view displays 10 posts per page. If the thread runs to more than 1o posts in total, links to the other pages of posts will be displayed in BLOCK {paging}. More details on using the paging block can be found on the page “Paging Navs” elsewhere in this documentation. The code sample below makes good use of the paging elements:
<table width="100%" cellpadding="4" cellspacing="0" border="1">
<tr>
<td valign="top" align="center" colspan="2">
<p><b>Posts {listfrom}
to {listto} of {total}
in this thread</b></p>
</td>
</tr>
<!--BLOCK {paging}-->
<tr>
<td valign="top" align="center" colspan="2">
<p align="center">
<!--IF {previous}-->
<<a href="/content/{id}/?forumpage={previous}"><b>
<!--/IF {previous}-->
Previous
<!--IF {previous}--></b></a><!--/IF {previous}-->
<!--BLOCK page_links-->
[<!--IF {current}--><!--/IF {current}-->
<!--ELSE--><a href="/content/{id}/?forumpage={link}"><b><!--/ELSE-->{
link}
<!--IF {current}--><!--/IF {current}-->
<!--ELSE--></b></a><!--/ELSE-->]
<!--/BLOCK page_links-->
<!--IF {next}-->
<a href="/content/{id}/?forumpage={next}"><b>
<!--/IF {next}-->
Next
<!--IF {next}--></b></a>><!--/IF {next}-->
</p>
</td>
</tr>
<!--/BLOCK {paging}-->
</table>
A typical use of paging in the thread_view block.
The following placeholders are available within the thread_view block of the forum template:
|
Placeholder
|
Output
|
|
{id}
|
The unique ID of this thread. Used when posting a new post to the thread.
|
|
{total}
|
The total number of user posts in this thread.
|
|
{listfrom}
|
The number of the first user post displayed on the current page.
|
|
{listo}
|
The number of the last user post displayed on the current page.
|
|
BLOCK {watched}
|
This element is displayed if the user is logged in, and contains the user's current “watching” status.
|
|
IF {yes}
|
Inside BLOCK {watched}, this element is displayed if the user is logged in, and is “watching” this thread (i.e. they recieve email notification of new posts).
|
|
BLOCK {postlist}
|
A repeating BLOCK containing each user post within this thread.
|
{title}
|
Inside BLOCK {postlist}, The post title.
|
|
{id}
|
Inside BLOCK {postlist}, the unique ID of this post.
|
|
{display_content}
|
Inside BLOCK {postlist}, the content of this post, escaped for HTML display, with special forum markup parsed and converted to HTML. Usually returned to the template using the literal placeholder qualifier.
|
|
{screen_name}
|
Inside BLOCK {postlist}, the screen name of the author of this post. Often this is surrounded by a conditional IF {screen_name}, and an ELSE clause which displays “Anonymous” when the poster does not have a screen name.
|
|
IF {edit}
|
Inside BLOCK {postlist}, this element is displayed if the viewing user is able to edit this post.
|
|
BLOCK {paging}
|
Contains links to other pages of user posts, if user posts are spread across more than one page.
|
|
{previous}
|
Inside BLOCK {paging}, numeric ID of the previous page of user posts, if a previous page exists.
|
|
{next}
|
Inside BLOCK {paging}, numeric ID of the next page of user posts, if there is a subsequent page to link to.
|
|
BLOCK {page_links}
|
Inside BLOCK {paging}, repeatable block containing links to individual pages of user post display.
|
|
{link}
|
Inside BLOCK {page_links}, numeric ID for each page of user posts.
|
|
{current}
|
Inside BLOCK {page_links}, used in a conditional instruction (IF) to format the current page link differently from other repetitions of the block.
|
|