<?php

$template_matrix = array(
							array('index',				'webpage'),
							array('comments',			'webpage'),
							array('comment_preview',	'webpage'),
							array('trackbacks',			'webpage'),
							array('referrers',			'webpage'),
							array('smileys',			'webpage'),
							array('site_css',			'css')
						);



if ( ! isset($type))
	$type = 'core';


//-------------------------------------
//	Stylesheet template
//-------------------------------------

function site_css()
{
	global $type;
	
ob_start();

?>
/* Built by Simon Collison www.collylogic.com 2004 for the Expression Engine Template Contest. Look for the comments to work out what does what */

body {
	margin: 0 auto;
	padding: 0;
	color: #333;
	text-align: center;
	background: #EDEAEB;
}

/* eeheader_temporary and its link styles control the dark blue bar at the top, and this is a temporary part of the design. You can safely remove this block of styles if you do not need that bar */

#eeheader_temporary {
	margin: 0 auto;
	padding: 4px 10px;
	width: 752px;
	background: #336;
	color: #9CF;
	text-align: left;
	border-left: 1px solid #336;
	border-right: 1px solid #336;
	border-bottom: 1px dashed #99C;
	font: bold 10px 'Lucida Grande', Verdana, Arial, Sans-Serif;
}
#eeheader_temporary a:link {
	text-decoration: underline;
	color: #9CF;
	background: transparent;
}
#eeheader_temporary a:hover {
	text-decoration: none;
	color: #900;
	background: #FFC;
}
#eeheader_temporary a:visited {
	text-decoration: underline;
	color: #9CF;
	background: transparent;
}

/* These are the default link styles */

a:link {
	text-decoration: underline;
	color: #666;
	background: transparent;
}
a:hover {
	text-decoration: underline;
	color: #900;
	background: #FFC;
}
a:visited {
	text-decoration: underline;
	color: #666;
	background: transparent;
}

/* the wrapper holds the whole thing centrally in the browser window */

#wrapper {
	margin: 0 auto;
padding:10px;
	width: 752px;
	background: #FFF;
	color: #333;
	text-align: left;
	border-left: 1px solid #999;
	border-right: 1px solid #999;
}

/* the masthead. Change the image reference to the one you want to use */

#header {
	margin: 0 0 10px 0;
	color: #030;
	height: 100px;
	width: 750px;
	border: 1px solid #663;
	background: url({site_url}themes/site_themes/logical_blocks/lb_header.gif);
}

/* the content style holds the two main columns together */

#content {
	margin: 10px 0;
}

/* about_site is the holder for your introduction. This can be safely removed */

#about_site {
	float: left;
	width: 483px;
	margin-bottom: 10px;
	color: #333;
	text-align: left;
	border: 1px dashed #999;
	padding: 0;
	font: 11px/130% 'Lucida Grande', Verdana, Arial, Sans-Serif;
	line-height: 165%;
	background: url({site_url}themes/site_themes/logical_blocks/lb_diags.gif);
}

/* blog is the right hand column where your entries and main content appear */

#blog {
	float: left;
	width: 483px;
	margin-bottom: 10px;
	color: #333;
	text-align: left;
	border: 1px dashed #999;
	padding: 0;
	font: 11px/130% 'Lucida Grande', Verdana, Arial, Sans-Serif;
	line-height: 165%;
	background: #CCC url({site_url}themes/site_themes/logical_blocks/lb_diags_grey.gif) repeat-x;
}

/* sidebar is the left column where all the links and secondary info show up */

#sidebar {
	float: left;
	color: #333;
	text-align: left;
	font: 9px 'Lucida Grande', Verdana, Arial, Sans-Serif;
	margin-right: 11px;
margin-bottom:15px;
	border-top: 1px solid #999;
	border-bottom: 1px solid #999;
	background: url({site_url}themes/site_themes/logical_blocks/lb_diags_white.gif) repeat-y right;
}

/* the footer, containing credits, rss links etc */

#footer {
	margin: 0;
	padding: 15px 10px 12px;
	border: 1px dashed #999;
	background: #CCC;
	color: #333;
	font-size: 9px;
	letter-spacing: 0.09em;
}

/* the main class keeps blog content away from the edges. Could have been done with padding in the blog class, but that could cause some woes with older browsers */

.main {
	margin: 0 16px 0 8px;
}

/* Header definitions. h1 is hidden, and only shows when styles are off. Note, there are specific definitions for the sidebar h3 header, blog h3 header, and the blog h2 link. The blog h2 link is a clickable rollover of the entry title */

h1 {
	font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif;
	font-size:  24px;
	font-weight: bold;
	margin: 38px 0 0 20px;
}
h3 {
	font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif;
	letter-spacing: 0.09em;
}
h2 {
	font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif;
	letter-spacing: 0.09em;
	font-weight: bold;
	margin-top: 6px;
	margin-bottom: 6px;
}
h4 {
	margin-bottom: 4px;
	font: 11px 'Lucida Grande', Verdana, Arial, Sans-Serif;
	font-weight: bold;
}
h5 {
	margin-bottom: 4px;
	font: 11px 'Lucida Grande', Verdana, Arial, Sans-Serif;
	font-weight: bold;
	line-height: 165%;
}
#sidebar h3 {
	width: 249px;
	height: 16px;
	margin: 0;
	color: #336;
	text-decoration: none;
	display: block;
	text-align: left;
	font: bold 10px 'Lucida Grande', Verdana, Arial, Sans-Serif;
	background: url({site_url}themes/site_themes/logical_blocks/lb_diags_h3.gif) right;
	padding: 6px 0 0 5px;
}
html>body .h3 {
	width: 249px;
}
#blog h3 {
	letter-spacing: 0.09em;
	margin-top: 9px;
	margin-bottom: 12px;
	font: 11px 'Lucida Grande', Verdana, Arial, Sans-Serif;
}
.center {
	text-align: center;
}
h2 a:link, h2 a:visited {
	font-weight: bold;
padding-left:17px;
	background: url({site_url}themes/site_themes/logical_blocks/lb_new_post.gif) left no-repeat;
	color: #336;
	text-decoration: none;
}
h2 a:hover {
	color: #900;
}

/* Dont ask. Just don't delete this spacer class */

.spacer {
	clear: both;
}

/* For use with the acronym plugin. Creates a question mark, italic text and underline on acronyms */
abbr, acronym {
	border-bottom: 1px dotted #666;
	cursor: help;
}

/* Two paragraph styles. A general one, and one specific to the footer */

p {
	font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif;
}
#footer p {
	margin: 10px 0 5px;
}

/* For use with quotes and text you need to present outside of normal format */

blockquote {
	color: #333;
	border-left: 1px solid #CCC;
	margin-left: 5px;
	padding-left: 4px;
	padding-right: 4px;
	font: 11px 'Lucida Grande', Verdana, Arial, Sans-Serif;
	line-height: 165%;
}

/* The standard list styles. There are specific sidebar list styles later on */

ul {
	list-style-type: none;
	margin-top: 3px;
	margin-bottom: 2px;
	margin-left: 0;
	padding-left: 0;
}
li {
	border-bottom: 0 solid #CCC;
	padding-bottom: 2px;
	font: 100% verdana, arial, helvetica, sans-serif;
}

/* As it says, control of multi-entry page pagination links */

.paginate {
	margin: 18px 16px 18px 8px;
}

/* date and title are added to earlier h tags for greater control of headers. Posted shows all the author, permalink and trackback stuff under each entry */

.date {
	font-size: 10px;
}
.title {
	font-size: 135%;
	font-weight: bold;
	background: transparent;
	color: #336;
}
.posted {
	clear: both;
	margin-bottom: 25px;
	font: 10px 'Lucida Grande', Verdana, Arial, Sans-Serif;
	color: #666;
	line-height: 165%;
	padding: 3px 0 15px;
	border-bottom: 1px dashed #999;
}
.posted_comments {
	clear: both;
	font: 10px 'Lucida Grande', Verdana, Arial, Sans-Serif;
	color: #666;
	line-height: 165%;
	padding: 3px 0 3px;
}

/* Comments classes. commbox and coomboxalt are used in the switch conditional on the comments page */

.comments {
	font-size: 120%;
	font-weight: bold;
	background: transparent;
	color: #E78818;
}
.commbox {
	background: #EDEAEB;
	border: 1px solid #ddd;
	padding-left: 7px;
	padding-right: 7px;
	margin-bottom: 7px;
}
.commboxalt {
	background: #FAF6F7;
	border: 1px solid #ddd;
	padding-left: 7px;
	padding-right: 7px;
	margin-bottom: 7px;
}

/* Some form styling. Not much though */

checkbox {
border: 3px double #999999;
padding:1px;
color: #333333;
font-size: 10px;
font-family: Verdana, Helvetica, Arial, sans-serif;
}
textarea {
border: 3px double #999999;
padding:1px;
color: #333333;
font-size: 10px;
font-family: Verdana, Helvetica, Arial, sans-serif;
}
input {
border: 3px double #999999;
padding:1px;
color: #333333;
font-size: 10px;
font-family: Verdana, Helvetica, Arial, sans-serif;
}
input.submit
{
border: 2px double #999999;
padding: 1px;
background-color: #FFF;
color: #333333;
font-size: 10px;
font-family: Verdana, Helvetica, Arial, sans-serif;
}
fieldset {padding:10px;}

/* As mentioned above, these are the sidebar-specific list styles, based on my ticked-off links technique. Note the sidebar-specific links also. They have set widths so you can rollover anywhere along the link line */

#sidebar ul {
	list-style-type: none;
	margin: 0;
	padding: 3px 5px;
	border: 0 solid #CCC;
	color: #666;
}
#sidebar li {
	border-bottom: 1px solid #CCC;
}
#sidebar li a:link {
	color: #333366;
	line-height: 150%;
	text-decoration: none;
	display: block;
	width: 243px;
}
#sidebar li a:visited {
	color: #333366;
	text-decoration: none;
	line-height: 150%;
	display: block;
	width: 243px;
}
#sidebar li a:hover {
	color: #000;
	line-height: 150%;
	text-decoration: none;
	display: block;
	width: 243px;
}
#sidebar li a:active {
	color: #333366;
	line-height: 150%;
	text-decoration: none;
	display: block;
	width: 243px;
}

/* Ok, this is a bit nasty. Everything else on the sheet is used to control the tab menu under the header. See how you go with this, and be sure to back it up before you tinker */

#nav_wrapper {
	padding: 20px 0 0;
	border-left: 1px solid #336;
	border-right: 1px solid #336;
	border-top: 1px solid #336;
	background: url({site_url}themes/site_themes/logical_blocks/lb_menuback.gif);
	font: bold 10px 'Lucida Grande', Verdana, Arial, Sans-Serif;
}
#nav_header {
	position: relative;
	top: 0;
	left: 0;
	width: 720px;
	height: 18px;
}
#nav_header ul#primary {
	margin: 0;
	padding: 0;
	position: absolute;
	bottom: -1px;
	left: 27px;
}
#nav_header ul#primary li {
	display: inline;
	list-style: none;
}
#nav_header ul#primary a, #nav_header ul#primary span, #nav_header ul#primary a.current {
	width: 102px;
	display: block;
	float: left;
	padding: 4px;
	margin-top: 1px;
	margin-right: 3px;
	margin-bottom: 0;
	text-align: center;
	text-decoration: none;
	color: #333;
	font: 100% verdana, sans-serif;
}
#nav_header ul#primary span, #nav_header ul#primary a.current, #nav_header ul#primary a.current:hover {
	border: 1px solid #FFF;
	border-bottom: none;
	background: url({site_url}themes/site_themes/logical_blocks/lb_selected.gif);
	padding-bottom: 6px;
	margin-top: 0;
	font-weight: bold;
	color: #336;
}
#nav_header ul#primary a {
	background: url({site_url}themes/site_themes/logical_blocks/lb_tab.gif);
	border-top: 1px solid #FFF;
	border-left: 1px solid #FFF;
	border-right: 1px solid #FFF;
	border-bottom: 0 solid #336;
	font-weight: bold;
	color: #336;
}
#nav_header ul#primary a:hover {
	margin-top: 0;
	border-top: 1px solid #FFF;
	border-left: 1px solid #FFF;
	border-right: 1px solid #FFF;
	border-bottom: 0 solid #336;
	background: url({site_url}themes/site_themes/logical_blocks/lb_tabover.gif);
	font-weight: bold;
	padding-bottom: 5px;
	color: #336;
}
<?php

$buffer = ob_get_contents();
ob_end_clean();
return $buffer;

}
// END



//-------------------------------------
//	Weblog index template
//-------------------------------------

function index()
{
	global $type;

ob_start();

?>
{assign_variable:my_weblog="default_site"}
{assign_variable:my_template_group="site"}

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{lang}" lang="{lang}">
<head>
<title>{exp:weblog:info weblog="{my_weblog}"}{blog_title}{/exp:weblog:info}</title>

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

<link rel='stylesheet' type='text/css' media='all' href='{stylesheet={my_template_group}/site_css}' />
<style type='text/css' media='screen'>@import "{stylesheet={my_template_group}/site_css}";</style>

</head>

<body>


<div id="wrapper">

<div id="header"><h1>{exp:weblog:info weblog="{my_weblog}"}{blog_title}{/exp:weblog:info}</h1></div>


<div id="nav_wrapper">

<div id="nav_header">

<ul id="primary">
<li><a href="{homepage}" class="current">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Archive</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">Spare 1</a></li>
<li><a href="#">Spare 2</a></li>
</ul>

</div>

</div>



<div id="content">

<div id="sidebar">

<?php if ($type != 'core') { ?>

<h3>Members</h3>
<ul>
{if logged_out}
<li><a href="{path=member/login}">Login</a></li>
<li><a href="{path=member/register}">Register</a></li>
{/if}
{if logged_in}
<li><a href="{path=member/profile}">Your Account</a></li>
<li><a href="{path=logout}">Logout</a></li>
{/if}
<li><a href="{path=member/memberlist}">Member List</a></li>
</ul>
<?php } ?>



<h3>Categories</h3>
{exp:weblog:categories weblog="{my_weblog}" style="nested"}
<a href="{path={my_template_group}/index}">{category_name}</a>
{/exp:weblog:categories}



<h3>Most recent posts</h3>
<ul>
{exp:weblog:entries orderby="date" sort="desc" limit="15" weblog="{my_weblog}" dynamic="off"}
<li><a href="{title_permalink={my_template_group}/index}">{title}</a></li>
{/exp:weblog:entries}
</ul>


<h3>Search</h3>
{exp:search:simple_form search_in="everywhere"}
<p><input type="text" name="keywords" value="" class="input" size="18" maxlength="100" /> <input type="submit" value="submit"  class="submit" /></p>
<p><a href="{path=search/index}">Advanced Search</a></p>
{/exp:search:simple_form}




</div>



<div id="about_site">
<div class="main">
<p>
Welcome to my site! My name is John Doe, and this is my personal blog, where I talk about things that interest me. The site is built using Expression Engine, and the template was designed by Simon Collison etc.
</p>
</div>
</div>


<div id="blog">


{exp:weblog:entries weblog="{my_weblog}" orderby="date" sort="desc" limit="15"}

<div class="main">

{date_heading}
<div class="date">{entry_date format=' %l, %F %d, %Y'}</div>
{/date_heading}

<h2 class="title"><a href="{title_permalink={my_template_group}/index}">{title}</a></h2>

{summary}
{body}
{extended}

<div class="posted">
Posted by <a href="{profile_path=member/index}">{author}</a> in
{categories}
&#8226; <a href="{path=site_index}">{category_name}</a>
{/categories}
<br />

{if allow_comments}
({comment_total}) <a href="{url_title_path="{my_template_group}/comments"}">Comments</a>  &#8226;
{/if}

{if allow_trackbacks}
({trackback_total}) <a href="{trackback_path="{my_template_group}/trackbacks"}">Trackbacks</a> &#8226;
{/if}

<a href="{title_permalink={my_template_group}/index}">Permalink</a>
</div>


{paginate}
<div class="paginate">
<span class="pagecount">Page {current_page} of {total_pages} pages</span>  {pagination_links}
</div>
{/paginate}

</div>
{/exp:weblog:entries}



</div>



<br class="spacer" />

<div id="footer">

<p>
{exp:stats}
Total Entries: {total_entries}<br />
Total Comments: {total_comments}<br />
Total Trackbacks: {total_trackbacks}<br />
Most Recent Entry: {last_entry_date format="%m/%d/%Y %h:%i %a"}<br />
Most Recent Comment on:  {last_comment_date format="%m/%d/%Y %h:%i %a"}<br />
Total Members: {total_members}<br />
Total Logged in members: {total_logged_in}<br />
Total guests: {total_guests}<br />
Total anonymous users: {total_anon}<br />
Most Recent Visitor on:  {last_visitor_date format="%m/%d/%Y %h:%i %a"}<br />
The most visitors ever was {most_visitors} on  {most_visitor_date format="%m/%d/%Y %h:%i %a"}
</p>

<?php if ($type != 'core') { ?>
{if member_names}
<p>Current Logged-in Members:&nbsp;
{member_names  backspace='6'}
<a href="{member_path=member/index}">{name}</a>&nbsp;
{/member_names}
</p>
{/if}
<?php } ?>

{/exp:stats}


<p><a href="{path={my_template_group}/referrers}">Referrers</a></p>

<p>
Validation: <a href="http://validator.w3.org:8001/check?uri=referer">XHTML</a> | <a href="http://jigsaw.w3.org/css-validator/validator?uri=http://www.collylogic.com/index.php/contest/site_css">CSS</a> | Syndication: <a href="">RSS 1.0</a> | <a href="">RSS 2.0</a> | <a href="">Atom</a>
</p>

<p>
Copyright 2004 Simon Collison/pMachine. Protected and licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/1.0/" title="View details">Creative Commons License</a> (some rights reserved).
</p>

</div>

</div>

</div>

</body>
</html>
<?php

$buffer = ob_get_contents();
ob_end_clean();
return $buffer;

}
// END






//-------------------------------------
// Comments
//-------------------------------------

function comments()
{
	global $type;

ob_start();

?>
{assign_variable:my_weblog="default_site"}
{assign_variable:my_template_group="site"}

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{lang}" lang="{lang}">
<head>
<title>{exp:weblog:info weblog="{my_weblog}"}{blog_title}{/exp:weblog:info}</title>

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

<link rel='stylesheet' type='text/css' media='all' href='{stylesheet={my_template_group}/site_css}' />
<style type='text/css' media='screen'>@import "{stylesheet={my_template_group}/site_css}";</style>

</head>

<body>


<div id="wrapper">

<div id="header"><h1>{exp:weblog:info weblog="{my_weblog}"}{blog_title}{/exp:weblog:info}</h1></div>


<div id="nav_wrapper">

<div id="nav_header">

<ul id="primary">
<li><a href="{homepage}" class="current">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Archive</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">Spare 1</a></li>
<li><a href="#">Spare 2</a></li>
</ul>

</div>

</div>



<div id="content">

<div id="sidebar">

<?php if ($type != 'core') { ?>

<h3>Members</h3>
<ul>
{if logged_out}
<li><a href="{path=member/login}">Login</a></li>
<li><a href="{path=member/register}">Register</a></li>
{/if}
{if logged_in}
<li><a href="{path=member/profile}">Your Account</a></li>
<li><a href="{path=logout}">Logout</a></li>
{/if}
<li><a href="{path=member/memberlist}">Member List</a></li>
</ul>
<?php } ?>



<h3>Categories</h3>
{exp:weblog:categories weblog="{my_weblog}" style="nested"}
<a href="{path={my_template_group}/index}">{category_name}</a>
{/exp:weblog:categories}



<h3>Most recent posts</h3>
<ul>
{exp:weblog:entries orderby="date" sort="desc" limit="15" weblog="{my_weblog}" dynamic="off"}
<li><a href="{title_permalink={my_template_group}/index}">{title}</a></li>
{/exp:weblog:entries}
</ul>


<h3>Search</h3>
{exp:search:simple_form search_in="everywhere"}
<p><input type="text" name="keywords" value="" class="input" size="18" maxlength="100" /> <input type="submit" value="submit"  class="submit" /></p>
<p><a href="{path=search/index}">Advanced Search</a></p>
{/exp:search:simple_form}




</div>



<div id="about_site">
<div class="main">
<p>
Welcome to my site! My name is John Doe, and this is my personal blog, where I talk about things that interest me. The site is built using Expression Engine, and the template was designed by Simon Collison etc.
</p>
</div>
</div>


<div id="blog">


{exp:weblog:entries limit="1"}

<div class="main">

{date_heading}
<div class="date">{entry_date format=' %l, %F %d, %Y'}</div>
{/date_heading}

<h2 class="title"><a href="{title_permalink={my_template_group}/index}">{title}</a></h2>

{summary}
{body}
{extended}

<div class="posted">
Posted by <a href="{profile_path=member/index}">{author}</a> in
{categories}
&#8226; <a href="{path=site_index}">{category_name}</a>
{/categories}
<br />

{if allow_comments}
({comment_total}) <a href="{url_title_path="{my_template_group}/comments"}">Comments</a>  &#8226;
{/if}

{if allow_trackbacks}
({trackback_total}) <a href="{trackback_path="{my_template_group}/trackbacks"}">Trackbacks</a> &#8226;
{/if}

<a href="{title_permalink={my_template_group}/index}">Permalink</a>
</div>

</div>
{/exp:weblog:entries}



{exp:weblog:next_entry weblog="{my_weblog}"}
<p>Next entry: <a href="{path={my_template_group}/comments}">{title}</a></p>
{/exp:weblog:next_entry}

{exp:weblog:prev_entry weblog="{my_weblog}"}
<p>Previous entry: <a href="{path={my_template_group}/comments}">{title}</a></p>
{/exp:weblog:prev_entry}


<a name="comment"></a>

<div class="main"><h2 class="title">Comments</h2></div>


{exp:comment:entries weblog="{my_weblog}" limit="25"}
<div class="main">
{comment}
<div class="posted">{url_or_email_as_author}  &nbsp;on&nbsp; {comment_date format='%m/%d'} &nbsp;at&nbsp; {comment_date format='%h:%i %A'}</div>

{paginate}
<div class="paginate">
<span class="pagecount">Page {current_page} of {total_pages} pages</span>  {pagination_links}
</div>
{/paginate}

</div>
{/exp:comment:entries}




<div class="main"><h2 class="title">Add a comment</h2></div>


{exp:comment:form preview="{my_template_group}/comment_preview"}

{if logged_out}
<p>
Name:<br />
<input type="text" name="name" value="{name}" size="50" />
</p>
<p>
Email:<br />
<input type="text" name="email" value="{email}" size="50" />
</p>
<p>
Location:<br />
<input type="text" name="location" value="{location}" size="50" />
</p>
<p>
URL:<br />
<input type="text" name="url" value="{url}" size="50" />
</p>

{/if}

<p>
<a href="{path={my_template_group}/smileys}" onclick="window.open(this.href, '_blank', 'width=400,height=440');return false;" onkeypress="this.onclick()">Smileys</a>
</p>


<p>
<textarea name="comment" cols="50" rows="12" style="width:95%">{comment}</textarea>
</p>

{if logged_out}
<p><input type="checkbox" name="save_info" value="yes" {save_info} /> Remember my personal information</p>
{/if}

<p><input type="checkbox" name="notify_me" value="yes" {notify_me} /> Notify me of follow-up comments?</p>

{if captcha}
<p>Submit the word you see below:</p>
<p>
{captcha}
<br />
<input type="text" name="captcha" value="" size="20" maxlength="20" style="width:140px;" />
</p>
{/if}

<input type="submit" name="submit" value="Submit" />
<input type="submit" name="preview" value="Preview" />

{/exp:comment:form}


</div>

<br class="spacer" />

<div id="footer">

<p>
{exp:stats}
Total Entries: {total_entries}<br />
Total Comments: {total_comments}<br />
Total Trackbacks: {total_trackbacks}<br />
Most Recent Entry: {last_entry_date format="%m/%d/%Y %h:%i %a"}<br />
Most Recent Comment on:  {last_comment_date format="%m/%d/%Y %h:%i %a"}<br />
Total Members: {total_members}<br />
Total Logged in members: {total_logged_in}<br />
Total guests: {total_guests}<br />
Total anonymous users: {total_anon}<br />
Most Recent Visitor on:  {last_visitor_date format="%m/%d/%Y %h:%i %a"}<br />
The most visitors ever was {most_visitors} on  {most_visitor_date format="%m/%d/%Y %h:%i %a"}
</p>

<?php if ($type != 'core') { ?>
{if member_names}
<p>Current Logged-in Members:&nbsp;
{member_names  backspace='6'}
<a href="{member_path=member/index}">{name}</a>&nbsp;
{/member_names}
</p>
{/if}
<?php } ?>

{/exp:stats}

<p><a href="{path={my_template_group}/referrers}">Referrers</a></p>

<p>
Validation: <a href="http://validator.w3.org:8001/check?uri=referer">XHTML</a> | <a href="http://jigsaw.w3.org/css-validator/validator?uri=http://www.collylogic.com/index.php/contest/site_css">CSS</a> | Syndication: <a href="">RSS 1.0</a> | <a href="">RSS 2.0</a> | <a href="">Atom</a>
</p>

<p>
Copyright 2004 Simon Collison/pMachine. Protected and licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/1.0/" title="View details">Creative Commons License</a> (some rights reserved).
</p>

</div>

</div>

</div>

</body>
</html>
<?php

$buffer = ob_get_contents();
ob_end_clean();
return $buffer;

}
// END




//-------------------------------------
//	Comment preview
//-------------------------------------

function comment_preview()
{
	global $type;

ob_start();

?>
{assign_variable:my_weblog="default_site"}
{assign_variable:my_template_group="site"}

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{lang}" lang="{lang}">
<head>
<title>{exp:weblog:info weblog="{my_weblog}"}{blog_title}{/exp:weblog:info}</title>

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

<link rel='stylesheet' type='text/css' media='all' href='{stylesheet={my_template_group}/site_css}' />
<style type='text/css' media='screen'>@import "{stylesheet={my_template_group}/site_css}";</style>

</head>

<body>


<div id="wrapper">

<div id="header"><h1>{exp:weblog:info weblog="{my_weblog}"}{blog_title}{/exp:weblog:info}</h1></div>


<div id="nav_wrapper">

<div id="nav_header">

<ul id="primary">
<li><a href="{homepage}" class="current">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Archive</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">Spare 1</a></li>
<li><a href="#">Spare 2</a></li>
</ul>

</div>

</div>



<div id="content">

<div id="sidebar">

<?php if ($type != 'core') { ?>
<h3>Members</h3>
<ul>
{if logged_out}
<li><a href="{path=member/login}">Login</a></li>
<li><a href="{path=member/register}">Register</a></li>
{/if}
{if logged_in}
<li><a href="{path=member/profile}">Your Account</a></li>
<li><a href="{path=logout}">Logout</a></li>
{/if}
<li><a href="{path=member/memberlist}">Member List</a></li>
</ul>
<?php } ?>



<h3>Categories</h3>
{exp:weblog:categories weblog="{my_weblog}" style="nested"}
<a href="{path={my_template_group}/index}">{category_name}</a>
{/exp:weblog:categories}



<h3>Most recent posts</h3>
<ul>
{exp:weblog:entries orderby="date" sort="desc" limit="15" weblog="{my_weblog}" dynamic="off"}
<li><a href="{title_permalink={my_template_group}/index}">{title}</a></li>
{/exp:weblog:entries}
</ul>


<h3>Search</h3>
{exp:search:simple_form search_in="everywhere"}
<p><input type="text" name="keywords" value="" class="input" size="18" maxlength="100" /> <input type="submit" value="submit"  class="submit" /></p>
<p><a href="{path=search/index}">Advanced Search</a></p>
{/exp:search:simple_form}




</div>



<div id="about_site">
<div class="main">
<p>
Welcome to my site! My name is John Doe, and this is my personal blog, where I talk about things that interest me. The site is built using Expression Engine, and the template was designed by Simon Collison etc.
</p>
</div>
</div>


<div id="blog">



<div class="main"><h2 class="title">Preview</h2></div>

<div class="main">
{exp:comment:preview}
{comment}
{/exp:comment:preview}
</div>



{exp:comment:form preview="{my_template_group}/comment_preview"}

{if logged_out}
<p>
Name:<br />
<input type="text" name="name" value="{name}" size="50" />
</p>
<p>
Email:<br />
<input type="text" name="email" value="{email}" size="50" />
</p>
<p>
Location:<br />
<input type="text" name="location" value="{location}" size="50" />
</p>
<p>
URL:<br />
<input type="text" name="url" value="{url}" size="50" />
</p>

{/if}

<p>
<a href="{path={my_template_group}/smileys}" onclick="window.open(this.href, '_blank', 'width=400,height=440');return false;" onkeypress="this.onclick()">Smileys</a>
</p>


<p>
<textarea name="comment" cols="50" rows="12" style="width:100%">{comment}</textarea>
</p>

{if logged_out}
<p><input type="checkbox" name="save_info" value="yes" {save_info} /> Remember my personal information</p>
{/if}

<p><input type="checkbox" name="notify_me" value="yes" {notify_me} /> Notify me of follow-up comments?</p>

{if captcha}
<p>Submit the word you see below:</p>
<p>
{captcha}
<br />
<input type="text" name="captcha" value="" size="20" maxlength="20" style="width:140px;" />
</p>
{/if}

<input type="submit" name="submit" value="Submit" />
<input type="submit" name="preview" value="Preview" />

{/exp:comment:form}


</div>



<br class="spacer" />

<div id="footer">

<p>
{exp:stats}
Total Entries: {total_entries}<br />
Total Comments: {total_comments}<br />
Total Trackbacks: {total_trackbacks}<br />
Most Recent Entry: {last_entry_date format="%m/%d/%Y %h:%i %a"}<br />
Most Recent Comment on:  {last_comment_date format="%m/%d/%Y %h:%i %a"}<br />
Total Members: {total_members}<br />
Total Logged in members: {total_logged_in}<br />
Total guests: {total_guests}<br />
Total anonymous users: {total_anon}<br />
Most Recent Visitor on:  {last_visitor_date format="%m/%d/%Y %h:%i %a"}<br />
The most visitors ever was {most_visitors} on  {most_visitor_date format="%m/%d/%Y %h:%i %a"}

<?php if ($type != 'core') { ?>
{if member_names}
<p>Current Logged-in Members:&nbsp;
{member_names  backspace='6'}
<a href="{member_path=member/index}">{name}</a>&nbsp;
{/member_names}
</p>
{/if}
<?php } ?>

{/exp:stats}

</p>

<p><a href="{path={my_template_group}/referrers}">Referrers</a></p>

<p>
Validation: <a href="http://validator.w3.org:8001/check?uri=referer">XHTML</a> | <a href="http://jigsaw.w3.org/css-validator/validator?uri=http://www.collylogic.com/index.php/contest/site_css">CSS</a> | Syndication: <a href="">RSS 1.0</a> | <a href="">RSS 2.0</a> | <a href="">Atom</a>
</p>

<p>
Copyright 2004 Simon Collison/pMachine. Protected and licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/1.0/" title="View details">Creative Commons License</a> (some rights reserved).
</p>

</div>

</div>
</body>
</html>
<?php

$buffer = ob_get_contents();
ob_end_clean();
return $buffer;

}
// END





//-------------------------------------
//	Trackbacks
//-------------------------------------

function trackbacks()
{
	global $type;

ob_start();

?>
{assign_variable:my_weblog="default_site"}
{assign_variable:my_template_group="site"}

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{lang}" lang="{lang}">
<head>
<title>{exp:weblog:info weblog="{my_weblog}"}{blog_title}{/exp:weblog:info}</title>

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

<link rel='stylesheet' type='text/css' media='all' href='{stylesheet={my_template_group}/site_css}' />
<style type='text/css' media='screen'>@import "{stylesheet={my_template_group}/site_css}";</style>

</head>

<body>


<div id="wrapper">

<div id="header"><h1>{exp:weblog:info weblog="{my_weblog}"}{blog_title}{/exp:weblog:info}</h1></div>


<div id="nav_wrapper">

<div id="nav_header">

<ul id="primary">
<li><a href="{homepage}" class="current">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Archive</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">Spare 1</a></li>
<li><a href="#">Spare 2</a></li>
</ul>

</div>

</div>



<div id="content">

<div id="sidebar">

<?php if ($type != 'core') { ?>
<h3>Members</h3>
<ul>
{if logged_out}
<li><a href="{path=member/login}">Login</a></li>
<li><a href="{path=member/register}">Register</a></li>
{/if}
{if logged_in}
<li><a href="{path=member/profile}">Your Account</a></li>
<li><a href="{path=logout}">Logout</a></li>
{/if}
<li><a href="{path=member/memberlist}">Member List</a></li>
</ul>
<?php } ?>

<h3>Categories</h3>
{exp:weblog:categories weblog="{my_weblog}" style="nested"}
<a href="{path={my_template_group}/index}">{category_name}</a>
{/exp:weblog:categories}


<h3>Most recent posts</h3>
<ul>
{exp:weblog:entries orderby="date" sort="desc" limit="15" weblog="{my_weblog}" dynamic="off"}
<li><a href="{title_permalink={my_template_group}/index}">{title}</a></li>
{/exp:weblog:entries}
</ul>


<h3>Search</h3>
{exp:search:simple_form search_in="everywhere"}
<p><input type="text" name="keywords" value="" class="input" size="18" maxlength="100" /> <input type="submit" value="submit"  class="submit" /></p>
<p><a href="{path=search/index}">Advanced Search</a></p>
{/exp:search:simple_form}


</div>


<div id="about_site">
<div class="main">
<p>
Welcome to my site! My name is John Doe, and this is my personal blog, where I talk about things that interest me. The site is built using Expression Engine, and the template was designed by Simon Collison etc.
</p>
</div>
</div>


<div id="blog">



<div class="main">
<h2 class="title">The trackback URL for this entry is:</h2>
<form action="">
<p><input type="text" value="{exp:trackback:url}" size="40" class="input" style="width:99%" /></p>
</form>
</div>


<div class="main"><h2 class="title">Trackbacks</h2></div>

{exp:trackback:entries}
<div class="main">

{if no_results}
<div class="main"><p>There are no trackbacks for this entry</p></div>
{/if}

<h2>{title}</h2>

{content}

<div class="posted">Tracked on: <a href="{trackback_url}">{weblog_name}</a> ({trackback_ip}) at {trackback_date format="%Y %m %d %H:%i:%s"}</div>
</div>
{/exp:trackback:entries}


</div>

<br class="spacer" />

<div id="footer">

<p>
{exp:stats}
Total Entries: {total_entries}<br />
Total Comments: {total_comments}<br />
Total Trackbacks: {total_trackbacks}<br />
Most Recent Entry: {last_entry_date format="%m/%d/%Y %h:%i %a"}<br />
Most Recent Comment on:  {last_comment_date format="%m/%d/%Y %h:%i %a"}<br />
Total Members: {total_members}<br />
Total Logged in members: {total_logged_in}<br />
Total guests: {total_guests}<br />
Total anonymous users: {total_anon}<br />
Most Recent Visitor on:  {last_visitor_date format="%m/%d/%Y %h:%i %a"}<br />
The most visitors ever was {most_visitors} on  {most_visitor_date format="%m/%d/%Y %h:%i %a"}
</p>

<?php if ($type != 'core') { ?>
{if member_names}
<p>Current Logged-in Members:&nbsp;
{member_names  backspace='6'}
<a href="{member_path=member/index}">{name}</a>&nbsp;
{/member_names}
</p>
{/if}
<?php } ?>


{/exp:stats}

<p><a href="{path={my_template_group}/referrers}">Referrers</a></p>

<p>
Validation: <a href="http://validator.w3.org:8001/check?uri=referer">XHTML</a> | <a href="http://jigsaw.w3.org/css-validator/validator?uri=http://www.collylogic.com/index.php/contest/site_css">CSS</a> | Syndication: <a href="">RSS 1.0</a> | <a href="">RSS 2.0</a> | <a href="">Atom</a>
</p>

<p>
Copyright 2004 Simon Collison/pMachine. Protected and licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/1.0/" title="View details">Creative Commons License</a> (some rights reserved).
</p>

</div>

</div>

</div>

</body>
</html>
<?php

$buffer = ob_get_contents();
ob_end_clean();
return $buffer;

}
// END


//-------------------------------------
//	Smileys
//-------------------------------------

function smileys()
{
	global $type;

ob_start();

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{lang}" lang="{lang}">
<head>
<meta http-equiv="content-type" content="text/html; charset={charset}" />
<title>Smileys</title>

<style type="text/css">

body {
 background-color: #ffffff;
 margin-left: 40px;
 margin-right: 40px;
 margin-top: 30px;
 font-size: 11px;
 font-family: verdana,trebuchet,sans-serif;
}
a:link {
 color: #990000;
 font-size: 11px;
 font-weight: normal;
 text-decoration: underline;
}
a:visited {
 color: #990000;
 font-size: 11px;
 font-weight: normal;
 text-decoration: underline;
}
a:active {
 color: #990000;
 font-size: 11px;
 font-weight: normal;
 text-decoration: underline;
}
a:hover {
 color: #990000;
 font-size: 11px;
 font-weight: normal;
 text-decoration: none;
}

</style>

<script language="javascript">
<!--

function add_smiley(smiley)
{
    opener.document.comment_form.comment.value += " " + smiley + " ";
    opener.window.document.comment_form.comment.focus();
    window.close();
}
//-->
</script>

</head>
<body>

<p>Click on an image to add it to your comment</p>

<table border="0" width="100%" cellpadding="6" cellspacing="1">

{exp:emoticon columns="4"}
<tr>
<td><div>{smiley}</div></td>
</tr>
{/exp:emoticon}

</table>

</body>
</html>
<?php

$buffer = ob_get_contents();
ob_end_clean();
return $buffer;

}
// END


//-------------------------------------
//	Default referrers
//-------------------------------------

function referrers()
{
	global $type;

ob_start();

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{lang}" lang="{lang}">

<head>
<meta http-equiv="content-type" content="text/html; charset={charset}" />
<title>Referrers</title>

<style type="text/css">

body {
 background-color: #ffffff;
 margin-left: 40px;
 margin-right: 40px;
 margin-top: 30px;
 font-size: 11px;
 font-family: verdana,trebuchet,sans-serif;
}
h4 {
 font-size: 14px;
 font-family: verdana,trebuchet,sans-serif;
}
a:link {
 color: #990000;
 font-size: 11px;
 font-weight: normal;
 text-decoration: underline;
}
a:visited {
 color: #990000;
 font-size: 11px;
 font-weight: normal;
 text-decoration: underline;
}
a:active {
 color: #990000;
 font-size: 11px;
 font-weight: normal;
 text-decoration: underline;
}
a:hover {
 color: #990000;
 font-size: 11px;
 font-weight: normal;
 text-decoration: none;
}

</style>
</head>
<body>

<h4>Referrers</h4>

<table border="0" width="100%" cellpadding="6" cellspacing="1">
<tr>
<td>From</td>
<td>To</td>
<td>IP Address</td>
<td>Date</td>
</tr>

{exp:referrer limit="50" popup="yes"}
<tr class="row">
<td><div>{ref_from}</div></td>
<td><div>{ref_to}</div></td>
<td><div>{ref_ip}</div></td>
<td><div>{ref_date format="%m/%d/%Y"}</div></td>
</tr>
{/exp:referrer}

</table>

</body>
</html>
<?php

$buffer = ob_get_contents();
ob_end_clean();
return $buffer;

}
// END
?>