Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 88 lines (77 sloc) 4.443 kb
1ad92c1 ComicPress put back on github.
Philip M. Hofer (Frumph) authored
1 <?php
2 /**
3 * Syndication - Feed Count Capturing & adding comic to feed.
4 * Author: Philip M. Hofer (Frumph)
5 * In Testing
6 */
7
8 function comicpress_the_title_rss($title = '') {
9 switch ($count = get_comments_number()) {
10 case 0:
11 $title_pattern = __('%s (No Comments)', 'comicpress');
12 break;
13 case 1:
14 $title_pattern = __('%s (1 Comment)', 'comicpress');
15 break;
16 default:
17 $title_pattern = sprintf(__('%%s (%d Comments)', 'comicpress'), $count);
18 break;
19 }
20
21 return sprintf($title_pattern, $title);
22 }
23
24 /**
25 * Handle making changes to ComicPress before the export process starts.
26 */
27 function comicpress_export_wp() {
28 remove_filter('the_title_rss', 'comicpress_the_title_rss');
29 }
30
31 if (comicpress_themeinfo('enable_comment_count_in_rss')) {
32 add_filter('the_title_rss', 'comicpress_the_title_rss');
33 // Remove the title count from being in the export.
34 add_action('export_wp', 'comicpress_export_wp');
35 }
36
37 //Insert the comic image into the RSS feed
38 if (!function_exists('comicpress_comic_feed')) {
39 function comicpress_comic_feed() {
c6fbf2f Philip M. Hofer (Frumph) ComicPress 2.9.4 for WordPress 3.4
authored
40 global $wp_query, $post, $comiccat;
7e01153 fix facebook code, membersonly code rewrite of archive.php
Philip M. Hofer (Frumph) authored
41 $output = '<p>';
c6fbf2f Philip M. Hofer (Frumph) ComicPress 2.9.4 for WordPress 3.4
authored
42 if ($wp_query->query_vars['cat'] == $comiccat ) {
43 $output .= '<a href="'.get_permalink().'" title="'.comicpress_the_hovertext($post).'">'.comicpress_display_comic_thumbnail('comic',$post,true).'</a>';
44 } else {
45 $output .= '<a href="'.get_permalink().'" title="'.comicpress_the_hovertext($post).'">'.comicpress_display_comic_thumbnail('rss',$post,true).'</a>';
46 }
7e01153 fix facebook code, membersonly code rewrite of archive.php
Philip M. Hofer (Frumph) authored
47 $output .= '</p>';
48 return apply_filters('comicpress_comic_feed', $output);
1ad92c1 ComicPress put back on github.
Philip M. Hofer (Frumph) authored
49 }
50 }
51
52 // removed the comicpress_in_comic_category so that if it has a post-image it will add it to the rss feed (else rss comic thumb)
53 if (!function_exists('comicpress_insert_comic_feed')) {
54 function comicpress_insert_comic_feed($content) {
55 global $wp_query, $post;
7e01153 fix facebook code, membersonly code rewrite of archive.php
Philip M. Hofer (Frumph) authored
56 $category = get_the_category($post->ID);
57 if (is_feed() && comicpress_in_comic_category($category[0]->cat_ID)) {
58 echo comicpress_comic_feed();
1ad92c1 ComicPress put back on github.
Philip M. Hofer (Frumph) authored
59 }
7e01153 fix facebook code, membersonly code rewrite of archive.php
Philip M. Hofer (Frumph) authored
60 return apply_filters('comicpress_insert_comic_feed', $content);
1ad92c1 ComicPress put back on github.
Philip M. Hofer (Frumph) authored
61 }
62 }
63
64 add_filter('the_content','comicpress_insert_comic_feed');
65 add_filter('the_excerpt','comicpress_insert_comic_feed');
66
67 // Using the_content and the_excerpt instead of the_content_rss cause it doesn't work properly otherwise
7e01153 fix facebook code, membersonly code rewrite of archive.php
Philip M. Hofer (Frumph) authored
68 /*
69 add_filter('comicpress_comic_feed', 'comicpress_test_feed');
70
71 function comicpress_test_feed($output) {
72 $output .= '<table width="500" style="border: none;" cellpadding="0" cellpadding="0">';
73 $output .= '<tr>';
74 $output .= '<td style="border: none;"><img src="http://www.zfcomics.com/graphics/footer/top.jpg" alt="" style="width: 500px; height:72px; border: none;" /></td>';
75 $output .= '</tr>';
76 $output .= '<tr>';
77 $output .= '<td><img src="http://www.zfcomics.com/graphics/footer/1.jpg" alt="" style="height:39px; width:25px; border: none;" /><a href="http://www.zfcomics.com"><img src="http://www.zfcomics.com/graphics/footer/read.jpg" alt="" height="39" width="113" padding="0" border="0" /></a><a href="http://www.zfcomics.com/store"><img src="http://www.zfcomics.com/graphics/footer/store.jpg" alt="" width="57" height="39" padding="0" border="0" /></a><a href="http://www.facebook.com/dgriff13"><img src="http://www.zfcomics.com/graphics/footer/fb.jpg" alt="" width="85" height="39" padding="0" border="0" /></a><a href="http://www.twitter.com/dgriff13"><img src="http://www.zfcomics.com/graphics/footer/twitter.jpg" alt="" width="67" height="39"padding="0" border="0" /></a><img src="http://www.zfcomics.com/graphics/footer/2.jpg" alt="" width="61" height="39" padding="0" border="0" /><a href="http://www.facebook.com/dgriff13"><img src="http://www.zfcomics.com/graphics/footer/FBicon.jpg" alt="" width="36" height="39" padding="0" border="0" /></a><a href="http://www.twitter.com/dgriff13"><img src="http://www.zfcomics.com/graphics/footer/twittericon.jpg" alt="" width="37" height="39" padding="0" border="0" /></a><img src="http://www.zfcomics.com/graphics/footer/3.jpg" alt="" style="width: 18px; height:39px; border: none;" /></td>';
78 $output .= '</tr>';
79 $output .= '<tr>';
80 $output .= '<td><img src="http://www.zfcomics.com/graphics/footer/4.jpg" alt="" width="280" height="156" padding="0" border="0" /><a href="http://www.zfcomics.com/store"><img src="http://www.zfcomics.com/graphics/footer/book.jpg" alt="" width="220" height="156" padding="0" border="0" /></a></td>';
81 $output .= '</tr>';
82 $output .= '</table>';
83 return $output;
84 }
85 */
1ad92c1 ComicPress put back on github.
Philip M. Hofer (Frumph) authored
86
87 ?>
Something went wrong with that request. Please try again.