Functions


Functions Summary
array

cot_tag_cloud(string area, string order, int limit)

Collects data for a tag cloud in some area.

array

cot_tag_complete(string tag, int min_length)

Gets an array of autocomplete options for a given tag

int

cot_tag_count(string tag, string area, mixed extra)

Returns number of items tagged with a specific keyword

bool

cot_tag_exists(string tag)

Checks whether the tag has already been registered in the dictionary

bool

cot_tag_isset(string tag, int item, string area, mixed extra)

Checks whether a tag has been already set on a specific item

array

cot_tag_list(mixed item, string area, mixed extra)

Returns an array containing tags which have been set on an item / items

array

cot_tag_parse(string input)

Parses user input into array of valid and safe tags

string

cot_tag_parse_query(string qs, array join_columns)

Parses search string into SQL query

string

cot_tag_prep(string tag)

Convert the tag to lowercase and prepare it for SQL operations.

static void

cot_tag_register(string tag)

Attempts to register a tag in the dictionary.

bool

cot_tag_remove(string tag, int item, string area, mixed extra)

Removes tag reference from a specific item

int

cot_tag_remove_all(int item, string area, mixed extra)

Removes all tags attached to an item, or all tags from area if item is set to 0.

void

cot_tag_search_form(string area)

Global tag cloud and search form

string

cot_tag_title(string tag)

Converts a lowercase tag into title-case string (capitalizes first latters of the words)

void

cot_tag_unregister(string tag)

Unregisters a tag from the dictionary

Function Detail

plugins\tags\inc\tags.functions.php at line 65

cot_tag_cloud

public array cot_tag_cloud(string area, string order, int limit)
Collects data for a tag cloud in some area. The result is an associative array with tags as keys and count of entries as values.
Global:
CotDB $db
Cache $cache
CotDB $db
Cache $cache
Parameters:
area - Site area
order - Should be 'tag' to order the result set by tag (alphabetical) or 'cnt' to order it by item count (descending)
limit - Use this parameter to limit number of rows in the result set
Returns:

plugins\tags\inc\tags.functions.php at line 128

cot_tag_complete

public array cot_tag_complete(string tag, int min_length)
Gets an array of autocomplete options for a given tag
Parameters:
tag - Beginning of a tag
min_length - Minimal length of the beginning
Returns:
Global:
CotDB $db

plugins\tags\inc\tags.functions.php at line 154

cot_tag_count

public int cot_tag_count(string tag, string area, mixed extra)
Returns number of items tagged with a specific keyword
Parameters:
tag - The tag (keyword)
area - Site area or empty to count in all areas
extra - Extra condition (name => value) for plugins
Returns:
Global:
CotDB $db

plugins\tags\inc\tags.functions.php at line 179

cot_tag_exists

public bool cot_tag_exists(string tag)
Checks whether the tag has already been registered in the dictionary
Parameters:
tag - The tag
Returns:
Global:
CotDB $db

plugins\tags\inc\tags.functions.php at line 195

cot_tag_isset

public bool cot_tag_isset(string tag, int item, string area, mixed extra)
Checks whether a tag has been already set on a specific item
Parameters:
tag - The tag (keyword)
item - Item ID
area - Site area code (e.g. 'pages', 'forums', 'blog')
extra - Extra condition (name => value) for plugins
Returns:
Global:
CotDB $db

plugins\tags\inc\tags.functions.php at line 220

cot_tag_list

public array cot_tag_list(mixed item, string area, mixed extra)
Returns an array containing tags which have been set on an item / items
Parameters:
item - Item ID or an array of item IDs
area - Site area code (e.g. 'pages', 'forums', 'blog')
extra - Extra condition (name => value) for plugins
Returns:
Global:
CotDB $db

plugins\tags\inc\tags.functions.php at line 255

cot_tag_parse

public array cot_tag_parse(string input)
Parses user input into array of valid and safe tags
Parameters:
input - Comma separated user input
Returns:

plugins\tags\inc\tags.functions.php at line 279

cot_tag_parse_query

public string cot_tag_parse_query(string qs, array join_columns)
Parses search string into SQL query
Parameters:
qs - User input
join_columns - Columns to be joined by on tag_item match in subquery
Returns:
Global:
CotDB $db

plugins\tags\inc\tags.functions.php at line 341

cot_tag_prep

public string cot_tag_prep(string tag)
Convert the tag to lowercase and prepare it for SQL operations. Please call this after cot_import()!
Parameters:
tag - The tag
Returns:

plugins\tags\inc\tags.functions.php at line 356

cot_tag_register

public static void cot_tag_register(string tag)
Attempts to register a tag in the dictionary. Duplicate entries are just ignored.
Parameters:
tag - The tag
Global:
CotDB $db

plugins\tags\inc\tags.functions.php at line 372

cot_tag_remove

public bool cot_tag_remove(string tag, int item, string area, mixed extra)
Removes tag reference from a specific item
Parameters:
tag - The tag (keyword)
item - Item ID
area - Site area code (e.g. 'pages', 'forums', 'blog')
extra - Extra condition (name => value) for plugins
Returns:
Global:
CotDB $db

plugins\tags\inc\tags.functions.php at line 401

cot_tag_remove_all

public int cot_tag_remove_all(int item, string area, mixed extra)
Removes all tags attached to an item, or all tags from area if item is set to 0. Returns number of tag references affected.
Parameters:
item - Item ID
area - Site area
extra - Extra condition (name => value) for plugins
Returns:
Global:
CotDB $db

plugins\tags\inc\tags.functions.php at line 451

cot_tag_search_form

public void cot_tag_search_form(string area)
Global tag cloud and search form
Parameters:
area - Site area
Global:
CotDB $db

plugins\tags\inc\tags.functions.php at line 428

cot_tag_title

public string cot_tag_title(string tag)
Converts a lowercase tag into title-case string (capitalizes first latters of the words)
Parameters:
tag - A tag
Returns:

plugins\tags\inc\tags.functions.php at line 439

cot_tag_unregister

public void cot_tag_unregister(string tag)
Unregisters a tag from the dictionary
Parameters:
tag - The tag
Global:
CotDB $db