<?php
defined('DOIT') or die('Restricted access');
global $page;
$content=explode("<hr class=\"readon\" />",$this->content);
$thissettings=explode(",",$this->settings);
if (isset($_GET["style"]) && $_GET["style"]=="full") { $style="full"; } else { $style = false; }
echo "<div class='mainarticle'>".
"<h1 class='mainheading'><a href='".URL."/index.php?id=".$this->id."'>".
"$this->name</a></h1>";
//show only full content
if ($style=="full") {
echo $content[0].$content[1]."</div>";
//show content depending on settings
} else {
//this article
if ($thissettings[0]==0 or $thissettings[0]==1) {
//show full article
if ($thissettings[0]==0) {
if (isset($content[0])) { echo $content[0]; }
if (isset($content[1])) { echo $content[1]; }
//show preview
} else {
echo $content[0];
//readon link
if ($content[1]) {
echo "<a class='readon' href='".URL."/index.php?id=".$this->id.
"&style=full'>$mod_cont[lbl_readon]</a>";
}
}
}
echo "</div>";
//children
if ((isset($thissettings[1]) && $thissettings[1]==='0') or (isset($thissettings[1]) && $thissettings[1]==1)) {
$sql = "select sc.*,sm.name as modname from site_content as sc left join system_modules as sm on sm.modid=sc.modid where `active`=1 and`parentid`=$this->id order by `order` asc";
$page->query($sql);
$result = $page->db->getdata_array();
if (!empty($result)) {
foreach ($result as $c) {
//only show child is the user is allowed to see it
if ($c['access']==0 or ($c['access']==1 && $is_user) or ($c['access']==2 && ($is_admin or in_array($c['specialaccess'],$mysession->user->gids)))) {
$ccont=explode("<hr class=\"readon\" />",$c["content"]);
echo "<div class='article' id='article".$c['id']."'>".
"<h2><a href='".URL."/index.php?id=".$c["id"]."'>".
"$c[name]</a></h2>";
if (!isset($ccont[1])) { $ccont[1] = ''; }
//show full child
if ($thissettings[1]==0) {
//regular content
if ($c['modid']==1) {
echo $ccont[0].$ccont[1];
//a mainmod
} else {
$child = new Frontendpage($c['id']);
$child->print_content();
}
//show preview
} else {
echo $ccont[0];
//readon link
if ($ccont[1]) {
echo "<a class='readon' href='".URL."/index.php?id=".$c["id"].
"&style=full'>$mod_cont[lbl_readon]</a>";
}
}
echo "</div>";
}
}
}
}
}
?>