dbprefix}metastrings where ( (id not in (select name_id from {$CONFIG->dbprefix}metadata)) AND (id not in (select value_id from {$CONFIG->dbprefix}metadata)) AND (id not in (select name_id from {$CONFIG->dbprefix}annotations)) AND (id not in (select value_id from {$CONFIG->dbprefix}annotations)) )"; if (delete_data($query)!==false) { $resulttext .= elgg_echo('garbagecollector:ok'); } else $resulttext .= elgg_echo('garbagecollector:error'); $resulttext .= "\n"; // Now we optimize all tables $tables = get_db_tables(); foreach ($tables as $table) { $resulttext .= sprintf(elgg_echo('garbagecollector:optimize'), $table); if (update_data("optimize table $table")!==false) $resulttext .= elgg_echo('garbagecollector:ok'); else $resulttext .= elgg_echo('garbagecollector:error'); $resulttext .= "\n"; } $resulttext .= elgg_echo('garbagecollector:done'); return $returnvalue . $resulttext; } // Initialise plugin register_elgg_event_handler('init','system','garbagecollector_init'); ?>