Changeset 1082 for trunk/admin/include
- Timestamp:
- Mar 15, 2006, 11:44:35 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/functions.php
r1070 r1082 781 781 $query = ' 782 782 UPDATE '.$tablename.' AS t1, '.$temporary_tablename.' AS t2 783 SET '.implode("\n , ", 784 array_map( 785 create_function('$s', 'return "t1.$s = t2.$s";') 786 , $dbfields['update'])).' 787 WHERE '.implode("\n AND ", 788 array_map( 789 create_function('$s', 'return "t1.$s = t2.$s";') 790 , $dbfields['primary'])).' 783 SET '. 784 implode( 785 "\n , ", 786 array_map( 787 create_function('$s', 'return "t1.$s = t2.$s";'), 788 $dbfields['update'] 789 ) 790 ).' 791 WHERE '. 792 implode( 793 "\n AND ", 794 array_map( 795 create_function('$s', 'return "t1.$s = t2.$s";'), 796 $dbfields['primary'] 797 ) 798 ).' 791 799 ;'; 792 800 pwg_query($query); … … 841 849 foreach ($uppercats_array as $id => $uppercats) 842 850 { 843 $data = array(); 844 $data['id'] = $id; 845 $global_rank = preg_replace('/(\d+)/e', 846 "\$ranks_array['$1']", 847 str_replace(',', '.', $uppercats)); 848 $data['global_rank'] = $global_rank; 849 array_push($datas, $data); 850 } 851 852 $fields = array('primary' => array('id'), 'update' => array('global_rank')); 853 mass_updates(CATEGORIES_TABLE, $fields, $datas); 851 array_push( 852 $datas, 853 array( 854 'id' => $id, 855 'global_rank' => preg_replace( 856 '/(\d+)/e', 857 "\$ranks_array['$1']", 858 str_replace(',', '.', $uppercats) 859 ), 860 ) 861 ); 862 } 863 864 mass_updates( 865 CATEGORIES_TABLE, 866 array( 867 'primary' => array('id'), 868 'update' => array('global_rank') 869 ), 870 $datas 871 ); 854 872 } 855 873 … … 1254 1272 // users present in user related tables must be present in the base user 1255 1273 // table 1256 $tables = 1257 array(1258 USER_MAIL_NOTIFICATION_TABLE,1259 USER_FEED_TABLE,1260 USER_INFOS_TABLE,1261 USER_ACCESS_TABLE,1262 USER_CACHE_TABLE,1263 USER_GROUP_TABLE1264 );1274 $tables = array( 1275 USER_MAIL_NOTIFICATION_TABLE, 1276 USER_FEED_TABLE, 1277 USER_INFOS_TABLE, 1278 USER_ACCESS_TABLE, 1279 USER_CACHE_TABLE, 1280 USER_GROUP_TABLE 1281 ); 1282 1265 1283 foreach ($tables as $table) 1266 1284 { … … 1269 1287 FROM '.$table.' 1270 1288 ;'; 1271 $to_delete = 1272 array_diff( 1273 array_from_query($query, 'user_id'), 1274 $base_users 1275 ); 1289 $to_delete = array_diff( 1290 array_from_query($query, 'user_id'), 1291 $base_users 1292 ); 1276 1293 1277 1294 if (count($to_delete) > 0)
Note: See TracChangeset
for help on using the changeset viewer.