Changeset 15110 for extensions/SmiliesSupport/admin.php
- Timestamp:
- May 19, 2012, 12:07:43 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/SmiliesSupport/admin.php
r14526 r15110 17 17 { 18 18 // the smilies.txt file is not saved if the directory is changed 19 if (isset($_POST[' text1']) AND $_POST['text1'] != $conf_smiliessupport['folder'])19 if (isset($_POST['folder']) AND $_POST['folder'] != $conf_smiliessupport['folder']) 20 20 { 21 21 $not_save_file = true; 22 22 23 $handle = opendir(SMILIES_PATH.'smilies/'.$_POST['text1']); 24 $i = 0; 25 while (false !== ($file = readdir($handle))) 23 if (!file_exists(SMILIES_PATH.'smilies/'.$_POST['folder'].'/'.$_POST['representant'])) 26 24 { 27 if ( $file != '.' AND $file != '..' AND in_array(get_extension($file), array('gif', 'jpg', 'png')) ) 25 $handle = opendir(SMILIES_PATH.'smilies/'.$_POST['folder']); 26 $i = 0; 27 while (false !== ($file = readdir($handle))) 28 28 { 29 $_POST['text3'] = $file; 30 closedir($handle); 31 break; 29 if ( $file != '.' AND $file != '..' AND in_array(get_extension($file), array('gif', 'jpg', 'png')) ) 30 { 31 $_POST['representant'] = $file; 32 closedir($handle); 33 break; 34 } 32 35 } 33 36 } … … 36 39 // new configuration 37 40 $conf_smiliessupport = array( 38 'folder' => isset($_POST[' text1']) ? $_POST['text1'] : 'crystal',39 'cols' => isset($_POST[' text2']) ? $_POST['text2'] : '6',40 'representant' => isset($_POST[' text3']) ? $_POST['text3'] : 'smile.png',41 'folder' => isset($_POST['folder']) ? $_POST['folder'] : 'crystal', 42 'cols' => isset($_POST['cols']) ? $_POST['cols'] : '6', 43 'representant' => isset($_POST['representant']) ? $_POST['representant'] : 'smile.png', 41 44 ); 42 if (empty($_POST['text'])) $_POST['text'] = ' :) smile.png';45 if (empty($_POST['text'])) $_POST['text'] = ''; 43 46 44 47 conf_update_param('smiliessupport', serialize($conf_smiliessupport)); … … 97 100 98 101 $template->assign(array( 99 ' TEXT1_VALUE' => $conf_smiliessupport['folder'],100 ' TEXT2_VALUE' => $conf_smiliessupport['cols'],101 ' TEXT3_VALUE' => $conf_smiliessupport['representant'],102 'FOLDER' => $conf_smiliessupport['folder'], 103 'COLS' => $conf_smiliessupport['cols'], 104 'REPRESENTANT' => $conf_smiliessupport['representant'], 102 105 'sets' => $sets, 103 106 'smiliesfiles' => $smilies_table, … … 107 110 // get the content of definitions file 108 111 $smilies_file = SMILIES_PATH.'smilies/'.$conf_smiliessupport['folder'].'/smilies.txt'; 109 if (file_exists($smilies_file)) { 112 if (file_exists($smilies_file)) 113 { 110 114 $content_file = file_get_contents($smilies_file); 111 115 $template->assign(array('CONTENT_FILE' => $content_file));
Note: See TracChangeset
for help on using the changeset viewer.