13 |
} |
} |
14 |
|
|
15 |
function MyDelete($src) { |
function MyDelete($src) { |
16 |
# @unlink($src); |
#@unlink($src); |
17 |
} |
} |
18 |
|
|
19 |
function PicSize($pic, $dir = "") { |
function PicSize($pic, $dir = "") { |
40 |
|
|
41 |
function GetLinks($read, $more, $more_title, $id, $cat, $name, $edit, $updown = false, $up = false, $down = false) { |
function GetLinks($read, $more, $more_title, $id, $cat, $name, $edit, $updown = false, $up = false, $down = false) { |
42 |
$t = new Smarty(); |
$t = new Smarty(); |
43 |
global $section, $section_menu, $spec; |
global $section, $section_menu, $section_menu2, $spec, $isMed, $offset; |
44 |
$t->assign("section", $section); |
$t->assign("section", $section); |
45 |
$t->assign("section_menu", $section_menu); |
$t->assign("section_menu", $section_menu); |
46 |
|
$t->assign("section_menu2", $section_menu2); |
47 |
$t->assign("spec", $spec); |
$t->assign("spec", $spec); |
48 |
|
$t->assign("offset", $offset); |
49 |
$t->assign("id", $id); |
$t->assign("id", $id); |
50 |
$t->assign("cat", $cat); |
$t->assign("cat", $cat); |
51 |
|
$t->assign("med", $isMed); |
52 |
|
$m = "more"; |
53 |
|
if ($cat == "t") $m = "tmore"; |
54 |
|
if ($cat == "w") $m = "wmore"; |
55 |
|
if ($cat == "p") $m = "pmore"; |
56 |
|
$t->assign("m", $m); |
57 |
$t->assign("name", $name); |
$t->assign("name", $name); |
58 |
$t->assign("read", $read && !strstr($more, "?")); |
$t->assign("read", $read || ($more && !strstr($more, "?")) ? $read : ""); |
59 |
$t->assign("more", /* $more */ strstr($more, "?") ? $more : ""); |
$t->assign("more", /* $more */ strstr($more, "?") ? $more : ""); |
60 |
$t->assign("more_new", strstr($more, "://") ? true : false); |
$t->assign("more_new", strstr($more, "://") ? true : false); |
61 |
$t->assign("more_title", $more_title); |
$t->assign("more_title", $more_title); |
66 |
return $t->fetch("links.tpl"); |
return $t->fetch("links.tpl"); |
67 |
} |
} |
68 |
|
|
69 |
|
function GetRead($id, $ct = "") { |
70 |
|
global $section, $section_menu, $section_menu2, $spec, $offset, $cat, $acat, $acat2; |
71 |
|
$tmp = array(); |
72 |
|
if ($section) array_push($tmp, "section=$section"); |
73 |
|
if ($section_menu) array_push($tmp, "section_menu=$section_menu"); |
74 |
|
if ($section_menu2) array_push($tmp, "section_menu=$section_menu2"); |
75 |
|
if ($spec) array_push($tmp, "spec=$spec"); |
76 |
|
if ($offset) array_push($tmp, "offset=$offset"); |
77 |
|
if ($acat) array_push($tmp, "acat=$acat"); |
78 |
|
if ($acat2) array_push($tmp, "acat2=$acat2"); |
79 |
|
if (!$ct) $ct = $cat; |
80 |
|
if ($ct) array_push($tmp, "cat=$ct"); |
81 |
|
array_push($tmp, "id=$id"); |
82 |
|
array_push($tmp, "show=1"); |
83 |
|
return "?".HTMLSpecialChars(implode("&", $tmp)); |
84 |
|
} |
85 |
|
|
86 |
function GetHighlight($hl) { |
function GetHighlight($hl) { |
87 |
$tp = new Smarty(); |
$tp = new Smarty(); |
88 |
$tp->assign("hl", $hl); |
$tp->assign("hl", $hl); |
137 |
function Auth($user = "", $pwd = "") { |
function Auth($user = "", $pwd = "") { |
138 |
global $ME,$HTTP_USER_AGENT,$REMOTE_ADDR; |
global $ME,$HTTP_USER_AGENT,$REMOTE_ADDR; |
139 |
// DEBUG: |
// DEBUG: |
140 |
if (stristr($ME, "test.plivamed.net")) return 0; |
#if (stristr($ME, "test.plivamed.net")) return 0; |
141 |
// User-Agent: should be mnoGoSearch, but in version 3.1.19 |
// User-Agent: should be mnoGoSearch, but in version 3.1.19 |
142 |
// it's UdmSearch so we match just search |
// it's UdmSearch so we match just search |
143 |
if (strstr($HTTP_USER_AGENT, "Search") && strstr($REMOTE_ADDR, "10.254.1.")) return 0; |
if (strstr($HTTP_USER_AGENT, "Search") && strstr($REMOTE_ADDR, "10.254.1.")) return 0; |
165 |
$isEdit = stristr($ME, "/edit/") ? true : false; |
$isEdit = stristr($ME, "/edit/") ? true : false; |
166 |
$isMed = stristr($ME, "med") || stristr($ME, "pm") ? true : false; |
$isMed = stristr($ME, "med") || stristr($ME, "pm") ? true : false; |
167 |
if ($isEdit) { |
if ($isEdit) { |
168 |
if ($PHP_AUTH_USER != "test" && $PHP_AUTH_PW != "test") { |
if ($PHP_AUTH_USER != "editor" && $PHP_AUTH_PW != "jokkvpr") { |
169 |
Header("WWW-Authenticate: Basic realm=\"PLIVA".($isMed?"med.net":"zdravlje.hr")."\""); |
Header("WWW-Authenticate: Basic realm=\"PLIVA".($isMed?"med.net":"zdravlje.hr")."\""); |
170 |
Header("HTTP/1.0 401 Unauthorized"); |
Header("HTTP/1.0 401 Unauthorized"); |
171 |
echo "Sorry, you are not allowed to edit the site.\n"; |
echo "Sorry, you are not allowed to edit the site.\n"; |