diff -r 0d9a58d2c515 -r 0d28b7c10758 web/wp-content/themes/thematic/library/extensions/content-extensions.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/wp-content/themes/thematic/library/extensions/content-extensions.php Fri Mar 12 13:29:04 2010 +0000 @@ -0,0 +1,804 @@ +« '; + $content .= get_the_title($post->post_parent); + $content .= ''; + } elseif (is_author()) { + $content .= '

'; + $author = get_the_author(); + $content .= __('Author Archives: ', 'thematic'); + $content .= ''; + $content .= $author; + $content .= '

'; + } elseif (is_category()) { + $content .= '

'; + $content .= __('Category Archives:', 'thematic'); + $content .= ' '; + $content .= single_cat_title('', FALSE); + $content .= '

' . "\n"; + $content .= '
'; + if ( !(''== category_description()) ) : $content .= apply_filters('archive_meta', category_description()); endif; + $content .= '
'; + } elseif (is_search()) { + $content .= '

'; + $content .= __('Search Results for:', 'thematic'); + $content .= ' '; + $content .= wp_specialchars(stripslashes($_GET['s']), true); + $content .= '

'; + } elseif (is_tag()) { + $content .= '

'; + $content .= __('Tag Archives:', 'thematic'); + $content .= ' '; + $content .= __(thematic_tag_query()); + $content .= '

'; + } elseif (is_day()) { + $content .= '

'; + $content .= sprintf(__('Daily Archives: %s', 'thematic'), get_the_time(get_option('date_format'))); + $content .= '

'; + } elseif (is_month()) { + $content .= '

'; + $content .= sprintf(__('Monthly Archives: %s', 'thematic'), get_the_time('F Y')); + $content .= '

'; + } elseif (is_year()) { + $content .= '

'; + $content .= sprintf(__('Yearly Archives: %s', 'thematic'), get_the_time('Y')); + $content .= '

'; + } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { + $content .= '

'; + $content .= __('Blog Archives', 'thematic'); + $content .= '

'; + } + $content .= "\n"; + echo apply_filters('thematic_page_title', $content); +} + +// Action to create the above navigation +function thematic_nav_above() { + if (is_single()) { ?> + + + + + + + + + +
+ +
+ + +
+ +
+ + + +
+ +
+ + +
+ +
+ + + +
+ +
+ + +
+ +
+ + + +
+ +
+ + + ' .__('Pages:', 'thematic') . '&after=
') ?> +
+ + + + +
+ +
+ + + ' .__('Pages:', 'thematic') . '&after=
') ?> +
+ + + + +
+ +
+ + +
+ +
+ + + +
+ +
+ + +
+ +
+ + post_type == 'page' || is_404()) { + $postheader = thematic_postheader_posttitle(); + } else { + $postheader = thematic_postheader_posttitle() . thematic_postheader_postmeta(); + } + + echo apply_filters( 'thematic_postheader', $postheader ); // Filter to override default post header +} // end thematic_postheader + +// Create the post edit link +function thematic_postheader_posteditlink() { + + global $id; + + $posteditlink = ''; + $posteditlink .= __('Edit', 'thematic') . ''; + return apply_filters('thematic_postheader_posteditlink',$posteditlink); + +} // end thematic_postheader_posteditlink + +// Create post title +function thematic_postheader_posttitle() { + + if (is_single() || is_page()) { + $posttitle = '

' . get_the_title() . "

\n"; + } elseif (is_404()) { + $posttitle = '

' . __('Not Found', 'thematic') . "

\n"; + } else { + $posttitle = '

'; + $posttitle .= get_the_title(); + $posttitle .= "

\n"; + } + return apply_filters('thematic_postheader_posttitle',$posttitle); + +} // end thematic_postheader_posttitle + +// Create post meta +function thematic_postheader_postmeta() { + + $postmeta = '
'; + $postmeta .= thematic_postmeta_authorlink(); + $postmeta .= ' | '; + $postmeta .= thematic_postmeta_entrydate(); + + $postmeta .= thematic_postmeta_editlink(); + + $postmeta .= "
\n"; + + return apply_filters('thematic_postheader_postmeta',$postmeta); + +} // end thematic_postheader_postmeta + +// Create author link for post meta +function thematic_postmeta_authorlink() { + + global $authordata; + + $authorlink = '' . __('By ', 'thematic') . ''; + $authorlink .= ''. ''; + $authorlink .= get_the_author(); + $authorlink .= ''; + + return apply_filters('thematic_post_meta_authorlink', $authorlink); + +} // end thematic_postmeta_authorlink() + +// Create entry date for post meta +function thematic_postmeta_entrydate() { + + $entrydate = '' . __('Published: ', 'thematic') . ''; + $entrydate .= ''; + $entrydate .= get_the_time(thematic_time_display()); + $entrydate .= ''; + + return apply_filters('thematic_post_meta_entrydate', $entrydate); + +} // end thematic_postmeta_entrydate() + +// Create edit link for post meta +function thematic_postmeta_editlink() { + + // Display edit link + if (current_user_can('edit_posts')) { + $editlink = ' | ' . '' . thematic_postheader_posteditlink() . ''; + return apply_filters('thematic_post_meta_editlink', $editlink); + } + +} + +//creates the content +function thematic_content() { + + if (is_home() || is_front_page()) { + $content = 'full'; + } elseif (is_single()) { + $content = 'full'; + } elseif (is_tag()) { + $content = 'excerpt'; + } elseif (is_search()) { + $content = 'excerpt'; + } elseif (is_category()) { + $content = 'excerpt'; + } elseif (is_author()) { + $content = 'excerpt'; + } elseif (is_archive()) { + $content = 'excerpt'; + } + + $content = apply_filters('thematic_content', $content); + + if ( strtolower($content) == 'full' ) { + $post = get_the_content(more_text()); + $post = apply_filters('the_content', $post); + $post = str_replace(']]>', ']]>', $post); + } elseif ( strtolower($content) == 'excerpt') { + $post = get_the_excerpt(); + } elseif ( strtolower($content) == 'none') { + } else { + $post = get_the_content(more_text()); + $post = apply_filters('the_content', $post); + $post = str_replace(']]>', ']]>', $post); + } + echo apply_filters('thematic_post', $post); +} // end thematic_content + +// Functions that hook into thematic_archives() + + // Open .archives-page + function thematic_archivesopen() { ?> + + + + +
+

+
+ +
+
+ + +
+
+ »', 'thematic').''; + return apply_filters('more_text', $content); +} // end more_text + + +// creates the $more_link_text for the_content +function list_bookmarks_args() { + $content = 'title_before=

&title_after=

'; + return apply_filters('list_bookmarks_args', $content); +} // end more_text + + +// Information in Post Footer +function thematic_postfooter() { + global $id, $post; + + if ($post->post_type == 'page' && current_user_can('edit_posts')) { /* For logged-in "page" search results */ + $postfooter = '
' . thematic_postfooter_posteditlink(); + $postfooter .= "
\n"; + } elseif ($post->post_type == 'page') { /* For logged-out "page" search results */ + $postfooter = ''; + } else { + if (is_single()) { + $postfooter = '
' . thematic_postfooter_postcategory() . thematic_postfooter_posttags() . thematic_postfooter_postconnect(); + } else { + $postfooter = '
' . thematic_postfooter_postcategory() . thematic_postfooter_posttags() . thematic_postfooter_postcomments(); + } + $postfooter .= "
\n"; + } + + // Put it on the screen + echo apply_filters( 'thematic_postfooter', $postfooter ); // Filter to override default post footer +} // end thematic_postfooter + +// Create the post edit link +function thematic_postfooter_posteditlink() { + + global $id; + + $posteditlink = ''; + $posteditlink .= __('Edit', 'thematic') . ''; + return apply_filters('thematic_postfooter_posteditlink',$posteditlink); + +} // end thematic_postfooter_posteditlink + +// Create post category +function thematic_postfooter_postcategory() { + + $postcategory = ''; + if (is_single()) { + $postcategory .= __('This entry was posted in ', 'thematic') . get_the_category_list(', '); + $postcategory .= ''; + } elseif ( is_category() && $cats_meow = thematic_cats_meow(', ') ) { /* Returns categories other than the one queried */ + $postcategory .= __('Also posted in ', 'thematic') . $cats_meow; + $postcategory .= ' |'; + } else { + $postcategory .= __('Posted in ', 'thematic') . get_the_category_list(', '); + $postcategory .= ' |'; + } + return apply_filters('thematic_postfooter_postcategory',$postcategory); + +} // end thematic_postfooter_postcategory + +// Create post tags +function thematic_postfooter_posttags() { + + if (is_single()) { + $tagtext = __(' and tagged', 'thematic'); + $posttags = get_the_tag_list(" $tagtext ",', ',''); + } elseif ( is_tag() && $tag_ur_it = thematic_tag_ur_it(', ') ) { /* Returns tags other than the one queried */ + $posttags = '' . __(' Also tagged ', 'thematic') . $tag_ur_it . ' |'; + } else { + $tagtext = __('Tagged', 'thematic'); + $posttags = get_the_tag_list(" $tagtext ",', ',' |'); + } + return apply_filters('thematic_postfooter_posttags',$posttags); + +} // end thematic_postfooter_posttags + +// Create comments link and edit link +function thematic_postfooter_postcomments() { + if (comments_open()) { + $postcommentnumber = get_comments_number(); + if ($postcommentnumber > '1') { + $postcomments = ' '; + $postcomments .= get_comments_number() . __(' Comments', 'thematic') . ''; + } elseif ($postcommentnumber == '1') { + $postcomments = ' '; + $postcomments .= get_comments_number() . __(' Comment', 'thematic') . ''; + } elseif ($postcommentnumber == '0') { + $postcomments = ' '; + $postcomments .= __('Leave a comment', 'thematic') . ''; + } + } else { + $postcomments = ' ' . __('Comments closed', 'thematic') .''; + } + // Display edit link + if (current_user_can('edit_posts')) { + $postcomments .= ' | ' . thematic_postfooter_posteditlink(); + } + return apply_filters('thematic_postfooter_postcomments',$postcomments); + +} // end thematic_postfooter_postcomments + +// Create permalink, comments link, and RSS on single posts +function thematic_postfooter_postconnect() { + + $postconnect = __('. Bookmark the ', 'thematic') . ''; + $postconnect .= __('permalink', 'thematic') . '.'; + if ((comments_open()) && (pings_open())) { /* Comments are open */ + $postconnect .= ' ' . __('Post a comment', 'thematic') . ''; + $postconnect .= __(' or leave a trackback: ', 'thematic'); + $postconnect .= '' . __('Trackback URL', 'thematic') . '.'; + } elseif (!(comments_open()) && (pings_open())) { /* Only trackbacks are open */ + $postconnect .= __(' Comments are closed, but you can leave a trackback: ', 'thematic'); + $postconnect .= '' . __('Trackback URL', 'thematic') . '.'; + } elseif ((comments_open()) && !(pings_open())) { /* Only comments open */ + $postconnect .= __(' Trackbacks are closed, but you can ', 'thematic'); + $postconnect .= '' . __('post a comment', 'thematic') . '.'; + } elseif (!(comments_open()) && !(pings_open())) { /* Comments and trackbacks closed */ + $postconnect .= __(' Both comments and trackbacks are currently closed.', 'thematic'); + } + // Display edit link on single posts + if (current_user_can('edit_posts')) { + $postconnect .= ' ' . thematic_postfooter_posteditlink(); + } + return apply_filters('thematic_postfooter_postconnect',$postconnect); + +} // end thematic_postfooter_postconnect + +// Action to create the below navigation +function thematic_nav_below() { + if (is_single()) { ?> + + + + + + + + '%link', + 'link' => '« %title', + 'in_same_cat' => FALSE, + 'excluded_categories' => ''); + $args = apply_filters('thematic_previous_post_link_args', $args ); + previous_post_link($args['format'], $args['link'], $args['in_same_cat'], $args['excluded_categories']); +} // end thematic_previous_post_link + + +// creates the next_post_link +function thematic_next_post_link() { + $args = array ('format' => '%link', + 'link' => '%title »', + 'in_same_cat' => FALSE, + 'excluded_categories' => ''); + $args = apply_filters('thematic_next_post_link_args', $args ); + next_post_link($args['format'], $args['link'], $args['in_same_cat'], $args['excluded_categories']); +} // end thematic_next_post_link + + +// Produces an avatar image with the hCard-compliant photo class for author info +function thematic_author_info_avatar() { + global $wp_query; $curauth = $wp_query->get_queried_object(); + $email = $curauth->user_email; + $avatar = str_replace( "class='avatar", "class='photo avatar", get_avatar("$email") ); + echo $avatar; +} // end thematic_author_info_avatar + + +// For category lists on category archives: Returns other categories except the current one (redundant) +function thematic_cats_meow($glue) { + $current_cat = single_cat_title( '', false ); + $separator = "\n"; + $cats = explode( $separator, get_the_category_list($separator) ); + foreach ( $cats as $i => $str ) { + if ( strpos( $str, ">$current_cat<" ) > 0) { + unset($cats[$i]); + break; + } + } + if ( empty($cats) ) + return false; + + return trim(join( $glue, $cats )); +} // end thematic_cats_meow + + +// For tag lists on tag archives: Returns other tags except the current one (redundant) +function thematic_tag_ur_it($glue) { + $current_tag = single_tag_title( '', '', false ); + $separator = "\n"; + $tags = explode( $separator, get_the_tag_list( "", "$separator", "" ) ); + foreach ( $tags as $i => $str ) { + if ( strpos( $str, ">$current_tag<" ) > 0 ) { + unset($tags[$i]); + break; + } + } + if ( empty($tags) ) + return false; + + return trim(join( $glue, $tags )); +} // end thematic_tag_ur_it + + + +?> \ No newline at end of file