From 5c1e3c5794d765b2ae55d2cee730e59ec7fb70c5 Mon Sep 17 00:00:00 2001 From: "Philip M. Hofer (Frumph)" Date: Fri, 13 Nov 2009 08:00:25 -0800 Subject: [PATCH] 2.8.2.6 fresh upload Signed-off-by: Philip M. Hofer (Frumph) --- 404.php | 18 + README | 18 + archive-comic-calendar.php | 162 ++ archive-comic-month.php | 45 + archive-comic-storyline-thumbs.php | 75 + archive-comic-storyline.php | 77 + archive-comic-year.php | 51 + archive-comic.php | 39 + archive.php | 155 ++ archives.php | 24 + author.php | 70 + blog.php | 54 + buystrip.php | 116 + chrome_style.css | 19 + classes/ComicPressDBInterface.inc | 111 + classes/ComicPressNavigation.inc | 68 + classes/ComicPressStoryline.inc | 589 ++++++ comicpress-config.php | 33 + comicpress-options-config.php | 294 +++ comicpress-options.php | 117 ++ comments.php | 134 ++ footer.php | 29 + functions.php | 888 ++++++++ functions/adminnotes.php | 19 + functions/avatars.php | 114 + functions/classes.php | 138 ++ functions/comment-functions.php | 231 ++ functions/custom-image-header.php | 73 + functions/displayblogpost.php | 72 + functions/displaycomic.php | 47 + functions/displaycomicpost.php | 74 + functions/membersonly.php | 122 ++ functions/moods.php | 117 ++ functions/multicomics.php | 24 + functions/pagination.php | 16 + functions/relatedcomics.php | 72 + functions/relatedposts.php | 74 + functions/searchcustomfields.php | 58 + functions/wp-pagenavi.php | 165 ++ gecko_style.css | 29 + header.php | 61 + ie_style.css | 13 + image.php | 66 + images/1.gif | Bin 0 -> 329 bytes images/2.gif | Bin 0 -> 321 bytes images/2a.gif | Bin 0 -> 345 bytes images/3.gif | Bin 0 -> 288 bytes images/3a.gif | Bin 0 -> 300 bytes images/4.gif | Bin 0 -> 270 bytes .../comic/AugustGravatar_PajamaForest.jpg | Bin 0 -> 2602 bytes images/avatars/comic/EA-Avatar-01.jpg | Bin 0 -> 2088 bytes images/avatars/comic/EA-Avatar-02.jpg | Bin 0 -> 1869 bytes images/avatars/comic/ali-avatar.jpg | Bin 0 -> 2459 bytes images/avatars/comic/angelic_dude.jpg | Bin 0 -> 1574 bytes images/avatars/comic/appleofdiscord.jpg | Bin 0 -> 2542 bytes images/avatars/comic/artiste-ava-64.jpg | Bin 0 -> 2568 bytes images/avatars/comic/av_bva_cp28_64_john.jpg | Bin 0 -> 2983 bytes images/avatars/comic/ava.jpg | Bin 0 -> 3117 bytes images/avatars/comic/cassiegrav.jpg | Bin 0 -> 2044 bytes images/avatars/comic/class.jpg | Bin 0 -> 2040 bytes images/avatars/comic/cp-av-domChibi.jpg | Bin 0 -> 2819 bytes images/avatars/comic/cp-av-katoChibi.jpg | Bin 0 -> 2298 bytes images/avatars/comic/cp2.8ablue.jpg | Bin 0 -> 2855 bytes images/avatars/comic/cp2.8ui.jpg | Bin 0 -> 1925 bytes images/avatars/comic/dara-avatar.jpg | Bin 0 -> 2877 bytes images/avatars/comic/eben07-01.jpg | Bin 0 -> 1963 bytes images/avatars/comic/eben07-03.jpg | Bin 0 -> 2777 bytes images/avatars/comic/gravatar_pack_imy.jpg | Bin 0 -> 2618 bytes images/avatars/comic/lemonincavatar.jpg | Bin 0 -> 2408 bytes images/avatars/comic/max.jpg | Bin 0 -> 1418 bytes images/avatars/comic/monkey.jpg | Bin 0 -> 2772 bytes images/avatars/comic/ngav1.jpg | Bin 0 -> 2548 bytes images/avatars/comic/reederrabbitgrav.jpg | Bin 0 -> 4081 bytes images/avatars/comic/rld_avatar.jpg | Bin 0 -> 1946 bytes images/avatars/comic/unrehearsedriot.jpg | Bin 0 -> 4970 bytes images/avatars/default/rascal.png | Bin 0 -> 8631 bytes images/bubble.png | Bin 0 -> 2206 bytes images/buynow_paypal.png | Bin 0 -> 4172 bytes images/buythis.png | Bin 0 -> 3131 bytes images/cal/default.png | Bin 0 -> 8776 bytes images/cal/default/april.jpg | Bin 0 -> 19346 bytes images/cal/default/august.jpg | Bin 0 -> 16466 bytes images/cal/default/december.jpg | Bin 0 -> 11488 bytes images/cal/default/february.jpg | Bin 0 -> 9657 bytes images/cal/default/january.jpg | Bin 0 -> 16027 bytes images/cal/default/july.jpg | Bin 0 -> 14215 bytes images/cal/default/june.jpg | Bin 0 -> 14337 bytes images/cal/default/march.jpg | Bin 0 -> 7363 bytes images/cal/default/may.jpg | Bin 0 -> 13668 bytes images/cal/default/november.jpg | Bin 0 -> 12427 bytes images/cal/default/october.jpg | Bin 0 -> 21323 bytes images/cal/default/september.jpg | Bin 0 -> 15650 bytes images/calendar.png | Bin 0 -> 1096 bytes images/comicpress-icon.png | Bin 0 -> 905 bytes images/comicpress-rascal.png | Bin 0 -> 20466 bytes images/header-blank.png | Bin 0 -> 746 bytes images/moods/default/anger.png | Bin 0 -> 7872 bytes images/moods/default/angry.png | Bin 0 -> 10897 bytes images/moods/default/awe.png | Bin 0 -> 10251 bytes images/moods/default/burn.png | Bin 0 -> 7448 bytes images/moods/default/confused.png | Bin 0 -> 7079 bytes images/moods/default/cool.png | Bin 0 -> 7842 bytes images/moods/default/coolglare.png | Bin 0 -> 10318 bytes images/moods/default/crazy.png | Bin 0 -> 9855 bytes images/moods/default/cry.png | Bin 0 -> 7541 bytes images/moods/default/crying.png | Bin 0 -> 9771 bytes images/moods/default/dizzy.png | Bin 0 -> 10401 bytes images/moods/default/embarrass.png | Bin 0 -> 9686 bytes images/moods/default/fire.png | Bin 0 -> 7701 bytes images/moods/default/grimace.png | Bin 0 -> 8156 bytes images/moods/default/happy.png | Bin 0 -> 10407 bytes images/moods/default/love.png | Bin 0 -> 7849 bytes images/moods/default/lust.png | Bin 0 -> 10117 bytes images/moods/default/miao.png | Bin 0 -> 7124 bytes images/moods/default/morequestions.png | Bin 0 -> 7678 bytes images/moods/default/music.png | Bin 0 -> 10094 bytes images/moods/default/ninja.png | Bin 0 -> 9212 bytes images/moods/default/normal.png | Bin 0 -> 9840 bytes images/moods/default/ooo.png | Bin 0 -> 10309 bytes images/moods/default/prettiness.png | Bin 0 -> 8554 bytes images/moods/default/pwnburn.png | Bin 0 -> 6262 bytes images/moods/default/question.png | Bin 0 -> 9689 bytes images/moods/default/shout.png | Bin 0 -> 7454 bytes images/moods/default/shy.png | Bin 0 -> 9848 bytes images/moods/default/silent.png | Bin 0 -> 10678 bytes images/moods/default/sleep.png | Bin 0 -> 9819 bytes images/moods/default/slobber.png | Bin 0 -> 7579 bytes images/moods/default/smile.png | Bin 0 -> 7596 bytes images/moods/default/spook.png | Bin 0 -> 6197 bytes images/moods/default/startle.png | Bin 0 -> 8210 bytes images/moods/default/surprise.png | Bin 0 -> 9041 bytes images/moods/default/sweat.png | Bin 0 -> 7157 bytes images/moods/default/tears.png | Bin 0 -> 10281 bytes images/moods/default/thirst.png | Bin 0 -> 7300 bytes images/moods/default/vomit.png | Bin 0 -> 7320 bytes images/nav/default/navstyle.css | 142 ++ images/nav/scifi/archive.png | Bin 0 -> 4027 bytes images/nav/scifi/buyprint.png | Bin 0 -> 3718 bytes images/nav/scifi/comments.png | Bin 0 -> 5185 bytes images/nav/scifi/first.png | Bin 0 -> 3955 bytes images/nav/scifi/last.png | Bin 0 -> 3930 bytes images/nav/scifi/navstyle.css | 134 ++ images/nav/scifi/next.png | Bin 0 -> 3594 bytes images/nav/scifi/nextchap.png | Bin 0 -> 4063 bytes images/nav/scifi/nextinchap.png | Bin 0 -> 5044 bytes images/nav/scifi/prev.png | Bin 0 -> 3625 bytes images/nav/scifi/prevchap.png | Bin 0 -> 4049 bytes images/nav/scifi/previnchap.png | Bin 0 -> 4977 bytes images/nav/scifi/random.png | Bin 0 -> 3548 bytes images/nav/silver/archive.png | Bin 0 -> 11862 bytes images/nav/silver/buyprint.png | Bin 0 -> 13473 bytes images/nav/silver/comments.png | Bin 0 -> 11539 bytes images/nav/silver/first.png | Bin 0 -> 8748 bytes images/nav/silver/last.png | Bin 0 -> 8650 bytes images/nav/silver/navstyle.css | 140 ++ images/nav/silver/next.png | Bin 0 -> 13120 bytes images/nav/silver/nextchap.png | Bin 0 -> 11291 bytes images/nav/silver/prev.png | Bin 0 -> 13109 bytes images/nav/silver/prevchap.png | Bin 0 -> 11275 bytes images/nav/silver/random.png | Bin 0 -> 14543 bytes images/options/3c.png | Bin 0 -> 1970 bytes images/options/3c2r.png | Bin 0 -> 1935 bytes images/options/blog.png | Bin 0 -> 4527 bytes images/options/comicpress_logo.png | Bin 0 -> 12759 bytes images/options/gn.png | Bin 0 -> 1847 bytes images/options/rgn.png | Bin 0 -> 1837 bytes images/options/standard.png | Bin 0 -> 1731 bytes images/options/v.png | Bin 0 -> 1773 bytes images/options/v3c.png | Bin 0 -> 2085 bytes images/paypal.png | Bin 0 -> 2768 bytes images/pingback.png | Bin 0 -> 1575 bytes images/trackback.png | Bin 0 -> 1575 bytes index.php | 126 ++ js/equalheight.js | 15 + js/ie6submenus.js | 14 + js/pre.js | 20 + js/scroll.js | 28 + js/tabbed/tabbed_pages.css | 63 + js/tabbed/tabbed_pages.js | 28 + js/tabbed/tabbed_pages_ie.css | 60 + js/tabbed/tabs_0.gif | Bin 0 -> 238 bytes js/tabbed/tabs_2.gif | Bin 0 -> 226 bytes lang/default.mo | Bin 0 -> 413 bytes lang/default.po | 1867 +++++++++++++++++ layout-foot.php | 26 + layout-head.php | 30 + links.php | 32 + lynx_style.css | 3 + members-blog.php | 28 + notie_style.css | 42 + ns4_style.css | 23 + opera_style.css | 20 + options/archivesearchoptions.php | 67 + options/buyprintoptions.php | 105 + options/customheaderoptions.php | 59 + options/generaloptions.php | 209 ++ options/indexoptions.php | 98 + options/membersoptions.php | 44 + options/menubaroptions.php | 101 + options/postoptions.php | 260 +++ options/themestyle.php | 52 + page.php | 24 + safari_style.css | 34 + screenshot.png | Bin 0 -> 42455 bytes search-transcript.php | 103 + search.php | 123 ++ searchform-transcript.php | 8 + searchform.php | 8 + sidebar-above.php | 5 + sidebar-blog.php | 5 + sidebar-comicleft.php | 5 + sidebar-comicright.php | 5 + sidebar-footer.php | 5 + sidebar-header.php | 5 + sidebar-left.php | 23 + sidebar-menubar.php | 11 + sidebar-over.php | 5 + sidebar-overblog.php | 5 + sidebar-right.php | 29 + sidebar-under.php | 5 + sidebar-underblog.php | 5 + single.php | 107 + style.css | 1510 +++++++++++++ swfobject/expressInstall.swf | Bin 0 -> 727 bytes swfobject/index.html | 28 + swfobject/index_dynamic.html | 17 + swfobject/src/expressInstall.as | 70 + swfobject/src/expressInstall.fla | Bin 0 -> 22016 bytes swfobject/src/swfobject.js | 777 +++++++ swfobject/swfobject.js | 4 + swfobject/test.swf | Bin 0 -> 7977 bytes test/widgets/GraphicalNavigationTest.php | 92 + widgets/archive-dropdown.php | 102 + widgets/bookmark.php | 151 ++ widgets/buythisprint.php | 64 + widgets/calendar.php | 99 + widgets/comicblogpost.php | 58 + widgets/comiccomments.php | 53 + widgets/comicdate.php | 59 + widgets/comictitle.php | 45 + widgets/control-panel.php | 87 + widgets/graphical-navigation-orig.php | 285 +++ widgets/graphical-navigation.php | 448 ++++ widgets/latestcomicjump.php | 63 + widgets/latestcomics.php | 70 + widgets/latestthumb.php | 68 + widgets/menubar.php | 131 ++ widgets/non-member.php | 57 + widgets/permalink.php | 57 + widgets/randomcomic.php | 68 + widgets/randompost.php | 67 + widgets/scheduledposts.php | 63 + widgets/searchtranscript.php | 53 + widgets/social.php | 95 + widgets/transcription.php | 62 + 255 files changed, 13930 insertions(+) create mode 100644 404.php create mode 100644 README create mode 100644 archive-comic-calendar.php create mode 100644 archive-comic-month.php create mode 100644 archive-comic-storyline-thumbs.php create mode 100644 archive-comic-storyline.php create mode 100644 archive-comic-year.php create mode 100644 archive-comic.php create mode 100644 archive.php create mode 100644 archives.php create mode 100644 author.php create mode 100644 blog.php create mode 100644 buystrip.php create mode 100644 chrome_style.css create mode 100644 classes/ComicPressDBInterface.inc create mode 100644 classes/ComicPressNavigation.inc create mode 100644 classes/ComicPressStoryline.inc create mode 100644 comicpress-config.php create mode 100644 comicpress-options-config.php create mode 100644 comicpress-options.php create mode 100644 comments.php create mode 100644 footer.php create mode 100644 functions.php create mode 100644 functions/adminnotes.php create mode 100644 functions/avatars.php create mode 100644 functions/classes.php create mode 100644 functions/comment-functions.php create mode 100644 functions/custom-image-header.php create mode 100644 functions/displayblogpost.php create mode 100644 functions/displaycomic.php create mode 100644 functions/displaycomicpost.php create mode 100644 functions/membersonly.php create mode 100644 functions/moods.php create mode 100644 functions/multicomics.php create mode 100644 functions/pagination.php create mode 100644 functions/relatedcomics.php create mode 100644 functions/relatedposts.php create mode 100644 functions/searchcustomfields.php create mode 100644 functions/wp-pagenavi.php create mode 100644 gecko_style.css create mode 100644 header.php create mode 100644 ie_style.css create mode 100644 image.php create mode 100644 images/1.gif create mode 100644 images/2.gif create mode 100644 images/2a.gif create mode 100644 images/3.gif create mode 100644 images/3a.gif create mode 100644 images/4.gif create mode 100644 images/avatars/comic/AugustGravatar_PajamaForest.jpg create mode 100644 images/avatars/comic/EA-Avatar-01.jpg create mode 100644 images/avatars/comic/EA-Avatar-02.jpg create mode 100644 images/avatars/comic/ali-avatar.jpg create mode 100644 images/avatars/comic/angelic_dude.jpg create mode 100644 images/avatars/comic/appleofdiscord.jpg create mode 100644 images/avatars/comic/artiste-ava-64.jpg create mode 100644 images/avatars/comic/av_bva_cp28_64_john.jpg create mode 100644 images/avatars/comic/ava.jpg create mode 100644 images/avatars/comic/cassiegrav.jpg create mode 100644 images/avatars/comic/class.jpg create mode 100644 images/avatars/comic/cp-av-domChibi.jpg create mode 100644 images/avatars/comic/cp-av-katoChibi.jpg create mode 100644 images/avatars/comic/cp2.8ablue.jpg create mode 100644 images/avatars/comic/cp2.8ui.jpg create mode 100644 images/avatars/comic/dara-avatar.jpg create mode 100644 images/avatars/comic/eben07-01.jpg create mode 100644 images/avatars/comic/eben07-03.jpg create mode 100644 images/avatars/comic/gravatar_pack_imy.jpg create mode 100644 images/avatars/comic/lemonincavatar.jpg create mode 100644 images/avatars/comic/max.jpg create mode 100644 images/avatars/comic/monkey.jpg create mode 100644 images/avatars/comic/ngav1.jpg create mode 100644 images/avatars/comic/reederrabbitgrav.jpg create mode 100644 images/avatars/comic/rld_avatar.jpg create mode 100644 images/avatars/comic/unrehearsedriot.jpg create mode 100644 images/avatars/default/rascal.png create mode 100644 images/bubble.png create mode 100644 images/buynow_paypal.png create mode 100644 images/buythis.png create mode 100644 images/cal/default.png create mode 100644 images/cal/default/april.jpg create mode 100644 images/cal/default/august.jpg create mode 100644 images/cal/default/december.jpg create mode 100644 images/cal/default/february.jpg create mode 100644 images/cal/default/january.jpg create mode 100644 images/cal/default/july.jpg create mode 100644 images/cal/default/june.jpg create mode 100644 images/cal/default/march.jpg create mode 100644 images/cal/default/may.jpg create mode 100644 images/cal/default/november.jpg create mode 100644 images/cal/default/october.jpg create mode 100644 images/cal/default/september.jpg create mode 100644 images/calendar.png create mode 100644 images/comicpress-icon.png create mode 100644 images/comicpress-rascal.png create mode 100644 images/header-blank.png create mode 100644 images/moods/default/anger.png create mode 100644 images/moods/default/angry.png create mode 100644 images/moods/default/awe.png create mode 100644 images/moods/default/burn.png create mode 100644 images/moods/default/confused.png create mode 100644 images/moods/default/cool.png create mode 100644 images/moods/default/coolglare.png create mode 100644 images/moods/default/crazy.png create mode 100644 images/moods/default/cry.png create mode 100644 images/moods/default/crying.png create mode 100644 images/moods/default/dizzy.png create mode 100644 images/moods/default/embarrass.png create mode 100644 images/moods/default/fire.png create mode 100644 images/moods/default/grimace.png create mode 100644 images/moods/default/happy.png create mode 100644 images/moods/default/love.png create mode 100644 images/moods/default/lust.png create mode 100644 images/moods/default/miao.png create mode 100644 images/moods/default/morequestions.png create mode 100644 images/moods/default/music.png create mode 100644 images/moods/default/ninja.png create mode 100644 images/moods/default/normal.png create mode 100644 images/moods/default/ooo.png create mode 100644 images/moods/default/prettiness.png create mode 100644 images/moods/default/pwnburn.png create mode 100644 images/moods/default/question.png create mode 100644 images/moods/default/shout.png create mode 100644 images/moods/default/shy.png create mode 100644 images/moods/default/silent.png create mode 100644 images/moods/default/sleep.png create mode 100644 images/moods/default/slobber.png create mode 100644 images/moods/default/smile.png create mode 100644 images/moods/default/spook.png create mode 100644 images/moods/default/startle.png create mode 100644 images/moods/default/surprise.png create mode 100644 images/moods/default/sweat.png create mode 100644 images/moods/default/tears.png create mode 100644 images/moods/default/thirst.png create mode 100644 images/moods/default/vomit.png create mode 100644 images/nav/default/navstyle.css create mode 100644 images/nav/scifi/archive.png create mode 100644 images/nav/scifi/buyprint.png create mode 100644 images/nav/scifi/comments.png create mode 100644 images/nav/scifi/first.png create mode 100644 images/nav/scifi/last.png create mode 100644 images/nav/scifi/navstyle.css create mode 100644 images/nav/scifi/next.png create mode 100644 images/nav/scifi/nextchap.png create mode 100644 images/nav/scifi/nextinchap.png create mode 100644 images/nav/scifi/prev.png create mode 100644 images/nav/scifi/prevchap.png create mode 100644 images/nav/scifi/previnchap.png create mode 100644 images/nav/scifi/random.png create mode 100644 images/nav/silver/archive.png create mode 100644 images/nav/silver/buyprint.png create mode 100644 images/nav/silver/comments.png create mode 100644 images/nav/silver/first.png create mode 100644 images/nav/silver/last.png create mode 100644 images/nav/silver/navstyle.css create mode 100644 images/nav/silver/next.png create mode 100644 images/nav/silver/nextchap.png create mode 100644 images/nav/silver/prev.png create mode 100644 images/nav/silver/prevchap.png create mode 100644 images/nav/silver/random.png create mode 100644 images/options/3c.png create mode 100644 images/options/3c2r.png create mode 100644 images/options/blog.png create mode 100644 images/options/comicpress_logo.png create mode 100644 images/options/gn.png create mode 100644 images/options/rgn.png create mode 100644 images/options/standard.png create mode 100644 images/options/v.png create mode 100644 images/options/v3c.png create mode 100644 images/paypal.png create mode 100644 images/pingback.png create mode 100644 images/trackback.png create mode 100644 index.php create mode 100644 js/equalheight.js create mode 100644 js/ie6submenus.js create mode 100644 js/pre.js create mode 100644 js/scroll.js create mode 100644 js/tabbed/tabbed_pages.css create mode 100644 js/tabbed/tabbed_pages.js create mode 100644 js/tabbed/tabbed_pages_ie.css create mode 100644 js/tabbed/tabs_0.gif create mode 100644 js/tabbed/tabs_2.gif create mode 100644 lang/default.mo create mode 100644 lang/default.po create mode 100644 layout-foot.php create mode 100644 layout-head.php create mode 100644 links.php create mode 100644 lynx_style.css create mode 100644 members-blog.php create mode 100644 notie_style.css create mode 100644 ns4_style.css create mode 100644 opera_style.css create mode 100644 options/archivesearchoptions.php create mode 100644 options/buyprintoptions.php create mode 100644 options/customheaderoptions.php create mode 100644 options/generaloptions.php create mode 100644 options/indexoptions.php create mode 100644 options/membersoptions.php create mode 100644 options/menubaroptions.php create mode 100644 options/postoptions.php create mode 100644 options/themestyle.php create mode 100644 page.php create mode 100644 safari_style.css create mode 100644 screenshot.png create mode 100644 search-transcript.php create mode 100644 search.php create mode 100644 searchform-transcript.php create mode 100644 searchform.php create mode 100644 sidebar-above.php create mode 100644 sidebar-blog.php create mode 100644 sidebar-comicleft.php create mode 100644 sidebar-comicright.php create mode 100644 sidebar-footer.php create mode 100644 sidebar-header.php create mode 100644 sidebar-left.php create mode 100644 sidebar-menubar.php create mode 100644 sidebar-over.php create mode 100644 sidebar-overblog.php create mode 100644 sidebar-right.php create mode 100644 sidebar-under.php create mode 100644 sidebar-underblog.php create mode 100644 single.php create mode 100644 style.css create mode 100644 swfobject/expressInstall.swf create mode 100644 swfobject/index.html create mode 100644 swfobject/index_dynamic.html create mode 100644 swfobject/src/expressInstall.as create mode 100644 swfobject/src/expressInstall.fla create mode 100644 swfobject/src/swfobject.js create mode 100644 swfobject/swfobject.js create mode 100644 swfobject/test.swf create mode 100644 test/widgets/GraphicalNavigationTest.php create mode 100644 widgets/archive-dropdown.php create mode 100644 widgets/bookmark.php create mode 100644 widgets/buythisprint.php create mode 100644 widgets/calendar.php create mode 100644 widgets/comicblogpost.php create mode 100644 widgets/comiccomments.php create mode 100644 widgets/comicdate.php create mode 100644 widgets/comictitle.php create mode 100644 widgets/control-panel.php create mode 100644 widgets/graphical-navigation-orig.php create mode 100644 widgets/graphical-navigation.php create mode 100644 widgets/latestcomicjump.php create mode 100644 widgets/latestcomics.php create mode 100644 widgets/latestthumb.php create mode 100644 widgets/menubar.php create mode 100644 widgets/non-member.php create mode 100644 widgets/permalink.php create mode 100644 widgets/randomcomic.php create mode 100644 widgets/randompost.php create mode 100644 widgets/scheduledposts.php create mode 100644 widgets/searchtranscript.php create mode 100644 widgets/social.php create mode 100644 widgets/transcription.php diff --git a/404.php b/404.php new file mode 100644 index 0000000..29146e5 --- /dev/null +++ b/404.php @@ -0,0 +1,18 @@ + + + +
+
+
+

+

+

+
+
+
+
+ + + + + \ No newline at end of file diff --git a/README b/README new file mode 100644 index 0000000..26b0e68 --- /dev/null +++ b/README @@ -0,0 +1,18 @@ +ComicPress is the WordPress Comic Pubishing Theme. + +Copyright 2005-2009 Tyler Martin +Copyright 2008-2009 John Bintz +Copyright 2009 Philip M. Hofer + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . diff --git a/archive-comic-calendar.php b/archive-comic-calendar.php new file mode 100644 index 0000000..c5754a9 --- /dev/null +++ b/archive-comic-calendar.php @@ -0,0 +1,162 @@ + + + + +query('&showposts=1000&cat='.get_all_comic_categories_as_cat_string().'&year='.$archive_year); +while ($comicArchive->have_posts()) : $comicArchive->the_post(); + $calTitle = get_the_title(); + $calLink = get_permalink(); + $calDay = get_the_time('j'); + $calMonth = get_the_time('F'); + $calComic[$calMonth.$calDay] = array('link' => $calLink, 'title' => $calTitle); +endwhile; +$post = $tempPost; + +function leapYear($yr) { + if ($yr % 4 != 0) { + return 28; + } else { + if ($yr % 100 != 0) { + return 29; + } else { + if ($yr % 400 != 0) { + return 28; + } else { + return 29; + } + } + } +} +$leapYear = leapYear($archive_year); + +$month['1'] = array('month' => __('January','comicpress'), 'days' => '31'); +$month['2'] = array('month' => __('February','comicpress'), 'days' => $leapYear); +$month['3'] = array('month' => __('March','comicpress'), 'days' => '31'); +$month['4'] = array('month' => __('April','comicpress'), 'days' => '30'); +$month['5'] = array('month' => __('May','comicpress'), 'days' => '31'); +$month['6'] = array('month' => __('June','comicpress'), 'days' => '30'); +$month['7'] = array('month' => __('July','comicpress'), 'days' => '31'); +$month['8'] = array('month' => __('August','comicpress'), 'days' => '31'); +$month['9'] = array('month' => __('September','comicpress'), 'days' => '30'); +$month['10'] = array('month' => __('October','comicpress'), 'days' => '31'); +$month['11'] = array('month' => __('November','comicpress'), 'days' => '30'); +$month['12'] = array('month' => __('December','comicpress'), 'days' => '31'); + +?> +
+
+
+ +
+

+ +
+ + +
| +get_col("SELECT DISTINCT YEAR(post_date) FROM $wpdb->posts WHERE post_status = 'publish' ORDER BY post_date ASC"); +foreach ( $years as $year ) { + if ($year != (0) ) { ?> + | + +
+
+ +
+ + + + 0) { + if (is_array($monthfile)) $monthfile = reset($monthfile); ?> + <?php echo $month[$i]['month'] ?> + + <?php echo $month[$i]['month'] ?> + + + 0) { + if (is_array($monthfile)) $monthfile = reset($monthfile); ?> + <?php echo $month[$i]['month'] ?> + + <?php echo $month[$i]['month'] ?> + + + + + + + + 0) { + if (is_array($monthfile)) $monthfile = reset($monthfile); ?> + <?php echo $month[$i]['month'] ?> + + <?php echo $month[$i]['month'] ?> + + + 0) { + if (is_array($monthfile)) $monthfile = reset($monthfile); ?> + <?php echo $month[$i]['month'] ?> + + <?php echo $month[$i]['month'] ?> + + + + + +
+ +
+ +
+ +
+ +
+ +
+ + + +
+ +
+ +
+
+
+
+ +comment_status) { comments_template('', true); } ?> + + + \ No newline at end of file diff --git a/archive-comic-month.php b/archive-comic-month.php new file mode 100644 index 0000000..8e67b50 --- /dev/null +++ b/archive-comic-month.php @@ -0,0 +1,45 @@ + + + + +
+
+
+ +
+

+ +
+ + + '" . date('Y-m-d', strtotime('-30 days')) . "'"; +// $where .= " AND post_date >= '2009-03-01' AND post_date < '2009-03-16'"; + return $where; + } +add_filter('posts_where', 'filter_where'); +$posts = query_posts('&show_posts=-1&posts_per_page=-1&cat='.get_all_comic_categories_as_cat_string()); + +?> + + +
+
+ <?php the_title() ?>
+
+
+ +
+
+
+
+ + + \ No newline at end of file diff --git a/archive-comic-storyline-thumbs.php b/archive-comic-storyline-thumbs.php new file mode 100644 index 0000000..33a1780 --- /dev/null +++ b/archive-comic-storyline-thumbs.php @@ -0,0 +1,75 @@ + + + + +
+
+
+ +
+

+ +
+ +
    +description; + $first_comic_in_category = get_terminal_post_in_category($category_id,true); + $first_comic_permalink = get_permalink($first_comic_in_category->ID); + $archive_image = null; + foreach (array("mini", "archive", "rss", "comic") as $type) { + if (($requested_archive_image = get_comic_url($type, $first_comic_in_category)) !== false) { + $archive_image = $requested_archive_image; break; + } + } + if ($target_depth < $current_depth) { + echo str_repeat("
", ($current_depth - $target_depth)); + } + if ($target_depth > $current_depth) { + for ($i = $current_depth; $i < $target_depth; ++$i) { + $next_i = $i + 1; + echo "
    • "; + } + } ?> + +
    • > + + + + cat_name ?> + +
      + +
      +
    • + + 0) { + echo str_repeat("
  • ", $current_depth); + } + } + } else { ?> +



  • ComicPress Manager
  • + + +
    +
    +
    +
    + + + \ No newline at end of file diff --git a/archive-comic-storyline.php b/archive-comic-storyline.php new file mode 100644 index 0000000..d27ae77 --- /dev/null +++ b/archive-comic-storyline.php @@ -0,0 +1,77 @@ + + + + +
    +
    +
    + +
    +

    + +
    + +
      + description; + $first_comic_in_category = get_terminal_post_in_category($category_id); + $first_comic_permalink = get_permalink($first_comic_in_category->ID); + $archive_image = null; + foreach (array("mini", "archive", "rss", "comic") as $type) { + if (($requested_archive_image = get_comic_url($type, $first_comic_in_category)) !== false) { + $archive_image = $requested_archive_image; break; + } + } + if ($target_depth < $current_depth) { + echo str_repeat("
    ", ($current_depth - $target_depth)); + } + if ($target_depth > $current_depth) { + for ($i = $current_depth; $i < $target_depth; ++$i) { + $next_i = $i + 1; + echo "
  • ", $current_depth); + } + } + } else { ?> +



  • ComicPress Manager
  • + + +
    +
    +
    +
    + + + \ No newline at end of file diff --git a/archive-comic-year.php b/archive-comic-year.php new file mode 100644 index 0000000..e9eb76e --- /dev/null +++ b/archive-comic-year.php @@ -0,0 +1,51 @@ + + + + + + + +
    +
    +
    + +
    +

    + +
    + +
    | + get_col("SELECT DISTINCT YEAR(post_date) FROM $wpdb->posts WHERE post_status = 'publish' ORDER BY post_date ASC"); + foreach ( $years as $year ) { + if ($year != (0) ) { ?> + | + +
    + + + query('&showposts=-1&cat='.get_all_comic_categories_as_cat_string().'&year='.$archive_year); + while ($comicArchive->have_posts()) : $comicArchive->the_post() ?> + + +
    + +
    + +
    +
    +
    + + + \ No newline at end of file diff --git a/archive-comic.php b/archive-comic.php new file mode 100644 index 0000000..337149c --- /dev/null +++ b/archive-comic.php @@ -0,0 +1,39 @@ + + + + +
    +
    +
    + +
    +

    + +
    + + + get_col("SELECT DISTINCT YEAR(post_date) FROM $wpdb->posts WHERE post_status = 'publish' ORDER BY post_date DESC"); + foreach ( $years as $year ) { + if ($year != (0) ) { ?> +

    + + query('showposts=10000&cat='.get_all_comic_categories_as_cat_string().'&year='.$year); + while ($comicArchive->have_posts()) : $comicArchive->the_post() ?> + + +
    + + +
    + +
    +
    +
    + + + + \ No newline at end of file diff --git a/archive.php b/archive.php new file mode 100644 index 0000000..a90c1aa --- /dev/null +++ b/archive.php @@ -0,0 +1,155 @@ +post_count; + + if (!$count) $count = "no"; +?> + + + +
    +
    +
    +
    + + +

    + +

    + +

    + +

    + +

    + +

    + +

    + +
    +
    +
    +
    +
    +
    + + + + + + +
    +
    + <?php the_title() ?> +
    +
    + + + +
    +
    +
    + +
    + <?php the_title() ?>
    +
    +
    +
    +
    +
    + +
    +
    +
    > + + +
    +
    +
    + '); ?> +
    +
    +
    +
    +
    +
    + + + +
    + +
    +
    +
    +

    +

    +

    +
    +
    +
    +
    + + + + + + \ No newline at end of file diff --git a/archives.php b/archives.php new file mode 100644 index 0000000..a710c48 --- /dev/null +++ b/archives.php @@ -0,0 +1,24 @@ + + + + +
    +
    +
    +
    +

    +
    +

    +
    +
    +
    +
    +
    +
    + + + \ No newline at end of file diff --git a/author.php b/author.php new file mode 100644 index 0000000..af87b63 --- /dev/null +++ b/author.php @@ -0,0 +1,70 @@ + + + + +

    + +
    +
    +
    +
    + display_name, 1)."' title='".wp_specialchars($curauth->display_name, 1), comicpress_get_avatar($curauth->user_email, 64)); ?> +
    +
    +
    + display_name) + $authorname = $curauth->display_name; + elseif($curauth->user_nickname) + $authorname = $curauth->nickname; + elseif($curauth->user_nicename) + $authorname = $curauth->user_nicename; + else + $authorname = $curauth->user_login; + ?> +
    + user_registered)); ?>
    +
    + user_url)) { ?> user_url; ?>
    + aim)) { ?> aim; ?>
    + jabber)) { ?> jabber; ?>
    + yim)) { ?> jabber; ?>
    +
    + description)) { ?> +
    + description; ?> +
    + +
    +
    +
    + +

    (ID); ?>) ¬

    + +
      + + + + + +
      +
    + + + + +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/blog.php b/blog.php new file mode 100644 index 0000000..db2896d --- /dev/null +++ b/blog.php @@ -0,0 +1,54 @@ + + + + + +
    +
    +
    + + View all posts by:
    +
    +
    +
    + + View all posts by:
    +
    +
    +
    + + + + + \ No newline at end of file diff --git a/buystrip.php b/buystrip.php new file mode 100644 index 0000000..e97060f --- /dev/null +++ b/buystrip.php @@ -0,0 +1,116 @@ + + + + + + + +
    +
    +
    +
    +
    + <?php _e('Powered by Paypal','comicpress'); ?>
    +
    +
    +

    +
    +
    + - #
    +
    +
    + + +
    + <?php the_title(); ?>
    +
    + + + + + + +
    +
    + + + + + + + + + + US/Canada
    + $ + $
    + + US/Canada
    + $
    + + +
    +
    + +
    + + + + + + + + + + International
    + $ + $
    + + International
    + $
    + + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    + + +
    +
    +
    +

    +
    + + '

    '.__('Pages:','comicpress').' ', 'after' => '

    ', 'next_or_number' => 'number')) ?> +
    + ', '

    ') ?> +
    +
    +
    +
    + + + + + diff --git a/chrome_style.css b/chrome_style.css new file mode 100644 index 0000000..0b0c65a --- /dev/null +++ b/chrome_style.css @@ -0,0 +1,19 @@ +/* ComicPress Custom CSS over-rides for [ chrome ]: ComicPress - 2.8 */ + +html { overflow-y: scroll; } + +.comicarchiveframe { + opacity:0.99; /* firefox, opera, safari, chrome */ +} + + .comicarchiveframe:hover { + opacity:0.70; /* firefox, opera, safari, chrome */ + } + + .imagenav-link img { + opacity:0.5; /* firefox, opera, safari, chrome */ + } + + .imagenav-link img:hover { + opacity:0.5; /* firefox, opera, safari, chrome */ + } \ No newline at end of file diff --git a/classes/ComicPressDBInterface.inc b/classes/ComicPressDBInterface.inc new file mode 100644 index 0000000..d844749 --- /dev/null +++ b/classes/ComicPressDBInterface.inc @@ -0,0 +1,111 @@ +_all_categories = get_all_category_ids(); + $this->_non_comic_categories = array_values(array_diff($this->_all_categories, $categories)); + } + + function _get_categories_to_exclude($category = null) { + $result = array_diff($this->_all_categories, array($category)); + if (is_array($result)) { + return (is_null($category)) ? $this->_non_comic_categories : array_values($result); + } else { + return $this->_non_comic_categories; + } + } + + /** + * Find the terminal post in a specific category. + */ + function get_terminal_post_in_category($category_id, $first = true) { + $this->_prepare_wp_query(); + + $sort_order = $first ? "asc" : "desc"; + $terminal_comic_query = new WP_Query(); + $terminal_comic_query->query("showposts=1&order=${sort_order}&cat=${category_id}&status=publish"); + $post = false; + if ($terminal_comic_query->have_posts()) { + $post = reset($terminal_comic_query->posts); + } + + $this->_reset_wp_query(); + return $post; + } + + /** + * Get the first comic in a category. + */ + function get_first_comic($category_id) { + return $this->get_terminal_post_in_category($category_id); + } + + /** + * Get the last comic in a category. + */ + function get_last_comic($category_id) { + return $this->get_terminal_post_in_category($category_id, false); + } + + /** + * Get the comic post adjacent to the current comic. + * Wrapper around get_adjacent_post(). Don't unit test this method. + */ + function get_adjacent_comic($category, $next = false, $override_post = null) { + global $post; + + $this->_prepare_wp_query(); + if (!is_null($override_post)) { $temp_post = $post; $post = $override_post; } + + $result = get_adjacent_post(false, implode(" and ", $this->_get_categories_to_exclude($category)), !$next); + + $this->_reset_wp_query(); + if (!is_null($override_post)) { $post = $temp_post; } + + return empty($result) ? false : $result; + } + + function _prepare_wp_query() { + global $wp_query; + + $this->is_single = $wp_query->is_single; + $this->in_the_loop = $wp_query->in_the_loop; + + $wp_query->is_single = $wp_query->in_the_loop = true; + } + + function _reset_wp_query() { + global $wp_query; + + $wp_query->is_single = $this->is_single; + $wp_query->in_the_loop = $this->in_the_loop; + } + + /** + * Get the previous comic from the current one. + */ + function get_previous_comic($category = null, $override_post = null) { return $this->get_adjacent_comic($category, false, $override_post); } + + /** + * Get the next comic from the current one. + */ + function get_next_comic($category = null, $override_post = null) { return $this->get_adjacent_comic($category, true, $override_post); } +} + +?> diff --git a/classes/ComicPressNavigation.inc b/classes/ComicPressNavigation.inc new file mode 100644 index 0000000..2097b0b --- /dev/null +++ b/classes/ComicPressNavigation.inc @@ -0,0 +1,68 @@ +_storyline = $storyline; + $this->_dbi = ComicPressDBInterface::get_instance(); + } + + function get_post_nav($post) { + $nav = array(); + if (is_object($post)) { + if (isset($post->ID)) { + $cache_key = 'navigation-' . $post->ID; + + if (($result = wp_cache_get($cache_key, 'comicpress')) !== false) { + foreach ($result as $key => $post_id) { + $nev[$key] = get_post($post_id); + } + } + + // global previous/next + foreach (array('previous', 'next') as $field) { + $nav[$field] = $this->_dbi->{"get_${field}_comic"}(null, $post); + } + + // global first/last + foreach (array('first', 'last') as $field) { + $nav[$field] = $this->_dbi->{"get_${field}_comic"}(null); + } + + if ($category = $this->_storyline->get_valid_post_category($post->ID)) { + // storyline previous/next + foreach (array('previous', 'next') as $field) { + $nav["storyline-${field}"] = $this->_dbi->{"get_${field}_comic"}($category, $post); + } + + // adjacent storyline nodes + if (is_array($valid = $this->_storyline->valid($category))) { + foreach ($valid as $field) { + $all_adjacents = $this->_storyline->all_adjacent($category, $field); + foreach ($all_adjacents as $adjacent_category) { + $result = $this->_dbi->get_first_comic($adjacent_category); + if (!empty($result)) { + $nav["storyline-chapter-${field}"] = $result; break; + } + } + } + } + } + + $cache_data = array(); + foreach ($nav as $key => $output_post) { + if (!empty($output_post)) { $cache_data[$key] = $output_post->ID; } + if ($output_post->ID == $post->ID) { $nav[$key] = false; } + } + + wp_cache_set($cache_key, $cache_data, 'comicpress'); + + return $nav; + } + } + } +} + +?> \ No newline at end of file diff --git a/classes/ComicPressStoryline.inc b/classes/ComicPressStoryline.inc new file mode 100644 index 0000000..ca4ba52 --- /dev/null +++ b/classes/ComicPressStoryline.inc @@ -0,0 +1,589 @@ +create_structure($this->get_flattened_storyline()); + return $this; + } + + /** + * Get the flattened storyline from options. + */ + function get_flattened_storyline() { + $comicpress = &ComicPress::get_instance(); + return $comicpress->comicpress_options['storyline_order']; + } + + /** + * Set the global storyline as a flattened storyline. + */ + function set_flattened_storyline($storyline) { + $comicpress = &ComicPress::get_instance(); + $comicpress->comicpress_options['storyline_order'] = $storyline; + $comicpress->save(); + } + + /** + * Set the order from a flattened storyline. + */ + function set_order_via_flattened_storyline($order) { + $nodes = explode(',', $order); + $original_nodes = explode(',', $this->get_flattened_storyline()); + + $missing_good_nodes = array_diff($original_nodes, $nodes); + $any_bad_nodes = array_diff($nodes, $original_nodes); + + if (empty($missing_good_nodes) && empty($any_bad_nodes)) { + $this->set_flattened_storyline($order); + return true; + } else { + return false; + } + } + + /** + * Create a searchable structure from a node list. + * @param array $structure The structure to process. + * @return boolean True if the structure was valid. + */ + function create_structure($structure) { + $key = null; + if (is_string($structure)) { + $key = $structure; + $structure = explode(',', $structure); + } else { + if (is_array($structure)) { + $fixed_structure = array(); + foreach ($structure as $s) { + if (!is_array($s)) { $fixed_structure[] = $s; } + } + $key = implode(',', $fixed_structure); + } + } + + if (!is_null($key)) { + $key = "storyline-structure-${key}"; + + if (($result = wp_cache_get($key, 'comicpress')) !== false) { + $this->_structure = $result; + } else { + $new_structure = array(); + $parent = null; + $all_leaves = array(); + + $adjacents_by_parent = array(); + + if (is_array($structure)) { + $is_valid = true; + foreach ($structure as $branch) { + if (is_string($branch)) { + $parts = explode('/', $branch); + $valid = false; + if (count($parts) > 1) { + if ($parts[0] == '0') { $valid = true; } + } + if (!$valid) { + $is_valid = false; break; + } else { + $data = array(); + $leaf = end($parts); + $all_leaves[] = $leaf; + + $data['level'] = count($parts) - 1; + + if (count($parts) > 2) { + $parent = $parts[count($parts) - 2]; + + if (!isset($adjacents_by_parent[$parent])) { + $adjacents_by_parent[$parent] = array(); + } + $adjacents_by_parent[$parent][] = $leaf; + + $data['parent'] = $parent; + } + + $new_structure[$leaf] = $data; + } + } else { + $is_valid = false; break; + } + } + if ($is_valid) { + for ($i = 0; $i < count($all_leaves); ++$i) { + foreach (array('previous' => -1, 'next' => 1) as $type => $dir) { + if (isset($all_leaves[$i + $dir])) { + $new_structure[$all_leaves[$i]][$type] = $all_leaves[$i + $dir]; + } + } + } + + $this->_structure = $new_structure; + } + } + wp_cache_set($key, $this->_structure, 'comicpress'); + } + } + return is_array($this->_structure); + } + + function _get_field($field, $id) { + if (isset($this->_structure)) { + if (isset($this->_structure[$id])) { + if (isset($this->_structure[$id][$field])) { + return $this->_structure[$id][$field]; + } + } + } + return false; + } + + function parent($id) { return $this->_get_field('parent', $id); } + function previous($id) { return $this->_get_field('previous', $id); } + function next($id) { return $this->_get_field('next', $id); } + function valid($id) { + if (isset($this->_structure[$id])) { + return array_keys($this->_structure[$id]); + } + return false; + } + + function all_adjacent($id, $direction) { + if (isset($this->_structure[$id])) { + $all_adjacent = array(); + do { + $has_adjacent = false; + if (!in_array($id, $all_adjacent)) { + if ($has_adjacent = isset($this->_structure[$id][$direction])) { + $all_adjacent[] = $this->_structure[$id][$direction]; + $id = $this->_structure[$id][$direction]; + } + } + } while ($has_adjacent); + return $all_adjacent; + } + return false; + } + + /** + * Get the valid navigation directions for a particular post. + */ + function get_valid_nav($post_id) { + if (($category = $this->get_valid_post_category($post_id)) !== false) { + return $this->valid($category); + } + return false; + } + + /** + * Get the valid comic category for this post. + */ + function get_valid_post_category($post_id) { + $result = false; + + foreach (wp_get_post_categories($post_id) as $category) { + if ($this->valid($category)) { + if ($result) { return false; } + + $result = $category; + } + } + return $result; + } + + /** + * Get all comic categories. + * @deprecated + */ + function get_comic_categories() { + return array_keys($this->_structure); + } + + /** + * Get a simple storyline. + */ + function get_simple_storyline() { + $simple_storyline = array('0' => array()); + foreach ($this->_structure as $category_id => $adjacents) { + $parent = 0; + if (isset($adjacents['parent'])) { $parent = $adjacents['parent']; } + if (!isset($simple_storyline[$parent])) { + $simple_storyline[$parent] = array(); + } + $simple_storyline[$parent][$category_id] = true; + } + + return $this->_merge_simple_storyline($simple_storyline); + } + + /** + * Get a simple structure. + */ + function get_category_simple_structure($parent = null) { + $structure = array(); + foreach (get_all_category_ids() as $category_id) { + $category = get_category($category_id); + if (!isset($structure[$category->parent])) { + $structure[$category->parent] = array(); + } + $structure[$category->parent][$category_id] = true; + } + $structure = $this->_merge_simple_storyline($structure); + if (!empty($parent)) { + if (isset($structure[0])) { + foreach ($structure[0] as $key => $children) { + if ($key != $parent) { unset($structure[0][$key]); } + } + } + } + return $structure; + } + + /** + * Get a flattened category node list. + */ + function get_category_flattened($parent = null) { + return $this->flatten_simple_storyline($this->get_category_simple_structure($parent)); + } + + /** + * Merge a flat simple storyline into a tree. + */ + function _merge_simple_storyline($simple_storyline) { + while (count($simple_storyline) > 0) { + $merge_found = false; + foreach ($simple_storyline as $parent => $children) { + $has_no_descendents = true; + foreach (array_keys($children) as $child) { + if (is_numeric($child)) { + if (isset($simple_storyline[$child])) { + $has_no_descendents = false; + break; + } + } + } + if ($has_no_descendents) { + $merge_found = $parent; break; + } + } + if ($merge_found !== false) { + foreach ($simple_storyline as $parent => $children) { + if (isset($children[$merge_found])) { + $simple_storyline[$parent][$merge_found] = $simple_storyline[$merge_found]; + unset($simple_storyline[$merge_found]); + break; + } + } + } + if (!$merge_found) { break; } + } + return $simple_storyline; + } + + /** + * Integrates a bunch of other things. + */ + function normalize($flattened_storyline = null, $set = true) { + $comicpress = ComicPress::get_instance(); + if (is_null($flattened_storyline)) { + $flattened_storyline = $this->get_flattened_storyline(); + } + $all_categories_flattened = $this->get_category_flattened(); + + $result = $this->normalize_flattened_storyline($flattened_storyline, $all_categories_flattened); + if ($set) { + $this->set_flattened_storyline($result); + } + return $result; + } + + /** + * Sort nodes by node count. + */ + function _length_sort($parts) { + $new = array(); + foreach ($parts as $part) { + $p = explode('/', $part); + if (!isset($new[count($p)])) { + $new[count($p)] = array(); + } + $new[count($p)][] = $part; + } + ksort($new); + $output = array(); + foreach (array_values($new) as $values) { + $output = array_merge($output, $values); + } + return $output; + } + + /** + * Normalize a flattened storyline, inserting and removing categories from the list is necessary. + */ + function normalize_flattened_storyline($storyline, $comic_categories) { + $storyline_nodes = explode(",", $storyline); + $category_nodes = explode(",", $comic_categories); + + $missing_from_storyline = array_diff($category_nodes, $storyline_nodes); + $extra_in_storyline = array_diff($storyline_nodes, $category_nodes); + + if (!empty($missing_from_storyline)) { + $missing_from_storyline = $this->_length_sort($missing_from_storyline); + foreach ($missing_from_storyline as $node) { + $parent_pattern = implode('/', array_slice(explode('/', $node), 0, -1)); + $last = null; + for ($i = 0, $il = count($storyline_nodes); $i < $il; ++$i) { + if (strpos($storyline_nodes[$i], $parent_pattern) === 0) { + $last = $i; + } + } + if (!is_null($last)) { + array_splice($storyline_nodes, $last + 1, 0, array($node)); + } else { + $storyline_nodes[] = $node; + } + } + } + + if (!empty($extra_in_storyline)) { + $new = array(); + foreach ($storyline_nodes as $node) { + if (!in_array($node, $extra_in_storyline)) { + $new[] = $node; + } + } + $storyline_nodes = $new; + } + + return implode(',', $storyline_nodes); + } + + /** + * Flatten a simple storyline. + */ + function flatten_simple_storyline($storyline) { + return implode(',', $this->_follow_simple_storyline($storyline)); + } + + /** + * Follow the nodes of a simple storyline, creating a node list. + */ + function _follow_simple_storyline($storyline, $parent = null) { + $output = array(); + foreach ($storyline as $key => $children) { + if (is_null($parent)) { + $new_parent = $key; + } else { + $new_parent = $parent . '/' . $key; + $output[] = $new_parent; + } + if (is_array($children)) { + $output = array_merge($output, $this->_follow_simple_storyline($children, $new_parent)); + } + } + return $output; + } + + function &include_all() { + $this->_category_search = array_keys($this->_structure); + return $this; + } + + function &exclude_all() { + $this->_category_search = array(); + return $this; + } + + function _find_children($parent) { + if (!is_numeric($parent)) { + foreach (get_all_category_ids() as $id) { + $category = get_category($id); + if ($category->slug == $parent) { + $parent = $id; break; + } + } + } + if (is_numeric($parent)) { + $children = array($parent); + do { + $found_children = false; + foreach ($this->_structure as $category_id => $info) { + if (!in_array($category_id, $children)) { + if (isset($info['parent'])) { + if (in_array($info['parent'], $children)) { + $children[] = $category_id; + $found_children = true; + } + } + } + } + } while ($found_children); + + return $children; + } + return false; + } + + function &_include() { + $args = func_get_args(); + $method = array_shift($args); + $this->_category_search = array_unique(array_merge($this->_category_search, call_user_func_array(array($this, $method), $args))); + sort($this->_category_search); + return $this; + } + + function &_exclude() { + $args = func_get_args(); + $method = array_shift($args); + $this->_category_search = array_diff($this->_category_search, call_user_func_array(array($this, $method), $args)); + sort($this->_category_search); + return $this; + } + + function _find_level_or_above($level = null) { + $found = array(); + foreach ($this->_structure as $category_id => $info) { + if ($info['level'] <= $level) { $found[] = $category_id; } + } + return $found; + } + + function _find_only($id = null) { + if (isset($this->_structure[$id])) { + return array($id); + } + return array(); + } + + function _find_level($level = null) { + $found = array(); + foreach ($this->_structure as $category_id => $info) { + if ($info['level'] == $level) { $found[] = $category_id; } + } + return $found; + } + + function _ensure_post_id($thing) { + $id = null; + if (is_object($thing)) { + if (isset($thing->ID)) { $id = $thing->ID; } + } else { + if (is_numeric($thing)) { $id = $thing; } + } + return $id; + } + + function _find_post_category($post = null) { + $found = array(); + + $id = $this->_ensure_post_id($post); + + if (!is_null($id)) { + if (count($categories = wp_get_post_categories($id)) == 1) { + $found = $categories; + } + } + return $found; + } + + function _find_adjacent($category = null, $next = false) { + $found = array(); + + if (!is_null($category)) { + if (isset($this->_structure[$category])) { + $field = $next ? 'next' : 'previous'; + if (isset($this->_structure[$category][$field])) { + $found = array($this->_structure[$category][$field]); + } + } + } + + return $found; + } + + function _find_post_root($post = null) { + $found = array(); + + $id = $this->_ensure_post_id($post); + + if (!is_null($id)) { + if (count($categories = wp_get_post_categories($id)) == 1) { + $comic_post = new ComicPressComicPost(get_post($id)); + $parents = $comic_post->find_parents(); + if (!empty($parents)) { + $parents = array_keys($parents); $found = $this->_find_children(end($parents)); + } + + } + } + return $found; + } + + function end_search() { + $result = $this->_category_search; + $this->_category_search = array(); + return $result; + } + + function build_from_restrictions($restrictions = null) { + global $post; + + $this->read_from_options(); + $this->exclude_all(); + + $include_all = true; + if (is_array($restrictions)) { + if (!empty($restrictions)) { + $include_all = false; + } + } + + if (!$include_all) { + foreach ($restrictions as $type => $list) { + if (substr($type, 0, 1) == "!") { + $method_root = 'exclude'; + $method_type = substr($type, 1); + } else { + $method_root = 'include'; + $method_type = $type; + } + + if (!is_array($list)) { $list = array($list); } + + foreach ($list as $restriction) { + $method = ''; + $args = array($restriction); + switch ($method_type) { + case 'child_of': $method = 'children'; break; + case 'root_of': $method = 'post_root'; break; + case 'from_post': $method = 'post_category'; break; + case 'previous': + $method = 'adjacent'; + $args[] = false; + break; + case 'next': + $method = 'adjacent'; + $args[] = true; + break; + default: + $method = $method_type; break; + } + if (!empty($method)) { + array_unshift($args, "_find_${method}"); + call_user_func_array(array($this, "_${method_root}"), $args); + } + } + } + } else { + $this->include_all(); + } + + return $this->end_search(); + } +} + +?> diff --git a/comicpress-config.php b/comicpress-config.php new file mode 100644 index 0000000..09a30e0 --- /dev/null +++ b/comicpress-config.php @@ -0,0 +1,33 @@ + \ No newline at end of file diff --git a/comicpress-options-config.php b/comicpress-options-config.php new file mode 100644 index 0000000..f05afed --- /dev/null +++ b/comicpress-options-config.php @@ -0,0 +1,294 @@ + "open"), + + array( + "id" => "comicpress-disable_comic_frontpage", + "default" => "no", + "type" => "comicpress-disable_comic_frontpage"), + + array( + "id" => "comicpress-disable_comic_blog_frontpage", + "default" => "no", + "type" => "comicpress-disable_comic_blog_frontpage"), + + array( + "id" => "comicpress-disable_comic_blog_single", + "default" => "no", + "type" => "comicpress-disable_comic_blog_single"), + + array( + "id" => "comicpress-disable_blog_frontpage", + "default" => "no", + "type" => "comicpress-disable_blog_frontpage"), + + array( + "id" => "comicpress-custom_css", + "default" => "", + "type" => "comicpress-custom_css"), + + array( + "id" => "comicpress-cp_theme_layout", + "default" => "standard", + "type" => "comicpress-cp_theme_layout"), + + array( + "id" => "comicpress-buy_print_email", + "default" => "youremail@youremail.com", + "type" => "comicpress-buy_print_email"), + + array( + "id" => "comicpress-buy_print_url", + "default" => "/shop/", + "type" => "comicpress-buy_print_url"), + + array( + "id" => "comicpress-buy_print_us_amount", + "default" => "19.95", + "type" => "comicpress-buy_print_us_amount"), + + array( + "id" => "comicpress-buy_print_int_amount", + "default" => "29.95", + "type" => "comicpress-buy_print_int_amount"), + + array( + "id" => "comicpress-buy_print_add_shipping", + "default" => "yes", + "type" => "comicpress-buy_print_add_shipping"), + + array( + "id" => "comicpress-buy_print_us_ship", + "default" => "4.95", + "type" => "comicpress-buy_print_us_ship"), + + array( + "id" => "comicpress-buy_print_int_ship", + "default" => "9.95", + "type" => "comicpress-buy_print_int_ship"), + + array( + "id" => "comicpress-transcript_in_posts", + "default" => "no", + "type" => "comicpress-transcript_in_posts"), + + array( + "id" => "comicpress-enable_widgetarea_use_sidebar_css", + "default" => "no", + "type" => "comicpress-enable_widgetarea_use_sidebar_css"), + + array( + "id" => "comicpress-contact_in_menubar", + "default" => "no", + "type" => "comicpress-contact_in_menubar"), + + array( + "id" => "comicpress-disable_extended_comments", + "default" => "no", + "type" => "comicpress-disable_extended_comments"), + + array( + "id" => "comicpress-enable_custom_image_header", + "default" => "no", + "type" => "comicpress-enable_custom_image_header"), + + array( + "id" => "comicpress-custom_image_header_width", + "default" => "780", + "type" => "comicpress-custom_image_header_width"), + + array( + "id" => "comicpress-custom_image_header_height", + "default" => "120", + "type" => "comicpress-custom_image_header_height"), + + array( + "id" => "comicpress-enable_numbered_pagination", + "default" => "no", + "type" => "comicpress-enable_numbered_pagination"), + + array( + "id" => "comicpress-disable_page_restraints", + "default" => "no", + "type" => "comicpress-disable_page_restraints"), + + array( + "id" => "comicpress-enable_dropdown_sidebar", + "default" => "no", + "type" => "comicpress-enable_dropdown_sidebar"), + + array( + "id" => "comicpress-enable_related_comics", + "default" => "no", + "type" => "comicpress-enable_related_comics"), + + array( + "id" => "comicpress-enable_related_posts", + "default" => "no", + "type" => "comicpress-enable_related_posts"), + + array( + "id" => "comicpress-comic_clicks_next", + "default" => "no", + "type" => "comicpress-comic_clicks_next"), + + array( + "id" => "comicpress-rascal_says", + "default" => "no", + "type" => "comicpress-rascal_says"), + + array( + "id" => "comicpress-disable_css_style_editor", + "default" => "no", + "type" => "comicpress-disable_css_style_editor"), + + array( + "id" => "comicpress-enable_post_calendar", + "default" => "no", + "type" => "comicpress-enable_post_calendar"), + + array( + "id" => "comicpress-enable_post_author_gravatar", + "default" => "no", + "type" => "comicpress-enable_post_author_gravatar"), + + array( + "id" => "comicpress-enable_comic_post_calendar", + "default" => "no", + "type" => "comicpress-enable_comic_post_calendar"), + + array( + "id" => "comicpress-enable_comic_post_author_gravatar", + "default" => "no", + "type" => "comicpress-enable_comic_post_author_gravatar"), + + array( + "id" => "comicpress-disable_tags_in_posts", + "default" => "no", + "type" => "comicpress-disable_tags_in_posts"), + + array( + "id" => "comicpress-disable_categories_in_posts", + "default" => "no", + "type" => "comicpress-disable_categories_in_posts"), + + array( + "id" => "comicpress-moods_directory", + "default" => "default", + "type" => "comicpress-moods_directory"), + + array( + "id" => "comicpress-graphicnav_directory", + "default" => "default", + "type" => "comicpress-graphicnav_directory"), + + array( + "id" => "comicpress-enable_search_in_menubar", + "default" => "no", + "type" => "comicpress-enable_search_in_menubar"), + + array( + "id" => "comicpress-enable_rss_in_menubar", + "default" => "no", + "type" => "comicpress-enable_rss_in_menubar"), + + array( + "id" => "comicpress-enable_navigation_in_menubar", + "default" => "yes", + "type" => "comicpress-enable_navigation_in_menubar"), + + array( + "id" => "comicpress-disable_lrsidebars_frontpage", + "default" => "no", + "type" => "comicpress-disable_lrsidebars_frontpage"), + + array( + "id" => "comicpress-calendar_directory", + "default" => "default", + "type" => "comicpress-calendar_directory"), + + array( + "id" => "comicpress-disable_dynamic_menubar_links", + "default" => "no", + "type" => "comicpress-disable_dynamic_menubar_links"), + + array( + "id" => "comicpress-disable_footer_text", + "default" => "no", + "type" => "comicpress-disable_footer_text"), + + array( + "id" => "comicpress-avatar_directory", + "default" => "default", + "type" => "comicpress-avatar_directory"), + + array( + "id" => "comicpress-archive_display_order", + "default" => "desc", + "type" => "comicpress-archive_display_order"), + + array( + "id" => "comicpress-disable_comment_note", + "default" => "no", + "type" => "comicpress-disable_comment_note"), + + array( + "id" => "comicpress-excerpt_or_content_archive", + "default" => "excerpt", + "type" => "comicpress-excerpt_or_content_archive"), + + array( + "id" => "comicpress-excerpt_or_content_search", + "default" => "excerpt", + "type" => "comicpress-excerpt_or_content_search"), + + array( + "id" => "comicpress-category_thumbnail_postcount", + "default" => "30", + "type" => "comicpress-category_thumbnail_postcount"), + + array( + "id" => "comicpress-members_post_category", + "default" => "", + "type" => "comicpress-members_post_category"), + + array( + "id" => "comicpress-blogposts_with_comic", + "default" => "no", + "type" => "comicpress-blogposts_with_comic"), + + array( + "id" => "comicpress-split_column_in_two", + "default" => "no", + "type" => "comicpress-split_column_in_two"), + + array( + "id" => "comicpress-author_column_one", + "default" => "1", + "type" => "comicpress-author_column_one"), + + array( + "id" => "comicpress-author_column_two", + "default" => "1", + "type" => "comicpress-author_column_two"), + + array( + "id" => "comicpress-remove_wptexturize", + "default" => "no", + "type" => "comicpress-remove_wptexturize"), + + array( + "id" => "comicpress-disable_default_menubar", + "default" => "no", + "type" => "comicpress-disable_default_menubar"), + + array( + "id" => "comicpress-disable_blogheader", + "default" => "no", + "type" => "comicpress-disable_blogheader"), + + array("type" => "close") + ); +?> \ No newline at end of file diff --git a/comicpress-options.php b/comicpress-options.php new file mode 100644 index 0000000..ce88a76 --- /dev/null +++ b/comicpress-options.php @@ -0,0 +1,117 @@ + + + + + + + +
    +

    + + ComicPress + + +
    +
    +
    + + +
    +
    +
    + +

    + +

    + +
    + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + +
    + +
    + + \ No newline at end of file diff --git a/comments.php b/comments.php new file mode 100644 index 0000000..037bee0 --- /dev/null +++ b/comments.php @@ -0,0 +1,134 @@ + +

    + + +
    +
    + + + + + + +

    + +
      + 'comment', + 'reply_text' => __('Reply to %s¬','comicpress'), + 'callback' => 'comicpress_comments_callback', + 'end-callback' => 'comicpress_comments_end_callback', + 'avatar_size'=>64 + ) + ); + } else { + wp_list_comments(array('type' => 'comment', 'avatar_size'=>64)); + }?> +
    + + + + 0)); + if (!empty($pagelinks)) { + $pagelinks = preg_replace('#\#', '', $pagelinks); + $pagelinks = preg_replace('#\#', '', $pagelinks); ?> +
    +
    +
  • '.__('Comment Pages','comicpress').'
  • '. $pagelinks . ''; ?> +
    +
    +
    + + + +
    +
    +
    +
    +
    + + + + + comment_status) : ?> + + + + +

    + + + + +comment_status) : ?> + +
    + +

    + +
    +

    +
    + + +

    + +
    + +

    .

    + +

    +

    +

    +

    +

    +

    + + ID); ?> +

    +

    + +


    + + +
    + +
    + + + + + +

    +
      +
        + 'pings', + 'callback' => 'comicpress_comments_callback', + 'end-callback' => 'comicpress_comments_end_callback', + 'avatar_size'=>32 + ) + ); + } else { + wp_list_comments(array('type' => 'pings', 'avatar_size'=>64)); + }?> +
      +
    + + +
    +
    \ No newline at end of file diff --git a/footer.php b/footer.php new file mode 100644 index 0000000..62c38ff --- /dev/null +++ b/footer.php @@ -0,0 +1,29 @@ + + + +
    + + + + + + + diff --git a/functions.php b/functions.php new file mode 100644 index 0000000..8ab0727 --- /dev/null +++ b/functions.php @@ -0,0 +1,888 @@ + 'comiccat', + 'blogcat' => 'blogcat', + 'comics_path' => 'comic_folder', + 'comicsrss_path' => 'rss_comic_folder', + 'comicsarchive_path' => 'archive_comic_folder', + 'comicsmini_path' => 'mini_comic_folder', + 'archive_comic_width' => 'archive_comic_width', + 'rss_comic_width' => 'rss_comic_width', + 'mini_comic_width' => 'mini_comic_width', + 'blog_postcount' => 'blog_postcount') as $options => $variable_name) { + $variables_to_extract[$variable_name] = get_option("comicpress-${options}"); + } + + extract($variables_to_extract); + } + +} else { + require(get_template_directory() . '/comicpress-config.php'); +} + +if (get_option('upload_path') !== false) { + $variables_to_extract = array(); + + foreach (array( + 'disable_comic_frontpage' => 'disable_comic_frontpage', + 'disable_comic_blog_frontpage' => 'disable_comic_blog_frontpage', + 'disable_comic_blog_single' => 'disable_comic_blog_single', + 'disable_blog_frontpage' => 'disable_blog_frontpage', + 'buy_print_email' => 'buy_print_email', + 'buy_print_url' => 'buy_print_url', + 'buy_print_us_amount' => 'buy_print_us_amount', + 'buy_print_int_amount' => 'buy_print_int_amount', + 'buy_print_add_shipping' => 'buy_print_add_shipping', + 'buy_print_us_ship' => 'buy_print_us_ship', + 'buy_print_int_ship' => 'buy_print_int_ship', + 'cp_theme_layout' => 'cp_theme_layout', + 'transcript_in_posts' => 'transcript_in_posts', + 'enable_widgetarea_use_sidebar_css' => 'enable_widgetarea_use_sidebar_css', + 'enable_custom_image_header' => 'enable_custom_image_header', + 'custom_image_header_width' => 'custom_image_header_width', + 'custom_image_header_height' => 'custom_image_header_height', + 'enable_numbered_pagination' => 'enable_numbered_pagination', + 'disable_page_restraints' => 'disable_page_restraints', + 'enable_related_comics' => 'enable_related_comics', + 'enable_related_posts' => 'enable_related_posts', + 'comic_clicks_next' => 'comic_clicks_next', + 'rascal_says' => 'rascal_says', + 'disable_css_style_editor' => 'disable_css_style_editor', + 'enable_post_calendar' => 'enable_post_calendar', + 'enable_post_author_gravatar' => 'enable_post_author_gravatar', + 'enable_comic_post_calendar' => 'enable_comic_post_calendar', + 'enable_comic_post_author_gravatar' => 'enable_comic_post_author_gravatar', + 'disable_tags_in_posts' => 'disable_tags_in_posts', + 'disable_categories_in_posts' => 'disable_categories_in_posts', + 'moods_directory' => 'moods_directory', + 'graphicnav_directory' => 'graphicnav_directory', + 'enable_search_in_menubar' => 'enable_search_in_menubar', + 'enable_rss_in_menubar' => 'enable_rss_in_menubar', + 'enable_navigation_in_menubar' => 'enable_navigation_in_menubar', + 'disable_lrsidebars_frontpage' => 'disable_lrsidebars_frontpage', + 'calendar_directory' => 'calendar_directory', + 'contact_in_menubar' => 'contact_in_menubar', + 'disable_dynamic_menubar_links' => 'disable_dynamic_menubar_links', + 'disable_footer_text' => 'disable_footer_text', + 'themepack_directory' => 'themepack_directory', + 'avatar_directory' => 'avatar_directory', + 'archive_display_order' => 'archive_display_order', + 'disable_comment_note' => 'disable_comment_note', + 'excerpt_or_content_archive' => 'excerpt_or_content_archive', + 'excerpt_or_content_search' => 'excerpt_or_content_search', + 'category_thumbnail_postcount' => 'category_thumbnail_postcount', + 'members_post_category' => 'members_post_category', + 'blogposts_with_comic' => 'blogposts_with_comic', + 'split_column_in_two' => 'split_column_in_two', + 'author_column_one' => 'author_column_one', + 'author_column_two' => 'author_column_two', + 'remove_wptexturize' => 'remove_wptexturize', + 'disable_default_menubar' => 'disable_default_menubar', + 'disable_blogheader' => 'disable_blogheader' ) as $options => $variable_name) { + $variables_to_extract[$variable_name] = get_option("comicpress-${options}"); + } + + extract($variables_to_extract); +} + +if (empty($avatar_directory)) $avatar_directory = 'default'; +if (empty($graphicnav_directory)) $graphicnav_directory = 'default'; +if (empty($moods_directory)) $moods_directory = 'default'; +if (empty($calendar_directory)) $calendar_directory = 'default'; +if (empty($cp_theme_layout)) $cp_theme_layout='standard'; + +function is_cp_theme_layout($choices) { +global $cp_theme_layout; + if (empty($cp_theme_layout)) $cp_theme_layout='standard'; + $choices = explode(",", $choices); + foreach ($choices as $choice) { + + if ($choice == $cp_theme_layout) { + return true; + } + } + return false; +} + +if ($remove_wptexturize == 'yes') { + // Remove the wptexturizer from changing the quotes and squotes. + // remove_filter('the_content', 'wpautop'); + // remove_filter('the_title', 'wptexturize'); + remove_filter('the_content', 'wptexturize'); + // remove_filter('the_excerpt', 'wptexturize'); + // remove_filter('comment_text', 'wptexturize'); +} + +// WIDGETS WP 2.8 compatible ONLY, no backwards compatibility here. +$dirs_to_search = array_unique(array(get_template_directory(),get_stylesheet_directory())); +foreach ($dirs_to_search as $dir) { + // Widgets + foreach (glob($dir . '/widgets/*.php') as $__file) { require_once($__file); } + + // FUNCTIONS & Extra's + foreach (glob($dir . '/functions/*.php') as $__file) { require_once($__file); } +} + +// Dashboard Menu Comicpress Options and ComicPress CSS +require_once(get_template_directory() . '/comicpress-options.php'); + +// If any errors occur while searching for a comic file, the error messages will be pushed into here. +$comic_pathfinding_errors = array(); + +// If ComicPress Manager is installed, use the date format defined there. If not, default to +// Y-m-d.. It's best to use CPM's date definition for improved operability between theme and plugin. + +if (defined("CPM_DATE_FORMAT")) { + define("CP_DATE_FORMAT", CPM_DATE_FORMAT); +} else { + define("CP_DATE_FORMAT", "Y-m-d"); +} + +// If you want to run multiple comics on a single day, define your additional filters here. +// Example: you want to run an additional comic with the filename 2008-01-01-a-my-new-years-comic.jpg. +// Define an additional filter in the list below: +// +// $comic_filename_filters['secondary'] = "{date}-a*.*"; +// +// Then show the second comic on your page by calling the_comic with your filter name (PHP tags munged +// to maintain valid file syntax): +// +// < ?php the_comic('secondary'); ? > +// +// Note that it's quite possible to slurp up the wrong file if your expressions are too broad. + +$comic_filename_filters = array(); +$comic_filename_filters['default'] = "{date}*.*"; + +// load all of the comic & non-comic category information +add_action('init', 'get_all_comic_categories'); + +function get_first_comic() { + return get_terminal_post_in_category(get_all_comic_categories_as_cat_string(), true); +} + +function get_last_comic() { + return get_terminal_post_in_category(get_all_comic_categories_as_cat_string(), false); +} + +/** +* Get the hyperlink to the first comic post in the database. +* @return string The hyperlink to the first comic post, or false. +*/ +function get_first_comic_permalink() { + $terminal = get_first_comic(); + return !empty($terminal) ? get_permalink($terminal->ID) : false; +} + +/** +* Get the hyperlink to the last comic post in the database. +* @return string The hyperlink to the first comic post, or false. +*/ +function get_last_comic_permalink() { + $terminal = get_last_comic(); + return !empty($terminal) ? get_permalink($terminal->ID) : false; +} + +/** + * Given a category ID or an array of category IDs, create an exclusion string that will + * filter out every category but the provided ones. + */ +function get_string_to_exclude_all_but_provided_categories($category) { + $category_ids = array_keys(get_all_category_objects_by_id()); + if (!is_array($category)) { $category = array($category); } + return implode(" and ", array_diff($category_ids, $category)); +} + +/** + * Get the link to the previous comic from the current one. + */ +function previous_comic_link($format, $link) { + global $non_comic_categories; + previous_post_link($format, $link, false, $non_comic_categories); +} + +/** + * Get the link to the next comic from the current one. + */ +function next_comic_link($format, $link) { + global $non_comic_categories; + next_post_link($format, $link, false, $non_comic_categories); +} + +/** + * Get the previous comic from the current one. + */ +function get_previous_comic($category = null) { return get_adjacent_comic($category, true); } + +/** + * Get the next comic from the current one. + */ +function get_next_comic($category = null) { return get_adjacent_comic($category); } + +/** + * This is function get_next_comic_permalink + * + * @return mixed false if no next comic permalink, else return the permalink + * + */ +function get_next_comic_permalink() { + $next_comic = get_next_comic(); + if (is_object($next_comic)) { + if (isset($next_comic->ID)) { + return get_permalink($next_comic->ID); + } + } + return false; +} + +/** + * This is function get_previous_comic_permalink + * + * @return mixed false if there is no permalink or next previous comic + * + */ +function get_previous_comic_permalink() { + $prev_comic = get_previous_comic(); + if (is_object($prev_comic)) { + if (isset($prev_comic->ID)) { + return get_permalink($prev_comic->ID); + } + } + return false; +} + +/** + * Get the adjacent comic from the current one. + * @param int $category The category to use. + * @param boolean $previous True if the previous chronological comic should be retrieved. + * @return array The WordPress post object for the comic post. + */ +function get_adjacent_comic($category, $previous = false) { + global $non_comic_categories; + +// get_all_comic_categories(); + + $categories_to_exclude = $non_comic_categories; + if (!empty($category)) { + $categories_to_exclude = get_string_to_exclude_all_but_provided_categories($category); + } + + return get_adjacent_post(false, $categories_to_exclude, $previous); +} + +/** + * Find the terminal post in a specific category. + */ +function get_terminal_post_in_category($categoryID, $first = true) { + global $post; + + $temp = $wp_query; $wp_query = null; + $sortOrder = $first ? "asc" : "desc"; + $terminalComicQuery = new WP_Query(); $terminalComicQuery->query("showposts=1&order=${sortOrder}&cat=${categoryID}"); + $terninalPost = false; + if ($terminalComicQuery->have_posts()) { + $terminalPost = reset($terminalComicQuery->posts); + } + + $wp_query = null; $wp_query = $temp; + return $terminalPost; +} + +/** + * Find the first post in the storyline prior to the current one. + */ +function get_previous_storyline_start() { + if (($category_id = get_adjacent_storyline_category_id(false)) !== false) { + return get_terminal_post_in_category($category_id); + } + return false; +} + +function get_previous_storyline_start_permalink() { + $prev_story = get_previous_storyline_start(); + if (is_object($prev_story)) { + if (isset($prev_story->ID)) { + return get_permalink($prev_story->ID); + } + } + return false; +} + +/** + * Find the first post in the storyline following to the current one. + */ +function get_next_storyline_start() { + if (($category_id = get_adjacent_storyline_category_id(true)) !== false) { + return get_terminal_post_in_category($category_id); + } + return false; +} + +function get_next_storyline_start_permalink() { + $next_story = get_next_storyline_start(); + if (is_object($next_story)) { + if (isset($next_story->ID)) { + return get_permalink($next_story->ID); + } + } + return false; +} + +function get_adjacent_storyline_category_id($next = false) { + global $post, $category_tree; + + $categories = wp_get_post_categories($post->ID); + if (is_array($categories)) { + $category_id = reset($categories); + for ($i = 0, $il = count($category_tree); $i < $il; ++$i) { + $storyline_category_id = end(explode("/", $category_tree[$i])); + + if ($storyline_category_id == $category_id) { + $target_index = false; + if ($next) { + $target_index = $i + 1; + } else { + $target_index = $i - 1; + } + if (isset($category_tree[$target_index])) { + return end(explode('/', $category_tree[$target_index])); + } + } + } + } + return false; +} + +/** +* Find a comic file in the filesystem. +* @param string $folder The folder name to search. +* @param string $override_post A WP Post object to use in place of global $post. +* @param string $filter The $comic_filename_filters to use. +* @return string The relative path to the comic file, or false if not found. +*/ + +function get_comic_path($folder = 'comic', $override_post = null, $filter = 'default', $multi = null) { + global $post, $comic_filename_filters, $comic_folder, $archive_comic_folder, $rss_comic_folder, $mini_comic_folder, $comic_pathfinding_errors, $wpmu_version; + + if (isset($comic_filename_filters[$filter])) { + $filter_to_use = $comic_filename_filters[$filter]; + } else { + $filter_to_use = '{date}*.*'; + } + + switch ($folder) { + case "rss": $folder_to_use = $rss_comic_folder; break; + case "archive": $folder_to_use = $archive_comic_folder; break; + case "mini": $folder_to_use = $mini_comic_folder; break; + case "comic": default: $folder_to_use = $comic_folder; break; + } + + if (!empty($wpmu_version)) { + if (($wpmu_path = get_option('upload_path')) !== false) { + $folder_to_use = $wpmu_path . '/' . $folder_to_use; + } + } + + $post_to_use = (is_object($override_post)) ? $override_post : $post; + $post_date = mysql2date(CP_DATE_FORMAT, $post_to_use->post_date); + + $filter_with_date = str_replace('{date}', $post_date, $filter_to_use); + + $cwd = get_stylesheet_directory(); + if ($cwd !== false) { + // Strip the wp-admin part and just get to the root. + $root_path = preg_replace('#[\\/]wp-(admin|content).*#', '', $cwd); + } + + $results = array(); + /* have to use root_path to get subdirectory installation directories */ + if (count($results = glob("${root_path}/${folder_to_use}/${filter_with_date}")) > 0) { + + if (!empty($wpmu_version)) { + $comic = reset($results); + $comic = $folder_to_use . '/'. basename($comic); + if ($wpmu_path !== false) { $comic = str_replace($wpmu_path, "files", $comic); } + return $comic; + } + + if (!empty($multi)) { + return $results; + } else { + /* clear the root path */ + $comic = reset($results); + $comic = $folder_to_use .'/'. basename($comic); + return $comic; + } + } + + $comic_pathfinding_errors[] = sprintf(__("Unable to find the file in the %s folder that matched the pattern %s. Check your WordPress and ComicPress settings.", 'comicpress'), $folder_to_use, $filter_with_date); + return false; +} + + +/** +* Find a comic file in the filesystem and return an absolute URL to that file. +* @param string $folder The folder name to search. +* @param string $override_post A WP Post object to use in place of global $post. +* @param string $filter The $comic_filename_filters to use. +* @return string The absolute URL to the comic file, or false if not found. +*/ +function get_comic_url($folder = 'comic', $override_post = null, $filter = 'default') { + if (($result = get_comic_path($folder, $override_post, $filter)) !== false) { + return get_bloginfo('wpurl') . '/' . $result; + } else { + if (($result = get_comic_path('comic', $override_post, $filter)) !== false) { + $basecomic = basename($result); + return get_bloginfo('wpurl') . '/' . $result; + } + } + return $result; +} + +/** + * get_comic_filename + * returns the filename of the comic for the individual date. + * + */ +function get_comic_filename($folder = 'comic', $override_post = null, $filter = 'default') { + if (($result = get_comic_path($folder, $override_post, $filter)) !== false) { + return $result; + } +} + +/** + * Return a list of the comic categories with a negative value for exclusions + * NOTE: need a pre - negative for the first one + */ +function exclude_comic_categories() { + global $all_comic_categories_as_string; + if (empty($all_comic_categories_as_string)) get_all_comic_categories_as_cat_string(); + $returnstring = str_replace(",",",-",$all_comic_categories_as_string); + return $returnstring; +} + +/** + * Turn the tree of comics categories into a string to be fed into wp_query functions. + */ +function get_all_comic_categories_as_cat_string() { + global $all_comic_categories_as_string, $category_tree; + if (empty($all_comic_categories_as_string)) { + $categories = array(); + foreach ($category_tree as $node) { + $parts = explode("/", $node); + $categories[] = end($parts); + } + $all_comic_categories_as_string = implode(",", $categories); + } + return $all_comic_categories_as_string; +} + +/** + * Turn the list of categories into a hash table of category objects. + */ +function get_all_category_objects_by_id() { + global $categories_by_id; + if (empty($categories_by_id)) { + $categories_by_id = array(); + foreach (get_categories("hide_empty=0") as $category_object) { + $categories_by_id[$category_object->term_id] = $category_object; + } + } + return $categories_by_id; +} + +/** + * Parse all categories and sort them into comics and non-comics categories. + */ +function get_all_comic_categories() { + global $comiccat, $category_tree, $non_comic_categories; + + $categories_by_id = get_all_category_objects_by_id(); + + foreach (array_keys($categories_by_id) as $category_id) { + $category_tree[] = $categories_by_id[$category_id]->parent . '/' . $category_id; + } + + do { + $all_ok = true; + for ($i = 0; $i < count($category_tree); ++$i) { + $current_parts = explode("/", $category_tree[$i]); + if (reset($current_parts) != 0) { + + $all_ok = false; + for ($j = 0; $j < count($category_tree); ++$j) { + $j_parts = explode("/", $category_tree[$j]); + + if (end($j_parts) == reset($current_parts)) { + $category_tree[$i] = implode("/", array_merge($j_parts, array_slice($current_parts, 1))); + break; + } + } + } + } + } while (!$all_ok); + + $non_comic_tree = array(); + + if (get_option('comicpress-enable-storyline-support') == 1) { + $result = get_option("comicpress-storyline-category-order"); + if (!empty($result)) { + $category_tree = explode(",", $result); + } + $non_comic_tree = array_keys($categories_by_id); + foreach ($category_tree as $node) { + $parts = explode("/", $node); + $category_id = end($parts); + if ($parts[1] == $comiccat) { + if (($index = array_search($category_id, $non_comic_tree)) !== false) { + array_splice($non_comic_tree, $index, 1); + } + } + } + } else { + $new_category_tree = array(); + foreach ($category_tree as $node) { + $parts = explode("/", $node); + if ($parts[1] == $comiccat) { + $new_category_tree[] = $node; + } else { + $non_comic_tree[] = end($parts); + } + } + $category_tree = $new_category_tree; + } + + $non_comic_categories = implode(" and ", $non_comic_tree); +} + +/** + * Return true if the current post is in the comics category or a child category. + */ +function in_comic_category() { + global $post, $category_tree; + + $comic_categories = array(); + foreach ($category_tree as $node) { + $comic_categories[] = end(explode("/", $node)); + } + + return (count(array_intersect($comic_categories, wp_get_post_categories($post->ID))) > 0); +} + +// ComicPress Template Functions + +function the_comic_filename($filter = 'default') { return get_comic_filename('comic',null, $filter); } + +function the_comic($filter = 'default') { echo get_comic_url('comic', null, $filter); } + //The following is deprecated... + function comic_display($filter = 'default') { echo get_comic_url('comic', null, $filter); } + +function the_comic_archive($filter = 'default') { echo get_comic_url('archive', null, $filter); } + //The following is deprecated... + function comic_archive($filter = 'default') { echo get_comic_url('archive', null, $filter); } + +function the_comic_rss($filter = 'default') { echo get_comic_url('rss', null, $filter); } + //The following is deprecated... + function comic_rss($filter = 'default') { echo get_comic_url('rss', null, $filter); } + +function the_comic_mini($filter = 'default') { echo get_comic_url('mini', null, $filter); } + //The following is deprecated... + function comic_mini($filter = 'default') { echo get_comic_url('mini', null, $filter); } + +/** + * Display the list of Storyline categories. + */ +function comicpress_list_storyline_categories($args = "") { + global $category_tree; + + $defaults = array( + 'style' => 'list', 'title_li' => __('Storyline','comicpress') + ); + + $r = wp_parse_args($args, $defaults); + + extract($r); + + $categories_by_id = get_all_category_objects_by_id(); + + $output = ''; + if ($style == "list") { $output .= '
  • '; } + if ($title_li && ($style == "list")) { $output .= $title_li; } + if ($style == "list") { $output .= "
      "; } + $current_depth = 0; + foreach ($category_tree as $node) { + $parts = explode("/", $node); + $category_id = end($parts); + $target_depth = count($parts) - 2; + if ($target_depth > $current_depth) { + $output .= str_repeat("
      • ", ($target_depth - $current_depth)); + } + if ($target_depth < $current_depth) { + $output .= str_repeat("
    • ", ($current_depth - $target_depth)); + } + $output .= '
    • '; + $output .= $categories_by_id[$category_id]->cat_name; + $output .= "
    • "; + $current_depth = $target_depth; + } + if ($current_depth > 0) { + $output .= str_repeat("
  • ", $current_depth); + } + if ($style == "list") { $output .= ""; } + echo $output; +} + +/** +* Display text when image (comic) is hovered +* Text is taken from a custom field named "hovertext" +*/ +function the_hovertext() { + $hovertext = get_post_meta( get_the_ID(), "hovertext", true ); + echo (empty($hovertext)) ? get_the_title() : $hovertext; +} + +/** +* Display the comic transcript +* Transcript must be entered into a custom field named "transcript" +* @param string $displaymode, "raw" (straight from the field), "br" (includes html line breaks), "styled" (fully css styled with JavaScript expander) +*/ +function the_transcript($displaymode = 'raw') { + $transcript = get_post_meta( get_the_ID(), "transcript", true ); + switch ($displaymode) { + case "raw": + echo $transcript; + break; + case "br": + echo nl2br($transcript); + break; + case "styled": + if (!empty($transcript)) { ?> + + + +

    <?php the_title() ?>

    'Left Sidebar', 'before_widget' => ' +
    +','after_widget' => ' +
    ','before_title' => '

    ', 'after_title' => '

    +' )); + register_sidebar(array('name'=>'Right Sidebar','before_widget' => ' +
    +','after_widget' => ' +
    ','before_title' => '

    ', 'after_title' => '

    +' )); + register_sidebar(array('name'=>'Above Header','before_widget' => ' +
    +','after_widget' => ' +
    ','before_title' => '

    ', 'after_title' => '

    +' )); + register_sidebar(array('name'=>'Header','before_widget' => ' +
    +','after_widget' => ' +
    ','before_title' => '

    ', 'after_title' => '

    +' )); + register_sidebar(array('name'=>'Menubar','before_widget' => ' +
    +','after_widget' => ' +
    ','before_title' => '

    ', 'after_title' => '

    +' )); + register_sidebar(array('name'=>'Over Comic','before_widget' => ' +
    +','after_widget' => ' +
    ','before_title' => '

    ', 'after_title' => '

    +' )); + register_sidebar(array('name'=>'Left of Comic','before_widget' => ' +
    +','after_widget' => ' +
    ','before_title' => '

    ', 'after_title' => '

    +' )); + register_sidebar(array('name'=>'Right of Comic','before_widget' => ' +
    +','after_widget' => ' +
    ','before_title' => '

    ', 'after_title' => '

    +' )); + register_sidebar(array('name'=>'Under Comic','before_widget' => ' +
    +','after_widget' => ' +
    ','before_title' => '

    ', 'after_title' => '

    +' )); + register_sidebar(array('name'=>'Over Blog','before_widget' => ' +
    +','after_widget' => ' +
    ','before_title' => '

    ', 'after_title' => '

    +' )); + register_sidebar(array('name'=>'Blog','before_widget' => ' +
    +','after_widget' => ' +
    ','before_title' => '

    ', 'after_title' => '

    +' )); + register_sidebar(array('name'=>'Under Blog','before_widget' => ' +
    +','after_widget' => ' +
    ','before_title' => '

    ', 'after_title' => '

    +' )); + register_sidebar(array('name'=>'Footer','before_widget' => ' +
    +','after_widget' => ' +
    ','before_title' => '

    ', 'after_title' => '

    +' )); +} + +function storyline_category_list() { + $listcats = wp_list_categories('echo=0&title_li=&include='.get_all_comic_categories_as_cat_string()); + $listcats = str_replace("