Advertisement
janoulle

georgia theme.php

Aug 10th, 2010
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.91 KB | None | 0 0
  1. <?php
  2.  
  3. define( 'THEME_CLASS', 'Unknown' );
  4.  
  5. class Unknown extends Theme
  6. {
  7.  
  8.     public function action_init_theme()
  9.     {
  10.         // Apply Format::autop() to post content...
  11.         Format::apply( 'autop', 'post_content_out' );
  12.         // Apply Format::autop() to comment content...
  13.         Format::apply( 'autop', 'comment_content_out' );
  14.         // Apply Format::tag_and_list() to post tags...
  15.         Format::apply( 'tag_and_list', 'post_tags_out' );
  16.         // Apply Format::nice_date() to post date...
  17.         Format::apply( 'nice_date', 'post_pubdate_out', 'F jS, Y' );
  18.         // Put out a reduced size version of the post when there are multiple posts displayed
  19.         Format::apply_with_hook_params( 'more', 'post_content_out', _t('Read More') . ' >> ' , 100, 1 );
  20.     }
  21.  
  22.     public function add_template_vars()
  23.     {
  24.         $this->assign('recent_comments', Comments::get( array('limit'=>5, 'status'=>Comment::STATUS_APPROVED, 'orderby'=>'date DESC' ) ) );
  25.         $this->assign('recent_posts', Posts::get( array('limit'=>5, 'orderby'=>'pubdate DESC', 'content_type'=>1, 'status'=>2 ) ) );
  26.        
  27.         if ( '' != Controller::get_var('tag') ) {
  28.              $tag_text= DB::get_value('SELECT tag_text FROM {tags} WHERE tag_slug=?', array( Controller::get_var('tag') ) );
  29.              $this->assign('tag_text', $tag_text);
  30.         }
  31.         if( !$this->template_engine->assigned( 'pages' ) ) {
  32.             $this->assign('pages', Posts::get( array( 'content_type' => 'page', 'status' => Post::status('published'), 'nolimit' => 1 ) ) );
  33.         }
  34.         if( !$this->template_engine->assigned( 'user' ) ) {
  35.             $this->assign('user', User::identify() );
  36.         }
  37.         if( !$this->template_engine->assigned( 'page' ) ) {
  38.             $this->assign('page', isset( $page ) ? $page : 1 );
  39.         }
  40.         parent::add_template_vars();
  41.  
  42.     }
  43.  
  44.     public function filter_theme_call_header( $return, $theme )
  45.     {
  46.         if ( User::identify() != FALSE ) {
  47.             Stack::add( 'template_header_javascript', Site::get_url('scripts') . '/jquery.js', 'jquery' );
  48.         }
  49.         return $return;
  50.     }
  51.  
  52. }
  53.  
  54. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement