--- inc/util.php 2001/10/16 13:07:03 1.9 +++ inc/util.php 2001/10/23 16:13:59 1.10 @@ -38,7 +38,7 @@ return array($w, $h); } - function GetLinks($read, $more, $more_title, $id, $cat, $name, $updown = false, $up = false, $down = false, $prikazi = true) { + function GetLinks($read, $more, $more_title, $id, $cat, $name, $updown = false, $up = false, $down = false, $prikazi = true, $related = false) { $t = new Smarty(); global $section, $section_menu, $section_menu2, $spec, $isMed, $isEdit, $offset; $t->assign("section", $section); @@ -50,13 +50,12 @@ $t->assign("cat", $cat); $t->assign("med", $isMed); $m = "more"; - if ($cat == "t") $m = "tmore"; + if ($cat == "t" || $cat == "3") $m = "tmore"; if ($cat == "w") $m = "wmore"; if ($cat == "p") $m = "pmore"; $t->assign("m", $m); $t->assign("name", $name); - $pos = strpos($more, "?"); - $t->assign("read", $read && (!$more || ($more && ($pos === false || $pos != 0))) ? $read : ""); + $t->assign("read", $read /* && (!$more || ($more && !strpos($more, "?"))) ? $read : "" */); $t->assign("more", /* $more */ strstr($more, "?") ? $more : ""); $t->assign("more_new", strstr($more, "://") ? true : false); $t->assign("more_title", $more_title); @@ -65,6 +64,7 @@ $t->assign("up", $up); $t->assign("down", $down); $t->assign("prikazi", $prikazi); + $t->assign("related", $related); return $t->fetch("links.tpl"); } @@ -91,13 +91,21 @@ return $tp->fetch("highlight.tpl"); } - function GetAuthor($pic = "", $alt = "", $info = "", $width = 0, $height = 0) { + function GetAuthor($pic = "", $alt = "", $info = "", $width = 0, $height = 0, $cv = 0) { $t = new Smarty(); global $aupicdir; $t->assign("aupicdir", "$aupicdir/"); $t->assign("url", $pic); $t->assign("alt", $alt); - $t->assign("info", nl2br($info)); + $info = nl2br($info); + if ($cv) { + $info = str_replace("{", "", $info); + $info = str_replace("}", "", $info); + } else { + $info = str_replace("{", "", $info); + $info = str_replace("}", "", $info); + } + $t->assign("info", $info); $t->assign("width", $width); $t->assign("height", $hight); return $t->fetch("author.tpl"); @@ -107,7 +115,7 @@ global $dbh; $conn = $dbh ? true : false; if (!$conn) include("inc/conn.php"); - $sql = "SELECT stanje, trave, korov, stabla, date FROM semafor ORDER BY date DESC LIMIT 1"; + $sql = "SELECT stanje, trave, korov, stabla, date, prikazi_date FROM semafor ORDER BY date DESC LIMIT 1"; $sth = $dbh->prepare($sql); if (!$sth) error("Cannot prepare query: \"$sql\""); if (!$sth->execute()) error("Cannot execute query: \"$sql\""); @@ -116,12 +124,13 @@ if (!$conn) $dbh->disconnect(); $t = new Smarty(); if ($row) { - list($stanje, $trave, $korov, $stabla, $date) = $row; + list($stanje, $trave, $korov, $stabla, $date, $prik) = $row; + if ($prik[0] == "f" || $prik[0] == "F") unset($prik); $t->assign("stabla", $stabla); $t->assign("trave", $trave); $t->assign("korov", $korov); $t->assign("msg", $stanje); - $t->assign("date", $date ? strftime("%d.%m.%y.", strtotime($date)) : ""); + $t->assign("date", $prik && $date ? strftime("%d.%m.%y.", strtotime($date)) : ""); } return $t->fetch("semafor-table.tpl"); } @@ -172,7 +181,8 @@ } $isEdit = stristr($ME, "/edit/") ? true : false; - $isMed = stristr($ME, "med") || stristr($ME, "pm") ? true : false; + # $isMed = stristr($ME, "med") || stristr($ME, "pm") ? true : false; + include_once("_site.php"); // This should define $isMed. function Auth($user = "", $pwd = "") { global $ME,$HTTP_USER_AGENT,$REMOTE_ADDR;