public function theme_title($theme) { $title = ''; $hv = (count($this->handler_vars) != 0) ? $this->handler_vars : Controller::get_handler()->handler_vars; $r = $this->request; $stitle = Options::get('title'); $ps = $this->posts; if($r->display_entries_by_date && count($hv) > 0){ $date = ''; $date .= isset($hv['year']) ? $hv['year'] : '' ; $date .= isset($hv['month']) ? '-' . $hv['month'] : '' ; $date .= isset($hv['day']) ? '-' . $hv['day'] : '' ; $title = sprintf(_t('%1$s - %2$s'), $date, $stitle); }elseif($r->display_entries_by_tag && isset($hv['tag'])){ $tag = (count($ps) > 0) ? $ps[0]->tags[$hv['tag']] : $hv['tag'] ; $title = sprintf(_t('%1$s - %2$s'), htmlspecialchars($tag), $stitle); }elseif(($r->display_entry || $r->display_page) && isset($ps)) $title = sprintf(_t('%1$s - %2$s'), strip_tags($ps->title), $stitle); elseif($r->display_search){ /* Set title to the search criteria, or to EMPTY if there were no criteria. */ $q = Controller::get_var('criteria'); $title = ($q != '') ? sprintf(_t('%1$s - %2$s Search'), htmlspecialchars($q), $stitle) : sprintf(_t('Empty %1$s Search'), $stitle); }else $title = $stitle; if($this->page > 1) $title = sprintf(_t('%1$s › Page %2$s'), $title, $this->page); return $title; }