Changeset 665
- Timestamp:
- Nov 22, 2010, 9:53:31 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/user_sync_xoops.php
r581 r665 390 390 $sql = "SELECT * FROM $db_xpress_usermeta WHERE meta_key LIKE '%_" . $wp_prefix_only . "%'" ; 391 391 $user_metas = $xoops_db->get_results($sql); 392 foreach($user_metas as $user_meta){ 393 if (strpos($user_meta->meta_key,$user_meta_prefix) === false) { 394 $new_meta_key = ''; 395 if (strpos($user_meta->meta_key,$wp_prefix_only.'user_level')) 396 $new_meta_key = $user_meta_prefix . 'user_level'; 397 if (strpos($user_meta->meta_key,$wp_prefix_only.'capabilities')) 398 $new_meta_key = $user_meta_prefix . 'capabilities'; 399 if (strpos($user_meta->meta_key,$wp_prefix_only.'autosave_draft_ids')) 400 $new_meta_key = $user_meta_prefix . 'autosave_draft_ids'; 401 if (strpos($user_meta->meta_key,$wp_prefix_only.'usersettings')){ 402 if (strpos($user_meta->meta_key,$wp_prefix_only.'usersettingstime')) 403 $new_meta_key = $user_meta_prefix . 'usersettingstime'; 404 else 405 $new_meta_key = $user_meta_prefix . 'usersettings'; 406 } 407 if (!empty($new_meta_key)){ 408 $repair_sql = "UPDATE $db_xpress_usermeta "; 409 $repair_sql .= 'SET '; 410 $repair_sql .= "meta_key = '$new_meta_key' "; 411 $repair_sql .= "WHERE (umeta_id = $user_meta->umeta_id )"; 412 $xoops_db->query($repair_sql); 392 if(!empty($user_metas)){ 393 foreach($user_metas as $user_meta){ 394 if (strpos($user_meta->meta_key,$user_meta_prefix) === false) { 395 $new_meta_key = ''; 396 if (strpos($user_meta->meta_key,$wp_prefix_only.'user_level')) 397 $new_meta_key = $user_meta_prefix . 'user_level'; 398 if (strpos($user_meta->meta_key,$wp_prefix_only.'capabilities')) 399 $new_meta_key = $user_meta_prefix . 'capabilities'; 400 if (strpos($user_meta->meta_key,$wp_prefix_only.'autosave_draft_ids')) 401 $new_meta_key = $user_meta_prefix . 'autosave_draft_ids'; 402 if (strpos($user_meta->meta_key,$wp_prefix_only.'usersettings')){ 403 if (strpos($user_meta->meta_key,$wp_prefix_only.'usersettingstime')) 404 $new_meta_key = $user_meta_prefix . 'usersettingstime'; 405 else 406 $new_meta_key = $user_meta_prefix . 'usersettings'; 407 } 408 if (!empty($new_meta_key)){ 409 $repair_sql = "UPDATE $db_xpress_usermeta "; 410 $repair_sql .= 'SET '; 411 $repair_sql .= "meta_key = '$new_meta_key' "; 412 $repair_sql .= "WHERE (umeta_id = $user_meta->umeta_id )"; 413 $xoops_db->query($repair_sql); 414 } 413 415 } 414 416 } … … 420 422 $prefix = get_wp_prefix(); 421 423 $option_tables = get_table_list($prefix,'options'); 422 foreach( $option_tables as $option_table){ 423 $mid_prefix = get_multi_mid_prefix($prefix,'options' , $option_table); 424 425 $new_option_name = $prefix .$mid_prefix . 'user_roles'; 426 $sql = "SELECT option_id , option_name FROM $option_table WHERE option_name LIKE '%_user_roles'" ; 427 $option= $xoops_db->get_row($sql); 428 if ($option->option_name != $new_option_name){ 429 $repair_sql = "UPDATE $db_wp_option "; 430 $repair_sql .= 'SET '; 431 $repair_sql .= "option_name = '$new_option_name' "; 432 $repair_sql .= "WHERE (option_id = $option->option_id )"; 433 $xoops_db->query($repair_sql); 424 if(!empty($option_tables)){ 425 foreach( $option_tables as $option_table){ 426 $mid_prefix = get_multi_mid_prefix($prefix,'options' , $option_table); 427 428 $new_option_name = $prefix .$mid_prefix . 'user_roles'; 429 $sql = "SELECT option_id , option_name FROM $option_table WHERE option_name LIKE '%_user_roles'" ; 430 $option= $xoops_db->get_row($sql); 431 if ($option->option_name != $new_option_name){ 432 $repair_sql = "UPDATE $db_wp_option "; 433 $repair_sql .= 'SET '; 434 $repair_sql .= "option_name = '$new_option_name' "; 435 $repair_sql .= "WHERE (option_id = $option->option_id )"; 436 $xoops_db->query($repair_sql); 437 } 434 438 } 435 439 }
Note: See TracChangeset
for help on using the changeset viewer.