Ignore:
Timestamp:
12/19/09 21:03:53 (10 years ago)
Author:
EXFTB
Message:

Version 2.0.i

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/LLGBO2/maintain.inc.php

    r4292 r4523  
    3030if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 
    3131function plugin_install() 
    32  
    33 {  global $prefixeTable;  
    34    plugin_uninstall(); // en cas de mauvaise deinstallation anterieure 
     32{  global $prefixeTable,$conf,$ttvalues,$plugvalues,$frvalues;  
     33  plugin_uninstall(); // en cas de mauvaise deinstallation anterieure 
    3534        $q = ' 
    3635INSERT INTO '.CONFIG_TABLE.' (param,value,comment) 
    37         VALUES 
    38         ("LLGBO","true,true,true,true,true,true,true,theAboutPage;theTagsPage;theCommentsPage;theIdentificationPage;theAdminPage,true,true,true","Look like gbo settings");'; 
     36        VALUES   
     37        ("LLGBO","'.$plugvalues.'","look like gbo global settings");'; 
    3938  pwg_query($q); 
     39        $q = ' 
     40INSERT INTO '.CONFIG_TABLE.' (param,value,comment) 
     41        VALUES   
     42        ("LLGBOTOOLTIP","'.$ttvalues.'","look like gbo tooltip settings");'; 
     43  pwg_query($q); 
     44        $q = ' 
     45INSERT INTO '.CONFIG_TABLE.' (param,value,comment) 
     46        VALUES   
     47        ("LLGBOFRAME","'.$frvalues.'","look like gbo frame settings");'; 
     48  pwg_query($q); 
     49   
     50$conf['LLGBO_SETTINGS'] =  explode("," , $plugvalues); 
     51$conf['LLGBO_TOOLTIP'] = explode(",",$ttvalues); 
     52$conf['LLGBO_FRAME'] = explode (",", $frvalues);  
     53  
    4054} 
    4155function plugin_activate() 
    42 { global $conf;  
    43  // Vérification de la config, si pas bon -> reinstallation 
    44 if ((!isset($conf['LLGBO'])) or (substr_count($conf['LLGBO'] , ',') != 10)) { 
    45          $conf['LLGBO'] = "true,true,true,true,true,true,true,theAboutPage;theTagsPage;theCommentsPage;theIdentificationPage;theAdminPage,true,true,true"; 
    46          plugin_install();} 
     56{ global $prefixeTable,$conf,$ttvalues,$plugvalues,$frvalues;  
     57 /////////////////////////////////////////////////// 
     58// Vérification de la config, si pas bon -> reinstallation 
     59$plugvalues = "true,true,true,true,true,true,true,theAboutPage;theTagsPage;theCommentsPage;theIdentificationPage;theAdminPage,true,true"; 
     60$ttvalues = "150,2,#fff,#000,#c92,#dadada"; 
     61$frvalues = "#16195f,#ffffff,3,#040404,1,#ffffff,7,#ffffff,1,#fdfdfd,1,#fcfcfc,1,#fafafa,1,#eaeaea,1,#d3d3d3,1,#bababa,1,#9f9f9f,1,#858585,1,#777777,1,#646464,1,#575757,1,#474747,1"; 
     62// 
     63 if ( (!isset($conf['LLGBO'])) or (substr_count($conf['LLGBO'], ',')  != 9)   
     64 or  (!isset($conf['LLGBOTOOLTIP'])) or (substr_count($conf['LLGBOTOOLTIP'], ',')  != 5)  
     65 or  (!isset($conf['LLGBOFRAME'])) or (substr_count($conf['LLGBOFRAME'], ',')  != 32))   
     66        {         plugin_install(); } 
    4767} 
    4868 
    49 function  plugin_uninstall() 
     69function plugin_uninstall() 
    5070{ global $prefixeTable; 
    5171  $q = ' 
    52 DELETE FROM '.CONFIG_TABLE.' WHERE param="LLGBO" LIMIT 1;'; 
     72DELETE FROM '.CONFIG_TABLE.' WHERE param like "LLGBO%" LIMIT 4;'; 
    5373  pwg_query( $q ); 
    5474} 
Note: See TracChangeset for help on using the changeset viewer.