Changeset 10983 for extensions/bbcode_bar/maintain.inc.php
- Timestamp:
- May 22, 2011, 12:23:03 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/bbcode_bar/maintain.inc.php
r10011 r10983 4 4 function plugin_install() 5 5 { 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 6 global $conf; 7 8 $BBcode_default = array( 9 'b' => true, 10 'i' => true, 11 'u' => true, 12 's' => true, 13 'p' => true, 14 'center' => true, 15 'right' => true, 16 'quote' => true, 17 'ul' => true, 18 'ol' => true, 19 'img' => true, 20 'url' => true, 21 'email' => true, 22 'size' => true, 23 'color' => true, 24 ); 25 25 26 27 28 29 30 31 26 if (!isset($conf['bbcode_bar'])) 27 { 28 $q = "INSERT INTO " . CONFIG_TABLE . " (param,value,comment) 29 VALUES ('bbcode_bar','" . serialize($BBcode_default) . "','Parametres BBCode Bar');"; 30 pwg_query($q); 31 } 32 32 } 33 33 34 34 function plugin_activate() 35 35 { 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 36 global $conf; 37 38 if (strpos($conf['bbcode_bar'],',') !== false) 39 { 40 $conf_bbcode_bar = explode(',', $conf['bbcode_bar']); 41 42 $new_bbcode_bar = array( 43 'b' => $conf_bbcode_bar[1] == '1' ? true : false, 44 'i' => $conf_bbcode_bar[2] == '1' ? true : false, 45 'u' => $conf_bbcode_bar[3] == '1' ? true : false, 46 's' => $conf_bbcode_bar[4] == '1' ? true : false, 47 'p' => $conf_bbcode_bar[0] == '1' ? true : false, 48 'center' => $conf_bbcode_bar[5] == '1' ? true : false, 49 'right' => $conf_bbcode_bar[6] == '1' ? true : false, 50 'quote' => $conf_bbcode_bar[9] == '1' ? true : false, 51 'ul' => $conf_bbcode_bar[7] == '1' ? true : false, 52 'ol' => $conf_bbcode_bar[8] == '1' ? true : false, 53 'img' => $conf_bbcode_bar[10] == '1' ? true : false, 54 'url' => $conf_bbcode_bar[11] == '1' ? true : false, 55 'email' => $conf_bbcode_bar[12] == '1' ? true : false, 56 'size' => $conf_bbcode_bar[13] == '1' ? true : false, 57 'color' => $conf_bbcode_bar[14] == '1' ? true : false, 58 ); 59 60 $q = "UPDATE " . CONFIG_TABLE . " 61 SET value='" . serialize($new_bbcode_bar) . "' 62 WHERE param='bbcode_bar';"; 63 pwg_query($q); 64 } 65 65 } 66 66 67 67 function plugin_uninstall() 68 68 { 69 69 global $conf; 70 70 71 72 73 74 71 if (isset($conf['bbcode_bar'])) 72 { 73 pwg_query('DELETE FROM ' . CONFIG_TABLE . ' WHERE param="bbcode_bar";'); 74 } 75 75 } 76 76
Note: See TracChangeset
for help on using the changeset viewer.