return db_fetch_array(db_query("SELECT * FROM collection WHERE cid = '". check_input($cid) ."'"));
}
function meta_get_tag($tid) {
return db_fetch_array(db_query("SELECT * FROM tag WHERE tid = '". check_input($tid) ."'"));
}
function meta_form_collection($edit = array()) {
global $REQUEST_URI;
$form .= form_textfield("Collection name", "name", $edit[name], 50, 64, "Required. The name for this group or collection of meta-tags. Example: 'Software'.");
$form .= form_textfield("Types", "types", $edit[types], 50, 64, "Required. A comma-seperated list of node types you want to associate this collection with. Example: 'story, book'.");
$form .= form_submit("Submit");
if ($edit[cid]) {
$form .= form_submit(t("Delete"));
$form .= form_hidden("cid", $edit[cid]);
}
return form($REQUEST_URI, $form);
}
function meta_form_tag($edit = array()) {
global $REQUEST_URI;
$form .= form_textfield("Meta-tag name", "name", $edit[name], 50, 64, "Required. The name for this meta-tag. Example: 'Apache'.");
$form .= form_textfield("Attributes", "attributes", $edit[attributes], 50, 64, "Required. A comma-seperated list of keywords you want to associate this meta-tag with. Example: 'Computers, Software, Webservers'.");
$form .= form_textfield("Collections", "collections", $edit[collections], 50, 64, "Required. A comma-seperated list of collections you want to associate this meta-tag with. Example: 'Section'.");
db_query("UPDATE tag SET name = '". check_input($edit[name]) ."', attributes = '". check_input($edit[attributes]) ."', collections = '". check_input($edit[collections]) ."' WHERE tid = '$edit[tid]'");
}
else if ($edit[tid]) {
db_query("DELETE FROM tag WHERE tid = '". check_input($edit[tid]) ."'");
}
else {
db_query("INSERT INTO tag (name, attributes, collections) VALUES ('". check_input($edit[name]) ."', '". check_input($edit[attributes]) ."', '". check_input($edit[collections]) ."')");