Lines Matching defs:tag

80      * Canonicalizes the tag to its lower case nospace form
82 * @param $tag
86 public function cleanTag($tag) {
87 $tag = str_replace(array(' ', '-', '_', '#'), '', $tag);
88 $tag = utf8_strtolower($tag);
90 return $tag;
128 foreach ($tags as $tag) {
129 $queries[] = array('INSERT INTO taggings (pid, tagger, tag, lang) VALUES(?, ?, ?, ?)', $id, $user, $tag, $lang);
147 * @param string $type What field to return 'tag'|'pid'
172 * Constructs the URL to search for a tag
174 * @param string $tag
179 public function getTagSearchURL($tag, $ns = '') {
180 $ret = '?do=search&sf=1&q=' . rawurlencode('#' . $this->cleanTag($tag));
209 foreach ($tags as $tag => $cnt) {
212 $tags[$tag] = $tresh;
215 $tags[$tag] = $levels;
223 * Display a tag cloud
226 * @param string $type 'tag'
227 * @param Callable $func The function to print the link (gets tag and ns)
252 if ($type === 'tag' and
305 * Get the link to a search for the given tag
307 * @param string $tag search for this tag
312 protected function linkToSearch($tag, $ns = '') {
313 return '<a href="' . hsc($this->getTagSearchURL($tag, $ns)) . '">' . $tag . '</a>';
317 * Display the Tags for the current page and prepare the tag editing form
332 $tags = $this->findItems($filter, 'tag');
337 $ret .= $this->html_cloud($tags, 'tag', array($this, 'linkToSearch'), true, true);
356 ), 'tag');
386 $order_by = 'tag';
394 CLEANTAG("tag") AS "tid",
421 SELECT pid, GROUP_CONCAT(tag) AS tags
436 * Renames a tag
444 msg($this->getLang("admin enter tag names"), -1);
451 $newTagNames = array_map(function ($tag) {
452 return $this->cleanTag($tag);
468 $where = ' WHERE CLEANTAG(tag) = ?';
509 * Rename or delete a tag for all users
522 'SELECT pid FROM taggings WHERE CLEANTAG(tag) = ? AND pid = ?',
529 return array(true, $this->getLang('admin tag does not exists'));
534 'DELETE FROM taggings WHERE pid = ? AND CLEANTAG(tag) = ?',
540 'UPDATE taggings SET tag = ? WHERE pid = ? AND CLEANTAG(tag) = ?',
552 * Deletes a tag
567 implode(' OR ', array_fill(0, count($tags), 'CLEANTAG(tag) = ?')) . ')';
624 } elseif (isset($parsedQuery['tag'])) {
626 $tags[] = $parsedQuery['tag'];
687 $sql = 'SELECT pid from taggings where CLEANTAG(tag) = CLEANTAG(?)';
704 * Display tag management table
710 array('value' => $this->getLang('admin tag'), 'sort_by' => 'tid'),
873 * Display tag cleaner
948 * Default sorting by tag id
1012 GROUP_CONCAT(CLEANTAG("tag")) AS "tags"