assign( 'latest', Post::get(array ( 'status' => 'published','content_type' => 'entry', 'offset' => 0, 'limit' => 1) ) ); $action = Controller::get_action(); $this->assign('controller_action', $action); $offset = 0; if ( $action == 'display_home' ) { $offset = 1; } $this->assign( 'recent', Posts::get(array ( 'status' => 'published','content_type' => 'entry', 'offset' => $offset, 'limit' => 5) ) ); parent::add_template_vars(); } public function theme_search_form( $theme ) { return $theme->fetch('searchform'); } public function theme_search_prompt( $theme, $criteria, $has_results ) { $out=array(); $keywords=explode(' ',trim($criteria)); foreach ($keywords as $keyword) { $out[]= '' . $keyword . ''; } if ( sizeof( $keywords ) > 1 ) { if ( $has_results ) { return sprintf( _t( 'Your search for "%s".' ), implode(' ',$out) ); exit; } return sprintf( _t('No results found for your search \'%1$s\'') . '
'. _t('You can try searching for \'%2$s\''), $criteria, implode('\' or \'',$out) ); } else { return sprintf( _t( 'Search results for "%s".' ), $criteria ); exit; } return sprintf( _t( 'Your search for "%s".' ), $criteria ); } public function filter_comment_date_out( $content, $post) { list($date,) = explode('|', $content); return $date; } public function filter_comment_date_excerpt( $content, $post ) { list(,$time) = explode('|', $content); return $time; } public function filter_comment_content_out( $content, $post) { return strip_tags( $content, '


' ); } /** * Convert a post's tags array into a usable list of links * * @param array $array The tags array from a Post object * @return string The HTML of the linked tags */ public function filter_post_tags_out($array) { if ( ! is_array( $array ) ) { $array = array ( $array ); } $fn = create_function('$a,$b', 'return "
  • $b) ) . "\\" rel=\\"tag\\">" . $a . "
  • \n";'); $array = array_map($fn, $array, array_keys($array)); $out = '
      ' . implode('', $array) . '
    '; return $out; } }