require_once "maincore.php";
require_once "subheader.php";
require_once "side_left.php";
include LOCALE.LOCALESET."articles.php";
if (!isset($cat_id)) {
opentable($locale['400']);
$result = dbquery("SELECT * FROM ".$db_prefix."article_cats WHERE ".groupaccess('article_cat_access')." ORDER BY article_cat_name");
$rows = dbrows($result);
if ($rows != 0) {
$counter = 0; $columns = 2;
echo "
\n\n";
while ($data = dbarray($result)) {
if ($counter != 0 && ($counter % $columns == 0)) echo "
\n\n";
$num = dbcount("(article_cat)", "articles", "article_cat='".$data['article_cat_id']."'");
echo "
[color=red]
[b] [/b][/color]
".$data['article_cat_name']." ($num)";
if ($data['article_cat_description'] != "") echo " \n".$data['article_cat_description']."";
echo " | \n";
$counter++;
}
echo "
\n
\n";
} else {
echo "
\n".$locale['401']."
\n\n";
}
closetable();
} else {
$res = 0;
if (!isNum($cat_id)) fallback(FUSION_SELF);
$result = dbquery("SELECT * FROM ".$db_prefix."article_cats WHERE article_cat_id='$cat_id'");
if (dbrows($result) != 0) {
$cdata = dbarray($result);
if (checkgroup($cdata['article_cat_access'])) {
$res = 1;
opentable($locale['400'].": ".$cdata['article_cat_name']);
$rows = dbcount("(article_id)", "articles", "article_cat='$cat_id'");
if (!isset($rowstart) || !isNum($rowstart)) $rowstart = 0;
if ($rows != 0) {
$result = dbquery("SELECT * FROM ".$db_prefix."articles WHERE article_cat='$cat_id' ORDER BY ".$cdata['article_cat_sorting']." LIMIT $rowstart,15");
$numrows = dbrows($result); $i = 1;
while ($data = dbarray($result)) {
if ($data['article_datestamp']+604800 > time()+($settings['timeoffset']*3600)) {
$new = " [".$locale['402']."]";
} else {
$new = "";
}
echo "".$data['article_subject']."$new
\n".stripslashes($data['article_snippet']);
echo ($i != $numrows ? "
\n" : "\n"); $i++;
}
closetable();
if ($rows > 15) echo "\n".makePageNav($rowstart,15,$rows,3,FUSION_SELF."?cat_id=$cat_id&")."\n
\n";
} else {
echo "".$locale['403']."\n";
closetable();
}
}
}
if ($res == 0) redirect(FUSION_SELF);
}
require_once "side_right.php";
require_once "footer.php";
?>