function fs_delete_url_metadata_by_id($url_id, $type, $value = null) { $fsdb =& fs_get_db_conn(); $url_metadata = fs_url_metadata_table(); $value = $value != null ? $fsdb->escape($value) : null; $url_id = $fsdb->escape($url_id); $type = $fsdb->escape($type); $sql = "DELETE FROM `{$url_metadata}` WHERE `url_id` = {$url_id} AND `type` = {$type}"; if ($value !== null) { $sql .= " AND `value` = {$value}"; } $r = $fsdb->query($sql); if ($r === false) { return fs_db_error(); } return true; }
function fs_create_url_metadata(&$fsdb) { $urlmeta = fs_url_metadata_table(); $sql = "CREATE TABLE IF NOT EXISTS `{$urlmeta}` \n\t\t(\n\t\t\t`url_id` INT NOT NULL ,\n\t\t\t`type` INT NOT NULL ,\n\t\t\t`value` TEXT NULL ,\n\t\t\tINDEX ( `url_id` , `type` )\n\t\t) " . fs_engine("InnoDB"); $r = $fsdb->query($sql); if ($r === FALSE) { return false; } return true; }
function fs_get_tables_list() { $a = array(fs_version_table(), fs_hits_table(), fs_useragents_table(), fs_urls_table(), fs_excluded_ips_table(), fs_bots_table(), fs_options_table(), fs_sites_table(), fs_archive_ranges(), fs_archive_sites(), fs_archive_pages(), fs_archive_referrers(), fs_archive_useragents(), fs_archive_countries(), fs_users_table(), fs_pending_date_table(), fs_url_metadata_table()); return $a; }