[4292] | 1 | <?php |
---|
| 2 | // +-----------------------------------------------------------------------+ |
---|
| 3 | // | Plugin Name : Register_llgbo | |
---|
| 4 | // | Plugin Version : 1.0 | |
---|
| 5 | // | File Version : 0.1 | |
---|
| 6 | // | Plugin Version author : Ex-FTB | |
---|
| 7 | // | Plugin description : | |
---|
| 8 | // | Ce plugin permet d'afficher les miniatures au survol des boutons | |
---|
| 9 | // | de navigation. This plugin allows display thumbnail under buton | |
---|
| 10 | // | | |
---|
| 11 | // +-----------------------------------------------------------------------+ |
---|
| 12 | // | This program is free software; you can redistribute it and/or modify | |
---|
| 13 | // | it under the terms of the GNU General Public License as published by | |
---|
| 14 | // | the Free Software Foundation | |
---|
| 15 | // | | |
---|
| 16 | // | This program is distributed in the hope that it will be useful, but | |
---|
| 17 | // | WITHOUT ANY WARRANTY; without even the implied warranty of | |
---|
| 18 | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
---|
| 19 | // | General Public License for more details. | |
---|
| 20 | // | | |
---|
| 21 | // | You should have received a copy of the GNU General Public License | |
---|
| 22 | // | along with this program; if not, write to the Free Software | |
---|
| 23 | // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | |
---|
| 24 | // | USA. | |
---|
| 25 | // +-----------------------------------------------------------------------+ |
---|
| 26 | |
---|
| 27 | // ****************************************** |
---|
| 28 | // ** Database install - uninstall queries ** |
---|
| 29 | // ****************************************** |
---|
| 30 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
| 31 | function plugin_install() |
---|
[4603] | 32 | { global $prefixeTable,$conf; |
---|
| 33 | if (!defined('LLGBO_PATH')) |
---|
[6548] | 34 | {define('LLGBO_PATH' ,get_root_url().'plugins/'.basename(dirname(__FILE__)). '/');} |
---|
[4603] | 35 | include(LLGBO_PATH.'defaultvalues.php'); |
---|
[4523] | 36 | plugin_uninstall(); // en cas de mauvaise deinstallation anterieure |
---|
[4292] | 37 | $q = ' |
---|
| 38 | INSERT INTO '.CONFIG_TABLE.' (param,value,comment) |
---|
[4523] | 39 | VALUES |
---|
| 40 | ("LLGBO","'.$plugvalues.'","look like gbo global settings");'; |
---|
[4292] | 41 | pwg_query($q); |
---|
[4523] | 42 | $q = ' |
---|
| 43 | INSERT INTO '.CONFIG_TABLE.' (param,value,comment) |
---|
| 44 | VALUES |
---|
| 45 | ("LLGBOTOOLTIP","'.$ttvalues.'","look like gbo tooltip settings");'; |
---|
| 46 | pwg_query($q); |
---|
| 47 | $q = ' |
---|
| 48 | INSERT INTO '.CONFIG_TABLE.' (param,value,comment) |
---|
| 49 | VALUES |
---|
| 50 | ("LLGBOFRAME","'.$frvalues.'","look like gbo frame settings");'; |
---|
| 51 | pwg_query($q); |
---|
[4574] | 52 | $q = ' |
---|
| 53 | INSERT INTO '.CONFIG_TABLE.' (param,value,comment) |
---|
| 54 | VALUES |
---|
| 55 | ("LLGBOHEADER","'.$headvalues.'","look like gbo header settings");'; |
---|
| 56 | pwg_query($q); |
---|
[4523] | 57 | |
---|
| 58 | $conf['LLGBO_SETTINGS'] = explode("," , $plugvalues); |
---|
| 59 | $conf['LLGBO_TOOLTIP'] = explode(",",$ttvalues); |
---|
| 60 | $conf['LLGBO_FRAME'] = explode (",", $frvalues); |
---|
[4574] | 61 | $conf['LLGBO_HEADER'] = explode (",", $headvalues); |
---|
[4523] | 62 | |
---|
[4292] | 63 | } |
---|
| 64 | function plugin_activate() |
---|
[4603] | 65 | { global $prefixeTable,$conf; |
---|
[4523] | 66 | /////////////////////////////////////////////////// |
---|
| 67 | // Vérification de la config, si pas bon -> reinstallation |
---|
[4574] | 68 | |
---|
[4523] | 69 | // |
---|
[4603] | 70 | if ( (!isset($conf['LLGBO'])) or (substr_count($conf['LLGBO'], ',') != 10) |
---|
[4523] | 71 | or (!isset($conf['LLGBOTOOLTIP'])) or (substr_count($conf['LLGBOTOOLTIP'], ',') != 5) |
---|
[4574] | 72 | or (!isset($conf['LLGBOFRAME'])) or (substr_count($conf['LLGBOFRAME'], ',') != 32) |
---|
[6259] | 73 | or (!isset($conf['LLGBOHEADER'])) or (substr_count($conf['LLGBOHEADER'], ',') != 20)) |
---|
| 74 | { |
---|
| 75 | plugin_install(); } |
---|
[4292] | 76 | } |
---|
| 77 | |
---|
[4523] | 78 | function plugin_uninstall() |
---|
[4292] | 79 | { global $prefixeTable; |
---|
[6283] | 80 | $q = ' |
---|
[4574] | 81 | DELETE FROM '.CONFIG_TABLE.' WHERE param like "LLGBO%" LIMIT 5;'; |
---|
[4292] | 82 | pwg_query( $q ); |
---|
| 83 | } |
---|
| 84 | |
---|
| 85 | ?> |
---|