Changeset 5424
- Timestamp:
- Mar 28, 2010, 7:17:31 PM (14 years ago)
- Location:
- extensions/grum_plugins_classes-2
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/grum_plugins_classes-2/common_plugin.class.inc.php
r3679 r5424 2 2 /* ----------------------------------------------------------------------------- 3 3 class name: common_plugin 4 class version: 2.0. 15 date: 20 09-07-244 class version: 2.0.2 5 date: 2010-03-28 6 6 7 7 ------------------------------------------------------------------------------ … … 39 39 2.0.1 - 2009-07-24 40 40 config loader : better management for arrays items 41 2.0.2 - 2010-03-28 42 * Uses piwigo pwg_db_* functions instead of mysql_* functions 41 43 42 44 --------------------------------------------------------------------------- */ … … 53 55 protected $plugin_admin_file = "plugin_admin"; 54 56 protected $tables; // list of all tables names used by plugin 55 private $debug_file; 57 private $debug_file; 56 58 public $my_config; // array of config parameters 57 59 … … 82 84 83 85 /* --------------------------------------------------------------------------- 84 CONFIGURATION RELATED FUNCTIONS 86 CONFIGURATION RELATED FUNCTIONS 85 87 --------------------------------------------------------------------------- */ 86 88 … … 100 102 if($result) 101 103 { 102 $row= mysql_fetch_row($result);103 if(is_string($row[0])) 104 $row=pwg_db_fetch_row($result); 105 if(is_string($row[0])) 104 106 { 105 107 $config = unserialize($row[0]); 106 108 reset($config); 107 while (list($key, $val) = each($config)) 108 { 109 while (list($key, $val) = each($config)) 110 { 109 111 if(is_array($val)) 110 112 { 111 113 foreach($val as $key2 => $val2) 112 114 { 113 $this->my_config[$key][$key2]=$val2; 115 $this->my_config[$key][$key2]=$val2; 114 116 } 115 117 } 116 118 else 117 119 { 118 $this->my_config[$key] =$val; 120 $this->my_config[$key] =$val; 119 121 } 120 122 } … … 126 128 public function save_config() 127 129 { 128 $sql="REPLACE INTO ".CONFIG_TABLE." 130 $sql="REPLACE INTO ".CONFIG_TABLE." 129 131 VALUES('".$this->plugin_name_files."_config', '" 130 .serialize($this->my_config)."', '')"; 132 .serialize($this->my_config)."', '')"; 131 133 $result=pwg_query($sql); 132 if($result) 133 { return true; } 134 else 134 if($result) 135 { return true; } 136 else 135 137 { return false; } 136 138 } … … 139 141 public function delete_config() 140 142 { 141 $sql="DELETE FROM ".CONFIG_TABLE." 142 WHERE param='".$this->plugin_name_files."_config'"; 143 $sql="DELETE FROM ".CONFIG_TABLE." 144 WHERE param='".$this->plugin_name_files."_config'"; 143 145 $result=pwg_query($sql); 144 if($result) 145 { return true; } 146 else 146 if($result) 147 { return true; } 148 else 147 149 { return false; } 148 150 } … … 166 168 167 169 /* --------------------------------------------------------------------------- 168 ADMINISTRATOR CONSOLE RELATED FUNCTIONS 170 ADMINISTRATOR CONSOLE RELATED FUNCTIONS 169 171 --------------------------------------------------------------------------- */ 170 172 … … 208 210 $fhandle=fopen($this->debug_file, "a"); 209 211 } 210 212 211 213 if($fhandle) 212 214 { -
extensions/grum_plugins_classes-2/main.inc.php
r4394 r5424 2 2 /* 3 3 Plugin Name: Grum Plugins Classes.2 4 Version: 2.0. 44 Version: 2.0.5 5 5 Description: Collection de classes partagées entre mes plugins (existants, ou à venir) / Partaged classes between my plugins (actuals or futures) 6 6 Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=199 … … 28 28 | 2.0.3 | 2009/07/24 | * modify common_plugin class config loader (r2.0.1) 29 29 | 2.0.4 | 2009/11/29 | * modify users class 30 | | |30 | 2.0.5 | 2010/03/28 | * Uses piwigo pwg_db_* functions instead of mysql_* functions 31 31 | | | 32 32 … … 39 39 Classes version for this package 40 40 ajax.class.php -v2.0 + ajax.js -v1.0.1 41 common_plugin.class.php -v2.0. 141 common_plugin.class.php -v2.0.2 42 42 css.class.php -v2.0 43 43 pages_navigation.class.php -v1.0 44 44 public_integration.class.php -v1.0 45 tables.class.php -v1. 445 tables.class.php -v1.5 46 46 tabsheets.class.inc.php -v1.1 47 47 translate.class.inc.php -v2.0.0 + google_translate.js -v2.0.0 48 users_groups.class.inc.php -v1. 148 users_groups.class.inc.php -v1.2 49 49 genericjs.class.inc.php -v1.0 + genericjs.js -v1.0 50 50 … … 58 58 define('GPC_PATH' , PHPWG_PLUGINS_PATH . GPC_DIR . '/'); 59 59 60 define('GPC_VERSION' , '2.0. 4');60 define('GPC_VERSION' , '2.0.5'); 61 61 62 62 /* -
extensions/grum_plugins_classes-2/tables.class.inc.php
r3395 r5424 1 <?php 1 <?php 2 2 3 3 /* ----------------------------------------------------------------------------- 4 4 class name: manage_tables 5 class version: 1. 46 date: 20 08-12-285 class version: 1.5 6 date: 2010-03-28 7 7 ------------------------------------------------------------------------------ 8 author: grum at grum.dnsalias.com8 author: grum at piwigo.org 9 9 << May the Little SpaceFrog be with you >> 10 10 ------------------------------------------------------------------------------ 11 11 12 12 this class provides base functions to manage tables while plugin installation 13 13 - constructor manage_tables($tables) … … 31 31 + $resultbooelan option for return 32 32 + add multi_queries($queries) function 33 + add import($filename) function 33 + add import($filename) function 34 34 v1.4 - 2009-03-01 + PHP5 migration (use of public/protected/private) 35 35 + export => DROP TABLE IF EXISTS 36 36 + import => if DROP TABLE without IF EXISTS, add IF EXISTS 37 v1.5 - 2010-03-28 + Uses piwigo pwg_db_* functions instead of mysql_* functions 37 38 38 39 -------------------------------------------------------------------------- */ … … 46 47 $this->tables = $tables; 47 48 } 48 49 /* 49 50 /* 50 51 create tables 51 52 $tables_def is an array of SQL CREATE queries 52 53 53 return true if everything is ok, otherwise tablename 54 return true if everything is ok, otherwise tablename 54 55 */ 55 56 public function create_tables($tables_def) … … 71 72 } 72 73 73 /* update tables definition 74 /* update tables definition 74 75 $tables_alteration : array of arrays 75 76 example : … … 81 82 "attribute2" => " ADD COLUMN `attribute2` text null default ''")); 82 83 83 return true if no error, otherwise return table.fields of error 84 return true if no error, otherwise return table.fields of error 84 85 */ 85 86 public function update_tables_fields($tables_alteration) … … 98 99 { 99 100 $columns=array(); 100 while($row= mysql_fetch_assoc($result))101 { 102 array_push($columns, $row['Field']); 101 while($row=pwg_db_fetch_assoc($result)) 102 { 103 array_push($columns, $row['Field']); 103 104 } 104 105 … … 121 122 122 123 123 /* 124 /* 124 125 delete tables listed in $this->tables_list 125 126 */ … … 170 171 if($result) 171 172 { 172 while($row= mysql_fetch_row($result))173 while($row=pwg_db_fetch_row($result)) 173 174 { 174 175 if(isset($list[$row[0]])) … … 207 208 if empty, assume that all tables have to be exported 208 209 $infos : additional info written in exported file (as comment) 209 $resultboolean : if true, result is true/false ; 210 $resultboolean : if true, result is true/false ; 210 211 if false, if result, return a string with nfo about export 211 212 */ … … 295 296 if($result) 296 297 { 297 while($row= mysql_fetch_row($result))298 while($row=pwg_db_fetch_row($result)) 298 299 { 299 300 $text.=sprintf("%s; -- EOQ\n", $row[1]); … … 316 317 { 317 318 $tmp=array(); 318 while($row= mysql_fetch_row($result))319 while($row=pwg_db_fetch_row($result)) 319 320 { 320 321 $tmp[]=$row[0]; … … 323 324 $colnames='('.implode(',', $tmp).')'; 324 325 } 325 326 326 327 $sql='SELECT * FROM '.$this->tables[$key]; 327 328 $result=pwg_query($sql); 328 329 if($result) 329 330 { 330 while($row= mysql_fetch_row($result))331 while($row=pwg_db_fetch_row($result)) 331 332 { 332 333 foreach($row as $key2 => $val2) … … 403 404 execute multiple query 404 405 each query have to be separated by a "-- EOQ\n" 405 406 406 407 $queries : sql queries 407 408 */ -
extensions/grum_plugins_classes-2/users_groups.class.inc.php
r4394 r5424 3 3 /* ----------------------------------------------------------------------------- 4 4 class name: allowed_access, groups, users 5 class version: 1. 16 date: 20 07-10-315 class version: 1.2 6 date: 2010-03-28 7 7 ------------------------------------------------------------------------------ 8 8 author: grum at piwog.org … … 27 27 | release | date | 28 28 | 1.1 | 2009/11/29 | add 'webmaster' status for users 29 | | |29 | 1.2 | 2010/03/28 | Uses piwigo pwg_db_* functions instead of mysql_* functions 30 30 | | | 31 31 … … 240 240 if($result) 241 241 { 242 while($row= mysql_fetch_assoc($result))242 while($row=pwg_db_fetch_assoc($result)) 243 243 { 244 244 $this->access_list[$row['id']] =
Note: See TracChangeset
for help on using the changeset viewer.