/[health_html]/inc/newsEdit.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/newsEdit.php

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

revision 1.7 by ravilov, Wed Sep 19 12:23:57 2001 UTC revision 1.10 by ravilov, Fri Sep 28 23:34:37 2001 UTC
# Line 16  Line 16 
16          }          }
17          function my_cmp($a, $b) { return MyCompare($a["txt"], $b["txt"]); }          function my_cmp($a, $b) { return MyCompare($a["txt"], $b["txt"]); }
18          function newsEdit($art, $trigger = "", $isVijest = false) {          function newsEdit($art, $trigger = "", $isVijest = false) {
19                  global $phptmp, $picdir, $syspicdir, $aupicdir, $sysaupicdir, $section, $section_menu, $dbh, $tpl;                  global $phptmp, $picdir, $syspicdir, $aupicdir, $sysaupicdir, $dbh, $tpl;
20                    global $section, $section_menu, $section_menu2, $spec;
21                  global $ed_id, $ed_cat, $isMed;                  global $ed_id, $ed_cat, $isMed;
22                  $i = 1;                  $i = 1;
23                  global $ed_delete_main, $ed_del_main;                  global $ed_delete_main, $ed_del_main;
# Line 70  sql($sql); Line 71  sql($sql);
71                  usort($categories, "my_cmp");                  usort($categories, "my_cmp");
72                  // -----                  // -----
73                  $specs = array();                  $specs = array();
74                  $sql = "SELECT spec_id, opis FROM specijalizacije WHERE (NOT link)";                  $sql = "SELECT spec_id, opis FROM specijalizacije WHERE (spec_id != 0) AND (NOT link)";
75  sql($sql);  sql($sql);
76                  $sth = $dbh->prepare($sql);                  $sth = $dbh->prepare($sql);
77                  if (!$sth) error("Cannot prepare query: \"$sql\"");                  if (!$sth) error("Cannot prepare query: \"$sql\"");
# Line 79  sql($sql); Line 80  sql($sql);
80                  $sth->finish();                  $sth->finish();
81                  usort($specs, "my_cmp");                  usort($specs, "my_cmp");
82                  // -----                  // -----
83                    $levels = array();
84                    $sql = "SELECT level_id, class, name FROM par_levels ORDER BY name";
85    sql($sql);
86                    $sth = $dbh->prepare($sql);
87                    if (!$sth) error("Cannot prepare query: \"$sql\"");
88                    if (!$sth->execute()) error("Cannot execute query: \"$sql\"");
89                    while ($row = $sth->fetchrow_array()) array_push($levels, array("id" => $row[0], "class" => $row[1], "name" => $row[2]));
90                    $sth->finish();
91                    // -----
92                  global $cancel, $save;                  global $cancel, $save;
93                  if ($cancel || $save) {                  if ($cancel || $save) {
94                          if ($save) {                          if ($save) {
95                                  // Move temp pics & save article.                                  // Move temp pics & save article.
96                                  if (ereg("$phptmp", $titlepic_url2) && $ed_id > 0) {                                  if (ereg("$phptmp", $titlepic_url2) && $ed_id > 0 && file_exists("$syspicdir/$titlepic_url2")) {
97                                          $sql = "SELECT title_pic FROM news WHERE (news_id = $ed_id)";                                          $sql = "SELECT title_pic FROM news WHERE (news_id = $ed_id)";
98  sql($sql);  sql($sql);
99                                          $sth = $dbh->prepare($sql);                                          $sth = $dbh->prepare($sql);
# Line 94  sql($sql); Line 104  sql($sql);
104                                          $row = array_shift($row);                                          $row = array_shift($row);
105                                          if ($row) MyDelete($syspicdir."/".$row);                                          if ($row) MyDelete($syspicdir."/".$row);
106                                  }                                  }
107                                  if (ereg("$phptmp", $author_url2) && $ed_id > 0) {                                  if (ereg("$phptmp", $author_url2) && $ed_id > 0 && file_exists("$sysaupicdir/$author_url2")) {
108                                          $sql = "SELECT author_pic FROM news WHERE (news_id = $ed_id)";                                          $sql = "SELECT author_pic FROM news WHERE (news_id = $ed_id)";
109  sql($sql);  sql($sql);
110                                          $sth = $dbh->prepare($sql);                                          $sth = $dbh->prepare($sql);
# Line 119  sql($sql); Line 129  sql($sql);
129                                  $ed_more_title = MyQuote($ed_more_title);                                  $ed_more_title = MyQuote($ed_more_title);
130                                  if (!$ed_titlepic_pos) $ed_titlepic_pos = 0;                                  if (!$ed_titlepic_pos) $ed_titlepic_pos = 0;
131                                  if ($ed_id > 0) {                                  if ($ed_id > 0) {
132                                          $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, url = $ed_more, url_title = $ed_more_title, plivamed = ".($isMed?"true":"false").", 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, url = $ed_more, url_title = $ed_more_title, plivamed = ".($isMed?"true":"false").", ord = 0, d_change = NOW() WHERE (news_id = $ed_id)";
133  sql($sql);  sql($sql);
134                                          $dbh->dbh_do($sql);                                          $dbh->dbh_do($sql);
135                                  } else {                                  } else {
136                                          $sql = "INSERT INTO news (category, title, lead, title_pic, title_alt, title_pos, author_pic, author_alt, author_info, 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_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, 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_more, $ed_more_title, ".($isMed?"true":"false").", NOW(), NOW())";
137  sql($sql);  sql($sql);
138                                          $dbh->dbh_do($sql);                                          $dbh->dbh_do($sql);
139                                          $sql = "SELECT news_id FROM news WHERE (title = $ed_title)";                                          $sql = "SELECT currval('news_news_id_seq')::text";
140  sql($sql);  sql($sql);
141                                          $sth = $dbh->prepare($sql);                                          $sth = $dbh->prepare($sql);
142                                          if (!$sth) error("Cannot prepare query: \"$sql\"");                                          if (!$sth) error("Cannot prepare query: \"$sql\"");
# Line 141  sql($sql); Line 151  sql($sql);
151                                  if ($titlepic_url2) MyMove("$syspicdir/$titlepic_url2", urldecode("$syspicdir/$titlepic_name"));                                  if ($titlepic_url2) MyMove("$syspicdir/$titlepic_url2", urldecode("$syspicdir/$titlepic_name"));
152                                  if ($author_url2) MyMove("$sysaupicdir/$author_url2", urldecode("$sysaupicdir/$author_name"));                                  if ($author_url2) MyMove("$sysaupicdir/$author_url2", urldecode("$sysaupicdir/$author_name"));
153                                  $i = 1;                                  $i = 1;
154                                    $parents = array();
155                                    $last_level = 0;
156                                    $last_id = 0;
157                                  while ($ed_id > 0 && isset(${"ed_text_id_".$i})) {                                  while ($ed_id > 0 && isset(${"ed_text_id_".$i})) {
158                                          global ${"ed_text_title_".$i}, ${"ed_text_".$i},                                          global ${"ed_text_title_".$i}, ${"ed_text_".$i},
159                                                  ${"ed_textpic_alt_".$i}, ${"ed_textpic_pos_".$i},                                                  ${"ed_textpic_alt_".$i}, ${"ed_textpic_pos_".$i},
160                                                  ${"ed_text_level_".$i}, ${"ed_hl_".$i};                                                  ${"ed_text_level_".$i}, ${"ed_hl_".$i},
161                                          list($id, $tit, $txt, $pic, $orig, $alt, $pos, $del, $lev, $hl) = array(                                                  ${"ed_textpic_exp_".$i};
162                                            list($id, $tit, $txt, $pic, $orig, $alt, $pos, $del, $lev, $hl, $exp) = array(
163                                                  ${"ed_text_id_".$i}, ${"ed_text_title_".$i},                                                  ${"ed_text_id_".$i}, ${"ed_text_title_".$i},
164                                                  ${"ed_text_".$i}, ${"textpic_url2_".$i}, ${"textpic_name_".$i},                                                  ${"ed_text_".$i}, ${"textpic_url2_".$i}, ${"textpic_name_".$i},
165                                                  ${"ed_textpic_alt_".$i}, ${"ed_textpic_pos_".$i},                                                  ${"ed_textpic_alt_".$i}, ${"ed_textpic_pos_".$i},
166                                                  ${"del_".$i}, ${"ed_text_level_".$i}, ${"ed_hl_".$i});                                                  ${"del_".$i}, ${"ed_text_level_".$i}, ${"ed_hl_".$i},
167                                                    ${"ed_textpic_exp_".$i});
168                                            if ($lev != $last_level) {
169                                                    if ($last_level) {
170                                                            if ($last_level < $lev) array_push($parents, $id);
171                                                            if ($last_level > $lev && count($parents) > 0) array_pop($parents);
172                                                    }
173                                                    $last_level = $lev;
174                                                    $parent = $parents[0];
175                                                    if ($parent < 0) $parent = $last_id;
176                                            }
177                                          $tit = MyQuote($tit);                                          $tit = MyQuote($tit);
178                                          $txt = MyQuote($txt);                                          $txt = MyQuote($txt);
179                                            $exp = MyQuote($exp);
180                                          $hl = MyQuote($hl);                                          $hl = MyQuote($hl);
181                                          $orig = basename($orig);                                          $orig = basename($orig);
182                                          $org = MyQuote($orig);                                          $org = MyQuote($orig);
# Line 171  sql($sql); Line 196  sql($sql);
196                                                          $sth->finish();                                                          $sth->finish();
197                                                  }                                                  }
198                                                  if ($del) $sql = "DELETE FROM paragraphs WHERE (news_id = $ed_id) AND (paragraph_id = $id)";                                                  if ($del) $sql = "DELETE FROM paragraphs WHERE (news_id = $ed_id) AND (paragraph_id = $id)";
199                                                          else $sql = "UPDATE paragraphs SET title = $tit, level = $lev, text = $txt, hl = $hl, pic = $org, alt = $alt, pos = $pos 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)";
200  sql($sql);  sql($sql);
201                                                  $dbh->dbh_do($sql);                                                  $dbh->dbh_do($sql);
202                                          } else if (!$del) {                                          } else if (!$del) {
203                                                  $sql = "INSERT INTO paragraphs (news_id, title, level, text, pic, alt, pos, hl) VALUES ($ed_id, $tit, $lev, $txt, $org, $alt, $pos, $hl)";                                                  $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)";
204  sql($sql);  sql($sql);
205                                                  $dbh->dbh_do($sql);                                                  $dbh->dbh_do($sql);
206                                                  $sql = "SELECT paragraph_id FROM paragraphs WHERE (text = $txt)";                                                  $sql = "SELECT currval('paragraphs_paragraph_id_seq')::text";
207  sql($sql);  sql($sql);
208                                                  $sth = $dbh->prepare($sql);                                                  $sth = $dbh->prepare($sql);
209                                                  if (!$sth) error("Cannot prepare query: \"$sql\"");                                                  if (!$sth) error("Cannot prepare query: \"$sql\"");
210                                                  if (!$sth->execute()) error("Cannot execute query: \"$sql\"");                                                  if (!$sth->execute()) error("Cannot execute query: \"$sql\"");
211                                                  $rows = array();                                                  $row = $sth->fetchrow_array();
                                                 while ($row = $sth->fetchrow_array()) array_push($rows, $row);  
212                                                  $sth->finish();                                                  $sth->finish();
213                                                  $row = array_pop($rows);                                                  $row = array_shift($row);
214                                                  if (is_array($row)) $row = array_shift($row);                                                  $last_id = $id = $row;
                                                 $id = $row;  
215                                          }                                          }
216                                          if ($pic) MyMove("$syspicdir/$pic", "$syspicdir/$orig");                                          if ($pic) MyMove("$syspicdir/$pic", "$syspicdir/$orig");
217                                          $i++;                                          $i++;
# Line 210  sql($sql); Line 233  sql($sql);
233                                          for ($k = 0; $k < count($categories); $k++) {                                          for ($k = 0; $k < count($categories); $k++) {
234                                                  $var = "ed_cat_".$categories[$k]["id"];                                                  $var = "ed_cat_".$categories[$k]["id"];
235                                                  global $$var;                                                  global $$var;
236                                                  if (!$$var) continue;                                                  if ($categories[$k]["id"] != $ed_cat && !$$var) continue;
237                                                  $sql = "INSERT INTO cat_news (news_id, cat_id) VALUES ($ed_id, '".$categories[$k]["id"]."')";                                                  $sql = "INSERT INTO cat_news (news_id, cat_id) VALUES ($ed_id, '".$categories[$k]["id"]."')";
238  sql($sql);  sql($sql);
239                                                  $dbh->dbh_do($sql);                                                  $dbh->dbh_do($sql);
# Line 241  sql($sql); Line 264  sql($sql);
264                          if ($size <= 0) continue;                          if ($size <= 0) continue;
265                          if (!$name) continue;                          if (!$name) continue;
266                          if ($tname == "none") continue;                          if ($tname == "none") continue;
267                            $name = strtr($name, "¹šðè澞©ŠÐÈÆ®Ž ", "ssdcczzSSDCCZZ_");
268                          $nm = basename($tname);                          $nm = basename($tname);
269                          $ext = ereg_replace('^.*(\..+)$', '\1', $name);                          $ext = ereg_replace('^.*(\..+)$', '\1', $name);
270                          if ($key == "ed_titlepic_url") {                          if ($key == "ed_titlepic_url") {
# Line 271  sql($sql); Line 295  sql($sql);
295                  }                  }
296                  // -----                  // -----
297                  $tp = new Smarty();                  $tp = new Smarty();
                 // -----  
                 $levels = array();  
                 $sql = "SELECT level_id, class, name FROM par_levels ORDER BY name";  
 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($levels, array("id" => $row[0], "class" => $row[1], "name" => $row[2]));  
                 $sth->finish();  
298                  $tp->assign("levels", $levels);                  $tp->assign("levels", $levels);
299                  // -----                  // -----
300                  global $ed_id, $ed_title, $ed_lead, $ed_titlepic_pos,                  global $ed_id, $ed_title, $ed_lead, $ed_titlepic_pos,
# Line 330  sql($sql); Line 345  sql($sql);
345                                  $id = ${"ed_text_id_".$i};                                  $id = ${"ed_text_id_".$i};
346                                  global ${"ed_text_".$i}, ${"ed_text_title_".$i},                                  global ${"ed_text_".$i}, ${"ed_text_title_".$i},
347                                          ${"ed_text_level_".$i}, ${"ed_textpic_alt_".$i},                                          ${"ed_text_level_".$i}, ${"ed_textpic_alt_".$i},
348                                          ${"ed_textpic_pos_".$i}, ${"ed_hl_".$i};                                          ${"ed_textpic_pos_".$i}, ${"ed_hl_".$i},
349                                            ${"ed_textpic_exp_".$i};
350                                  $pic_url = ($HTTP_POST_FILES["ed_textpic_url_".$i]["name"]) ?                                  $pic_url = ($HTTP_POST_FILES["ed_textpic_url_".$i]["name"]) ?
351                                          ${"textpic_url_".$i} : "";                                          ${"textpic_url_".$i} : "";
352                                  if (!$pic_url) $pic_url = ${"textpic_url2_".$i};                                  if (!$pic_url) $pic_url = ${"textpic_url2_".$i};
# Line 339  sql($sql); Line 355  sql($sql);
355                                          if ($art["text"][$j]["id"] == $id) $tmp = $art["text"][$j]["pic"];                                          if ($art["text"][$j]["id"] == $id) $tmp = $art["text"][$j]["pic"];
356                                  if (!$pic_url && $tmp && !(${"clear_".$i} || ${"clr_".$i})) $pic_url = $tmp;                                  if (!$pic_url && $tmp && !(${"clear_".$i} || ${"clr_".$i})) $pic_url = $tmp;
357                                  $level = ${"ed_text_level_".$i};                                  $level = ${"ed_text_level_".$i};
358                                  $class = "";                                  list($w, $h) = PicSize($pic_url);
                                 while (list($key, $val) = each($levels))  
                                         if ($val["id"] == $level) $class = $val["class"];  
359                                  array_push($ed_pgfs, array($id,                                  array_push($ed_pgfs, array($id,
360                                          ${"ed_text_".$i}, ${"ed_text_title_".$i},                                          ${"ed_text_".$i}, ${"ed_text_title_".$i},
361                                          $level, $class, $pic_url, ${"textpic_name_".$i},                                          $level, $pic_url, ${"textpic_name_".$i},
362                                          ${"ed_textpic_alt_".$i}, ${"ed_textpic_pos_".$i},                                          ${"ed_textpic_alt_".$i}, ${"ed_textpic_pos_".$i},
363                                          0, 0, ${"ed_hl_".$i}, false));                                          $w, $h, ${"ed_hl_".$i}, ${"ed_textpic_exp_".$i}, false));
364                                  $i++;                                  $i++;
365                          }                          }
366                  } else {                  } else {
# Line 378  sql($sql); Line 392  sql($sql);
392                                  $art["au_pic"], $art["au_pic"], urldecode($art["au_pic"]),                                  $art["au_pic"], $art["au_pic"], urldecode($art["au_pic"]),
393                                  $art["au_alt"], $art["au_info"], $art["au_w"], $art["au_h"]);                                  $art["au_alt"], $art["au_info"], $art["au_w"], $art["au_h"]);
394                          while ($art["text"] && list($id, $val) = each($art["text"])) {                          while ($art["text"] && list($id, $val) = each($art["text"])) {
                                 list($id, $txt, $title, $lev, $cls, $pic, $alt, $pos, $w, $h) = array(  
                                         $val["id"], $val["text"], $val["title"], $val["level"],  
                                         $val["class"], urldecode($val["pic"]), $val["alt"], $val["pos"],  
                                         $val["w"], $val["h"]);  
395                                  array_push($ed_pgfs, array($val["id"], $val["text"], $val["title"],                                  array_push($ed_pgfs, array($val["id"], $val["text"], $val["title"],
396                                          $val["level"], $val["class"], urldecode($val["pic"]),                                          $val["level"], urldecode($val["pic"]),
397                                          urldecode($val["pic"]), $val["alt"], $val["pos"], $val["w"],                                          urldecode($val["pic"]), $val["alt"], $val["pos"], $val["w"],
398                                          $val["h"], $val["hl"], false));                                          $val["h"], $val["hl"], $val["exp"], false));
399                          }                          }
400                          $ed_id = $art["id"];                          $ed_id = $art["id"];
401                          if (!$ed_id) $ed_id = -1;                          if (!$ed_id) $ed_id = -1;
# Line 402  sql($sql); Line 412  sql($sql);
412                  if ($add) {                  if ($add) {
413                          global $add_num;                          global $add_num;
414                          for ($i = 0; $i < intval($add_num); $i++)                          for ($i = 0; $i < intval($add_num); $i++)
415                                  array_push($ed_pgfs, array(-1, "", "", -1, "", "", "", "", 0, 0, 0, "", true));                                  array_push($ed_pgfs, array(-1, "", "", -1, "", "", "", 0, 0, 0, "", "", true));
416                  }                  }
417                  $ed_empty = ($ed_title || $ed_lead || $ed_titlepic_pos || $ed_more) ? false : true;                  $ed_empty = ($ed_title || $ed_lead || $ed_titlepic_pos || $ed_more) ? false : true;
418                  $ed_text = array();                  $ed_text = array();
# Line 410  sql($sql); Line 420  sql($sql);
420                  $ed_warnings = ($ed_warning ? true : false);                  $ed_warnings = ($ed_warning ? true : false);
421                  $i = 1;                  $i = 1;
422                  while (list($key, $val) = each($ed_pgfs)) {                  while (list($key, $val) = each($ed_pgfs)) {
423                          list($id, $txt, $tit, $lev, $cls, $pic, $name, $alt, $pos, $w, $h, $hl, $new) = $val;                          list($id, $txt, $tit, $lev, $pic, $name, $alt, $pos, $w, $h, $hl, $exp, $new) = $val;
424                          $del = ((${"delete_".$i} || ${"del_".$i}) ? true : false);                          $del = ((${"delete_".$i} || ${"del_".$i}) ? true : false);
425                          array_push($ed_records, array("val" => $del, "id" => $id));                          array_push($ed_records, array("val" => $del, "id" => $id));
426                          if ($del) { $i++; continue; }                          if ($del) { $i++; continue; }
427                          $picurl = ${"textpic_url_".$id};                          $picurl = ${"textpic_url_".$id};
428                          if (!$picurl) $picurl = $pic;                          if (!$picurl) $picurl = $pic;
429                          $class = "";                          $class = "";
430                          while (list($key, $val) = each($levels)) if ($val["id"] == $lev) $class = $val["class"];                          reset($levels);
431                            while (list($k, $v) = each($levels)) if ($v["id"] == $lev) $class = $v["class"];
432                          if ((${"clear_".$i} || ${"clr_".$i}) && $ed_preview && (${"textpic_name_".$i} != ${"textpic_url2_".$i})) {                          if ((${"clear_".$i} || ${"clr_".$i}) && $ed_preview && (${"textpic_name_".$i} != ${"textpic_url2_".$i})) {
433                                  $tmp = ${"textpic_url2_".$i};                                  $tmp = ${"textpic_url2_".$i};
434                                  if (ereg("$phptmp", $tmp)) MyDelete($syspicdir."/".$tmp);                                  if (ereg("$phptmp", $tmp)) MyDelete($syspicdir."/".$tmp);
# Line 432  sql($sql); Line 443  sql($sql);
443                          $txt3 = str_replace(">", "&gt;", $txt3);                          $txt3 = str_replace(">", "&gt;", $txt3);
444                          $hl = MyEscape(convert_html($hl), false);                          $hl = MyEscape(convert_html($hl), false);
445                          $hl2 = ParseNewline($hl, true);                          $hl2 = ParseNewline($hl, true);
446                            if ($hl2) $hl2 = GetHighlight($hl2);
447                          $hl3 = str_replace("&", "&amp;", $hl);                          $hl3 = str_replace("&", "&amp;", $hl);
448                          $hl3 = str_replace("\"", "&quot;", $hl3);                          $hl3 = str_replace("\"", "&quot;", $hl3);
449                          $hl3 = str_replace("<", "&lt;", $hl3);                          $hl3 = str_replace("<", "&lt;", $hl3);
# Line 459  sql($sql); Line 471  sql($sql);
471                                  "url" => MyEscape(convert_html($picurl)),                                  "url" => MyEscape(convert_html($picurl)),
472                                  "name" => MyEscape(convert_html($name)),                                  "name" => MyEscape(convert_html($name)),
473                                  "alt" => MyEscape(convert_html($alt)),                                  "alt" => MyEscape(convert_html($alt)),
474                                  "width" => $w,                                  "w" => $w,
475                                  "height" => $h,                                  "h" => $h,
476                                  "pos" => $pos,                                  "pos" => $pos,
477                                    "exp" => MyEscape(convert_html($exp)),
478                                  "warning" => $warning,                                  "warning" => $warning,
479                                  "clr" => (${"clear_".$i} || ${"clr_".$i} || !$picurl) ? true : false                                  "clr" => (${"clear_".$i} || ${"clr_".$i} || !$picurl) ? true : false
480                          ));                          ));
# Line 512  sql($sql); Line 525  sql($sql);
525                  $params = array();                  $params = array();
526                  if ($section) array_push($params, "section=$section");                  if ($section) array_push($params, "section=$section");
527                  if ($section_menu) array_push($params, "section_menu=$section_menu");                  if ($section_menu) array_push($params, "section_menu=$section_menu");
528                    if ($section_menu2) array_push($params, "section_menu2=$section_menu2");
529                    if ($spec) array_push($params, "spec=$spec");
530                  if ($ed_id) array_push($params, "ed_id=$ed_id");                  if ($ed_id) array_push($params, "ed_id=$ed_id");
531                  if ($ed_preview) array_push($params, "ed_preview=$ed_preview");                  if ($ed_preview) array_push($params, "ed_preview=$ed_preview");
532                  if ($trigger) array_push($params, "$trigger=1");                  if ($trigger) array_push($params, "$trigger=1");
533                  global $PHP_SELF;                  $tp->assign("FORM_ACTION", HTMLSpecialChars("?".implode("&", $params)));
                 $tp->assign("FORM_ACTION", $PHP_SELF.HTMLSpecialChars("?".implode("&", $params)));  
534                  if (!$ed_preview) {                  if (!$ed_preview) {
535                          global $onload;                          global $onload;
536                          $onload .= "document.forms[0].elements[0].focus();";                          $onload .= "document.forms[1].elements[0].focus();";
537                  }                  }
538                  return $tp->fetch("edit.tpl");                  return $tp->fetch("edit.tpl");
539          }          }

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

  ViewVC Help
Powered by ViewVC 1.1.26