fetch_all_order_by_tid(500) as $tid => $addview) { $deltids[$tid] = $updateviews[$addview['addviews']][] = $tid; } if($deltids) { C::t('forum_threadaddviews')->delete($deltids); } foreach($updateviews as $views => $tids) { C::t('forum_thread')->increase($tids, array('views' => $views), true); } ?>