- Timestamp:
- Oct 22, 2009, 9:54:26 PM (15 years ago)
- Location:
- trunk/xpressme_integration_kit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/xpressme_integration_kit/include/general_functions.php
r415 r417 136 136 } 137 137 } else { // load XPressME or not Load XOOPS 138 $table_list = $xoops_db->get_results($sql); 138 $rows = $xoops_db->get_results($sql, ARRAY_N); 139 foreach ($rows as $row){ 140 $table_list[] = $row[0]; 141 } 139 142 } 140 143 } -
trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/user_sync_xoops.php
r276 r417 1 1 <?php 2 /*3 * The default authority setting value given by a new user of WordPress4 */5 function get_default_capabillities(){6 global $xoops_db;7 $db_option = get_wp_prefix() . 'options';8 return $xoops_db->get_var("SELECT option_value FROM $db_option WHERE option_name = 'default_role'");9 }10 11 2 /* 12 3 * Get The level from the capabillities name. 13 4 */ 14 5 function get_role_level($capabillities){ 15 if ($capabillities == 'default') $capabillities = get_ default_capabillities();6 if ($capabillities == 'default') $capabillities = get_option('default_role');; 16 7 switch($capabillities) { 17 8 case 'administrator': … … 309 300 function repair_user_meta_prefix(){ 310 301 global $xoops_db; 311 312 302 // repair usermeta db 313 303 $db_xpress_usermeta = get_wp_prefix() . 'usermeta'; … … 342 332 343 333 // repair option db user_roles 344 $db_wp_option = get_wp_prefix() . 'options'; 345 $new_option_name = get_wp_prefix() . 'user_roles'; 346 $sql = "SELECT option_id , option_name FROM $db_wp_option WHERE option_name LIKE '%_" . $wp_prefix_only . "user_roles'" ; 347 $option= $xoops_db->get_row($sql); 348 if ($option->option_name != $new_option_name){ 349 $repair_sql = "UPDATE $db_wp_option "; 350 $repair_sql .= 'SET '; 351 $repair_sql .= "option_name = '$new_option_name' "; 352 $repair_sql .= "WHERE (option_id = $option->option_id )"; 353 $xoops_db->query($repair_sql); 334 include_once (ABSPATH . '/include/general_functions.php'); 335 336 $prefix = get_wp_prefix(); 337 $option_tables = get_table_list($prefix,'options'); 338 foreach( $option_tables as $option_table){ 339 $mid_prefix = get_multi_mid_prefix($prefix,'options' , $option_table); 340 341 $new_option_name = $prefix .$mid_prefix . 'user_roles'; 342 $sql = "SELECT option_id , option_name FROM $option_table WHERE option_name LIKE '%_user_roles'" ; 343 $option= $xoops_db->get_row($sql); 344 if ($option->option_name != $new_option_name){ 345 $repair_sql = "UPDATE $db_wp_option "; 346 $repair_sql .= 'SET '; 347 $repair_sql .= "option_name = '$new_option_name' "; 348 $repair_sql .= "WHERE (option_id = $option->option_id )"; 349 $xoops_db->query($repair_sql); 350 } 354 351 } 355 352 }
Note: See TracChangeset
for help on using the changeset viewer.