/[health_html]/inc/newsShow.php
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /inc/newsShow.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.10 by ravilov, Tue Oct 2 16:18:09 2001 UTC revision 1.11 by ravilov, Thu Oct 4 14:59:35 2001 UTC
# Line 28  Line 28 
28                  }                  }
29                  $sth->finish();                  $sth->finish();
30          }          }
31          function newsLoad($id, $cat = "", $limit = 0, $offset = 0, $npar = 1) {          function newsLoad($id, $ct = "", $limit = 0, $offset = 0, $npar = 1) {
32                  global $dbh, $spec, $isMed;                  global $dbh, $spec, $isMed;
33                  $arts = array();                  $arts = array();
34                  if (!$offset) $offset = 0;                  if (!$offset) $offset = 0;
35                  $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, ord FROM news".(isset($cat)?", cat_news":"").($spec?", spec_news":"")." WHERE (".($isMed?"":"NOT ")."plivamed)";                  $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 FROM news".(isset($ct)?", cat_news":"").($spec?", spec_news":"")." WHERE (".($isMed?"":"NOT ")."plivamed)";
36                  if ($id > 0) $sql .= " AND (news.news_id = $id)";                  if ($id > 0) $sql .= " AND (news.news_id = $id)";
37                  if ($cat) $sql .= " AND ((category = '$cat') OR ((cat_news.cat_id = '$cat') 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)))";
38                  if ($spec) $sql .= " AND (spec_news.news_id = news.news_id) AND (spec_news.spec_id = $spec)";                  if ($spec) $sql .= " AND (spec_news.news_id = news.news_id) AND (spec_news.spec_id = $spec)";
39                  $sql .= " ORDER BY d_orig DESC";                  $sql .= " ORDER BY d_orig DESC";
40                  if ($limit) $sql .= " LIMIT $limit OFFSET $offset";                  if ($limit) $sql .= " LIMIT $limit OFFSET $offset";
# Line 46  Line 46 
46                          list($art["id"], $art["title"], $art["lead"], $art["pic_url"],                          list($art["id"], $art["title"], $art["lead"], $art["pic_url"],
47                                  $art["pic_alt"], $art["pic_pos"], $art["more"],                                  $art["pic_alt"], $art["pic_pos"], $art["more"],
48                                  $art["more_title"], $art["date"], $art["au_pic"],                                  $art["more_title"], $art["date"], $art["au_pic"],
49                                  $art["au_alt"], $art["au_info"], $ord) = $row;                                  $art["au_alt"], $art["au_info"], $art["au_name"],
50                                    $ord) = $row;
51                          list($art["pic_w"], $art["pic_h"]) = PicSize($art["pic_url"]);                          list($art["pic_w"], $art["pic_h"]) = PicSize($art["pic_url"]);
52                          $art["more_new"] = strstr($art["more"], "://") ? true : false;                          $art["more_new"] = strstr($art["more"], "://") ? true : false;
53                          global $sysaupicdir;                          global $sysaupicdir;
# Line 56  Line 57 
57                          $art["text"] = array();                          $art["text"] = array();
58                          if ($art["id"]) get_sections($art["id"], $art["text"]);                          if ($art["id"]) get_sections($art["id"], $art["text"]);
59                          $art["order"] = $ord;                          $art["order"] = $ord;
60                          $art["read"] = (count($art["text"]) > $npar) ? true : false;                          $art["read"] = (count($art["text"]) > $npar) ? GetRead($art["id"], $ct) : "";
61                          $art["category"] = $cat;                          $art["category"] = $ct;
62                          $art["limit"] = $limit;                          $art["limit"] = $limit;
63                          $art["offset"] = $offset;                          $art["offset"] = $offset;
64                          $art["npar"] = $npar;                          $art["npar"] = $npar;
# Line 84  Line 85 
85          }          }
86    
87          function newsShow($art) {          function newsShow($art) {
88                  global $fname, $tpl;                  global $fname, $tpl, $acat, $acat2;
89                  $fname = "show.tpl";                  $fname = "show.tpl";
90                  $tpl->assign("title", MyEscape(convert_html($art["title"])));                  $tpl->assign("title", MyEscape(convert_html($art["title"])));
91                  $tpl->assign("lead", MyEscape(convert_html($art["lead"]), false));                  $tpl->assign("lead", MyEscape(convert_html($art["lead"]), false));
# Line 96  Line 97 
97                  $tpl->assign("title_url_title", MyEscape(convert_html($art["more_title"])));                  $tpl->assign("title_url_title", MyEscape(convert_html($art["more_title"])));
98                  $tpl->assign("titlepic_width", $art["pic_w"]);                  $tpl->assign("titlepic_width", $art["pic_w"]);
99                  $tpl->assign("titlepic_height", $art["pic_h"]);                  $tpl->assign("titlepic_height", $art["pic_h"]);
100                  $tpl->assign("date", strftime("%d.%m.%Y.", strtotime($art["date"])));                  $tpl->assign("date", $art["date"] ? strftime("%d.%m.%Y.", strtotime($art["date"])) : "");
101                  include_once("author.php");                  include_once("author.php");
102                  $tpl->assign("AUTHOR", GetAuthor($art["au_pic"],                  $tpl->assign("AUTHOR", GetAuthor($art["au_pic"],
103                          $art["au_alt"], $art["au_info"],                          $art["au_alt"], $art["au_info"],
# Line 113  Line 114 
114                  }                  }
115                  $tpl->assign("text", $art["text"]);                  $tpl->assign("text", $art["text"]);
116                  $tpl->assign("cat", $art["category"]);                  $tpl->assign("cat", $art["category"]);
117                    $tpl->assign("acat", $acat);
118                    $tpl->assign("acat2", $acat2);
119                  global $PATH;                  global $PATH;
120                  if (is_array($PATH)) array_push($PATH,                  if (is_array($PATH)) array_push($PATH,
121                          MyUpper(MyEscape(convert_html($art["title"]))));                          MyUpper(MyEscape(convert_html($art["title"]))));

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

  ViewVC Help
Powered by ViewVC 1.1.26