WordPress Plugin: MyComic Browser

[[innerindex]]While creating the Uber-Geeks Web Comic, I wanted to keep WordPress as the backend for all my comic posting needs…which was fine. In doing so, I lacked the appropriate browsing features that seem common amongst many web comics (like Penny Arcade and RealLife).

Description

This plugin places a comic browser in a comic post (along with the comic name) providing navigation to First, Previous, Next, and Last comics.

Installation

  • Download and unzip mycomic.zip
  • Place mycomic.php in your wp-content/plugins directory
  • Log in to your WordPress admin panel and activate the plugin, then visit the new mycomic submenu of the plugins tab. This will allow mycomic to create its database tables.
  • Once installed, be sure to enable the options and consider customizing the look by adding the mycomic CSS to your theme’s CSS.
  • Edit Your Post/Page Tempates

Editing Your Post & Page Templates

Place the following line of code above the output of the content of a post/page:

< ?php if($comic=mycomic_is_comic($id)) mycomic_navigator($comic,$id); ?>

Here’s what the Uber-Geeks index.php looks like (line 14 has the code you want to insert):

< ?php get_header(); ?>

	<div id="content" class="narrowcolumn">

	< ?php if (have_posts()) : ?>

  	< ?php while (have_posts()) : the_post(); ?>

			<div class="post top" id="post-<?php the_ID(); ?>">
				<h2 class="first"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to < ?php the_title(); ?>">< ?php the_title(); ?></a></h2>
				<div class="postmetadata">Posted in < ?php the_category(', ') ?> by < ?php the_author() ?> | < ?php edit_post_link('Edit', '', ' | '); ?>  < ?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?></div>

				<div class="entry">
					< ?php if($comic=mycomic_is_comic($id)) mycomic_navigator($comic,$id); ?>
					< ?php the_content("<span class=\"continue\">" . __('Continue reading','') . " '" . the_title('', '', false) . "'"); ?>
				</div>
			</div>

		< ?php endwhile; ?>

	< ?php else : ?>

		<h2 class="center">Not Found</h2>
		<p class="center">Sorry, but you are looking for something that isn't here.</p>
		< ?php include (TEMPLATEPATH . "/searchform.php"); ?>

	< ?php endif; ?>

	</div>

< ?php get_sidebar(); ?>

< ?php get_footer(); ?>

Place that line of code in similar fashion in any template file that you wish to display the MyComic Browser.

Adding A Comic

Once fully installed, you are free to mark your comic posts as comics (in order to add them to the comic browser table). While editing/adding a post, simply create a custom field:

  • Key: comic
  • Value: 1

Save your post and the browser will appear!


Comments

24 responses to “WordPress Plugin: MyComic Browser”

  1. […] My Comic BrowserFrom the plugin’s name alone, I’m sure you’d have noticed that it’s an extremely niche plugin. What it does is to create a navigation system that you’d normally see on a webcomic (e.g. first, previous, next, last comic). My first thought was that it is an easy way to augment WP to act as a webcomic-centric CMS. After all, it’s really only up to your imagination how to use WP as a CMS. […]

  2. Was toying with code last night to try and do this. Glad to see someone has whipped up a plugin.

    Have been thinkin however, perhaps basing the inclusion of the navigation bassed on category? Might have a play with the plugin and see what I can break come up with. :)

  3. Well.. it doesn’t work with 2.0.5 -> I can’t activate it since all the code of the plugin is displayed in admin panel..

  4. Been looking a long time for something like this to try and help get my web comic(s) started up. Thanks for the plugin! :) Just wondering..Does it support multiple comics? Because I will be supporting two different ones on the same page..

  5. Doesn’t work with 2.0.5. Damn.

  6. Kisakookoo Avatar
    Kisakookoo

    Hi! Why I can’t fill my info in profile? Can somebody help me?
    My login is Kisakookoo!

  7. Doesnt work with wordpress 2.0.4 and it shows everything in the plugin panel

  8. Works perfect for me with 2.1

    But I’ve got a question. Is there a possibility to let the plugin check “id” instead of “post_id”, because my post_id’s aren’t in the right order, but my id’s are.

    Thnx.

  9. Jake, Mattisdada etc. It’s breaking because the file is in mac format, with \r’s instead of \n’s. You can fix this on linux like this:

    tr ‘\r’ ‘\n’ mycomic.php.bak
    mv mycomic.php.bak mycomic.php

  10. gah! it lost the angle brackets. That should be
    tr ‘\r’ ‘\n’ &lt mycomic.php &gt mycomic.php.bak

  11. sigh… well that didn’t work either. whatever. I hope you know what I mean.

  12. For people having issues with the plugin showing *everywhere* on the Plugins page – its a MAC format issue as explained by Mike Lin.

    However, not all of us know how to use the command line and such (I certainly don’t! :P) so for those on e.g. WindowsXP – once you’ve downloaded the file to your hard drive, I suggest donwloading Notepad++ here, loading up the file and clicking on ‘Format’ -> ‘Convert to Unix Format’ before uploading it to your webhost (usually unix/linux)

  13. During Activation – the plugin warns you that tables will have to be manually deleted if the plugin is removed. It also gave a header error… which I didn’t manage to copy down.

  14. I haven’t been able to make this work on 2.11 yet… although the posts have the key ‘comic’ and value ‘1’, for some reason they’re not being written to the wp_comic table. Some suggestions would be appreciated :) Thanks!

  15. This plugin now works in 2.12. The author (Matthew Batchelder) has updated the plugin so all the errors (that I can find anyway) have disappeared. Thanks Matt! :)

  16. I’m having some issues getting it working. I created a page template and included the php line above. Tag is set to dncomic and I set the comic title. I get the error message

    WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ” at line 1]
    SELECT comic FROM wp_comic WHERE post_id=;

    Kind of stuck as to what to do. I know how to admin MySQL and I can decipher php and css enough to modify things but I’m not so hot on trouble shooting and I definitely can’t write from scratch. tekchip at yahoo dot com

  17. […] Mycomic what to do Thanks if you could help me with this one wordpress-bobo heheh Filed under: Geekiness […]

  18. Hello, i dont fully understand where i add your code so it can be displayed in the theme i use. Can i email you somehow, to give you my comments.php and add it? If yes, please do email me:)

  19. Will there be any demo?

  20. Is there any demo?

  21. Long time no see! In the end my previous project petered out, but I’m back again! Just wondering if the plugin works with 2.3.3 and/or 2.5 (WordPress versions)? :) Thanks!

  22. […] do I incorporate this plugin to Thesis without it breaking? I’m trying to incorporate "The MyComic Browser" into my blog and I have limited knowledge of CSS/PHP. How exactly should I use the code given on […]

  23. I got one of my blog setup but it is wordpress version2.7 however I will try if it’s working or not. thanks!