36 |
global $dbh, $spec, $isMed, $isEdit; |
global $dbh, $spec, $isMed, $isEdit; |
37 |
$arts = array(); |
$arts = array(); |
38 |
if (!$offset) $offset = 0; |
if (!$offset) $offset = 0; |
39 |
$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; |
40 |
|
$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)"); |
41 |
if ($id > 0) $sql .= " AND (news.news_id = $id)"; |
if ($id > 0) $sql .= " AND (news.news_id = $id)"; |
42 |
if ($ct) $sql .= " AND ((category = '$ct') OR ((cat_news.cat_id = '$ct') AND (cat_news.news_id = news.news_id)))"; |
if ($ct) $sql .= " AND ((category = '$ct') OR ((cat_news.cat_id = '$ct') AND (cat_news.news_id = news.news_id)))"; |
43 |
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)"; |
44 |
if ($limit && $isEdit) $sql .= ""; |
if ($limit && $isEdit) $sql .= ""; |
45 |
$sql .= " ORDER BY d_orig DESC"; |
$sql .= " ORDER BY d_orig DESC"; |
46 |
if ($limit && !$isEdit) $sql .= " LIMIT $limit"; |
if ($limit && !$isEdit) $sql .= " LIMIT $limit"; |
54 |
$art["pic_alt"], $art["pic_pos"], $art["more"], |
$art["pic_alt"], $art["pic_pos"], $art["more"], |
55 |
$art["more_title"], $art["date"], $art["au_pic"], |
$art["more_title"], $art["date"], $art["au_pic"], |
56 |
$art["au_alt"], $art["au_info"], $art["au_name"], |
$art["au_alt"], $art["au_info"], $art["au_name"], |
57 |
$ord, $art["show"]) = $row; |
$art["au_cv"], $ord, $art["show"]) = $row; |
58 |
$art["show"] = ($art["show"][0] == "f" || $art["show"][0] == "F") ? false : true; |
$art["show"] = ($art["show"][0] == "f" || $art["show"][0] == "F") ? false : true; |
59 |
list($art["pic_w"], $art["pic_h"]) = PicSize($art["pic_url"]); |
list($art["pic_w"], $art["pic_h"]) = PicSize($art["pic_url"]); |
60 |
$art["more_new"] = strstr($art["more"], "://") ? true : false; |
$art["more_new"] = strstr($art["more"], "://") ? true : false; |
65 |
$art["text"] = array(); |
$art["text"] = array(); |
66 |
if ($art["id"]) get_sections($art["id"], $art["text"]); |
if ($art["id"]) get_sections($art["id"], $art["text"]); |
67 |
$art["order"] = $ord; |
$art["order"] = $ord; |
68 |
$art["read"] = (count($art["text"]) > $npar) ? GetRead($art["id"], $ct) : ""; |
$art["read"] = (count($art["text"]) > $npar || $art["more"]) ? GetRead($art["id"], $ct) : ""; |
69 |
$art["category"] = $ct; |
$art["category"] = $ct; |
70 |
$art["limit"] = $limit; |
$art["limit"] = $limit; |
71 |
$art["offset"] = $offset; |
$art["offset"] = $offset; |
110 |
$art["au_alt"], $art["au_info"], |
$art["au_alt"], $art["au_info"], |
111 |
$art["au_w"], $art["au_h"])); |
$art["au_w"], $art["au_h"])); |
112 |
for ($i = 0; $i < count($art["text"]); $i++) { |
for ($i = 0; $i < count($art["text"]); $i++) { |
113 |
$art["text"][$i]["text"] = ParseNewline(convert_html( |
$art["text"][$i]["text"] = ParseNewline(MyEscape( |
114 |
MyEscape($art["text"][$i]["text"], false)), true); |
convert_html($art["text"][$i]["text"]), false), true); |
115 |
$art["text"][$i]["hl"] = ParseNewline(convert_html( |
$art["text"][$i]["hl"] = ParseNewline(MyEscape( |
116 |
MyEscape($art["text"][$i]["hl"], false)), true); |
convert_html($art["text"][$i]["hl"]), false), true); |
117 |
$art["text"][$i]["exp"] = ParseNewline(convert_html( |
$art["text"][$i]["exp"] = ParseNewline(MyEscape( |
118 |
MyEscape($art["text"][$i]["exp"], false)), true); |
convert_html($art["text"][$i]["exp"]), false), true); |
119 |
if ($art["text"][$i]["hl"]) $art["text"][$i]["hl"] = GetHighlight($art["text"][$i]["hl"]); |
if ($art["text"][$i]["hl"]) $art["text"][$i]["hl"] = GetHighlight($art["text"][$i]["hl"]); |
120 |
if ($art["text"][$i]["level"]) $art["text"][$i]["level2"] = (($art["text"][$i]["level"] - 1) * 15) + 2; |
if ($art["text"][$i]["level"]) $art["text"][$i]["level2"] = (($art["text"][$i]["level"] - 1) * 15) + 2; |
121 |
} |
} |