[Phpslash-commit] CVS: phpslash-ft/class Variable.class,1.3,1.4
Brought to you by:
joestewart,
nhruby
From: Joe S. <joe...@us...> - 2002-05-15 15:18:54
|
Update of /cvsroot/phpslash/phpslash-ft/class In directory usw-pr-cvs1:/tmp/cvs-serv22366a/phpslash-ft/class Modified Files: Variable.class Log Message: psl -> Variable.class Index: Variable.class =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/class/Variable.class,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Variable.class 6 Feb 2002 19:55:46 -0000 1.3 --- Variable.class 15 May 2002 15:18:51 -0000 1.4 *************** *** 14,18 **** var $var_array; var $db; ! /* * CONSTRUCTORS --- 14,19 ---- var $var_array; var $db; ! var $psl; ! /* * CONSTRUCTORS *************** *** 23,31 **** $this->var_array['rootdir'] = $_PSL['rooturl']; $this->var_array['basedir'] = $_PSL['basedir']; ! $this->db = new slashDB; /* Templates */ ! $this->variable_templ = new Template($templatedir); $this->variable_templ->debug = 0; $this->variable_templ->set_file(array( --- 24,32 ---- $this->var_array['rootdir'] = $_PSL['rooturl']; $this->var_array['basedir'] = $_PSL['basedir']; ! $this->psl = $_PSL; $this->db = new slashDB; /* Templates */ ! $this->variable_templ = new Template($this->psl['templatedir']); $this->variable_templ->debug = 0; $this->variable_templ->set_file(array( *************** *** 86,94 **** function listVariable() { - global $PHP_SELF,$amp; - - /* Get preferences */ - $basedir = $this->getvar("basedir"); - $q = "SELECT * FROM psl_variable --- 87,90 ---- *************** *** 104,112 **** $variable_id = $this->db->Record[variable_id]; ! $admin = "<A HREF=$PHP_SELF?submit=edit&variable_id=$variable_id>(Edit)</A>"; ! $admin .= "<A HREF=$PHP_SELF?submit=delete&variable_id=$variable_id>(Delete)</A>"; $this->variable_templ->set_var(array( ! ACTION_URL => $PHP_SELF, VARIABLE_ID => $variable_id, VARIABLE_NAME => $this->db->Record[variable_name], --- 100,108 ---- $variable_id = $this->db->Record[variable_id]; ! $admin = "<A HREF=$this->psl['phpself']?submit=edit&variable_id=$variable_id>(Edit)</A>"; ! $admin .= "<A HREF=$this->psl['phpself']?submit=delete&variable_id=$variable_id>(Delete)</A>"; $this->variable_templ->set_var(array( ! ACTION_URL => $this->psl['phpself'], VARIABLE_ID => $variable_id, VARIABLE_NAME => $this->db->Record[variable_name], *************** *** 147,169 **** } - /* addslashes for the (') AND str_replace for the (") */ ! $ary[description] = addslashes(str_replace('\"',""",stripslashes($ary["description"]))); ! $ary[variable_name] = addslashes(str_replace('\"',""",stripslashes($ary["variable_name"]))); ! $ary[variable_name] = str_replace(" "," ",stripslashes($ary["variable_name"])); /* if a record exists, then we update, else we insert a new variable! */ ! ! $this->db->query("SELECT variable_id ! FROM psl_variable ! WHERE variable_id = '$ary[variable_id]'"); ! if ($this->db->next_record()) { ! $q = "UPDATE psl_variable ! SET variable_name = '$ary[variable_name]', ! description = '$ary[description]', ! value = '$ary[value]', ! variable_group = '$ary[group]' ! WHERE variable_id = '$ary[variable_id]'"; } else { --- 143,166 ---- } /* addslashes for the (') AND str_replace for the (") */ ! $ary[description] = clean($ary["description"]); ! $ary[variable_name] = clean($ary["variable_name"]); ! $ary[variable_name] = clean($ary["variable_name"]); /* if a record exists, then we update, else we insert a new variable! */ ! ! if (isset($ary[variable_id])) { ! $this->db->query("SELECT variable_id ! FROM psl_variable ! WHERE variable_id = '$ary[variable_id]'"); ! if ($this->db->next_record()) { ! $q = "UPDATE psl_variable ! SET variable_name = '$ary[variable_name]', ! description = '$ary[description]', ! value = '$ary[value]', ! variable_group = '$ary[group]' ! WHERE variable_id = '$ary[variable_id]'"; ! } } else { |