Last change
on this file since 8187 was
3645,
checked in by tiico, 15 years ago
|
Add index.php file into directory
Add CHANGELOG and clean header files
Add 'last comments' option for name and descriptions (%ID option)
Add maintain.inc.php for migration to 0.4.x (name and description translation)
Complete Chinese translation (thanks winson)
- Correct the latests commit (3636 & 3637 were not complete)
|
File size:
1.0 KB
|
Rev | Line | |
---|
[3637] | 1 | <?php |
---|
| 2 | /* |
---|
| 3 | * Plugin Name: CoolIris-Piclens |
---|
[3645] | 4 | * File : fonctions.php |
---|
| 5 | */ |
---|
[3637] | 6 | |
---|
| 7 | |
---|
[3645] | 8 | |
---|
[3637] | 9 | function get_html_exts_selection( |
---|
| 10 | $exts, |
---|
| 11 | $fieldname, |
---|
| 12 | $selecteds = array() |
---|
| 13 | ) |
---|
| 14 | { |
---|
| 15 | global $conf; |
---|
| 16 | if (count ($exts) == 0 ) |
---|
| 17 | { |
---|
| 18 | return ''; |
---|
| 19 | } |
---|
| 20 | $output = '<div id="'.$fieldname.'">'; |
---|
| 21 | $id = 1; |
---|
| 22 | foreach ($exts as $ext) |
---|
| 23 | { |
---|
| 24 | $output.= |
---|
| 25 | |
---|
| 26 | '<input type="checkbox" name="'.$fieldname.'[]"' |
---|
| 27 | .' id="ext_'.$id++.'"' |
---|
| 28 | .' value="'.$ext['tn_ext'].'"' |
---|
| 29 | ; |
---|
| 30 | |
---|
| 31 | if (in_array($ext['tn_ext'], $selecteds)) |
---|
| 32 | { |
---|
| 33 | $output.= ' checked="checked"'; |
---|
| 34 | } |
---|
| 35 | |
---|
| 36 | $output.= |
---|
| 37 | '><label>' |
---|
| 38 | .' <b>'. $ext['tn_ext'].'</b> ' |
---|
| 39 | .'</label>' |
---|
| 40 | ."\n" |
---|
| 41 | ; |
---|
| 42 | } |
---|
| 43 | $output.= '</div>'; |
---|
| 44 | |
---|
| 45 | return $output; |
---|
| 46 | } |
---|
| 47 | |
---|
| 48 | |
---|
| 49 | function get_all_exts() |
---|
| 50 | { |
---|
| 51 | $query = ' |
---|
| 52 | SELECT DISTINCT(tn_ext) |
---|
| 53 | FROM '.IMAGES_TABLE.' |
---|
| 54 | ORDER BY tn_ext;'; |
---|
| 55 | |
---|
| 56 | $result = pwg_query($query); |
---|
| 57 | |
---|
| 58 | $ext = array(); |
---|
| 59 | while ($row = mysql_fetch_assoc($result)) |
---|
| 60 | { |
---|
| 61 | if (empty($row['tn_ext'])) |
---|
| 62 | $row['tn_ext']='!NULL!'; |
---|
| 63 | array_push($ext, $row); |
---|
| 64 | } |
---|
| 65 | |
---|
| 66 | return $ext; |
---|
| 67 | } |
---|
| 68 | |
---|
[3410] | 69 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.