Blogs Manual Page

# Administrators guide to 'blogging' with SurgeMail

There is a global setting 'g_blog_enable' once this is turned on then users will find a 'Blogs' button in the user self administration web interface and in WebMail.

FIve main blogs pages are available to users:

- Listed blogs page shows all listed blogs on the system
- My Blogs shows users current blogs (listed and unlisted) and form for creating a new blog
- Settings to control settings for an individual blog.
- Posts to edit/moderate posts and comments
- View to view an individual blog.

On the first page the user can create a new blog, to do this they specify a 'urlname' and a 'title'. The urlname must be suitable to appear in a normal url, so would not contain spaces or unusual characters. e.g.

UrlName for blog: fishchips
Title: Fish and Chips

The blogs external address (used to view the blog) is then made using the urlname: http://your.domain/blogs/urlname

or alternatively urlname.blog.your.domain

Note ! The users name does not appear in this url, the blogs name must be unique for the entire domain.

After creating the blog the user can select from one or more template sets to define the appearance of the blog. These template sets are stored in:

> G_HOME/blogtpl/template_set_name/

If you wish to add new template sets or modify the default ones, you can modify the files in those directories, in general you should create new ones so that any updates from netwin will not over-ride your new ones.

When the blog is created one of those template sets (the default one) is coppied to the users blog directory, at which point they can then modify it further. If you update a template set the user will not see the changes unless they press on the buttons to 'reset the template set'

A template set can contain multiple files, including images, style sheets etc, this structued approach allows new templates to be quickly created just by modifying a style sheet or other 'ancillary' files.

Blogs and attached posts form part of the users normal email disk quota.

Example template:

<html><head>
<title>||h_title||</title>
<link rel="stylesheet" href="blog.css" type="text/css">
</head>
<body ||r_body_add||>

||ifdef||h_banner||
<img src="||h_banner||">
||else||
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0"
WIDTH="100%" BGCOLOR="#336699">
<TR>
<TD width="403"><a href="/"><IMG BORDER=0 SRC="/web/blogban.gif" NAME=""></href></TD>
<TD><B><font face="Verdana, Arial, Helvetica, sans-serif" color="white">||h_title||</font></B></TD>
</TR>
</TABLE>
||endif||

<table>
<tr>
<td valign="top" width="259">
<p><span class="archive_header">List of archives</span><br>
||begin_list_archive_months||
<span class="archive_list">
<a href="/blogs/||h_urlname||/index_||year||_||month||.htm"> Archives ||year|| ||month||</a>
</span><br>
||end_list_archive_months|| </p>
<p>
<span class="index_header">Index of items on this page:</span><br>
||begin_list_index||
<span class="index_list">
<a href="/blogs/||h_urlname||/item_||item||.htm"> ||subject|| </a><br>
</span>
||end_list_index||
</p>
</td>
<td>

||begin_list_items||
<p class="item_date">Posted By: ||name|| - ||datetime_long(time)||</p>
<p class="item_subject">||subject|| <br>
<span class="item_body">||body|| </span></p>
||begin_list_comments||
<p class="commentheader">||c_name|| ||datetime_long(c_time)||</p>
<p class="commentbody">
<blockquote>
||body||
</blockquote>
</p>
||end_list_comments||
<form action="/cgi/user.cgi" method="POST" align="left" name="create">
<input type="hidden" name="urlname" value="||urlname||">
<input type="hidden" name="inreplyto" value="||item||">
||ifndef||h_disable_comments||
<input type="submit" name="cmd_blog_comment" value="$$Add comment$$" ||button_style||>
||endif||
</form>
<hr>
||end_list_items||

<p>
<a href="/blogs/||h_urlname||/rss.xml">RSS feed</a>
<p>
There had been a total of ||h_visitor|| visitors at time of last post.
</table>
</body>
</html>

Note: The template language used in these templates is not compatible with other blog servers, sorry, we have no plans to make it so. Our goal was to make it simple and powerful. So our standard templates would be easy to understand and change. Note how small this template is and yet it's fully functional.

The users directory structure looks something like this:

tellmail path user@domain.name

...\xx\yy\username\mdir\... (normal mailbox stuff)

...\xx\yy\username\blogs\urlname\ (Everything about the blog 'urlname')

> > .\attach -- Attached files extracted from email messages or uploaded posts (images)
> > .\posts -- Each post and comment in the blog, one item per file
> > .\tpl -- The template files currently being used by this user.
> > .\www -- The generated blog html files (Index archives and individual posts)

Note that the html files are generated when the user posts, so viewing the pages does not create significant load on the server.

References to other files from the template directory do not need to include ../attach/file.name etc, when parsing these files the www tpl and attach directories are all searched, this makes templates much simpler and easier to edit with a normal html editor.

So in a template, to reference a file in the attach directory you just specify it's name, e.g. <img src="picture.jpg">

The files that make up the users blog are all part of the users normal quota.

See this page for an outline of blog features and screen shots