Changeset 38 for trunk/admin/cat_modify.php
- Timestamp:
- Jul 25, 2003, 11:33:41 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/cat_modify.php
r21 r38 21 21 $tpl = array( 'remote_site','editcat_confirm','editcat_back','editcat_title1', 22 22 'editcat_name','editcat_comment','editcat_status', 23 'editcat_visible','editcat_status_info', 'submit' ); 23 'editcat_visible','editcat_visible_info', 'submit', 24 'editcat_uploadable' ); 24 25 templatize_array( $tpl, 'lang', $sub ); 25 26 //---------------------------------------------------------------- verification … … 54 55 55 56 $query = 'UPDATE '.PREFIX_TABLE.'categories'; 57 58 $query.= ' SET name = '; 56 59 if ( $_POST['name'] == '' ) 57 { 58 $query.= ' SET name = NULL'; 59 } 60 $query.= 'NULL'; 60 61 else 61 {62 $query.= " SET name = '".htmlentities( $_POST['name'], ENT_QUOTES)."'"; 63 }62 $query.= "'".htmlentities( $_POST['name'], ENT_QUOTES)."'"; 63 64 $query.= ', comment = '; 64 65 if ( $_POST['comment'] == '' ) 65 { 66 $query.= ', comment = NULL'; 67 } 66 $query.= 'NULL'; 68 67 else 69 { 70 $query.= ", comment = '".htmlentities( $_POST['comment'], ENT_QUOTES )."'"; 71 } 68 $query.= "'".htmlentities( $_POST['comment'], ENT_QUOTES )."'"; 69 72 70 $query.= ", status = '".$_POST['status']."'"; 73 71 $query.= ", visible = '".$_POST['visible']."'"; 74 $query.= " WHERE id = '".$_GET['cat']."'"; 72 $query.= ", uploadable = '".$_POST['uploadable']."'"; 73 $query.= ' WHERE id = '.$_GET['cat']; 75 74 $query.= ';'; 76 75 mysql_query( $query ); … … 94 93 $vtp->setVar( $sub, 'form_action', add_session_id( $form_action ) ); 95 94 96 $query = 'SELECT a.id,name,dir,status,comment ';95 $query = 'SELECT a.id,name,dir,status,comment,uploadable'; 97 96 $query.= ',id_uppercat,site_id,galleries_url,visible'; 98 97 $query.= ' FROM '.PREFIX_TABLE.'categories as a, '.PREFIX_TABLE.'sites as b'; … … 149 148 $vtp->setVar( $sub, 'visible_option.checked', $checked ); 150 149 $vtp->closeSession( $sub, 'visible_option' ); 150 // uploadable : true or false 151 if ( $conf['upload_available'] ) 152 { 153 $vtp->addSession( $sub, 'uploadable' ); 154 $vtp->addSession( $sub, 'uploadable_option' ); 155 $vtp->setVar( $sub, 'uploadable_option.value', 'true' ); 156 $vtp->setVar( $sub, 'uploadable_option.option', $lang['yes'] ); 157 $checked = ''; 158 if ( $row['uploadable'] == 'true' ) 159 { 160 $checked = ' checked="checked"'; 161 } 162 $vtp->setVar( $sub, 'uploadable_option.checked', $checked ); 163 $vtp->closeSession( $sub, 'uploadable_option' ); 164 $vtp->addSession( $sub, 'uploadable_option' ); 165 $vtp->setVar( $sub, 'uploadable_option.value', 'false' ); 166 $vtp->setVar( $sub, 'uploadable_option.option', $lang['no'] ); 167 $checked = ''; 168 if ( $row['uploadable'] == 'false' ) 169 { 170 $checked = ' checked="checked"'; 171 } 172 $vtp->setVar( $sub, 'uploadable_option.checked', $checked ); 173 $vtp->closeSession( $sub, 'uploadable_option' ); 174 $vtp->closeSession( $sub, 'uploadable' ); 175 } 151 176 //----------------------------------------------------------- sending html code 152 177 $vtp->Parse( $handle , 'sub', $sub );
Note: See TracChangeset
for help on using the changeset viewer.