Forum

Notifications
Clear all

[MODULE] ePubVersion

Page 3 / 9
Amalthia
(@amalthia)
Trusted Member

That's probably not a bad idea to keep a watch on the forums after a big update.

I tried the patched upgrade.php and it did not work so I uninstalled and uploaded the 1.0 version and it looks like I got the same error message.

A fatal MySQL error was encountered.
Query: ALTER TABLE `fanfiction_settings` ADD `epubanon` TINYINT( 1 ) NOT NULL default '1'
Error: (1060) Duplicate column name 'epubanon'

I'm not sure why the clean install didn't work or why the upgrade threw up the same error. But I've tried it both ways with efiction 3.5.3.

Actually, if the error happened where I think it happened, you have a complete install of 1.0 now, it just errored out as it tried to run a 2nd install of the new settings. Unless you backed out the changes it made, you shouldn't need to run again.

As for responding quickly, I stalk this forum like a hawk looking for mice after I make a release... That's why small version updates were coming out so fast previously. πŸ˜›

-HuGgLeS-
-P/KAF/PT

ReplyQuote
Posted : 01/02/2011 9:31 am
Piper
(@piper)
Trusted Member

If you send me an email ( GeekBrat[@]Gmail[.]Com ) I will send you a custom version uninstall script that will clean your database of all ePubVersion entries. Then we can try a new clean install.

-P/KAF/PT

StoryPortal Fiction Network - StoryPortal.Net
TG Fiction dot NET | T* Fiction Archive - TGFiction.Net
LG Tales | TG Style Fiction for LG's - LGTales.Com

ReplyQuote
Topic starter Posted : 01/02/2011 10:06 am
Piper
(@piper)
Trusted Member

I've been up all night debugging and re-writing the install script. I'm going to take a nap, then when I wake up, do the same for the update script... I pulled the 1.0 downloads from my site, and I will post when I have re-released them. With all the work I did to the script, I really thought any issues would _NOT_ be in the install/updates script... Funnily enough the Uninstall script worked fine, but I wrote a "drop all" script that doesn't halt on errors just in case someone has "half an install"..

I'm sorry for this everyone, but it's a 1 person project, and I've not been feeling my best the last couple days. One of the reasons I delayed releasing is I was hoping to get better, and catch any errors...

-Sighs-

-P/KAF/PT

StoryPortal Fiction Network - StoryPortal.Net
TG Fiction dot NET | T* Fiction Archive - TGFiction.Net
LG Tales | TG Style Fiction for LG's - LGTales.Com

ReplyQuote
Topic starter Posted : 01/02/2011 12:36 pm
Piper
(@piper)
Trusted Member

That's probably not a bad idea to keep a watch on the forums after a big update.

I tried the patched upgrade.php and it did not work so I uninstalled and uploaded the 1.0 version and it looks like I got the same error message.

A fatal MySQL error was encountered.
Query: ALTER TABLE `fanfiction_settings` ADD `epubanon` TINYINT( 1 ) NOT NULL default '1'
Error: (1060) Duplicate column name 'epubanon'

I'm not sure why the clean install didn't work or why the upgrade threw up the same error. But I've tried it both ways with efiction 3.5.3.

I have updated the initial post again, and updated the download site...

We are now at version 1.0u1 (Update One)...

The changes include, working Install script, working Update script, and the addition of dropall.php which can be used to remove all bits of code added to your MySQL database by ePubVersion. DropAll was created to allow an admin to uninstall a half installed or partially installed ePubVersion installation without having to manually modify the MySQL database. What makes it special, is if it encounters a SQL statement that fails, it ignores it and continues processing.

-HuGgLES- and thank you everyone for hanging in there!
-P/KAF/PT

StoryPortal Fiction Network - StoryPortal.Net
TG Fiction dot NET | T* Fiction Archive - TGFiction.Net
LG Tales | TG Style Fiction for LG's - LGTales.Com

ReplyQuote
Topic starter Posted : 02/02/2011 8:54 am
calash
(@calash)
Estimable Member

Wonderful work!

I am going to get this put on my site today.  Then I will run the Nook test tonight πŸ˜‰

The World of Necrotania - Story Writing Community

ReplyQuote
Posted : 03/02/2011 1:05 pm
calash
(@calash)
Estimable Member
Ran into a minor panel issue, but this is due to my site setup and not your mod.  My custom menus have some odd issues with module paths so I have to hard code the fix into the panel path.  Nothing for you to worry about but worth noting.

I did have an issue with the browse page.  During the install I set all stories to have ePub off.  I then set one to On.  When I went to the browse page it showed all the stories, but none of the links worked.

I made a change in your browse page to correct it.  Here is what I changed the implode statment to


$epubquery[] = "validated > 0";
$epubquery = "epub = '1' AND ".implode(' AND ', $epubquery)." ORDER BY ".($defaultsort == 1 ? "date DESC" : "title ASC");

Here is the origional


$epubquery[] = "validated > 0";
$epubquery = implode(" AND epub = '1' AND ", $epubquery)." ORDER BY ".($defaultsort == 1 ? "date DESC" : "title ASC");

I am still not getting story links working at this point.  Going to check my code and see if it is my mods interfering or if it is a bug of some kind.

The download from the page works great for what I have been able to test so far.  I will be giving it a Nook test tonight when I get home from work.

Edit:  Found the problem with the URL.

From epubsblock.php


$epubslist->assign("title", $rectarget == 2 ? "<a href="' http://www.necrotania.com/eFiction/viewstory.php?sid=".$epub['sid' ;"]."'>".stripslashes($epub['title'])."</a>" : format_link($epub['url'], stripslashes($epub['title']), $rectarget));

I believe that $rectargets is leftover from the recontamination mod.  If I add the following to the beginning of the file


$rectarget=2;

This corrects my URL problem on the browse page.

The World of Necrotania - Story Writing Community

ReplyQuote
Posted : 03/02/2011 6:29 pm
Piper
(@piper)
Trusted Member

I'm currently coding and testing revision 1.2 of the script... 1.1 was created and released to one person for testing...

The changes are this:

v1.1
The ability to choose from the 3 following options for image handling:

CURL - Uses CURL to retrieve and store the images. (Requires PHP compiled with CURL support).
URL_FOPEN - Uses get_file_contents() to retrieve and store images (requires URL_FOPEN be enabled in PHP.INI (hence the name).
NONE - Does not retrieve or store any images, but does filter out the IMG tags.

v1.2
The ability to choose the following HTML parsing options:

TIDY - Uses PHP's TIDY support to format and pretty-print the html and fix errors (requires PHP compiled with TIDY support)
PURE - Uses a purely HTML function called HTML Purifier, which actually does a BETTER job than TIDY! (Is slower than tidy, unless a conversion is done often, at which time it uses an internal caching function)
NONE - This sends the HTML as it is stored, with no processing. This might cause many processing errors in various eBook readers as they are REALLY PICKY about tags.

I'm considering adding the following option "TIDY + PURE" because they both have options that are mutually exclusive to each other... So I could pass it through  BOTH loops which might increase server load, and processing time, but produce a REALLY WELL formatted/compliant ePub

I still have work to do for filtering out some bad HTML using PURE, but right now, a few of the stories @ TGFiction.Net are coming back 100% valid using ePubCheck or with minimal errors that won't hinder rendering.

100% Valid :
Examples - http://www.tgfiction.net/eFiction30Beta/viewstory.php?sid=34 | http://www.tgfiction.net/eFiction30Beta/modules/epubversion/epubs/34/1/Flower_Girls_1.epub
Examples - http://www.tgfiction.net/eFiction30Beta/viewstory.php?sid=36 | http://www.tgfiction.net/eFiction30Beta/modules/epubversion/epubs/36/1/Sisters_A_School_Story_1.epub
Minimal Errors: (I think caused by a bad href)
Examples - http://www.tgfiction.net/eFiction30Beta/viewstory.php?sid=41 | http://www.tgfiction.net/eFiction30Beta/modules/epubversion/epubs/41/all/Expo_Summer.epub

Looking at those links reminds me of another change/improvement... The ability to use search friendly URL's...
I included a .htaccess file and a config option for if you want to use the friendly urls or not. The advantage to this is that STANZA uses the filename in the url as the title of the book when it downloading directly via the STANZA app on iPhone. By using the Printer friendly urls you get a book titled "Book_title" instead of "epubversion". This format will also help newer iOS4 devices know to pass the .epub download over to stanza if you click the link in mobile safari.

Calash, thanks for the heads up, I will fix the errors before the next code release.

As always, keep those bug reports coming! The only way I know if this isn't working right for everyone, is if people tell me what's happening!

-P/KAF/PT

StoryPortal Fiction Network - StoryPortal.Net
TG Fiction dot NET | T* Fiction Archive - TGFiction.Net
LG Tales | TG Style Fiction for LG's - LGTales.Com

ReplyQuote
Topic starter Posted : 03/02/2011 11:41 pm
Piper
(@piper)
Trusted Member

Can I ask a ?

Do y'all want me to keep "blogging" my updates here, or just announce code releases and blog the updates on my blog?

I ask this as I was about to post that I've made a lot of progress with a preprocessing function that I wrote which pre-converts <S><B><I><STRONG><EM><U> to span tags with styles, which tidy or purifier then combined into a master tag if needed. This, along with the new TIDY+PURE option is REALLY creating some clean ePub books.

N-E-Ways, I started to feel like this was turning too much into a blog thread, when I already have a blog.... Several in fact πŸ˜›

What r ur thoughts?
-P/KAF/PT

StoryPortal Fiction Network - StoryPortal.Net
TG Fiction dot NET | T* Fiction Archive - TGFiction.Net
LG Tales | TG Style Fiction for LG's - LGTales.Com

ReplyQuote
Topic starter Posted : 04/02/2011 5:12 am
Amalthia
(@amalthia)
Trusted Member

Do y'all want me to keep "blogging" my updates here, or just announce code releases and blog the updates on my blog?

What r ur thoughts?
-P/KAF/PT

I'd love if you kept posting about the updates. Not knowing what was updated is rather frustrating sometimes and without a list of what's changed some people may not realize there have been big improvements or changes to a code/program/module.

Again thanks for taking the time to keep us in the loop!

ReplyQuote
Posted : 04/02/2011 5:55 am
Sue
 Sue
(@sue)
Estimable Member

I'm not sure about the policy of the eFiction board, but personally, I appreciate very much seeing the "story so far" stuff here. I think it becomes a useful resource for people to trouble shoot their sites (what's already been tried etc) and it gives people an insight into how much work goes into not only eFiction, but mods such as yours.

ReplyQuote
Posted : 06/02/2011 9:21 am
Piper
(@piper)
Trusted Member

Current Version: 1.2 (There was no v1.1 public file release, but there was a 1.1 version. I'm keeping it listed in the changelog as 1.1 for my own sanity πŸ˜› )

Demo: http://www.tgfiction.net (visit any story, and look for the ePub icon under DisplayWord and Printer friendly)

Mod History:

  • 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.2 – Added Dynamic Banner option to banners list.
  • v.1.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.

Download: http://storyportal.net/software/epub/

Version 1.2 is officially released. All reported errors have been fixed. We are now generating near perfect XHTML in most cases (TIDY+PURE Option creates BEAUTIFUL code).

My current plan is to add the ability for site admins to set a default "cover image" which should be picked up by many eReaders....  And then add the ability for an author to use the eFiction Image Uploads to upload a custom ePub cover for each book.

Any comments/questions are always welcome.  Here and @ the wordpress release site. I'm working hard on this module and I'm glad people are liking it.

-P/KAF/PT

StoryPortal Fiction Network - StoryPortal.Net
TG Fiction dot NET | T* Fiction Archive - TGFiction.Net
LG Tales | TG Style Fiction for LG's - LGTales.Com

ReplyQuote
Topic starter Posted : 07/02/2011 12:25 am
calash
(@calash)
Estimable Member

Wonderful job!  I am updating now.

One thing I did not know but found out this weekend what that I could not download the ePub to my wifes Nook from the internal web browser.  Apparently the internal browser does not allow downloads.

Downloading to the computer and copying over works great.

Edit:  Just ran the update and it reset all my stories to "No" for the setting, even the one I had put to "Yes" previously.  Not a big deal on my site since I have not advertised the feature yet.

Edit:  No wait...it is set right.  It is just not showing up on the browse list.

The World of Necrotania - Story Writing Community

ReplyQuote
Posted : 07/02/2011 3:59 pm
calash
(@calash)
Estimable Member

False alarm.  Something in my custom epub.tpl was not working with the new version.  I flipped to the default and it is working fine now.

Edit:  Found a minor bug in epubsblock.php that prevents the download link from showing in the browse page even if you allow anon downloads.

The offending line is


if(isMEMBER) {
$epubslist->assign("dlepub", " [<a href=""modules/epubversion/epubversion.php?sid=".$epub['sid'"]."&amp;chapter=ALL">"._EPUBDL."</a> (".$epub['epubread']." Downloads)]");
}

I changed it to the following to allow the link to display for guests.


if(isMEMBER OR (!isMEMBER && $epubanon)) {
$epubslist->assign("dlepub", " [<a href=""modules/epubversion/epubversion.php?sid=".$epub['sid'"]."&amp;chapter=ALL">"._EPUBDL."</a> (".$epub['epubread']." Downloads)]");
}

Like I said, very minor πŸ™‚

On a different note I just tested rendering with the Android Nook app and it is perfect.  Great job!

The World of Necrotania - Story Writing Community

ReplyQuote
Posted : 07/02/2011 7:04 pm
Piper
(@piper)
Trusted Member

False alarm.  Something in my custom epub.tpl was not working with the new version.  I flipped to the default and it is working fine now.

Edit:  Found a minor bug in epubsblock.php that prevents the download link from showing in the browse page even if you allow anon downloads.

Like I said, very minor πŸ™‚

On a different note I just tested rendering with the Android Nook app and it is perfect.  Great job!

It wasn't a bug, it was designed that way, but maybe I'll change it....

When I first put that download link on that page, there was no ePub counter.... So I was hoping to urge people to ckick thru to the first chapter at least so that it counted as a read, but I gave the DL link on the browse page as a perk for being a member.... Hrmmm....

Thanks for the report!

-P/KAF/PT!

StoryPortal Fiction Network - StoryPortal.Net
TG Fiction dot NET | T* Fiction Archive - TGFiction.Net
LG Tales | TG Style Fiction for LG's - LGTales.Com

ReplyQuote
Topic starter Posted : 07/02/2011 8:47 pm
Piper
(@piper)
Trusted Member

Just a heads up on current development..

I think I have the the cover image selector mostly finished. It's not a lot of code or particularly tricky, but I took some time off ePubVersion development to work on some writing and photoshop work.

I think I have also figured out how to re-implement TemplatePower support into ePubVersion. It's funny, the TemplatePower function I need to use is damn near undocumented (getOutputContent) and when I did some research on how it works, it seems to use the same workaround that I was thinking might work (capturing the rendered template to the output buffer). The problem with this is that the PHP ePub class that ePubVersion uses doesn't like it when the output buffer is used... But I will see what happens when we work with it.

I also have ideas for PDF output and was wondering if I should include this in ePubVersion as a 2nd output format or code an entirely separate module that will duplicate much of the same admin/configure code. Any thoughts?

-P/KAF/PT

P.S. Thank YOU! To everyone whom has donated/gifted to the project, and as always, if anyone has any special feature requests/ideas just post them here or @ the StoryPortal Fiction Network ( http://storyportal.net ) blog.

StoryPortal Fiction Network - StoryPortal.Net
TG Fiction dot NET | T* Fiction Archive - TGFiction.Net
LG Tales | TG Style Fiction for LG's - LGTales.Com

ReplyQuote
Topic starter Posted : 17/02/2011 8:30 am
Page 3 / 9
Share: