loadCacheFile('payments')) && ($GLOBALS['cache_instance']->extensionVersionMatches('payments'))) { // Load cache $GLOBALS['cache_array']['payments'] = $GLOBALS['cache_instance']->getArrayFromCache(); // Init temporary array $paymentsData = array(); // Rewrite all to id foreach ($GLOBALS['cache_array']['payments']['id'] as $key => $id) { // Re-add key with id foreach ($GLOBALS['cache_array']['payments'] as $key2 => $array) { // Is key2 not 'id'? if ($key2 != 'id') { // Then Add it $paymentsData[$id][$key2] = $GLOBALS['cache_array']['payments'][$key2][$key]; } // END - if } // END - foreach } // END - foreach // Set the array back and remove temporary $GLOBALS['cache_array']['payments'] = $paymentsData; unset($paymentsData); } elseif (isHtmlOutputMode()) { // Create cache file $GLOBALS['cache_instance']->init(); // Load every data from DB to cache file //$add = runFilterChain('sql_admin_extra_data'); // Query the database about this $result = SQL_QUERY('SELECT * FROM `{?_MYSQL_PREFIX?}_payments` ORDER BY `id` ASC', __FILE__, __LINE__); while ($dummy = SQL_FETCHARRAY($result)) { // Save row $GLOBALS['cache_instance']->addRow($dummy); } // END - while // Free memory SQL_FREERESULT($result); // Close cache $GLOBALS['cache_instance']->storeExtensionVersion('payments'); $GLOBALS['cache_instance']->finalize(); } // [EOF] ?>