Changeset 38
- Timestamp:
- Jul 25, 2003, 11:33:41 PM (21 years ago)
- Location:
- trunk
- Files:
-
- 7 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 ); -
trunk/category.php
r37 r38 437 437 } 438 438 // upload a picture in the category 439 if ( $page['cat_site_id'] == 1 and $conf['upload_available'] ) 439 if ( $page['cat_site_id'] == 1 440 and $conf['upload_available'] 441 and $page['cat_uploadable'] ) 440 442 { 441 443 $vtp->addSession( $handle, 'upload' ); -
trunk/include/functions_category.inc.php
r33 r38 283 283 284 284 $query = 'SELECT nb_images,id_uppercat,comment,site_id,galleries_url,dir'; 285 $query.= ',date_last ';285 $query.= ',date_last,uploadable'; 286 286 $query.= ' FROM '.PREFIX_TABLE.'categories AS a'; 287 287 $query.= ', '.PREFIX_TABLE.'sites AS b'; … … 295 295 $cat['last_dir'] = $row['dir']; 296 296 $cat['date_last'] = $row['date_last']; 297 $cat['uploadable'] = get_boolean( $row['uploadable'] ); 297 298 $galleries_url = $row['galleries_url']; 298 299 299 300 $cat['dir'] = ""; 300 301 $i = 0; … … 380 381 { 381 382 global $page,$lang,$user,$conf; 382 383 383 384 if ( isset( $page['cat'] ) ) 384 385 { … … 392 393 { 393 394 $result = get_cat_info( $page['cat'] ); 394 $page['comment'] = $result['comment']; 395 $page['cat_dir'] = $result['dir']; 396 $page['cat_name'] = $result['name']; 397 $page['cat_nb_images'] = $result['nb_images']; 398 $page['cat_site_id'] = $result['site_id']; 395 $page['comment'] = $result['comment']; 396 $page['cat_dir'] = $result['dir']; 397 $page['cat_name'] = $result['name']; 398 $page['cat_nb_images'] = $result['nb_images']; 399 $page['cat_site_id'] = $result['site_id']; 400 $page['cat_uploadable'] = $result['uploadable']; 399 401 $page['title'] = get_cat_display_name( $page['cat_name'], ' - ', '' ); 400 402 $page['where'] = ' WHERE cat_id = '.$page['cat']; -
trunk/language/francais.php
r33 r38 486 486 $lang['editcat_comment'] = 'Commentaire'; 487 487 $lang['editcat_status'] = 'Status'; 488 $lang['editcat_status_info'] = '(invisible sauf pour les administrateurs)'; 489 // start version 1.3 488 // start version 1.3 489 // $lang['editcat_status_info'] = '(invisible sauf pour les administrateurs)'; 490 // $lang['editcat_status_info'] => $lang['editcat_visible_info'] 491 $lang['editcat_visible_info'] = '(invisible sauf pour les administrateurs)'; 490 492 $lang['editcat_visible'] = 'Visible'; 493 $lang['editcat_uploadable'] = 'Ajout d\'images par les visiteurs'; 491 494 // end version 1.3 492 495 // page info images -
trunk/template/default/admin/cat_modify.vtp
r21 r38 21 21 </tr> 22 22 <tr> 23 <td style="width:20%;">{#editcat_comment}</td>23 <td>{#editcat_comment}</td> 24 24 <td class="row2"> 25 25 <textarea name="comment" rows="5" cols="50" style="overflow:auto">{#comment}</textarea> … … 27 27 </tr> 28 28 <tr> 29 <td style="width:20%;">{#editcat_status}</td>29 <td>{#editcat_status}</td> 30 30 <td class="row2"> 31 31 <!--VTP_status_option--> … … 35 35 </tr> 36 36 <tr> 37 <td style="width:20%;">{#editcat_visible}</td>37 <td>{#editcat_visible}</td> 38 38 <td class="row2"> 39 39 <!--VTP_visible_option--> 40 40 <input type="radio" name="visible" value="{#value}"{#checked} />{#option} 41 41 <!--/VTP_visible_option--> 42 {#editcat_ status_info}42 {#editcat_visible_info} 43 43 </td> 44 44 </tr> 45 <!--VTP_uploadable--> 46 <tr> 47 <td>{#editcat_uploadable}</td> 48 <td class="row2"> 49 <!--VTP_uploadable_option--> 50 <input type="radio" name="uploadable" value="{#value}"{#checked} />{#option} 51 <!--/VTP_uploadable_option--> 52 </td> 53 </tr> 54 <!--/VTP_uploadable--> 45 55 <tr> 46 56 <td colspan="2"> </td> -
trunk/template/default/category.vtp
r25 r38 31 31 <img src="{#lien_collapsed}" alt=">"/> <a href="{#url}" title="{#title}">{#name}</a><br /> 32 32 <!--/VTP_summary--> 33 <!--VTP_upload--> 34 <br /> <img src="{#lien_collapsed}" alt=">"/> <a href="{#url}" class="back">{#upload_picture}</a> 35 <!--/VTP_upload--> 33 36 </div> 34 37 {#frame_end} … … 78 81 <div class="infoCat"> 79 82 {#nb_image_category} "{#cat_name}" : {#cat_nb_images} 80 <!--VTP_upload-->81 <br /><a href="{#url}" class="back">{#upload_picture}</a>82 <!--/VTP_upload-->83 83 </div> 84 84 <!--/VTP_cat_infos--> -
trunk/upload.php
r26 r38 104 104 check_restrictions( $page['cat'] ); 105 105 $result = get_cat_info( $page['cat'] ); 106 $page['cat_dir'] = $result['dir']; 107 $page['cat_site_id'] = $result['site_id']; 108 $page['cat_name'] = $result['name']; 106 $page['cat_dir'] = $result['dir']; 107 $page['cat_site_id'] = $result['site_id']; 108 $page['cat_name'] = $result['name']; 109 $page['cat_uploadable'] = $result['uploadable']; 109 110 } 110 111 else … … 114 115 if ( $access_forbidden == true 115 116 or $page['cat_site_id'] != 1 116 or !$conf['upload_available'] ) 117 or !$conf['upload_available'] 118 or !$page['cat_uploadable'] ) 117 119 { 118 120 echo '<div style="text-align:center;">'.$lang['upload_forbidden'].'<br />';
Note: See TracChangeset
for help on using the changeset viewer.