<?php

$template_matrix = array(
							array('index',				'webpage'),
							array('archives',			'webpage'),
							array('categories',			'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();
?>
body {
margin: 0;
padding: 0;
background: #003366;
color: #000;
width: 100%;
}

h1, h2, h3 {
font-family: lucida grande, verdana, arial, helvetica, sans-serif;}

h4 {
font-family: lucida grande, verdana, arial, helvetica, sans-serif;
margin-bottom: 4px;
}

p {
font-family: lucida grande, verdana, arial, helvetica, sans-serif;
}

blockquote {
font-family: georgia, times new roman, times, serif;
font-size: 12px;
background: transparent;
color: #333;
}

.center {
text-align: center;
}

ul {
list-style: square;
margin-top: 3px;
margin-bottom: 3px;
margin-left: 1em;
padding-left: 1em;
}

li {
font-family: lucida grande, verdana, arial, sans-serif;
}

img {
margin: 0;
padding: 0;
border: 0;
}

a:link { color: #FF6600; border-bottom: 1px dashed #ccc; background-color: transparent; text-decoration: none; }
a:hover { color: #ccc; border: 0; background-color: #FF6600; text-decoration: none; }
a:visited { color: #FF6600; border: 0; background-color: transparent; text-decoration: none; }

#blogtitle {
margin: 0;
padding: 10px;
text-align: left;
background: #609EFF;
color: #eef;
border: 3px solid #fff;
}

#blogtitle h1 {
font: bold 40px tahoma, georgia, times new roman, times, serif;
margin: 0;
padding: 0;
}

#content {
position: relative;
margin: 0 330px 0 0;
padding: 10px;
border-right: 5px solid #fff;
background: #E0ECFF;
color: #000;
}

#stats {
position: relative;
margin: 14px 330px 0 0;
padding: 10px;
border-right: 5px solid #fff;
background: #E0ECFF;
color: #000;
}

#stats p {
font-face: verdana, arial, sans-serif;
font-size: 11px;
}

#stats h2 {
font: bold 18px tahoma, georgia, times new roman, times, serif;
margin: 0;
padding: 0;
}

#content p {
font-size: 12px;
background: transparent;
color: #000;
text-align: justify;
}

#content li {
font-size: 12px;
background: transparent;
color: #000;
}

.date {
font-size: 13px;
background: transparent;
color: #036;
text-align: left;
margin-top: 20px;
margin-bottom: 0;
padding: 0;
}

.title {
margin: 0;
padding: 0;
font-size: 17px;
background: transparent;
color: #330000;
text-align: left;
}

.posted {
font: 10px lucida grande, verdana, arial, helvetica, sans-serif;
background: transparent;
color: #666;
text-align: right;
margin: 0;
padding-top: 0;
padding-bottom: 20px;
}

#rightbar {
position: absolute;
top: 0;
right: 130px;
border: 0;
color: #fff;
margin: 0;
padding: 0;
width: 200px;
background: transparent;
}

#rightbar p {
font-size: 11px;
margin: 10px;
background: transparent;
color: #fff;
}

#rightbar li {
font-size: 11px;
background: transparent;
color: #fff;
}

.sidetitle {
margin: 15px 10px 10px 10px;
font-size: 12px;
background: transparent;
color: #fc0;
}

.paginate {
 font-family:		Verdana, Geneva, Tahoma, Trebuchet MS, Arial, Sans-serif;
 font-size:			12px;
 font-weight: 		normal;
 letter-spacing:	.1em;
 padding:			10px 6px 10px 4px;
 margin:			0;
 background-color:	transparent;
}

.pagecount {
 font-family:		Verdana, Geneva, Tahoma, Trebuchet MS, Arial, Sans-serif;
 font-size:			10px;
 color:				#666;
 font-weight:		normal;
 background-color: transparent;
}

.calendarBG {
 background-color: #000;
}

.calendarBlank {
 background-color: #fff;
}

.calendarHeader {
 font-weight: bold;
 color: #fff;
 text-align: center;
 background-color: #000;
}

.calendarMonthLinks {
 font-family:       Arial, Trebuchet MS, Tahoma, Verdana, Sans-serif;
 font-size:         11px;
 font-weight:		bold;
 letter-spacing:	.1em;
 text-decoration:   none;
 color:             #fff;
 background-color:  transparent;
}

.calendarMonthLinks a {
 color:             #fff;
 text-decoration:   none;
 background-color:  transparent;
}

.calendarMonthLinks a:visited {
 color:             #fff;
 text-decoration:   none;
 background-color:  transparent;
}

.calendarMonthLinks a:hover {
 color:             #ccc;
 text-decoration:   underline;
 background-color:  transparent;
}

.calendarDayHeading {
 font-weight: bold;
 font-size:	11px;
 color: #fff;
 background-color: #fc0;
 text-align:  center;
 vertical-align: middle;
}

.calendarToday {
 font-family:       Arial, Trebuchet MS, Tahoma, Verdana, Sans-serif;
 font-size:         12px;
 font-weight:		bold;
 letter-spacing:	.1em;
 text-decoration:   none;
 text-align:  center;
 vertical-align: middle;
 color:             #000;
 background-color: 	#fc0;
}

.calendarCell {
 font-family:       Arial, Trebuchet MS, Tahoma, Verdana, Sans-serif;
 font-size:         12px;
 font-weight:		bold;
 letter-spacing:	.1em;
 text-decoration:   none;
 text-align:  center;
 vertical-align: middle;
 color:             #666;
 background-color:  #E0ECFF;
}

.calendarCell a {
 color:             #000;
 text-decoration:   underline;
 background-color:  transparent;
}

.calendarCell a:visited {
 color:             #000;
 text-decoration:   underline;
 background-color:  transparent;
}

.calendarCell a:hover {
 color:             #fff;
 text-decoration:   none;
 background-color:  transparent;
}
.spacer {
margin: 0;
padding: 0;
clear: both;
}

.input {
border-top:        1px solid #999999;
border-left:       1px solid #999999;
background-color:  #fff;
color:             #000;
font-family:       Verdana, Geneva, Tahoma, Trebuchet MS, Arial, Sans-serif;
font-size:         11px;
height:            1.6em;
padding:           .3em 0 0 2px;
margin-top:        6px;
margin-bottom:     3px;
}

.textarea {
border-top:        1px solid #999999;
border-left:       1px solid #999999;
background-color:  #fff;
color:             #000;
font-family:       Verdana, Geneva, Tahoma, Trebuchet MS, Arial, Sans-serif;
font-size:         11px;
margin-top:        3px;
margin-bottom:     3px;
}

.checkbox {
background-color:  transparent;
margin:            3px;
padding:           0;
border:            0;
}

.submit {
background-color:  #fff;
font-family:       Arial, Verdana, Sans-serif;
font-size:         11px;
font-weight:       normal;
letter-spacing:    .1em;
padding:           1px 3px 1px 3px;
margin-top:        6px;
margin-bottom:     4px;
text-transform:    uppercase;
color:             #000;
}
<?php

$buffer = ob_get_contents();
ob_end_clean();
return $buffer;
}
// END


//-------------------------------------
//	Weblog 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>
<meta http-equiv="content-type" content="text/html; charset={charset}" />
<title>{exp:weblog:info weblog="{my_weblog}"}{blog_title}{/exp:weblog:info}</title>

<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="content">

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


<div class="spacer">&nbsp;</div>

{exp:weblog:category_heading weblog="{my_weblog}"}
<h1>{category_name}</h1>
{if category_description}
<p>{category_description}</p>
{/if}
{/exp:weblog:category_heading}


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

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

<h2 class="title">{title}</h2>

{summary}

{body}

{extended}

<div class="posted">Posted by <?php if ($type != 'core') { ?>{author}<?php } else { ?><a href="{profile_path=member/index}">{author}</a><?php } ?>  on {entry_date format='%m/%d'} at {entry_date format='%h:%i %A'}
<br />

{categories}
<a href="{path=site_index}">{category_name}</a> &#8226;
{/categories}

{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}/comments}">Permalink</a>
</div>

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

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


<div id="stats">

<h2>Statistics</h2>
<p>
This page has been viewed {hits} times<br />
Page rendered in {elapsed_time} seconds<br />

{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"}

{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}

{/exp:stats}

</p>

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

<p><a href="http://www.pmachine.com/">Powered by ExpressionEngine</a></p>

</div>



<div id="rightbar">


<?php if ($type != 'core') { ?>
<p><b>Members:</b>
<br />
{if logged_in}
 <a href="{path=member/profile}">Your Account</a>  |  <a href="{path=logout}">Logout</a>
{/if}

{if logged_out}
 <a href="{path=member/login}">Login</a> | <a href="{path=member/register}">Register</a>
{/if}

 | <a href="{path=member/memberlist}">Member List</a>
</p>
<?php } ?>


<h2 class="sidetitle">About</h2>
<p>Quote meon an estimate et non interruptus stadium. Sic tempus fugit esperanto hiccup estrogen. Glorious baklava ex librus hup hey ad infinitum. Non sequitur condominium facile et geranium incognito.</p>

{exp:weblog:calendar switch="calendarToday|calendarCell"}
<p>
 <table class="calendarBG" border="0" cellpadding="5" cellspacing="1" summary="My Calendar">
<tr>
<th class="calendarHeader"><div class="calendarMonthLinks"><a href="{previous_path={my_template_group}/index}">&lt;&lt;</a></div></th>
<th class="calendarHeader" colspan="5">{date format="%F %Y"}</th>
<th class="calendarHeader"><div class="calendarMonthLinks"><a class="calendarMonthLinks" href="{next_path={my_template_group}/index}">&gt;&gt;</a></div></th>
</tr>
<tr>
{calendar_heading}
<td class="calendarDayHeading">{lang:weekday_abrev}</td>
{/calendar_heading}
</tr>
{calendar_rows }
{row_start}<tr>{/row_start}
{if entries}<td class='{switch}' align='center'><a href="{day_path={my_template_group}/index}">{day_number}</a></td>{/if}
{if not_entries}<td class='{switch}' align='center'>{day_number}</td>{/if}
{if blank}<td class='calendarBlank'>&nbsp;</td>{/if}
{row_end}</tr>{/row_end}
{/calendar_rows}
</table>
</p>
{/exp:weblog:calendar}

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

<p><input type="submit" value="submit"  class="submit" /></p>

{/exp:search:simple_form}


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

<h2 class="sidetitle">Monthly Archives</h2>
<ul>
{exp:weblog:month_links weblog="{my_weblog}"}
<li><a href="{path={my_template_group}/index}">{month} {year}</a></li>
{/exp:weblog:month_links}

<li><a href="{path={my_template_group}/archives}">Complete Archives</a></li>
<li><a href="{path={my_template_group}/categories}">Category Archives</a></li>
</ul>

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

<h2 class="sidetitle">Syndicate</h2>
<ul>
<li><a href="{path={my_template_group}/rss_2.0}">RSS 2.0</a></li>
<li><a href="{path={my_template_group}/atom}">Atom</a></li>
</ul>

<?php if ($type != 'core') { ?>
<h2 class="sidetitle">Join our Mailing List</h2>
{exp:mailinglist:form}
<p><input type="text" name="email" value="" class="input" size="18" /></p>
<p><input type="submit" value="submit"  class="submit" /></p>
{/exp:mailinglist:form}
<?php } ?>





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

$buffer = ob_get_contents();
ob_end_clean();
return $buffer;
}
// END


//-------------------------------------
//	Archives template
//-------------------------------------

function archives()
{
	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>
<meta http-equiv="content-type" content="text/html; charset={charset}" />
<title>{exp:weblog:info weblog="{my_weblog}"}{blog_title}{/exp:weblog:info}</title>

<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="content">

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

<div class="spacer">&nbsp;</div>

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

{date_heading display="yearly"}
<h2 class="title">{entry_date format="%Y"}</h2>
{/date_heading}

{date_heading display="monthly"}
<h3 class="date">{entry_date format="%F"}</h3>
{/date_heading}

<ul>
<li><a href="{title_permalink="{my_template_group}/index"}">{title}</a></li>
</ul>

{/exp:weblog:entries}



<p><a href="{homepage}">&lt;&lt; Back to main</a></p>
</div>
<div id="rightbar">

<?php if ($type != 'core') { ?>
<p><b>Members:</b>
<br />
{if logged_in}
 <a href="{path=member/profile}">Your Account</a>  |  <a href="{path=logout}">Logout</a>
{/if}

{if logged_out}
 <a href="{path=member/login}">Login</a> | <a href="{path=member/register}">Register</a>
{/if}

 | <a href="{path=member/memberlist}">Member List</a>
</p>
<?php } ?>


<h2 class="sidetitle">About</h2>
<p>Quote meon an estimate et non interruptus stadium. Sic tempus fugit esperanto hiccup estrogen. Glorious baklava ex librus hup hey ad infinitum. Non sequitur condominium facile et geranium incognito.</p>
<h2 class="sidetitle">Monthly Archives</h2>
<ul>
{exp:weblog:month_links weblog="{my_weblog}"}

<li><a href="{path={my_template_group}/index}">{month} {year}</a></li>
{/exp:weblog:month_links}


<li><a href="{path={my_template_group}/archives}">Complete Archives</a></li>
<li><a href="{path={my_template_group}/categories}">Category Archives</a></li>
</ul>
<h2 class="sidetitle">Most recent entries</h2>
<ul>
{exp:weblog:entries orderby="date" sort="desc" limit="15" weblog="{my_weblog}" dynamic="off"}
<li><a href="{title_permalink={my_template_group}/comments}">{title}</a></li>
{/exp:weblog:entries}
</ul>

<h2 class="sidetitle">Syndicate</h2>
<ul>
<li><a href="{path={my_template_group}/rss_2.0}">RSS 2.0</a></li>
<li><a href="{path={my_template_group}/atom}">Atom</a></li>
</ul>

<h2 class="sidetitle">Statistics</h2>
<ul>
<li>This page has been viewed {hits} times</li>
<li>Page rendered in {elapsed_time} seconds</li>
<li><a href="{path={my_template_group}/referrers}">Referrers</a></li>
</ul>

<p><a href="http://www.pmachine.com/">Powered by ExpressionEngine</a></p>

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

$buffer = ob_get_contents();
ob_end_clean();
return $buffer;
}
// END



//-------------------------------------
//  Category archives template
//-------------------------------------

function categories()
{
	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>
<meta http-equiv="content-type" content="text/html; charset={charset}" />
<title>{exp:weblog:info weblog="{my_weblog}"}{blog_title}{/exp:weblog:info}</title>

<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="content">

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

<div class="spacer">&nbsp;</div>


<h2 class="sidetitle">Categories</h2>

{exp:weblog:category_archive weblog="{my_weblog}"}

{categories}<h4>{category_name}</h4>{/categories}

{entry_titles}<a href="{path={my_template_group}/comments}">{title}</a>{/entry_titles}

{/exp:weblog:category_archive}



<p><a href="{homepage}">&lt;&lt; Back to main</a></p>
</div>
<div id="rightbar">

<?php if ($type != 'core') { ?>
<p><b>Members:</b>
<br />
{if logged_in}
 <a href="{path=member/profile}">Your Account</a>  |  <a href="{path=logout}">Logout</a>
{/if}

{if logged_out}
 <a href="{path=member/login}">Login</a> | <a href="{path=member/register}">Register</a>
{/if}

 | <a href="{path=member/memberlist}">Member List</a>
</p>
<?php } ?>


<h2 class="sidetitle">About</h2>
<p>Quote meon an estimate et non interruptus stadium. Sic tempus fugit esperanto hiccup estrogen. Glorious baklava ex librus hup hey ad infinitum. Non sequitur condominium facile et geranium incognito.</p>
<h2 class="sidetitle">Monthly Archives</h2>
<ul>
{exp:weblog:month_links weblog="{my_weblog}"}

<li><a href="{path={my_template_group}/index}">{month} {year}</a></li>
{/exp:weblog:month_links}


<li><a href="{path={my_template_group}/archives}">Complete Archives</a></li>
<li><a href="{path={my_template_group}/categories}">Category Archives</a></li>
</ul>
<h2 class="sidetitle">Most recent entries</h2>
<ul>
{exp:weblog:entries orderby="date" sort="desc" limit="15" weblog="{my_weblog}" dynamic="off"}
<li><a href="{title_permalink={my_template_group}/comments}">{title}</a></li>
{/exp:weblog:entries}
</ul>

<h2 class="sidetitle">Syndicate</h2>
<ul>
<li><a href="{path={my_template_group}/rss_2.0}">RSS 2.0</a></li>
<li><a href="{path={my_template_group}/atom}">Atom</a></li>
</ul>

<h2 class="sidetitle">Statistics</h2>
<ul>
<li>This page has been viewed {hits} times</li>
<li>Page rendered in {elapsed_time} seconds</li>
<li><a href="{path={my_template_group}/referrers}">Referrers</a></li>
</ul>

<p><a href="http://www.pmachine.com/">Powered by ExpressionEngine</a></p>

</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>
<meta http-equiv="content-type" content="text/html; charset={charset}" />
<title>{exp:weblog:info weblog="{my_weblog}"}{blog_title}{/exp:weblog:info}</title>

<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="content">

<div id="blogtitle">
<h1>{exp:weblog:info weblog="{my_weblog}"}{blog_title}{/exp:weblog:info}</h1>
</div>
<div class="spacer">&nbsp;</div>


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

<h2 class="title">{title}</h2>

{summary}

{body}

<div class="posted">Posted by <?php if ($type != 'core') { ?>{author}<?php } else { ?><a href="{profile_path=member/index}">{author}</a><?php } ?>  on {entry_date format='%m/%d'} at {entry_date format='%h:%i %A'}

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



<div class="spacer">&nbsp;</div>

<ol>
{exp:comment:entries weblog="{my_weblog}" limit="25"}

<li>{comment}

<div class="posted">Posted by {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}

</li>

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


{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="45" rows="10">{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 class="center">

{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}

</div>



<p><a href="{homepage}">&lt;&lt; Back to main</a></p>

</div>

<div id="rightbar">

<?php if ($type != 'core') { ?>
<p><b>Members:</b>
<br />
{if logged_in}
 <a href="{path=member/profile}">Your Account</a>  |  <a href="{path=logout}">Logout</a>
{/if}

{if logged_out}
 <a href="{path=member/login}">Login</a> | <a href="{path=member/register}">Register</a>
{/if}

 | <a href="{path=member/memberlist}">Member List</a>
</p>
<?php } ?>


<h2 class="sidetitle">About</h2>
<p>Quote meon an estimate et non interruptus stadium. Sic tempus fugit esperanto hiccup estrogen. Glorious baklava ex librus hup hey ad infinitum. Non sequitur condominium facile et geranium incognito.</p>


<h2 class="sidetitle">Monthly Archives</h2>
<ul>
{exp:weblog:month_links weblog="{my_weblog}"}
<li><a href="{path={my_template_group}/index}">{month} {year}</a></li>
{/exp:weblog:month_links}
<li><a href="{path={my_template_group}/archives}">Complete Archives</a></li>
<li><a href="{path={my_template_group}/categories}">Category Archives</a></li>
</ul>

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

<h2 class="sidetitle">Syndicate</h2>
<ul>
<li><a href="{path={my_template_group}/rss_2.0}">RSS 2.0</a></li>
<li><a href="{path={my_template_group}/atom}">Atom</a></li>
</ul>

<h2 class="sidetitle">Statistics</h2>
<ul>
<li>This page has been viewed {hits} times</li>
<li>Page rendered in {elapsed_time} seconds</li>
<li><a href="{path={my_template_group}/referrers}">Referrers</a></li>
</ul>

<p><a href="http://www.pmachine.com/">Powered by ExpressionEngine</a></p>
</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>
<meta http-equiv="content-type" content="text/html; charset={charset}" />
<title>{exp:weblog:info weblog="{my_weblog}"}{blog_title}{/exp:weblog:info}</title>

<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="content">

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

<div class="spacer">&nbsp;</div>

{exp:comment:preview}
{comment}
{/exp:comment:preview}


{exp:comment:form}

{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="45" rows="10">{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}


<p><a href="{homepage}">&lt;&lt; Back to main</a></p>
</div>


<div id="rightbar">

<?php if ($type != 'core') { ?>
<p><b>Members:</b>
<br />
{if logged_in}
 <a href="{path=member/profile}">Your Account</a>  |  <a href="{path=logout}">Logout</a>
{/if}

{if logged_out}
 <a href="{path=member/login}">Login</a> | <a href="{path=member/register}">Register</a>
{/if}

 | <a href="{path=member/memberlist}">Member List</a>
</p>
<?php } ?>


<h2 class="sidetitle">About</h2>
<p>Quote meon an estimate et non interruptus stadium. Sic tempus fugit esperanto hiccup estrogen. Glorious baklava ex librus hup hey ad infinitum. Non sequitur condominium facile et geranium incognito.</p>



<h2 class="sidetitle">Monthly Archives</h2>
<ul>
{exp:weblog:month_links weblog="{my_weblog}"}
<li><a href="{path={my_template_group}/index}">{month} {year}</a></li>
{/exp:weblog:month_links}

<li><a href="{path={my_template_group}/archives}">Complete Archives</a></li>
<li><a href="{path={my_template_group}/categories}">Category Archives</a></li>
</ul>


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


<h2 class="sidetitle">Syndicate</h2>
<ul>
<li><a href="{path={my_template_group}/rss_2.0}">RSS 2.0</a></li>
<li><a href="{path={my_template_group}/atom}">Atom</a></li>
</ul>

<h2 class="sidetitle">Statistics</h2>
<ul>
<li>This page has been viewed {hits} times</li>
<li>Page rendered in {elapsed_time} seconds</li>
<li><a href="{path={my_template_group}/referrers}">Referrers</a></li>
</ul>

<p><a href="http://www.pmachine.com/">Powered by ExpressionEngine</a></p>
</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>
<meta http-equiv="content-type" content="text/html; charset={charset}" />
<title>{exp:weblog:info weblog="{my_weblog}"}{blog_title}{/exp:weblog:info}</title>

<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="content">

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

<div class="spacer">&nbsp;</div>


<h2 class="title">The trackback URL for this entry is:</h2>

<form action="">
<input type="text" value="{exp:trackback:url}" size="60" class="input" />
</form>


<h2 class="title">Trackbacks:</h2>
<ol>
{exp:trackback:entries}

<li><strong>{title}</strong><br /><br />

{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></li>

{/exp:trackback:entries}
</ol>


<p><a href="{homepage}">&lt;&lt; Back to main</a></p>
</div>

<?php if ($type != 'core') { ?>
<p><b>Members:</b>
<br />
{if logged_in}
 <a href="{path=member/profile}">Your Account</a>  |  <a href="{path=logout}">Logout</a>
{/if}

{if logged_out}
 <a href="{path=member/login}">Login</a> | <a href="{path=member/register}">Register</a>
{/if}

 | <a href="{path=member/memberlist}">Member List</a>
</p>
<?php } ?>


<div id="rightbar">
<h2 class="sidetitle">About</h2>
<p>Quote meon an estimate et non interruptus stadium. Sic tempus fugit esperanto hiccup estrogen. Glorious baklava ex librus hup hey ad infinitum. Non sequitur condominium facile et geranium incognito.</p>


<h2 class="sidetitle">Monthly Archives</h2>
<ul>
{exp:weblog:month_links weblog="{my_weblog}"}
<li><a href="{path={my_template_group}/index}">{month} {year}</a></li>
{/exp:weblog:month_links}

<li><a href="{path={my_template_group}/archives}">Complete Archives</a></li>
<li><a href="{path={my_template_group}/categories}">Category Archives</a></li>
</ul>


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

<h2 class="sidetitle">Syndicate</h2>
<ul>
<li><a href="{path={my_template_group}/rss_2.0}">RSS 2.0</a></li>
<li><a href="{path={my_template_group}/atom}">Atom</a></li>
</ul>

<h2 class="sidetitle">Statistics</h2>
<ul>
<li>This page has been viewed {hits} times</li>
<li>Page rendered in {elapsed_time} seconds</li>
<li><a href="{path={my_template_group}/referrers}">Referrers</a></li>
</ul>

<p><a href="http://www.pmachine.com/">Powered by ExpressionEngine</a></p>
</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
?>