<!-- HEADER i -->
<div class="tpl_top_bar">&nbsp;{$showpath}</div>
<div class="tpl_head">
	<table width="900" border="0" cellpadding="0" cellspacing="0" align="center">
		<tr>
			<td class="tpl_logo"><a href='{$site_url}' title='{$site_name}'>{$site_name}</a></td>
			<td valign="bottom" align="right"><a href="index.php?page=rss" title="RSS"><img src="images/tpl_rss_0.gif" border="0" alt='RSS'></a></td>
		</tr>
		<tr>
			<td width="550"><div class="tpl_search_bg"><div class="tpl_search_str">
			<form name='cerca' id='cerca' action='index.php?page=search' method='post'>
				<input name='query' type='text' id='query' size='33' value='<?php echo _SEARCH_."..."; ?>' maxlength='100' class='tpl_search_txt' onfocus="this.value=''">
				<input type='hidden' name='results' value='10'>
				<input type='hidden' name='where' value='all'>
			</form>
			</div></div></td>
			<td width="350" align="right"><a href="index.php?page=rss" title="RSS"><img src="images/tpl_rss_1.gif" border="0" alt='RSS'></a></td>
		</tr>
	</table>
</div>
<!-- HEADER e -->

<table width="100%" border="0" cellpadding="0" cellspacing="0" align="center"><tr>
	<td class="tpl_main_left">&nbsp;</td>
	<td width="900">
		<table width="100%" border="0" cellpadding="0" cellspacing="0" align="center"><tr>
			{if condition="$fullscreen < 1"}
				<td width='550' class='tpl_main_left' valign='top' style='padding:8px 8px 0 0;'>
			{elseif condition="$fullscreen < 2"}
				<td width='738' class='tpl_main_left' valign='top' style='padding:8px 8px 0 0;'>
			{else}
				<td width='900' class='tpl_main_left' valign='top' style='padding-top:8px;'>
			{/if}

			<!-- MAIN CONTENT i -->
				<!-- MESSAGES i -->
				{loop name="tpl_messages"}
					<div class='tpl_mex_box'>{$value.content}</div>
					<div class='tpl_vspacer'></div>
				{/loop}
				<!-- MESSAGES e -->
									
				<!-- CENTRAL BLOCKS i -->
				{loop name="tpl_blocks_central"}
					{if condition="$value.usetitle > 0"}
						<div class='tpl_block_title_c'><h2>{$value.title}</h2></div>
					{/if}
					<div class='tpl_block_body_c'>{$value.content}</div>
					<div class='tpl_vspacer'></div>
				{/loop}
				<!-- CENTRAL BLOCKS e -->
									
				<!-- PAGE i -->
				{if condition="$tpl_page.title != ''"}
					<div class='tpl_page_title'>
					{if condition="$tpl_page.url != ''"}
						<a href='{$tpl_page.url}' title='{$tpl_page.title}'><b><h1>{$tpl_page.title}</h1></b></a>
					{else}
						<b><h1>{$tpl_page.title}</h1></b>
					{/if}
					</div>
					<div class='tpl_vspacer'></div>
				{/if}
				{if condition="$tpl_page.name == 'blog'"} {include="blog"} {/if}
				{if condition="$tpl_page.name == 'news'"} {include="news"} {/if}
				<div>{$tpl_page.content}</div>
				<!-- PAGE e -->
			<!-- MAIN CONTENT e -->
			
			</td>
			{if condition="$fullscreen < 1"}
				<td width='350' class='tpl_main_right' style='border-left:1px solid #FFF;' valign='top'>
					<table width='100%' border='0' cellpadding='0' cellspacing='0'><tr>
						<td width='180' style='padding:8px 8px 0 8px;' valign='top'>
							<!-- EXTRA BLOCKS i -->
							{loop name="tpl_blocks_extra"}
								{if condition="$value.usetitle > 0"}
									<div class='tpl_block_title_e'><h2>{$value.title}</h2></div>
								{/if}
								<div class='tpl_block_body_e'>{$value.content}</div>
								<div class='tpl_vspacer'></div>
							{/loop}
							<!-- EXTRA BLOCKS e -->
						</td>
						<td width='146' style='padding:8px 0 0 8px; border-left:1px solid #FFF;' valign='top'>
							<!-- NAVIGATOR BLOCKS i -->
							{loop name="tpl_blocks_navigator"}
								{if condition="$value.usetitle > 0"}
									<div class='tpl_block_title'><h2>{$value.title}</h2></div>
								{/if}
								<div class='tpl_block_body'>{$value.content}</div>
								<div class='tpl_vspacer'></div>
							{/loop}
							<!-- NAVIGATOR BLOCKS e -->
						</td>
					</tr></table>
				</td>
			{elseif condition="$fullscreen < 2"}
				<td width='160' class='tpl_main_right' valign='top'>
					<table width='100%' border='0' cellpadding='0' cellspacing='0'><tr>
						<td width='146' style='padding:8px 0 0 8px; border-left:1px solid #FFF;' valign='top'>
							<!-- NAVIGATOR BLOCKS i -->
							{loop name="tpl_blocks_navigator"}
								{if condition="$value.usetitle > 0"}
									<div class='tpl_block_title'><h2>{$value.title}</h2></div>
								{/if}
								<div class='tpl_block_body'>{$value.content}</div>
								<div class='tpl_vspacer'></div>
							{/loop}
							<!-- NAVIGATOR BLOCKS e -->
						</td>
					</tr></table>
				</td>
			{/if}
			</tr></table>
		</td>
	<td class="tpl_main_right">&nbsp;</td>
	</tr></table>
	
	<?php
	if (!defined("_RECENT_POSTS_")) { define("_RECENT_POSTS_","Recent posts"); }
	if (!defined("_RECENT_COMMENTS_")) { define("_RECENT_COMMENTS_","Recent comments"); }
	global $dblink,$siteConfig;
	?>
	
	<div class="tpl_foot" align="center">
		<div id="sub" align="left">
			
			<table width="900" border="0" cellpadding="0" cellspacing="0">
			<tr>
				<td width="33%" valign="top">
					<div style='margin-bottom:4px;' class='tpl_foot_title'><?php echo _RECENT_POSTS_; ?></div>
					<?php
					$result = $dblink->get_list("SELECT title FROM memht_blog_posts WHERE enabled=1 ORDER BY id DESC LIMIT 5");
					foreach ($result as $row) {
						$title = outCode($row['title']);
						
						echo "<div style='padding:2px 0;'><img src='templates/".$siteConfig['template']."/images/page_white.gif' border='0' alt='Bullet'> <span style='vertical-align: top;'><a href='index.php?page=blog&title=".urlencode($title)."' title=\"$title\">$title</a></span></div>\n";
					}
					?>
				</td>
				<td width="33%" valign="top">
					<div style='margin-bottom:4px;' class='tpl_foot_title'><?php echo _RECENT_COMMENTS_; ?></div>
					<?php
					$result = $dblink->get_list("SELECT name,text FROM memht_comments WHERE moderate=0 ORDER BY id DESC LIMIT 5");
					foreach ($result as $row) {
						$name = outCode($row['name']);
						$text = outCode($row['text']);
						
						echo "<div style='padding:2px 0;'><img src='templates/".$siteConfig['template']."/images/page_white.gif' border='0' alt='Bullet'> <span style='vertical-align: top;'>$name: <i>".trimString($text,25,1)."</i></a></span></div>\n";
					}
					?>
				</td>
				<td width="33%" valign="top">
					<div style='margin-bottom:4px;' class='tpl_foot_title'><?php echo _RSS_FEEDS_; ?></div>
					<?php
					if ($dblink->get_num("SELECT id FROM memht_articoli WHERE enabled=1")>0) {
						$link = ($siteConfig['modrewrite']) ? "rss-articles.xml" : "rss.php?page=articles";
						echo "<div style='padding:2px 0;'><a href='$link' title='"._ARTRSSFEED_."' target='_blank'><img src='images/rss-syndicate_box.gif' style='vertical-align:baseline' title='"._ARTRSSFEED_."' border='0' alt='RSS'> <span style='vertical-align: top;'>"._ARTRSSFEED_."</span></a></div>\n";
					}
					if ($dblink->get_num("SELECT id FROM memht_blog_posts WHERE enabled=1 LIMIT 1 ")>0) {
						$link = ($siteConfig['modrewrite']) ? "rss-blog.xml" : "rss.php?page=blog";
						echo "<div style='padding:2px 0;'><a href='$link' title='"._BLOGRSSFEED_."' target='_blank'><img src='images/rss-syndicate_box.gif' style='vertical-align:baseline' title='"._BLOGRSSFEED_."' border='0' alt='RSS'> <span style='vertical-align: top;'>"._BLOGRSSFEED_."</span></a></div>\n";
					}
					if ($dblink->get_num("SELECT id FROM memht_download")>0) {
						$link = ($siteConfig['modrewrite']) ? "rss-download.xml" : "rss.php?page=download";
						echo "<div style='padding:2px 0;'><a href='$link' title='"._DWNRSSFEED_."' target='_blank'><img src='images/rss-syndicate_box.gif' style='vertical-align:baseline' title='"._DWNRSSFEED_."' border='0' alt='RSS'> <span style='vertical-align: top;'>"._DWNRSSFEED_."</span></a></div>\n";
					}			
					if ($dblink->get_num("SELECT id FROM memht_forum_posts")>0) {
						$link = ($siteConfig['modrewrite']) ? "rss-forum.xml" : "rss.php?page=forum";
						echo "<div style='padding:2px 0;'><a href='$link' title='"._FORUMRSSFEED_."' target='_blank'><img src='images/rss-syndicate_box.gif' style='vertical-align:baseline' title='"._FORUMRSSFEED_."' border='0' alt='RSS'> <span style='vertical-align: top;'>"._FORUMRSSFEED_."</span></a></div>\n";
					}
					if ($dblink->get_num("SELECT id FROM memht_guide WHERE enabled=1")>0) {
						$link = ($siteConfig['modrewrite']) ? "rss-guide.xml" : "rss.php?page=guide";
						echo "<div style='padding:2px 0;'><a href='$link' title='"._GUIRSSFEED_."' target='_blank'><img src='images/rss-syndicate_box.gif' style='vertical-align:baseline' title='"._GUIRSSFEED_."' border='0' alt='RSS'> <span style='vertical-align: top;'>"._GUIRSSFEED_."</span></a></div>\n";
					}
					if ($dblink->get_num("SELECT id FROM memht_news WHERE enabled=1")>0) {
						$link = ($siteConfig['modrewrite']) ? "rss-news.xml" : "rss.php?page=news";
						echo "<div style='padding:2px 0;'><a href='$link' title='"._NEWSRSSFEED_."' target='_blank'><img src='images/rss-syndicate_box.gif' style='vertical-align:baseline' title='"._NEWSRSSFEED_."' border='0' alt='RSS'> <span style='vertical-align: top;'>"._NEWSRSSFEED_."</span></a></div>\n";
					}
					$link = ($siteConfig['modrewrite']) ? "sitemap.xml" : "sitemap.php";
					echo "<div style='padding:2px 0;'><a href='$link' target='_blank' title='Sitemap'><img src='images/rss-syndicate_box.gif' style='vertical-align:baseline' title='Sitemap' border='0' alt='Sitemap'> <span style='vertical-align: top;'>Sitemap</span></a></div>\n";
					?>
				</td>
			</tr>
			</table>

			<div class='tpl_foot_text' style='margin-top:10px;'>
				<div>{$copyright}</div>
				<div>{$footmsg}</div>
				<div>{$copytext}</div>
				<div>Template designed by <a href='http://www.memht.com' title='MemHT.com'>MemHT.com</a></div>
			</div>
		</div>
	</div>