function get_posttableids() { $tableids = array(0); foreach (C::t('forum_post')->show_table() as $table) { list($tempkey, $tablename) = each($table); $tableid = gettableid($tablename); if (!preg_match('/^\\d+$/', $tableid)) { continue; } $tableid = intval($tableid); if (!$tableid) { continue; } $tableids[] = $tableid; } return $tableids; }
function get_posttableids() { $tableids = array(0); $query = DB::query("SHOW TABLES LIKE '" . DB::table('forum_post') . "\\_%'"); while ($table = DB::fetch($query)) { list($tempkey, $tablename) = each($table); $tableid = gettableid($tablename); if (!preg_match('/^\\d+$/', $tableid)) { continue; } $tableid = intval($tableid); if (!$tableid) { continue; } $tableids[] = $tableid; } return $tableids; }
function update_posttableids() { $tableids = array(0); $query = DB::query("SHOW TABLES LIKE '" . DB::table('forum_post') . "\\_%'"); while ($table = DB::fetch($query)) { list($tempkey, $tablename) = each($table); $tableid = gettableid($tablename); if (!$tableid) { continue; } $tableids[] = $tableid; } DB::insert('common_setting', array('skey' => 'posttableids', 'svalue' => serialize($tableids)), false, true); save_syscache('posttableids', $tableids); }