" . $row[cat_name] . "
"; } $content = str_replace("{INTRANET-CONTENT-CATEGORIES}",$INTRANETCONTENTCATEGORIES,$content); // Article List $sql = "SELECT * FROM intranet_article WHERE categoryid = '$categoryid' ORDER BY ordered ASC"; $result = mysql_query($sql, $conn); $INTRANETCONTENTARTICLES = ""; while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $INTRANETCONTENTARTICLES .= "" . $row[art_title] . "  " . $row[art_anriss] . ""; } $content = str_replace("{INTRANET-CONTENT-ARTICLES}",$INTRANETCONTENTARTICLES,$content); } if ($action == "show") { $template = "templates/" . $categoryid . "-arttmp.html"; $fp = @fopen ($template, "r"); if (!$fp) { echo "Dieser Bereich ist derzeitig nicht Verfügbar. Bitte versuchen Sie es später nocheinmal (template)"; EXIT; } $content_array = file($template); $content = implode("", $content_array); $sql = "SELECT * FROM intranet_article WHERE articleid = '$articleid' ORDER BY ordered ASC"; $result = mysql_query($sql, $conn); $row = mysql_fetch_array($result, MYSQL_ASSOC); $content = str_replace("{INTRANET-CONTENT-ARTICLE_TITLE}",$row[art_title],$content); $content = str_replace("{INTRANET-CONTENT-ARTICLE_ANRISS}",$row[art_anriss],$content); $content = str_replace("{INTRANET-CONTENT-ARTICLE_BODY}",$row[art_body],$content); $content = str_replace("{INTRANET-CONTENT-ARTICLE_DATE}",$row[art_date],$content); $picturefile = "img/" . $row[articleid] . ".jpg"; if (file_exists($picturefile)) { $size = getimagesize ($picturefile); $IMG = ""; $content = str_replace("{INTRANET-CONTENT-ARTICLE_IMG}",$IMG,$content); } else { $content = str_replace("{INTRANET-CONTENT-ARTICLE_IMG}","",$content); } } echo $content; ?>