if (!in_array($item->package_id, $packages)) { $queries->delete('donation_packages', array('package_id', '=', $item->package_id)); } } $category_query = $queries->getWhere('donation_categories', array('cid', '<>', 0)); foreach ($category_query as $item) { if (!in_array($item->cid, $categories)) { $queries->delete('donation_categories', array('cid', '=', $item->cid)); } } /* * Latest donors */ if (count($bc_payments)) { // Get latest payment already stored in cache $latest_payment = $queries->orderWhere('donation_cache', 'id <> 0', 'time', 'DESC'); if (count($latest_payment)) { $latest_payment = $latest_payment[0]->time; } else { $latest_payment = 0; } foreach ($bc_payments as $item) { if ($item['date'] < strtotime($item['date'])) { // Input into database $queries->create('donation_cache', array('time' => strtotime($item['date']), 'uuid' => htmlspecialchars($item['player']['uuid']), 'ign' => htmlspecialchars($item['player']['name']), 'price' => $item['amount'], 'package' => isset($item['packages'][0]) ? $item['packages'][0]['id'] : 0)); } } } } else { if ($webstore == 'mm') { // MinecraftMarket