$result = mysql_query("SELECT doc_content FROM documents WHERE doc_id = 1 AND doc_visible = 1", $linkid);
$data = mysql_fetch_array($result);
echo $data['doc_content'];
?>
}
LayoutBottom();
}
else { // main home page
header("location: home");
exit;
}
function showGallery($id) {
global $linkid;
$imgresult = mysql_query("SELECT * FROM documentimages, imagelibrary WHERE docimg_document = $id AND docimg_image = img_id AND docimg_preview = 1 AND img_active = 1", $linkid);
if ($imgdata = mysql_fetch_array($imgresult)) {
echo "";
//show thumbnails of all images
$optionimgresult = mysql_query("SELECT * FROM documentimages, imagelibrary WHERE docimg_document = $id AND docimg_image = img_id AND img_active = 1 ORDER BY docimg_order", $linkid);
if (mysql_num_rows($optionimgresult) > 0) {
echo "
[mouse over thumbnails, click image to enlarge]
";
echo "
";
echo "
";
$count = 0;
while ($optimgdata = mysql_fetch_array($optionimgresult)) {
if ($count % 6 == 0) {
echo "
";
}
echo "
";
$count++;
}
echo "
";
echo "
";
}
}
}
function navChild($id, $order) {
global $linkid, $site, $pid, $parent;
if ($order == 1) {
$navlistresult = mysql_query("SELECT doc_title, doc_content, doc_preview, doc_link, doc_date, doc_file, doc_id, doc_source, date_format(doc_date, '%b %D, %Y') AS DATE, doc_showdate, doc_shorturl FROM documents, documentchildren WHERE child_related = doc_id AND child_document = $id AND doc_visible = 1 AND (doc_enddate > now() OR doc_enddate = '0000-00-00') AND (doc_startdate <= now()) AND doc_delete = 0 AND doc_tempid = 0 AND doc_top = 1 ORDER BY child_order, doc_date DESC", $linkid);
}
elseif ($order == 2) {
$navlistresult = mysql_query("SELECT doc_title, doc_content, doc_preview, doc_link, doc_date, doc_file, doc_id, doc_source, date_format(doc_date, '%b %D, %Y') AS DATE, doc_showdate, doc_shorturl FROM documents, documentchildren WHERE child_related = doc_id AND child_document = $id AND doc_visible = 1 AND (doc_enddate > now() OR doc_enddate = '0000-00-00') AND (doc_startdate <= now()) AND doc_delete = 0 AND doc_tempid = 0 AND doc_top = 1 ORDER BY doc_title, doc_date DESC", $linkid);
}
elseif ($order == 3) {
$navlistresult = mysql_query("SELECT doc_title, doc_content, doc_preview, doc_link, doc_date, doc_file, doc_id, doc_source, date_format(doc_date, '%b %D, %Y') AS DATE, doc_showdate, doc_shorturl FROM documents, documentchildren WHERE child_related = doc_id AND child_document = $id AND doc_visible = 1 AND (doc_enddate > now() OR doc_enddate = '0000-00-00') AND (doc_startdate <= now()) AND doc_delete = 0 AND doc_tempid = 0 AND doc_top = 1 ORDER BY doc_date, doc_id", $linkid);
}
else {
$navlistresult = mysql_query("SELECT doc_title, doc_content, doc_preview, doc_link, doc_date, doc_file, doc_id, doc_source, date_format(doc_date, '%b %D, %Y') AS DATE, doc_showdate, doc_shorturl FROM documents, documentchildren WHERE child_related = doc_id AND child_document = $id AND doc_visible = 1 AND (doc_enddate > now() OR doc_enddate = '0000-00-00') AND (doc_startdate <= now()) AND doc_delete = 0 AND doc_tempid = 0 AND doc_top = 1 ORDER BY doc_date DESC, doc_id", $linkid);
}
if (mysql_num_rows($navlistresult) > 0) {
echo "";
}
while ($navlistdata = mysql_fetch_array($navlistresult)) {
if ($navlistdata['doc_shorturl'] <> "") {
$link = $navlistdata['doc_shorturl'];
}
else {
$link = "main.php?p=$navlistdata[doc_id]&s=$site";
}
?>