Index: footer.php =================================================================== --- footer.php (revision 121) +++ footer.php (working copy) @@ -1,8 +1,21 @@ +

+ Habari + Charcoal themeAtom + Entries and Atom + Comments +

+ footer(); ?> + + +
+
+
+
+ + + + + Index: header.php =================================================================== --- header.php (revision 121) +++ header.php (working copy) @@ -1,57 +1,56 @@ -<?php Options::out( 'title' ) ?><?php if($request->display_entry && isset($post)) { echo " :: {$post->title}"; } ?> - - - - - - - -header(); ?> -'); ?> - + <?php Options::out( 'title' ) ?><?php if($request->display_entry && isset($post)) { echo " :: {$post->title}"; } ?> + + + + + + + + header(); ?> + '); ?>
-
-
- -
-
-
-
-
-
-
- +
+
+ -
-
-
-
-
-
-
-
- - +
+ \ No newline at end of file Index: page.single.php =================================================================== --- page.single.php (revision 121) +++ page.single.php (working copy) @@ -28,7 +28,7 @@
-comments->moderated->count ) { foreach ( $post->comments->moderated as $comment ) { $class= '"post-comment'; @@ -52,12 +52,4 @@ -
-
-
-
-
-
-
- - + Index: style.css =================================================================== --- style.css (revision 121) +++ style.css (working copy) @@ -81,7 +81,8 @@ } p { - margin: 0px; + margin: 0px 0px 10px; + line-height: 130%; } /*-------------------------------------The upper part of the page----------------*/ @@ -144,7 +145,7 @@ height:48px; } - + #navbar ul li { padding: 3px 0px 0px 0px; float: left; @@ -162,7 +163,7 @@ font-weight: normal; border: none; display: block; - + } #navbar ul li a:hover { @@ -204,10 +205,7 @@ background: url(images/paperclip.png) top left no-repeat; } -.post-alt { - min-height: 153px; - padding-left: 100px; - padding-top: 60px; +.post.alt { background: none; } .post-tags { @@ -229,7 +227,7 @@ } .post-title { - + } .post-sup { @@ -304,7 +302,7 @@ width: 200px; height: 20px; text-align: center; - + } #search #search-btn { @@ -319,20 +317,20 @@ #feeds { height: 92px; padding: 0px 80px 5px 35px; - + } #feeds img { border: none; margin-right: 10px; vertical-align: top; - + } #feeds a { text-decoration: none; padding-bottom: 2px; - + } #feeds span { @@ -428,11 +426,11 @@ } .prev-post { - + } .prev-post-title { - + } .prev-post-excerpt { @@ -515,7 +513,7 @@ } .post-comment-commentor { - + } .post-comment-body { @@ -558,7 +556,7 @@ #comment-form p{ margin-bottom:5px; - + } #comment-form p input{ color: #666666;} Index: theme.php =================================================================== --- theme.php (revision 121) +++ theme.php (working copy) @@ -1,34 +1,57 @@ -assign('show_title_image',true); //Set to true to show the title image, false to display the title text. - $this->assign('home_label','Blog'); //Set to whatever you want your fist tab text to be. - $this->assign('show_entry_paperclip', true); //Set to true to show the paperclip graphic in posts, false to hide it. - $this->assign('show_page_paperclip', false); //Set to true to show the paperclip graphic in pages, false to hide it. - $this->assign('show_powered', true); //Set to true to show the "powered by Habari" graphic in the sidebar, false to hide it. - - + //Set to true to show the title image, false to display the title text. + const SHOW_TITLE_IMAGE = true; + + //Set to whatever you want your fist tab text to be. + const HOME_LABEL = 'Blog'; + + //Set to true to show the paperclip graphic in posts, false to hide it. + const SHOW_ENTRY_PAPERCLIP = true; + + //Set to true to show the paperclip graphic in pages, false to hide it. + const SHOW_PAGE_PAPERCLIP = false; + + //Set to true to show the "powered by Habari" graphic in the sidebar, false to hide it. + const SHOW_POWERED = true; + + /** + * Execute on theme init to apply these filters to output + */ + public function action_init_theme() + { + // Apply Format::autop() to post content... + Format::apply( 'autop', 'post_content_out' ); + // Apply Format::autop() to comment content... + Format::apply( 'autop', 'comment_content_out' ); + // Apply Format::nice_date() to post date... + Format::apply( 'nice_date', 'post_pubdate_out', 'F j, Y g:ia' ); + // Apply Format::nice_date() to comment date... + Format::apply( 'nice_date', 'comment_date', 'F j, Y g:ia' ); + // Truncate content excerpt at "more" or 56 characters... + Format::apply_with_hook_params( 'more', 'post_content_excerpt', '',56, 1 ); + } + + /** + * Add some variables to the template output + */ + public function add_template_vars() + { + // Use theme options to set values that can be used directly in the templates + // Don't check for constant values in the template code itself + $this->assign('show_title_image', self::SHOW_TITLE_IMAGE); + $this->assign('home_label', self::HOME_LABEL); + $this->assign('show_entry_paperclip', self::SHOW_ENTRY_PAPERCLIP); + $this->assign('show_page_paperclip', self::SHOW_PAGE_PAPERCLIP); + $this->assign('show_powered', self::SHOW_POWERED); + + $this->assign('post_class', 'post' . ( ! self::SHOW_ENTRY_PAPERCLIP ? ' alt' : '' ) ); + if( !$this->template_engine->assigned( 'pages' ) ) { $this->assign('pages', Posts::get( array( 'content_type' => 'page', 'status' => Post::status('published'), 'nolimit' => 1 ) ) ); } @@ -38,46 +61,60 @@ if( !$this->template_engine->assigned( 'page' ) ) { $this->assign('page', isset( $page ) ? $page : 1 ); } - + + $this->assign( 'post_id', ( isset($this->post) && $this->post->content_type == Post::type('page') ) ? $this->post->id : 0 ); + parent::add_template_vars(); } - public function filter_theme_call_header( $return,$theme ) + /** + * Provide links to the next and previous pages if they exist + * + * @param Theme $theme This object + * @param integer $currentpage The number of the current page + * @param integer $totalpages The total number of pages in this set + * @return string HTML with links to the next and previous pages + */ + public function theme_prevnext($theme, $currentpage, $totalpages) { - if ( User::identify() != FALSE ) { - Stack::add( 'template_header_javascript', Site::get_url('scripts') . '/jquery.js', 'jquery' ); - } - return $return; - } - - - public function theme_prevnext($theme,$currentpage, $totalpages){ - $out=''; - if ( $currentpage > $totalpages ) { + if ( $currentpage > $totalpages ) { $currentpage= $totalpages; } else if ( $currentpage < 1 ) { $currentpage= 1; } - - if ($currentpage < $totalpages){ - $out.='Older Posts';} - if ($currentpage > 1){ - $out.='Newer Posts';} + + if ($currentpage < $totalpages) { + $out.='Older Posts'; + } + if ($currentpage > 1) { + $out.='Newer Posts'; + } echo $out; - } - - public function filter_post_tags_out($return){ - // removes the 'and' and the commas from the tag list - return str_replace('and',null,str_replace(',',null,$return)); - + + /** + * 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 . "";'); + $array = array_map($fn, $array, array_keys($array)); + $out = implode(' ', $array); + return $out; } - - public function theme_post_comments_link($theme, $post,$zero,$one,$more){ + + public function theme_post_comments_link($theme, $post, $zero, $one, $more) + { $c=$post->comments->approved->count; - switch ($c){ + switch ($c) { case '0': return $zero; break; @@ -87,13 +124,12 @@ default : return str_replace('%s',$c,$more); } - + } - - public function filter_post_content_excerpt($return){ + + public function filter_post_content_excerpt($return) + { return strip_tags($return); } - - } ?>