Class: Content_EventTag
Source Location: /content_classes/eventtag.class.php
Class Details
[line 36]
Class Variables
Class Methods
constructor __construct [line 65]
Content_EventTag __construct(
)
|
|
Start instance of base class, load configuration and establish database connection. Please don't call the constructor direcly, use the singleton pattern instead.
Tags:
method addEventTag [line 216]
int addEventTag(
int
$page, int
$posting, string
$tag)
|
|
Inserts a event tag into the event tag database. Takes the page id as first argument, the event posting that the tag will be linked to as second argument and the tag word as third argument. The amount of occurrences will be set to 1. If the tag already exists in the database, updateEventTag() will be called.
Tags:
Parameters:
method addLink [line 738]
int addLink(
int
$posting, int
$tag)
|
|
Adds link between posting and tag. Takes the posting id as first argument, the tag word id as second argument. First, the function will look up, if the link exists. If it doesn't exists, the function will add one. If it already exist, nothing happens. The function always returns boolean true.
Tags:
Parameters:
method addPostingTags [line 93]
bool addPostingTags(
int
$page, int
$posting, array
$tags)
|
|
Adds tags of a posting. Takes the page id as first argument, the posting id second argument and the tag word list as third argument.
Tags:
Parameters:
method deleteEventTag [line 361]
bool deleteEventTag(
int
$page, int
$posting, string
$tag)
|
|
Removes tag.Takes the page id as first argument, the posting id as second argument and the tag word as third argument. First, the function will decrease the occurrences (-1) and then remove every tag where the amount of occurrences is 0 (null). Then it will remove the link between the tag an the posting.
Tags:
Parameters:
method deleteLink [line 775]
bool deleteLink(
int
$posting, int
$tag)
|
|
Removes link between posting and tag. Takes the posting id as first argument, the tag word id as second argument. First, the function will look up, if the link exists. If it exists, it will be deleted. If it doesn't exist, nothing happens. The function always returns boolean true.
Tags:
Parameters:
method deletePostingTags [line 181]
bool deletePostingTags(
int
$page, int
$posting, array
2)
|
|
Deletes all tags of a posting. Takes the page id as first argument, the posting id as second argument. Returns bool.
Tags:
Parameters:
method getSerializedTagArrayFromTagArray [line 909]
void getSerializedTagArrayFromTagArray(
$array)
|
|
Tags:
Parameters:
method getTagStringFromSerializedArray [line 919]
void getTagStringFromSerializedArray(
$str)
|
|
Tags:
Parameters:
method getTagWordUrlArrayFromSerializedArray [line 930]
void getTagWordUrlArrayFromSerializedArray(
$str)
|
|
Tags:
Parameters:
method link_exists [line 686]
mixed link_exists(
int
$posting, int
$tag)
|
|
Check for link between posting id and tag word. Takes posting id as first argument, tag word id as second argument. Return bool on false and int (Link id) on true.
Tags:
Parameters:
method prepareTagsForCloud [line 816]
void prepareTagsForCloud(
array
$tags, int
$range)
|
|
Prepares tags for tag cloud generation. Calculates relevance for every tag. Relevance is a number between 0 and the given higher range delimiter. It's recommend to pass an array of tags that contains the n most relevant tags (so these one with the highest occurrences) in descending order (highest number of occurrences comes first). Alphabetical sorting will be done automatically.
Tags:
Parameters:
method selectEventTag [line 402]
array selectEventTag(
int
$id)
|
|
Select tag Takes tag word id as first argument. Returns tag information.
Tags:
Parameters:
method selectEventTagByWordUrl [line 585]
array selectEventTagByWordUrl(
string
$word_url)
|
|
Select tag by word_url Takes tag word_url as first argument. Returns tag information.
Tags:
Parameters:
method selectEventTags [line 468]
array selectEventTags(
[array
$params = array()])
|
|
Selects event tags. Takes array with select params as first argument. Returns array with tags. List of supported parameters - page: int, page id
- posting: int, posting id
- start: int, article offset
- limit: int, amount of articles to return
- order_marco, string, otpional: How to sort the result set.
Supported macros:
- FIRST_CHAR: sort by first char
- WORD: sorty by tag word
- OCCURRENCES: sorty by occurrences
</ul>
Tags:
Parameters:
method tag_exists [line 629]
mixed tag_exists(
int
$page, string
$tag)
|
|
Function to look up if the tag is already in the database. Takes the page id as first argument, the tag word (some scalar value) as second argument. Returns the tag id in the database (int) or, if the tag wasn't found, boolean false.
Tags:
Parameters:
method updateEventTag [line 273]
void updateEventTag(
int
$page, int
$posting, string
$tag, [string
$modify_amount = 'increase'])
|
|
Function to increase/decrease occurrences of tag words and to add/remove links between tag words. Takes the page id as first argument, the posting id as second argument, the tag word as third argument and the instruction how to modify the occurrences as fourth argument. modify_amount can be either increase or decrease.
Tags:
Parameters:
method updatePostingTags [line 129]
bool updatePostingTags(
int
$page, int
$posting, array
$tags)
|
|
Update tags of a posting. Takes the page id as first argument, the posting id as second argument and the new tag list as third argument. Fetches the old tag list from the database and calculates the differences. Tags that are no longer required will be removed, new ones will be added.
Tags:
Parameters:
method _tagArrayToString [line 896]
array _tagArrayToString(
string
$array)
|
|
Helper function to convert a array of tags into a string of tags, each separated by a comma. Useful when it's required to prepare data for a user input field.
Tags:
Parameters:
method _tagStringToArray [line 869]
array _tagStringToArray(
string
$string)
|
|
Helper function to convert a string of tags, each separated by a comma, into an array. Useful when receiving data from a an user input field.
Tags:
Parameters:
|
|