--- inc/newsShow.php 2001/10/12 13:13:38 1.15 +++ inc/newsShow.php 2001/10/16 13:07:03 1.16 @@ -36,10 +36,11 @@ global $dbh, $spec, $isMed, $isEdit; $arts = array(); if (!$offset) $offset = 0; - $sql = "SELECT DISTINCT news.news_id, title, lead, title_pic, title_alt, title_pos, url, url_title, d_orig, author_pic, author_alt, author_info, author_name, ord, prikazi FROM news".(isset($ct)?", cat_news":"").($spec?", spec_news":"")." WHERE (".($isMed?"":"NOT ")."plivamed)".($isEdit?"":" AND (prikazi)"); + if (!$spec && $isMed) $spec = 0; + $sql = "SELECT DISTINCT news.news_id, title, lead, title_pic, title_alt, title_pos, url, url_title, d_orig, author_pic, author_alt, author_info, author_name, autor_cv, ord, prikazi FROM news".(isset($ct)?", cat_news":"").(isset($spec)?", spec_news":"")." WHERE (".($isMed?"":"NOT ")."plivamed)".($isEdit?"":" AND (prikazi)"); if ($id > 0) $sql .= " AND (news.news_id = $id)"; if ($ct) $sql .= " AND ((category = '$ct') OR ((cat_news.cat_id = '$ct') AND (cat_news.news_id = news.news_id)))"; - if ($spec) $sql .= " AND (spec_news.news_id = news.news_id) AND (spec_news.spec_id = $spec)"; + if (isset($spec)) $sql .= " AND (spec_news.news_id = news.news_id) AND (spec_news.spec_id = $spec)"; if ($limit && $isEdit) $sql .= ""; $sql .= " ORDER BY d_orig DESC"; if ($limit && !$isEdit) $sql .= " LIMIT $limit"; @@ -53,7 +54,7 @@ $art["pic_alt"], $art["pic_pos"], $art["more"], $art["more_title"], $art["date"], $art["au_pic"], $art["au_alt"], $art["au_info"], $art["au_name"], - $ord, $art["show"]) = $row; + $art["au_cv"], $ord, $art["show"]) = $row; $art["show"] = ($art["show"][0] == "f" || $art["show"][0] == "F") ? false : true; list($art["pic_w"], $art["pic_h"]) = PicSize($art["pic_url"]); $art["more_new"] = strstr($art["more"], "://") ? true : false; @@ -64,7 +65,7 @@ $art["text"] = array(); if ($art["id"]) get_sections($art["id"], $art["text"]); $art["order"] = $ord; - $art["read"] = (count($art["text"]) > $npar) ? GetRead($art["id"], $ct) : ""; + $art["read"] = (count($art["text"]) > $npar || $art["more"]) ? GetRead($art["id"], $ct) : ""; $art["category"] = $ct; $art["limit"] = $limit; $art["offset"] = $offset; @@ -109,12 +110,12 @@ $art["au_alt"], $art["au_info"], $art["au_w"], $art["au_h"])); for ($i = 0; $i < count($art["text"]); $i++) { - $art["text"][$i]["text"] = ParseNewline(convert_html( - MyEscape($art["text"][$i]["text"], false)), true); - $art["text"][$i]["hl"] = ParseNewline(convert_html( - MyEscape($art["text"][$i]["hl"], false)), true); - $art["text"][$i]["exp"] = ParseNewline(convert_html( - MyEscape($art["text"][$i]["exp"], false)), true); + $art["text"][$i]["text"] = ParseNewline(MyEscape( + convert_html($art["text"][$i]["text"]), false), true); + $art["text"][$i]["hl"] = ParseNewline(MyEscape( + convert_html($art["text"][$i]["hl"]), false), true); + $art["text"][$i]["exp"] = ParseNewline(MyEscape( + convert_html($art["text"][$i]["exp"]), false), true); if ($art["text"][$i]["hl"]) $art["text"][$i]["hl"] = GetHighlight($art["text"][$i]["hl"]); if ($art["text"][$i]["level"]) $art["text"][$i]["level2"] = (($art["text"][$i]["level"] - 1) * 15) + 2; }