<?
/*--------------------------------------------+
| PHP-Fusion v6 - Content Management System   |
|---------------------------------------------|
| author: Nick Jones (Digitanium) © 2002-2005 |
| web: http://www.php-fusion.co.uk            |
| email: nick@php-fusion.co.uk                |
|---------------------------------------------|
| Released under the terms and conditions of  |
| the GNU General Public License (Version 2)  |
+--------------------------------------------*/
/*--------------------------------------------+
|       Infused Theme for PHP-Fusion v6       |
|---------------------------------------------|
| author: PHP-Fusion Themes - Shedrock © 2005 |
| web: http://phpfusion.org                   |
| email: webmaster@phpfusion.org              |
|---------------------------------------------|
| Released under the terms and conditions of  |
| the GNU General Public License (Version 2)  |
+--------------------------------------------*/

// theme settings
$body_text = "#000000";
$body_bg = "#f2f2f2";
$theme_width = "100%";
$theme_width_l = "175";
$theme_width_r = "175";

function render_header($header_content) {

global $theme_width,$settings;

echo "<table align='center' width='$theme_width' cellspacing='0' cellpadding='0'>
<tr>
<td class='border-tleft'><img src='".THEME."images/blank.gif' width='10' height='21' alt=''></td>
<td colspan='2' class='border-tmain'><img src='".THEME."images/blank.gif' width='1' height='21' alt=''></td>
<td class='border-tright'><img src='".THEME."images/blank.gif' width='10' height='21' alt=''></td>
</tr>
<tr>
<td class='border-left'><img src='".THEME."images/blank.gif' width='10' height='1' alt=''></td>
<td colspan='2' class='header'>
<table width='100%' cellspacing='0' cellpadding='0'>
<tr>
<td height='80'>$header_content</td>

</tr>
</table>
</td>
<td class='border-right'><img src='".THEME."images/blank.gif' width='10' height='1' alt=''></td>
</tr>
<tr>
<td class='header-bleft'><img src='".THEME."images/blank.gif' width='10' height='21' alt=''></td>
<td class='header-bmain'>\n";
$result = dbquery("SELECT * FROM ".DB_PREFIX."site_links WHERE link_position>='2' ORDER BY link_order");
if (dbrows($result) != 0) {
	$i = 0;
	while($data = dbarray($result)) {
		if (checkgroup($data['link_visibility'])) {
			if ($data['link_url']!="---") {
				if ($i != 0) { echo " <img src='".THEME."images/div.gif'>\n"; } else { echo "\n"; }
				$link_target = ($data['link_window'] == "1" ? " target='_blank'" : "");
				if (strstr($data['link_url'], "http://") || strstr($data['link_url'], "https://")) {
					echo "<a href='".$data['link_url']."'".$link_target.">".$data['link_name']."</a>";
				} else {
					echo "<a class='white' href='".BASEDIR.$data['link_url']."'".$link_target.">".$data['link_name']."</a>";
				}
			}
			$i++;
		}
	}
}
echo ($i == 0 ? "&nbsp;" : "")."</td>\n<td align='right' class='header-bmain'>".ucwords(showdate($settings['subheaderdate'], time()))."</td>
<td class='header-bright'><img src='".THEME."images/blank.gif' width='10' height='21' alt=''></td>
</tr>
</table>\n";

echo "<table width='100%' cellspacing='0' cellpadding='0'>\n<tr>\n";

}

function render_footer($license=false) {
global $theme_width,$locale,$settings;

echo "</tr>\n</table>\n";

echo "<table align='center' width='$theme_width' cellspacing='0' cellpadding='0'>
<tr>
<td class='border-tleft'><img src='".THEME."images/blank.gif' width='10' height='21' alt=''></td>
<td class='border-tmain'><img src='".THEME."images/blank.gif' width='1' height='21' alt=''></td>
<td class='border-tright'><img src='".THEME."images/blank.gif' width='10' height='21' alt=''></td>
</tr>
<tr>
<td class='border-left'><img src='".THEME."images/blank.gif' width='10' height='1' alt=''></td>
<td align='center' class='header'>".stripslashes($settings['footer'])."
<b>".$settings['counter']."</b> ".($settings['counter'] == 1 ? $locale['140']."<br><br>\n" : $locale['141']."<br><br>\n");
		if ($license == false) {
	echo "Powered by <a target='_blank' href='http://www.php-fusion.co.uk'><img src='".THEME."images/fusion.gif' title='PHP-Fusion' style='vertical-align:middle;'></a> v".$settings['version']." &copy; 2003-2005";
	}
echo " | Infused by: <a target='_blank' href='http://phpfusion.org/'><img src='".THEME."images/fthemes.gif' title='PHP-Fusion Themes' style='vertical-align:middle;'></a>";

echo"</td>";
echo"<td class='border-right'><img src='".THEME."images/blank.gif' width='10' height='1' alt=''></td>
</tr>
<tr>
<td class='border-bleft'><img src='".THEME."images/blank.gif' width='10' height='16' alt=''></td>
<td class='border-bmain'><img src='".THEME."images/blank.gif' width='1' height='16' alt=''></td>
<td class='border-bright'><img src='".THEME."images/blank.gif' width='10' height='16' alt=''></td>
</tr>
</table>\n";
}

function render_news($subject, $news, $info) {

global $locale;
	
echo "<table width='100%' cellpadding='0' cellspacing='0'>
<tr>
<td class='pan-left'><img src='".THEME."images/blank.gif' width='10' height='21' alt=''></td>
<td width='100%' class='pan-main'>$subject</td>
<td class='pan-right'><img src='".THEME."images/blank.gif' width='10' height='21' alt=''></td>
</tr>
</table>
<table width='100%' cellpadding='0' cellspacing='0'>
<tr>
<td class='border-left'><img src='".THEME."images/blank.gif' width='10' height='1' alt=''></td>
<td class='main-body'>
<div style='width:100%;vertical-align:top;'>$news</div>
<div style='margin-top:5px'>
<table width='100%' cellpadding='0' cellspacing='0'>
<tr>
<td class='infobar'>&nbsp;<img src='".THEME."images/bullet.gif'>
".$locale['040']."<a href='profile.php?lookup=".$info['user_id']."'>".$info['user_name']."</a>
".$locale['041'].showdate("longdate", $info['news_date'])."</td>
<td align='right' class='infobar'>";
echo "".($info['news_ext'] == "y" ? "<a href='news.php?readmore=".$info['news_id']."'>".$locale['042']."</a> ·\n" : "")." ";
if ($info['news_allow_comments'])
echo "<a href='news.php?readmore=".$info['news_id']."'>".$info['news_comments'].$locale['043']."</a> · ";
echo "".$info['news_reads'].$locale['044']." ";
echo "<a href='print.php?type=N&item_id=".$info['news_id']."'><img src='".THEME."images/printer.gif' alt='".$locale['045']."' border='0' style='vertical-align:middle;'></a>";
echo "&nbsp;</td>
</tr>
</table>
</div>
</td>
<td class='border-right'><img src='".THEME."images/blank.gif' width='10' height='1' alt=''></td>
</tr>
<tr>
<td class='border-bleft'><img src='".THEME."images/blank.gif' width='10' height='16' alt=''></td>
<td class='border-bmain'><img src='".THEME."images/blank.gif' width='1' height='16' alt=''></td>
<td class='border-bright'><img src='".THEME."images/blank.gif' width='10' height='16' alt=''></td>
</tr>
</table>\n";

}

function render_article($subject, $article, $info) {

global $locale;
	
echo "<table width='100%' cellpadding='0' cellspacing='0'>
<tr>
<td class='pan-left'><img src='".THEME."images/blank.gif' width='10' height='21' alt=''></td>
<td width='100%' class='pan-main'>$subject</td>
<td class='pan-right'><img src='".THEME."images/blank.gif' width='10' height='21' alt=''></td>
</tr>
</table>
<table width='100%' cellpadding='0' cellspacing='0'>
<tr>
<td class='border-left'><img src='".THEME."images/blank.gif' width='10' height='1' alt=''></td>
<td class='main-body'>
<div style='width:100%;vertical-align:top;'>".($info['article_breaks'] == "y" ? nl2br($article) : $article)."</div>
<div style='margin-top:5px'>
<table width='100%' cellpadding='0' cellspacing='0'>
<tr>
<td class='infobar'>&nbsp;<img src='".THEME."images/bullet.gif'>
".$locale['040']."<a href='profile.php?lookup=".$info['user_id']."'>".$info['user_name']."</a>
".$locale['041'].showdate("longdate", $info['article_date'])."
</td>
<td align='right' class='infobar'>";
if ($info['article_allow_comments']) echo $info['article_comments'].$locale['043']." · ";
echo "".$info['article_reads'].$locale['044']." ";
	echo "<a href='print.php?type=A&item_id=".$info['article_id']."'><img src='".THEME."images/printer.gif' alt='".$locale['045']."' border='0' style='vertical-align:middle;'></a>";
echo "&nbsp;</td>
</tr>
</table>
</div>
</td>
<td class='border-right'><img src='".THEME."images/blank.gif' width='10' height='1' alt=''></td>
</tr>
<tr>
<td class='border-bleft'><img src='".THEME."images/blank.gif' width='10' height='16' alt=''></td>
<td class='border-bmain'><img src='".THEME."images/blank.gif' width='1' height='16' alt=''></td>
<td class='border-bright'><img src='".THEME."images/blank.gif' width='10' height='16' alt=''></td>
</tr>
</table>\n";

}

function opentable($title) {

echo "<table width='100%' cellpadding='0' cellspacing='0'>
<tr>
<td class='pan-left'><img src='".THEME."images/blank.gif' width='10' height='21' alt=''></td>
<td width='100%' class='pan-main'>$title</td>
<td class='pan-right'><img src='".THEME."images/blank.gif' width='10' height='21' alt=''></td>
</tr>
</table>
<table width='100%' cellpadding='0' cellspacing='0'>
<tr>
<td class='border-left'><img src='".THEME."images/blank.gif' width='10' height='1' alt=''></td>
<td class='main-body'>\n";

}

function closetable() {

echo "</td>
<td class='border-right'><img src='".THEME."images/blank.gif' width='10' height='1' alt=''></td>
</tr>
<tr>
<td class='border-bleft'><img src='".THEME."images/blank.gif' width='10' height='16' alt=''></td>
<td class='border-bmain'><img src='".THEME."images/blank.gif' width='1' height='16' alt=''></td>
<td class='border-bright'><img src='".THEME."images/blank.gif' width='10' height='16' alt=''></td>
</tr>
</table>\n";

}

function openside($title) {
	
echo "<table width='100%' cellpadding='0' cellspacing='0'>
<tr>
<td class='pan-left'><img src='".THEME."images/blank.gif' width='10' height='21' alt=''></td>
<td width='100%' class='pan-main'><img src='".THEME."images/pan_image.gif'>$title</td>
<td class='pan-right'><img src='".THEME."images/blank.gif' width='10' height='21' alt=''></td>
</tr>
</table>
<table width='100%' cellpadding='0' cellspacing='0'>
<tr>
<td class='border-left'><img src='".THEME."images/blank.gif' width='10' height='1' alt=''></td>
<td class='side-body'>\n";

}

function closeside() {

echo "</td>
<td class='border-right'><img src='".THEME."images/blank.gif' width='10' height='1' alt=''></td>
</tr>
<tr>
<td class='border-bleft'><img src='".THEME."images/blank.gif' width='10' height='16' alt=''></td>
<td class='border-bmain'><img src='".THEME."images/blank.gif' width='1' height='16' alt=''></td>
<td class='border-bright'><img src='".THEME."images/blank.gif' width='10' height='16' alt=''></td>
</tr>
</table>\n";
tablebreak();

}

function opensidex($title,$open="on") {

$box_img = ($open=="on" ? "off" : "on");
echo "<table width='100%' cellpadding='0' cellspacing='0'>
<tr>
<td class='pan-left'><img src='".THEME."images/blank.gif' width='10' height='21' alt=''></td>
<td class='pan-main'>$title</td>
<td align='right' class='pan-main'><img onclick=\"javascript:flipBox('$title')\" name='b_$title' alt='$box_img' border='0' src='".THEME."images/panel_$box_img.gif'></td>
<td class='pan-right'><img src='".THEME."images/blank.gif' width='10' height='21' alt=''></td>
</tr>
</table>
<table width='100%' cellpadding='0' cellspacing='0'>
<tr>
<td class='border-left'><img src='".THEME."images/blank.gif' width='10' height='1' alt=''></td>
<td class='side-body'>
<div id='box_$title'".($open=="off" ? "style='display:none'" : "").">\n";

}

function closesidex() {

echo "</div>
<td class='border-right'><img src='".THEME."images/blank.gif' width='10' height='1' alt=''></td>
</tr>
<tr>
<td class='border-bleft'><img src='".THEME."images/blank.gif' width='10' height='16' alt=''></td>
<td class='border-bmain'><img src='".THEME."images/blank.gif' width='1' height='16' alt=''></td>
<td class='border-bright'><img src='".THEME."images/blank.gif' width='10' height='16' alt=''></td>
</tr>
</table>\n";
tablebreak();

}

function tablebreak() {

echo "<table width='100%' cellspacing='0' cellpadding='0'>
<tr><td height='5'></td></tr>
</table>\n";

}
?>