ePubVersion Logo Image

ePubVersion is FREE software, but

Please Consider a Gift

to Help Support Further Development.


v1.3 Update 1 Has been RELEASED and is ready for download!

[download id=”26″ format=”2″]

[download id=”27″ format=”2″]


Manage ePub
What is it?:

  • ePubVersion is an eFiction 3.x module that creates on-the-fly ePUB eBooks for Single Chapter and Multi Chapter stories.
  • eFiction is a CMS catering to Fiction Archive sites.
  • ePub (or EPUB, ePUB, EPub, epub) is an Electronic Publication format (or eBook) supported by most Hardware and Software eBook readers. The most notible exception being the Amazon Kindle. For more information on ePub and devices that support them, Click Here.



  • PHP – 5.3.2
  • I use don’t use any specialized MySQL functions. I use MySQL5 for testing and development, but again, have no specific requirements other than that.
  • PHP needs to be compiled with TIDY in order to use the TIDY option.
  • Apache Mod_Rewrite is needed for Search/Stanza friendly URL’s
  • PHP needs to be compiled with CURL support to enable CURL as an option for image retrieval.
  • PHP needs to have URL_FOPEN enabled to enable URL_FOPEN/get_file_contents() as an option for image retrieval.
  • I make GREAT use of preg_match/preg_replace so your webhost needs to have perl regular expressions (regexp/PCRE) enabled in PHP.
  • PHP needs to be compiled with DOM support
  • PHP needs to be compiled with GD support and PNG/JPEG/GIF GD extensions to properly support images.



  • v1.3u1 – Fixed installer and update.php errors present in version 1.3 and referenced in comments and the eFiction.org/de forums.
  • v1.3 – Fixed errors introduced by v1.3rc1
  • v1.3 – Added {cover} {printthumb} {printepub} {epubcount} to available template variables.
  • v1.3 – Added support for changing the ePub “Language” identifier.
  • v1.3 – Added support for site wide “Cover” images for stories.
  • v1.3 – Added support for author uploaded/custom “Cover” images for stores.
  • v1.3 – Upgraded EPub.php to current released version.
  • v1.3 – Upgraded HTML Purifier to current released version.
  • v1.3 – Added the ability to use “Cover” images on your eFiction Front page and Stories pages…
  • v1.3 – Improved handling of extraneous character sets.
  • v1.3 – Fixed several reported errors.
  • v1.3 – Fixed Dynamic Banner code.
  • v1.2 – Added Dynamic Banner option to banners list.
  • v1.2 – Incorporated changes to browse pages to fix errors as reported by Calash (THX!)
  • v1.2 – Added ePub Download Counter
  • v1.2 – Added pre-processing preg_replace filter for pre-processing conversion of <b><i><u><em><s><strong> into span tags.
  • v1.2 – Added routine for a Combined TIDY+PURE. This option creates the largest resource hit on your server, as it essentially processes each page 4 times. (once for images, once for pre-processing,  and then once each to filter through TIDY and HTMLPurifier). Each step improves the output book for better compatibility on more readers).
  • v1.2 – Added support for HTMLPurifier (PURE). HTMLPurifier outputs pretty XHTML compliant source pages that make for optimally redered ePub eBooks.
  • v1.1 – Added choice of URL_FOPEN/get_file_contents() support for those whom don’t have CURL for image retrieval.
  • v1.1 – Added choice of NONE which filters all IMG tags from the source material, and creates a image-less ePub eBook.
  • v1.0 – Added Image Support
  • v1.0 – Added Admin Configure/Options Panel
  • v1.0 – Added Author Configure/Manage Panel
  • v1.0 – Added ePub Browse Panel
  • v1.0 – Added Update script
  • v1.0 – Added Tidy support
  • v1.0 – Added ability to turn off ePub Creations for non logged in users
  • v1.0 – Fixed double header error on Cover page (caused crash in Stanza)
  • v1.0 – Added Title Sanitation (Caused crash in Stanza)
  • v1.0 – Cleaned up code where needed. Compacted some bits.
  • v0.9 – copied formatstory() and nblr2() functions from corefunctions.php to epubversion.php to remove errors caused by stories with content warnings.
  • v0.9 – Removed includes for TemplatePower, corefunctions.php. pagesetup.php
  • v0.9 – more general code cleanup.
  • v0.8 – Added small configuration section at the top of epubversion.php that can be used to configure $sitename, $siteurl, and $sitetagline which are used for the OPF File’s publisher line, and the “Brought to you by” line on the coverpage.
  • v0.8 – added ‘exit();’ right after the epub is sent to the user in order to stop erroneous/extra data being sent and causing some ebook readers to detect a bad ebpu/zip container.




  • v1.3 – eBook Cover Selection for Authors and Site Admins
  • v1.4 – PDF Creation
  • v1.4 – Mobi/AZW Creation (Kindle Support)
  • v2.0 – Template.Power Support? (not sure this is even possible).
  • v3.0OPDS Catalog Creation. Will allows users to add your eFiction site as an eBook Catalog/Provider/Store in their favorite eBook readers.

Current issues:

  • All Formatting is currently hardcoded into ePubVersion (I will work on putting the Template.Power template support back in in a later release, but I was having issues mixing the EPub class and the Template.Power class).



This module was coded/adapted by Kirstyn Amanda Fox (GeekBrat [at] Gmail [dot] Com) , is released under GPL and is free to use. Use it to your hearts content. Please leave my info in any derivative works, as I have left those whom came before me.

This module makes use of PHP’s Tidy function.

This module makes use of HTML Purifier by Edward Z. Yang

This moudule makes use of the EPub and ZIP  PHP classes by Asbjorn Grandt
– http://www.phpclasses.org/package/6115

This module is being based on DisplayWord for eFiction 3.0 by Tammy Keefer
– http://efiction.hugosnebula.com/






Legacy/Old Version Downloads:

  • [download id=”22″ format=”2″]
  • [download id=”23″ format=”2″]
  • [download id=”24″ format=”2″]
  • [download id=”25″ format=”2″]
  • [download id=”21″ format=”2″]
  • [download id=”20″ format=”2″]
  • [download id=”19″ format=”2″]
  • [download id=”18″ format=”2″]
  • [download id=”16″ format=”2″]
  • [download id=”17″ format=”2″]
  • [download id=”9″ format=”2″]
  • [download id=”8″ format=”2″]
  • [download id=”10″ format=”2″]
  • [download id=”5″ format=”1″]
  • [download id=”6″ format=”1″]
  • [download id=”7″ format=”1″]
  • [download id=”1″ format=”1″]
  • [download id=”2″ format=”1″]
  • [download id=”3″ format=”1″]
  • [download id=”4″ format=”1″]

Powered by HTML Purifier

eFiction LOGO Image

21 Thoughts on “ePub

  1. Pingback: ePub eBooks Now Available! | StoryPortal Fiction Network

  2. Your download links aren’t working.

  3. Lyndsie on January 16, 2011 at 1:56 pm said:

    When I click on any of the download links: “Sorry, no posts matched your criteria.”

  4. Download links have been fixed.


  5. Thank you for creating this! My users are really looking forward to this feature.

    I’m trying to install the module but get:

    Parse error: syntax error, unexpected ‘”‘ in /XXX/fictioning.net/modules/epubversion/version.php on line 11

  6. Thanks for the note! just add a ” before epubversion on line 11.

    The line looks like this now:
    $moduleName = ePubVersion";

    You want it to look like this:
    $moduleName = "ePubVersion";

    Or you can wait for the next release which will be out in a few days that will sanitize the story output making it proper xhtml (choice of regex or tidy) and possibly even image support!


  7. Wait? Are you kidding? This is very exciting!

    Thank you for the prompt fix. The module installed and the icon displays, but when I try to “epub” a story, I get:

    Notice: Undefined variable: skin in /XXX/fictioning.net/includes/class.TemplatePower.inc.php on line 146

    Notice: Use of undefined constant SITEKEY – assumed ‘SITEKEY’ in /XXX/fictioning.net/includes/corefunctions.php on line 242

    Warning: array_key_exists() [function.array-key-exists]: The first argument should be either a string or an integer in XXX/fictioning.net/includes/storyblock.php on line 103

    Error: Unable to send file Another_Case_Scenario_[1].epub. HTML Headers have already been sent from /XXX/fictioning.net/includes/class.TemplatePower.inc.php in line 146

    This is going to be mega! I can’t thank you enough for taking the time to develop this module.

  8. in epubversion.php go ahead and comment out the following lines, starting at or around line 85:
    include (_BASEDIR."includes/class.TemplatePower.inc.php");
    if(file_exists("$skindir/printstory.tpl")) $tpl = new TemplatePower( "$skindir/printword.tpl" );
    else $tpl = new TemplatePower(_BASEDIR."modules/displayword/default_tpls/printword.tpl");

    Once that is taken care of, try making an ePub of a book that doesn’t have a content warning attached and see if that goes through. I will have to try a work-around for the content warning stuff.

    Ignore the instructions about commenting out the TemplatePower stuff, it’s needed by other functions. Try the suggestion about a story without a content warning tho and see if that helps.

  9. Page updated. New code released to fix previous error report.

  10. Working! Thank you so much. This is just brilliant. Congratulations on all your work.

  11. Pingback: ePubVersion Matures! | StoryPortal Fiction Network

  12. Annica on March 3, 2011 at 10:57 pm said:

    Hi, I’ve just installed this on my site and am currently testing it out.
    I saw your question over at efiction about including a pdf option. I’d love that and if it’s possible to have epub and pdf in one Mod then that’s what I’d prefer any day.

    Great work!

  13. It’s definately something I’m looking into. I’m actually thinking about modifying Tammy’s original “Display Word” mod and including it too, creating like an “Export Version” mod that contains as many formats as I can produce. I’m currently sideline by other projects, but have the next release of ePubVersion nearly ready. IT includes a lot of small changes, that can be used to spice up your eFiction site in general (see examples @ TGFiction.Net [the thumbnail images]).

    Thanks for the comment! I’m a Comment WHORE!

  14. Hi,
    I’ve got to move the site to another host and…long story short, I’m reskinning and whatnot and I need to uninstall the module.
    When I try via the admin area, I get a blank screen.
    What should I delete etc?

    cheers and thanks again,

  15. Me again 🙂

    All installed on the new host now. When I try to uninstall on that I get:

    Fatal error: Cannot redeclare validemail() (previously declared in /home/xxx/public_html/includes/corefunctions.php:26) in /home/xxx/public_html/includes/corefunctions.php on line 28

  16. I’d love to install this but I get the following :

    A fatal MySQL error was encountered.
    Query: select `epubimg` from `settingsfanfiction_settings` limit 0
    Error: ()

  17. There will be an update shortly, I promise 🙂

  18. Nice plugin – with a little work it integrates with nearly every kind of fanfiction archiv – in my case with a heavily changed efiction 2.0.3.

    Thanks for your work, I think our users love it 😉

  19. I have this error when installing

    A fatal MySQL error was encountered.
    Query: select `epubimg` from `settingsfanfiction_settings` limit 0
    Error: (1054) Unknown column ‘epubimg’ in ‘field list’

  20. Unfortunately, cPanel is not providing PHP 5.3 anymore since it was moved out of production list already. Is PHP 5.4 or 5.5 is enough for the website to work after making code changes?.

  21. I successfully use it on php 5.6 … I’m not quite sure eFiction or my code are quite PHP7 ready yet.


Leave a Reply

Your email address will not be published. Required fields are marked *