You are here

function flag_lists_title_exists in Flag Lists 7

Same name and namespace in other branches
  1. 6 flag_lists.module \flag_lists_title_exists()
  2. 7.3 flag_lists.module \flag_lists_title_exists()

Checks for a list title by node type.

2 calls to flag_lists_title_exists()
flag_lists_add_js in ./flag_lists.admin.inc
Callback for adding new lists through AJAX.
flag_lists_form_validate in ./flag_lists.admin.inc
Validate a list.

File

./flag_lists.module, line 1603
The Flag Lists module.

Code

function flag_lists_title_exists($title, $type) {
  return db_query("SELECT COUNT(flf.fid) FROM {flag_lists_flags} flf LEFT JOIN {flag_types} ft ON flf.pfid=ft.fid WHERE flf.title=:title AND ft.type=:type AND flf.uid=:uid", array(
    ':title' => $title,
    ':type' => $type,
    ':uid' => $GLOBALS['user']->uid,
  ))
    ->fetchField();
}