/[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.8 by ravilov, Tue Sep 25 15:38:04 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 135  sql($sql); Line 136  sql($sql);
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 294  sql($sql); Line 295  sql($sql);
295                  }                  }
296                  // -----                  // -----
297                  $tp = new Smarty();                  $tp = new Smarty();
                 // -----  
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 525  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[1].elements[0].focus();";                          $onload .= "document.forms[1].elements[0].focus();";

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

  ViewVC Help
Powered by ViewVC 1.1.26