<?php
//v1.0.4 www.bcoos.net 2006/10 GPL
// www.bcoos.net 2006-09 1.0.2 GPL
//v1.3 www.bcoos.net 2006-08 GPL
//v1.2 www.exoops.info 2006/03 GPL
// $Id: print.php,v 1.1
// ------------------------------------------------------------------------- //
// Passed on      : My Downloads
// New module name: My Sections
// Version        : 1.1
// Modified by    : Faisal
// Website        : < http://www.a-xoops.com >
// Email          : info@a-xoops.com
// ------------------------------------------------------------------------- //
include_once("header.php");
echo '<?xml version="1.0" encoding="'._CHARSET.'"?>';?>
<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "DTD/xhtml1-transitional.dtd">
<html>
<head>
<title><?php echo $bcoosConfig['title'];?></title>
<meta http-equiv="content-type" content="text/html; charset=<?php echo _CHARSET;?>">
<meta name="generator" content="<?php echo XOOPS_VERSION;?>">
<meta name="description" content="<?php echo $bcoosConfig['description'];?>">
<?php readfile(XOOPS_ROOT_PATH . "/modules/system/cache/header.php");?>
<link rel="icon" href="<?php echo XOOPS_URL."/icon.png";?>" type="image/png">
<link rel="shortcut icon" href="<?php echo XOOPS_URL."/icon.png";?>" type="image/png">
</head>
<body bgcolor='#ffffff' text='#000000'>
<table align='center' border='0' width='640' cellpadding='0' cellspacing='1' bgcolor='#000000'><tr><td>
<table border='0' width='640' cellpadding='20' cellspacing='1' bgcolor='#FFFFFF'><tr><td>
<div align='center'>
<?php
if (@file_exists(XOOPS_URL."/themes/".$bcoosConfig['default_theme']."/images/logo.png")) {
        echo "<img src='".XOOPS_URL."/themes/".$bcoosConfig['default_theme']."/images/logo.png' border='0' alt='".$myts->makeTboxData4Show($bcoosConfig['title'])."' />";
        } else {
                echo "<img src='".XOOPS_URL."/images/logo.png' border='0' alt='".$myts->makeTboxData4Show($bcoosConfig['title'])."' />";
        }
echo "</div>";
$mytree = new XoopsTree($db->prefix("mysections_cat"), "cid", "pid");
$lid    = intval($_GET['lid']);
$sql    = "
                SELECT
                lid,
                cid,
                title,
                date,
                description
                FROM
                ".$db->prefix("mysections_articles")."
                WHERE
                lid=$lid
                AND
                status>0";
$result = $db->query($sql);
if ($db->getRowsNum($result) != 1) {
        redirect_header('index.php');
        exit();
}
list($lid, $cid, $title, $time, $description) = $db->fetchRow($result);
echo "<table width='100%' cellspacing='0' cellpadding='3' border='0'><tr><td>";
$pathstring  = "<a href=index.php>"._MODIFYCATEGORY."</a> : ";
$nicepath    = $mytree->getNicePathFromId($cid, "title", "viewcat.php?");
$pathstring .= $nicepath;
$pathstring = substr($pathstring, 0, -2);
$pathstring = str_replace(":", ">", $pathstring);
echo "<b>".$pathstring."</b></td></tr></table><br />";
$dtitle      = $myts->makeTboxData4Show($title);
$datetime    = formatTimestamp($time, "s");
$description = $myts->makeTareaData4Show($description, 1, 1, 1);
echo "<table width='100%' cellspacing='0' cellpadding='5' border='0'><tr><td align='center' valign='top'>";
echo "
<table width='100%' border='0' cellspacing='1' cellpadding='0'><tr><td>
<table width='100%' border='0' cellspacing='1' cellpadding='4'><tr>
<td>
<b>".$dtitle."</b></td>
<td width='1%' align='center' valign='bottom' nowrap>
".$datetime."</td>
</tr><tr>
<td colspan='2'>
".str_replace("[pagebreak]","<br>",$description)."
</td>
</tr>
</table></td></tr></table></td></tr></table>
<br />
<hr size='1' noshade='noshade' />";
echo printf(_MD_THISCOMESFROM, $bcoosConfig['title'])."
<br /><a href=".XOOPS_URL.">".XOOPS_URL."</a>
<br /><br />"._MD_URLFORSTORY."<br />
<a href='".XOOPS_URL."/modules/".$xoopsModule->dirname()."/singlefile.php?lid=$lid'>".XOOPS_URL."/modules/".$xoopsModule->dirname()."/singlefile.php?lid=$lid</a>
</td></tr></table>
</td></tr></table>
</body>
</html>";
?>