function app_itemid2tid($item, $item_id, $options = null) { $table_name = app_table($item); if (!$table_name) { return array(); } if ($item == 'talk' && $options['talkwhere']) { $where_sql = $options['talkwhere']; } else { $where_sql = ' 1 '; } if (is_array($item_id)) { $where_sql .= " AND item_id IN (" . jimplode($item_id) . ") "; } else { $where_sql .= " AND item_id='{$item_id}' "; } $query = DB::query("SELECT tid FROM " . DB::table($table_name) . " WHERE {$where_sql} "); $tid_ary = array(); while ($value = DB::fetch($query)) { $tid_ary[] = $value['tid']; } return $tid_ary; }
<?php include 'includes/functions.php'; head('Application'); app_menu(); app_table(); foot();