3 |
global $dbh; |
global $dbh; |
4 |
$arts = array(); |
$arts = array(); |
5 |
if (!$offset) $offset = 0; |
if (!$offset) $offset = 0; |
6 |
$sql = "SELECT news_id, title, lead, title_pic, title_alt, title_pos, url, date, ord FROM news WHERE (category = '$cat')"; |
$sql = "SELECT news_id, title, lead, title_pic, title_alt, title_pos, url, url_title, date, ord FROM news WHERE (category = '$cat')"; |
7 |
if ($id > 0) $sql .= " AND (news_id = $id)"; |
if ($id > 0) $sql .= " AND (news_id = $id)"; |
8 |
$sql .= " ORDER BY date DESC"; |
$sql .= " ORDER BY date DESC"; |
9 |
if ($limit) $sql .= " LIMIT $limit OFFSET $offset"; |
if ($limit) $sql .= " LIMIT $limit OFFSET $offset"; |
14 |
$art = array(); |
$art = array(); |
15 |
list($art["id"], $art["title"], $art["lead"], $art["pic_url"], |
list($art["id"], $art["title"], $art["lead"], $art["pic_url"], |
16 |
$art["pic_alt"], $art["pic_pos"], $art["more"], |
$art["pic_alt"], $art["pic_pos"], $art["more"], |
17 |
$date, $ord) = $row; |
$art["more_title"], $date, $ord) = $row; |
18 |
$art["pic_url"] = str_replace("+", "%20", urlencode($art["pic_url"])); |
$art["pic_url"] = str_replace("+", "%20", urlencode($art["pic_url"])); |
19 |
list($art["pic_w"], $art["pic_h"]) = PicSize($art["pic"]); |
list($art["pic_w"], $art["pic_h"]) = PicSize($art["pic"]); |
20 |
$text = array(); |
$text = array(); |
76 |
$tpl->assign("titlepic_alt", MyEscape($art["pic_alt"])); |
$tpl->assign("titlepic_alt", MyEscape($art["pic_alt"])); |
77 |
$tpl->assign("titlepic_type", $art["pic_pos"]); |
$tpl->assign("titlepic_type", $art["pic_pos"]); |
78 |
$tpl->assign("title_url", MyEscape($art["more"])); |
$tpl->assign("title_url", MyEscape($art["more"])); |
79 |
|
$tpl->assign("title_url_title", MyEscape($art["more_title"])); |
80 |
$tpl->assign("titlepic_width", $art["pic_w"]); |
$tpl->assign("titlepic_width", $art["pic_w"]); |
81 |
$tpl->assign("titlepic_height", $art["pic_h"]); |
$tpl->assign("titlepic_height", $art["pic_h"]); |
82 |
for ($i = 0; $i < count($art["text"]); $i++) |
for ($i = 0; $i < count($art["text"]); $i++) |