--- inc/newsEdit.php 2001/10/04 14:59:35 1.11 +++ inc/newsEdit.php 2001/10/27 16:54:50 1.18 @@ -15,8 +15,9 @@ #echo "[SQL] $sql
\n"; } function my_cmp($a, $b) { return MyCompare($a["txt"], $b["txt"]); } + function my_cmp_2($a, $b) { return MyCompare($a["ime"], $b["ime"]); } function newsEdit($art, $trigger = "", $isVijest = false) { - global $phptmp, $picdir, $syspicdir, $aupicdir, $sysaupicdir, $dbh, $tpl; + global $phptmp, $picdir, $syspicdir, $aupicdir, $sysaupicdir, $dbh; global $section, $section_menu, $section_menu2, $spec; global $ed_id, $ed_cat, $isMed; $i = 1; @@ -50,12 +51,21 @@ global ${"ed_clear_".$i}, ${"ed_clr_".$i}; ${"clear_".$i} = ${"ed_clear_".$i}; ${"clr_".$i} = ${"ed_clr_".$i}; + global ${"ed_fclear_".$i}, ${"ed_fclr_".$i}; + ${"fclear_".$i} = ${"ed_fclear_".$i}; + ${"fclr_".$i} = ${"ed_fclr_".$i}; global ${"ed_textpic_url_".$i}, ${"ed_textpic_url2_".$i}, ${"ed_textpic_name_".$i}; ${"textpic_url_".$i} = ${"ed_textpic_url_".$i}; ${"textpic_url2_".$i} = ${"ed_textpic_url2_".$i}; ${"textpic_name_".$i} = urldecode(${"ed_textpic_name_".$i}); # Fix for M$IE if (${"textpic_url_".$i} == "none") ${"textpic_url_".$i} = ""; + global ${"ed_textpic_full_".$i}, ${"ed_textpic_full2_".$i}, ${"ed_textpic_fname_".$i}; + ${"textpic_full_".$i} = ${"ed_textpic_full_".$i}; + ${"textpic_full2_".$i} = ${"ed_textpic_full2_".$i}; + ${"textpic_fname_".$i} = urldecode(${"ed_textpic_fname_".$i}); + # Fix for M$IE + if (${"textpic_full_".$i} == "none") ${"textpic_full_".$i} = ""; $i++; } // ----- @@ -70,6 +80,33 @@ $sth->finish(); usort($categories, "my_cmp"); // ----- + $autori = array(); + $sql = "SELECT autor_id, ime FROM autori"; +sql($sql); + $sth = $dbh->prepare($sql); + if (!$sth) error("Cannot prepare query: \"$sql\""); + if (!$sth->execute()) error("Cannot execute query: \"$sql\""); + while ($row = $sth->fetchrow_array()) array_push($autori, array("id" => $row[0], "ime" => MyEscape($row[1], false))); + $sth->finish(); + usort($autori, "my_cmp_2"); + // ----- + $newsi = array(); + #$sql = "SELECT news_id, title FROM news WHERE (".($isMed?"":"NOT ")."plivamed) ORDER BY title"; + $sql = "SELECT news_id, title FROM news"; + if ($ed_id && $ed_id > 0) $sql .= " WHERE (news_id != $ed_id)"; + $sql .= " ORDER BY title"; +sql($sql); + $sth = $dbh->prepare($sql); + if (!$sth) error("Cannot prepare query: \"$sql\""); + if (!$sth->execute()) error("Cannot execute query: \"$sql\""); + while ($row = $sth->fetchrow_array()) { + $txt = $row[1]; + if (strlen($txt) > 55) $txt = substr($txt, 0, 55)."..."; + array_push($newsi, array("id" => $row[0], "txt" => $txt)); + } + $sth->finish(); + usort($newsi, "my_cmp"); + // ----- $specs = array(); $sql = "SELECT spec_id, opis FROM specijalizacije WHERE (spec_id != 0) AND (NOT link)"; sql($sql); @@ -79,6 +116,7 @@ while ($row = $sth->fetchrow_array()) array_push($specs, array("id" => $row[0], "txt" => $row[1])); $sth->finish(); usort($specs, "my_cmp"); + array_unshift($specs, array("id" => 0, "txt" => "HOME")); // ----- $levels = array(); $sql = "SELECT level_id, class, name FROM par_levels ORDER BY name"; @@ -118,7 +156,8 @@ global $ed_title, $ed_lead, $ed_titlepic_alt, $ed_titlepic_pos, $ed_more, $ed_more_title, $ed_cat, $ed_author_alt, $ed_author_info, - $ed_author_ime; + $ed_author_ime, $ed_author_cv, $ed_exclusive, + $ed_prikazi; $ed_title = MyQuote($ed_title); $ed_lead = MyQuote($ed_lead); $ed_author_nm = urldecode(MyQuote(basename($author_name))); @@ -130,12 +169,14 @@ $ed_more = MyQuote($ed_more); $ed_more_title = MyQuote($ed_more_title); if (!$ed_titlepic_pos) $ed_titlepic_pos = 0; + if (!$ed_author_cv) $ed_author_cv = 0; + if (!isset($ed_exclusive)) $ed_exclusive = false; if ($ed_id > 0) { - $sql = "UPDATE news SET category = '$ed_cat', title = $ed_title, lead = $ed_lead, title_pic = $ed_titlepic_nm, title_alt = $ed_titlepic_alt, title_pos = $ed_titlepic_pos, author_pic = $ed_author_nm, author_alt = $ed_author_alt, author_info = $ed_author_info, author_name = $ed_author_ime, url = $ed_more, url_title = $ed_more_title, plivamed = ".($isMed?"true":"false").", ord = 0, d_change = NOW() WHERE (news_id = $ed_id)"; + $sql = "UPDATE news SET category = '$ed_cat', title = $ed_title, lead = $ed_lead, title_pic = $ed_titlepic_nm, title_alt = $ed_titlepic_alt, title_pos = $ed_titlepic_pos, author_pic = $ed_author_nm, author_alt = $ed_author_alt, author_info = $ed_author_info, author_name = $ed_author_ime, autor_cv = $ed_author_cv, exclusive = ".($ed_exclusive?"true":"false").", url = $ed_more, url_title = $ed_more_title, plivamed = ".($isMed?"true":"false").", prikazi = ".($ed_prikazi?"true":"false").", ord = 0, d_change = NOW() WHERE (news_id = $ed_id)"; sql($sql); $dbh->dbh_do($sql); } else { - $sql = "INSERT INTO news (category, title, lead, title_pic, title_alt, title_pos, author_pic, author_alt, author_info, author_name, url, url_title, plivamed, d_orig, d_change) VALUES ('$ed_cat', $ed_title, $ed_lead, $ed_titlepic_nm, $ed_titlepic_alt, $ed_titlepic_pos, $ed_author_nm, $ed_author_alt, $ed_author_info, $ed_author_ime, $ed_more, $ed_more_title, ".($isMed?"true":"false").", NOW(), NOW())"; + $sql = "INSERT INTO news (category, title, lead, title_pic, title_alt, title_pos, author_pic, author_alt, author_info, author_name, autor_cv, exclusive, url, url_title, plivamed, prikazi, d_orig, d_change) VALUES ('$ed_cat', $ed_title, $ed_lead, $ed_titlepic_nm, $ed_titlepic_alt, $ed_titlepic_pos, $ed_author_nm, $ed_author_alt, $ed_author_info, $ed_author_ime, $ed_author_cv, ".($ed_exclusive?"true":"false").", $ed_more, $ed_more_title, ".($isMed?"true":"false").", ".($ed_prikazi?"true":"false").", NOW(), NOW())"; sql($sql); $dbh->dbh_do($sql); $sql = "SELECT currval('news_news_id_seq')::text"; @@ -161,12 +202,12 @@ ${"ed_textpic_alt_".$i}, ${"ed_textpic_pos_".$i}, ${"ed_text_level_".$i}, ${"ed_hl_".$i}, ${"ed_textpic_exp_".$i}; - list($id, $tit, $txt, $pic, $orig, $alt, $pos, $del, $lev, $hl, $exp) = array( - ${"ed_text_id_".$i}, ${"ed_text_title_".$i}, - ${"ed_text_".$i}, ${"textpic_url2_".$i}, ${"textpic_name_".$i}, - ${"ed_textpic_alt_".$i}, ${"ed_textpic_pos_".$i}, - ${"del_".$i}, ${"ed_text_level_".$i}, ${"ed_hl_".$i}, - ${"ed_textpic_exp_".$i}); + list($id, $tit, $txt, $pic, $orig,$full, $forig, $alt, $pos, $del, $lev, $hl, $exp) = array( + ${"ed_text_id_".$i}, ${"ed_text_title_".$i}, ${"ed_text_".$i}, + ${"textpic_url2_".$i}, ${"textpic_name_".$i}, ${"textpic_full2_".$i}, + ${"textpic_fname_".$i}, ${"ed_textpic_alt_".$i}, + ${"ed_textpic_pos_".$i}, ${"del_".$i}, ${"ed_text_level_".$i}, + ${"ed_hl_".$i}, ${"ed_textpic_exp_".$i}); if ($lev != $last_level) { if ($last_level) { if ($last_level < $lev) array_push($parents, $id); @@ -182,6 +223,8 @@ $hl = MyQuote($hl); $orig = basename($orig); $org = MyQuote($orig); + $forig = basename($forig); + $forg = MyQuote($forig); $alt = MyQuote($alt); if (!$pos) $pos = 0; if ($id && $id > 0) { @@ -192,17 +235,29 @@ if (!$sth) error("Cannot prepare query: \"$sql\""); if (!$sth->execute()) error("Cannot execute query: \"$sql\""); while ($row = $sth->fetchrow_array()) { - list($pic) = $row; - MyDelete($syspicdir."/".$pic); + list($pic2) = $row; + MyDelete($syspicdir."/".$pic2); + } + $sth->finish(); + } + if ($del || !$forig) { + $sql = "SELECT full_pic FROM paragraphs WHERE (news_id = $ed_id) AND (paragraph_id = $id)"; +sql($sql); + $sth = $dbh->prepare($sql); + if (!$sth) error("Cannot prepare query: \"$sql\""); + if (!$sth->execute()) error("Cannot execute query: \"$sql\""); + while ($row = $sth->fetchrow_array()) { + list($pic2) = $row; + MyDelete($syspicdir."/".$pic2); } $sth->finish(); } if ($del) $sql = "DELETE FROM paragraphs WHERE (news_id = $ed_id) AND (paragraph_id = $id)"; - else $sql = "UPDATE paragraphs SET title = $tit, level = $lev, text = $txt, hl = $hl, pic = $org, alt = $alt, pos = $pos, pic_title = $exp WHERE (news_id = $ed_id) AND (paragraph_id = $id)"; + else $sql = "UPDATE paragraphs SET title = $tit, level = $lev, text = $txt, hl = $hl, pic = $org, full_pic = $forg, alt = $alt, pos = $pos, pic_title = $exp WHERE (news_id = $ed_id) AND (paragraph_id = $id)"; sql($sql); $dbh->dbh_do($sql); } else if (!$del) { - $sql = "INSERT INTO paragraphs (news_id, title, level, text, pic, alt, pos, hl, pic_title) VALUES ($ed_id, $tit, $lev, $txt, $org, $alt, $pos, $hl, $exp)"; + $sql = "INSERT INTO paragraphs (news_id, title, level, text, pic, full_pic, alt, pos, hl, pic_title) VALUES ($ed_id, $tit, $lev, $txt, $org, $forg, $alt, $pos, $hl, $exp)"; sql($sql); $dbh->dbh_do($sql); $sql = "SELECT currval('paragraphs_paragraph_id_seq')::text"; @@ -216,6 +271,7 @@ $last_id = $id = $row; } if ($pic) MyMove("$syspicdir/$pic", "$syspicdir/$orig"); + if ($full) MyMove("$syspicdir/$full", "$syspicdir/$forig"); $i++; } if ($ed_id) { @@ -223,12 +279,30 @@ sql($sql); $dbh->dbh_do($sql); for ($k = 0; $k < count($specs); $k++) { - $var = "ed_spec_".$specs[$k]["id"]; global $$var; + $var = "ed_spec_".$specs[$k]["id"]; + global $$var; if (!$$var) continue; $sql = "INSERT INTO spec_news (news_id, spec_id) VALUES ($ed_id, ".$specs[$k]["id"].")"; sql($sql); $dbh->dbh_do($sql); } + $sql = "DELETE FROM related WHERE (news_id = $ed_id)"; +sql($sql); + $dbh->dbh_do($sql); + $x = 1; + $foo = array(); + while (true) { + $var = "ed_related_".$x; + $x++; + global $$var; + if (!isset($$var)) break; + if (!$$var) continue; + if ($foo[$$var]) continue; + $foo[$$var] = true; + $sql = "INSERT INTO related (news_id, rel_id) VALUES ($ed_id, ".$$var.")"; +sql($sql); + $dbh->dbh_do($sql); + } $sql = "DELETE FROM cat_news WHERE (news_id = $ed_id)"; sql($sql); $dbh->dbh_do($sql); @@ -249,6 +323,8 @@ while (isset(${"ed_textpic_id_".$i})) { $tmp = ${"textpic_url2_".$i}; if (ereg("$phptmp", $tmp)) MyDelete($syspicdir."/".$tmp); + $tmp = ${"textpic_full2_".$i}; + if (ereg("$phptmp", $tmp)) MyDelete($syspicdir."/".$tmp); $i++; } } @@ -291,18 +367,28 @@ $u = ${"textpic_url2_".$n}; if (ereg("$phptmp", $u)) MyDelete($syspicdir."/".$u2); unset(${"clear_".$n}, ${"clr_".$n}); + } else if (ereg("^ed_textpic_full_([1-9][0-9]*)$", $key, $regs)) { + move_uploaded_file($tname, $syspicdir."/".$nm.$ext); + $n = $regs[1]; + ${"textpic_full_".$n} = $nm.$ext; + ${"textpic_fname_".$n} = $name; + $u = ${"textpic_full2_".$n}; + if (ereg("$phptmp", $u)) MyDelete($syspicdir."/".$u2); + unset(${"fclear_".$n}, ${"fclr_".$n}); } else { - // [?!?] + // ?!? } } // ----- $tp = new Smarty(); $tp->assign("levels", $levels); + $tp->assign("autori", $autori); + $tp->assign("newsi", $newsi); // ----- global $ed_id, $ed_title, $ed_lead, $ed_titlepic_pos, $ed_titlepic_alt, $ed_cat, $ed_more, $ed_more_title, $ed_author_url, $ed_author_alt, - $ed_author_info, $ed_author_ime; + $ed_author_info, $ed_author_ime, $ed_prikazi; global $ed_edit, $ed_preview, $preview, $add; if (!$ed_preview) $ed_preview = ($preview ? true : false); if ($ed_edit) $ed_preview = false; @@ -318,12 +404,14 @@ $ed_warning = 0; $nspecs = array(); $ncats = array(); + $related = array(); // Transfer data if ($ed_edit || $ed_preview || $add || $delete || $clear) { for ($i = 0; $i < count($specs); $i++) { $var = "ed_spec_".$specs[$i]["id"]; global $$var; - $nspecs[$specs[$i]["id"]] = $$var ? true : false; + $foo = isset($$var) ? $$var : ($spec && $spec == $specs[$i]["id"]); + $nspecs[$specs[$i]["id"]] = $foo ? true : false; } for ($i = 0; $i < count($categories); $i++) { $var = "ed_cat_".$categories[$i]["id"]; @@ -331,10 +419,9 @@ $ncats[$categories[$i]["id"]] = $$var ? true : false; } global $ed_title, $ed_lead, $ed_titlepic_pos, - $ed_titlepic_alt, $ed_cat, $ed_more, - $ed_more_title, $ed_author_url, - $ed_author_alt, $ed_author_info, - $ed_author_ime; + $ed_titlepic_alt, $ed_cat, $ed_more, $ed_more_title, + $ed_author_url, $ed_author_alt, $ed_author_info, + $ed_author_ime, $ed_author_cv, $ed_exclusive, $ed_prikazi; if (!$HTTP_POST_FILES["ed_titlepic_url"]["name"]) $titlepic_url = ""; if (!$titlepic_url) $titlepic_url = $titlepic_url2; if (!$titlepic_url && !($clear_main || $clr_main)) $titlepic_url = $art["pic_url"]; @@ -344,6 +431,14 @@ global $ed_title_force; if ($titlepic_url && !$ed_titlepic_pos && !$ed_title_force) $ed_warning = 2; $i = 1; + while (true) { + $var = "ed_related_".$i; + global $$var; + if (!isset($$var)) break; + array_push($related, $$var); + $i++; + } + $i = 1; while (isset(${"ed_text_id_".$i})) { $id = ${"ed_text_id_".$i}; global ${"ed_text_".$i}, ${"ed_text_title_".$i}, @@ -353,17 +448,26 @@ $pic_url = ($HTTP_POST_FILES["ed_textpic_url_".$i]["name"]) ? ${"textpic_url_".$i} : ""; if (!$pic_url) $pic_url = ${"textpic_url2_".$i}; + $full_url = ($HTTP_POST_FILES["ed_textpic_full_".$i]["name"]) ? + ${"textpic_full_".$i} : ""; + if (!$full_url) $full_url = ${"textpic_full2_".$i}; $tmp = ""; for ($j = 0; $j < count($art["text"]); $j++) if ($art["text"][$j]["id"] == $id) $tmp = $art["text"][$j]["pic"]; if (!$pic_url && $tmp && !(${"clear_".$i} || ${"clr_".$i})) $pic_url = $tmp; + $tmp = ""; + for ($j = 0; $j < count($art["text"]); $j++) + if ($art["text"][$j]["id"] == $id) $tmp = $art["text"][$j]["full"]; + if (!$full_url && $tmp && !(${"fclear_".$i} || ${"fclr_".$i})) $full_url = $tmp; $level = ${"ed_text_level_".$i}; list($w, $h) = PicSize($pic_url); + list($w2, $h2) = PicSize($full_url); array_push($ed_pgfs, array($id, ${"ed_text_".$i}, ${"ed_text_title_".$i}, $level, $pic_url, ${"textpic_name_".$i}, + $full_url, ${"textpic_fname_".$i}, ${"ed_textpic_alt_".$i}, ${"ed_textpic_pos_".$i}, - $w, $h, ${"ed_hl_".$i}, ${"ed_textpic_exp_".$i}, false)); + $w, $h, $w2, $h2, ${"ed_hl_".$i}, ${"ed_textpic_exp_".$i}, false)); $i++; } } else { @@ -382,28 +486,46 @@ if (!$sth->execute()) error("Cannot execute query: \"$sql\""); while ($row = $sth->fetchrow_array()) $ncats[$row[0]] = true; $sth->finish(); + $sql = "SELECT rel_id FROM related WHERE (news_id = $ed_id)"; +sql($sql); + $sth = $dbh->prepare($sql); + if (!$sth) error("Cannot prepare query: \"$sql\""); + if (!$sth->execute()) error("Cannot execute query: \"$sql\""); + while ($row = $sth->fetchrow_array()) { + list($id) = $row; + array_push($related, $id); + } + $sth->finish(); + } else { + $art["show"] = false; + for ($j = 0; $j < count($specs); $j++) + $nspecs[$specs[$j]["id"]] = ($specs[$j]["id"] == $spec) ? true : false; } list($ed_title, $ed_lead, $ed_titlepic_pos, $titlepic_url, $titlepic_url2, $titlepic_name, $ed_titlepic_alt, $ed_cat, $ed_more, $ed_more_title, $width, $height, $author_url, $author_url2, $author_name, $ed_author_alt, $ed_author_info, $width2, $height2, - $ed_author_ime) = array($art["title"], $art["lead"], $art["pic_pos"], - $art["pic_url"], $art["pic_url"], urldecode($art["pic_url"]), - $art["pic_alt"], $art["category"], $art["more"], - $art["more_title"], $art["pic_w"], $art["pic_h"], - $art["au_pic"], $art["au_pic"], urldecode($art["au_pic"]), + $ed_author_ime, $ed_author_cv, $ed_exclusive, $ed_prikazi) = + array($art["title"], $art["lead"], $art["pic_pos"], $art["pic_url"], + $art["pic_url"], urldecode($art["pic_url"]), $art["pic_alt"], + $art["category"], $art["more"], $art["more_title"], $art["pic_w"], + $art["pic_h"], $art["au_pic"], $art["au_pic"], urldecode($art["au_pic"]), $art["au_alt"], $art["au_info"], $art["au_w"], $art["au_h"], - $art["au_name"]); + $art["au_name"], $art["au_cv"], $art["ex"], $art["show"]); + if ($art["text"]) reset($art["text"]); while ($art["text"] && list($id, $val) = each($art["text"])) { array_push($ed_pgfs, array($val["id"], $val["text"], $val["title"], $val["level"], urldecode($val["pic"]), - urldecode($val["pic"]), $val["alt"], $val["pos"], $val["w"], - $val["h"], $val["hl"], $val["exp"], false)); + urldecode($val["pic"]), urldecode($val["full"]), urldecode($val["full"]), + $val["alt"], $val["pos"], $val["w"], $val["h"], $val["fw"], $val["fh"], + $val["hl"], $val["exp"], false)); } $ed_id = $art["id"]; if (!$ed_id) $ed_id = -1; } + for ($i = count($related); $i < 10; $i++) array_push($related, 0); + $tp->assign("related", $related); $ncats[$ed_cat] = true; for ($i = 0; $i < count($specs); $i++) $specs[$i]["check"] = $nspecs[$specs[$i]["id"]]; for ($i = 0; $i < count($categories); $i++) $categories[$i]["check"] = $ncats[$categories[$i]["id"]]; @@ -416,7 +538,7 @@ if ($add) { global $add_num; for ($i = 0; $i < intval($add_num); $i++) - array_push($ed_pgfs, array(-1, "", "", -1, "", "", "", 0, 0, 0, "", "", true)); + array_push($ed_pgfs, array(-1, "", "", -1, "", "", "", "", "", 0, 0, 0, 0, 0, "", "", true)); } $ed_empty = ($ed_title || $ed_lead || $ed_titlepic_pos || $ed_more) ? false : true; $ed_text = array(); @@ -424,12 +546,14 @@ $ed_warnings = ($ed_warning ? true : false); $i = 1; while (list($key, $val) = each($ed_pgfs)) { - list($id, $txt, $tit, $lev, $pic, $name, $alt, $pos, $w, $h, $hl, $exp, $new) = $val; + list($id, $txt, $tit, $lev, $pic, $name, $fpic, $fname, $alt, $pos, $w, $h, $fw, $fh, $hl, $exp, $new) = $val; $del = ((${"delete_".$i} || ${"del_".$i}) ? true : false); array_push($ed_records, array("val" => $del, "id" => $id)); if ($del) { $i++; continue; } $picurl = ${"textpic_url_".$id}; if (!$picurl) $picurl = $pic; + $fullurl = ${"textpic_full_".$id}; + if (!$fullurl) $fullurl = $fpic; $class = ""; reset($levels); while (list($k, $v) = each($levels)) if ($v["id"] == $lev) $class = $v["class"]; @@ -439,19 +563,22 @@ $picurl = ${"textpic_url_".$i} = ${"textpic_url2_".$i} = $name = ""; } if (!$name) $name = $picurl; - $txt = MyEscape(convert_html($txt), false); - $txt2 = ParseNewline($txt, true); - $txt3 = str_replace("&", "&", $txt); - $txt3 = str_replace("\"", """, $txt3); - $txt3 = str_replace("<", "<", $txt3); - $txt3 = str_replace(">", ">", $txt3); - $hl = MyEscape(convert_html($hl), false); - $hl2 = ParseNewline($hl, true); - if ($hl2) $hl2 = GetHighlight($hl2); - $hl3 = str_replace("&", "&", $hl); - $hl3 = str_replace("\"", """, $hl3); - $hl3 = str_replace("<", "<", $hl3); - $hl3 = str_replace(">", ">", $hl3); + if ((${"fclear_".$i} || ${"fclr_".$i}) && $ed_preview && (${"textpic_full_".$i} != ${"textpic_full2_".$i})) { + $tmp = ${"textpic_full2_".$i}; + if (ereg("$phptmp", $tmp)) MyDelete($syspicdir."/".$tmp); + $fullurl = ${"textpic_full_".$i} = ${"textpic_full2_".$i} = $fname = ""; + } + if (!$fname) $fname = $fullurl; + // ---- + $txt3 = MyEscape(convert_html($txt), true); + $txt = str_replace("&", "&", MyEscape(convert_html($txt), false)); + $txt2 = $ed_preview ? ParseNewline($txt, true) : $txt3; + // ---- + $hl3 = MyEscape(convert_html($hl), true); + $hl = str_replace("&", "&", MyEscape(convert_html($hl), false)); + $hl2 = $ed_preview ? ParseNewline($hl, true) : $hl3; + if ($hl) $hl = GetHighlight($hl); + // ---- global ${"ed_text_force_".$i}; $force = ${"ed_text_force_".$i}; $empty = (($ed_preview && !$txt && !$pos && !$new) ? true : false); @@ -474,13 +601,18 @@ "class" => MyEscape(convert_html($class)), "url" => MyEscape(convert_html($picurl)), "name" => MyEscape(convert_html($name)), + "full" => MyEscape(convert_html($fullurl)), + "fname" => MyEscape(convert_html($fname)), "alt" => MyEscape(convert_html($alt)), "w" => $w, "h" => $h, + "fw" => $fw, + "fh" => $fh, "pos" => $pos, "exp" => MyEscape(convert_html($exp)), "warning" => $warning, - "clr" => (${"clear_".$i} || ${"clr_".$i} || !$picurl) ? true : false + "clr" => (${"clear_".$i} || ${"clr_".$i} || !$picurl) ? true : false, + "fclr" => (${"fclear_".$i} || ${"fclr_".$i} || !$fullurl) ? true : false )); $i++; } @@ -490,7 +622,8 @@ $tp->assign("ed_preview", $ed_preview); $tp->assign("ed_trigger", $trigger); $tp->assign("ed_title", MyEscape(convert_html($ed_title))); - $tp->assign("ed_lead", MyEscape(convert_html($ed_lead))); + $tp->assign("ed_lead", MyEscape(convert_html($ed_lead), true)); + $tp->assign("ed_lead2", ParseNewline(MyEscape(convert_html($ed_lead), false), false)); $tp->assign("ed_titlepic_pos", $ed_titlepic_pos); $tp->assign("ed_titlepic_url", MyEscape(convert_html($titlepic_url))); $tp->assign("ed_titlepic_url2", MyEscape(convert_html($titlepic_url2))); @@ -509,6 +642,9 @@ $tp->assign("ed_more", MyEscape($ed_more)); $tp->assign("ed_more_new", strstr($ed_more, "://") ? true : false); $tp->assign("ed_more_title", MyEscape($ed_more_title)); + $tp->assign("ed_prikazi", $ed_prikazi); + $tp->assign("ed_author_cv", $ed_author_cv); + $tp->assign("ed_exclusive", $ed_exclusive); $tp->assign("ed_clr_main", ($clear_main || $clr_main || !$titlepic_url) ? true : false); $tp->assign("ed_clr_author", ($clear_author || $clr_author || !$author_url) ? true : false); $tp->assign("ed_text", $ed_text); @@ -520,11 +656,10 @@ $tp->assign("aupicdir", "$aupicdir/"); $tp->assign("vijest", $isVijest ? true : false); if ($ed_preview) { - include_once("author.php"); $tp->assign("AUTHOR", GetAuthor(MyEscape(convert_html($author_url)), MyEscape(convert_html($ed_author_alt)), MyEscape(convert_html($ed_author_info)), - $width2, $height2)); + $width2, $height2, $ed_author_cv)); } $tp->assign("med", $isMed ? true : false); $params = array();