protected function tagPrepare($id, $auto_title = true) { $tag_model = new photosTagModel(); $tag = false; if (is_numeric($id)) { $tag = $tag_model->getById($id); } if (!$tag) { $tag = $tag_model->getByName($id); if ($tag) { $id = (int) $tag['id']; } } $this->joins['tags'] = array('table' => 'photos_photo_tags', 'alias' => 'pt'); if (!$tag && strstr($id, ',') !== false) { $this->tagPrepareIntersection($id); } else { $this->where[] = "pt.tag_id = " . (int) $id; $this->addTitle(sprintf(_w('Tagged “%s”'), $tag['name'])); } }