Notifications
Clear all

[MODULE] ePubVersion

113 Posts
19 Users
0 Reactions
53.4 K Views
(@snowhitesally)
Posts: 30
Eminent Member
 

When I try and install this module, I get this error, any ideas?

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


 
Posted : 28/08/2016 2:58 pm
(@ladama)
Posts: 44
Trusted Member
 

I am also trying to install this. I was having the same problem as Sally, but then I replaced the install.php code with the code that SJP posted upthread and appeared to be able to install the module.

However I'm now getting the same error Heatherlly posted about above, trying to download an epub and getting these error messages:

Notice: Array to string conversion in /home/ladama/jimothy/fanfiction/modules/epubversion/epubversion.php on line 164

Notice: Undefined variable: img_filename in /home/ladama/jimothy/fanfiction/modules/epubversion/cover_img.php on line 90

Error: Unable to send file Anywhere But Here [1].epub. HTML Headers have already been sent from /home/ladama/jimothy/fanfiction/modules/epubversion/epubversion.php in line 164

Piper said to turn off error reporting but as far as I know it's turned off, I have the "Display Debug Info" setting switched off in the "Site Settings"  of eFiction, is there also some code I should be adding or removing somewhere like in the header.php?


 
Posted : 29/08/2016 4:37 am
(@ladama)
Posts: 44
Trusted Member
 

So after some poking around I got this module mostly working (finally!) but there are still several annoying things going on so any assistance with this is appreciated!

Firstly, it looks like the storyportal site is down right now, but the module is available here: https://github.com/geekbrat/ePubVersion

How I got it to work!
* First, I replace the install.php code with what SJP posted upthread.
* Next I went into the epubversion.php file and on line 9 changed the error reporting value from E_ALL to 0 (zero)
At this point I can install the module no problem and, once the {printepub} tag is on the proper TPL files, I could download a file, except the ePub file downloaded just had errors.
So now I -
* go to admin>module>epub version options and for "HTML Filters?" I select "PURE"
(EDIT: I figured out how to turn on TIDY, most hosts/servers have it installed but the user has to initiate it. You can do this in your CPanel, or if you have DreamHost like we do you can do it this other somewhat convoluted way, let me know if you have DH and need help! I don't know if there's a noticeable difference but TIDY is apparently faster. Either way, you need the HTML filters set to something and not just "none" to get this to work!)

Now I can actually download a functional ePub file!
Here's my tester site: http://jimothy.just-once.net/fanfiction/ <---I sometimes keep it in maintenance mode just in case one of our users stumble onto it, you can log in with username and password "admintest"

So that's the good news, now onto some of the issues!

*Personally, I want only registered/logged in users to be able to download ePub files, but when I disable anon downloads in the module settings, then attempt to download, it just sends me to a page that reads: "We are sorry, but we have chosen to disable ePub eBook creation for non logged-in users." Trouble is I AM logged in! Any clue where to start looking to fix this?

*On the Table of Contents page (the storyindex.tpl) of a multi-chapter story, when I click the ePub download it will only render the first chapter. When I'm viewing the story (viewstory.tpl) it will give me both "chapter" or "story" download options. How to I get it to render the whole story if a user clicks the download link in the table of contents?

I'm also having all the same problems detailed upthread in this reply:
* There's no break or other delineation between the chapter notes and the chapter text
* Some stories won't work in eReaders especially if there is certain punctuation or accented letters in the story title or chapter title.
* The user that's uid=1 is put as a co-author on many of the stories.

I think that's it, mostly minor but still annoying. The disabling anon downloads is what I most want to fix (I'm hoping to use this feature as incentive for people to sign up and log in!) but help with anything is appreciated!


 
Posted : 22/09/2016 5:44 pm
(@ladama)
Posts: 44
Trusted Member
 

*Personally, I want only registered/logged in users to be able to download ePub files, but when I disable anon downloads in the module settings, then attempt to download, it just sends me to a page that reads: "We are sorry, but we have chosen to disable ePub eBook creation for non logged-in users." Trouble is I AM logged in! Any clue where to start looking to fix this?

*On the Table of Contents page (the storyindex.tpl) of a multi-chapter story, when I click the ePub download it will only render the first chapter. When I'm viewing the story (viewstory.tpl) it will give me both "chapter" or "story" download options. How to I get it to render the whole story if a user clicks the download link in the table of contents?

Did a little more tinkering and at least figured out the download chapter problem. In the ePub module folder, I went to the storyblock.php and on line 47 where it says:

else $printepub = "<a href=""modules/epubversion/epubversion.php?sid=$sid&amp;chapter=1">[/code"]

I changed it to "chapter=all" . I also did the same change in "storyblock2.php" for good measure.

Now with the disabling anon download, I found this around line 141
if(!isMEMBER && !$settings['epubanon']) {
die(_EPUBERRORANON);
}

and changed it to

if(!isMEMBER && !$settings['epubanon'] == "0") {
die(_EPUBERRORANON);
}

Adding the '== "0"' at least seems to solve the problem before where I wasn't able download the ePub even if I was logged in, now anon users don't see any ePub download links while logged-in users do.

However I actually want non-logged in users to see the ePub download links and then click and get the "registered users only" message, and/or have the number of ePub downloads be on display to everyone (with the disable anon downloads selected) as right now that download total disappears if anon downloads are disabled. This isn't essential, but still something I'd like!


 
Posted : 22/09/2016 8:14 pm
(@snowhitesally)
Posts: 30
Eminent Member
 

Is there a way to add the epub downloads to the top ten section? I'd love for people to see who is most downloaded etc?


 
Posted : 17/10/2016 1:08 pm
(@guest17300)
Posts: 0
 

so today i installed this mod to our website. it's all fine, even though we had to hack our way in the database to change NONE setting to PURE, but it works nonetheless. now, two problems:

> some stories (not all of them) return a corrupt epub file.
> turkish characters don't exist at all. i tried the basic things from changing character settings to iso-8xxx-9 for turkish, to change the language from story settings etc. any suggestions?


 
Posted : 04/03/2017 9:01 pm
(@guest17300)
Posts: 0
 

We have tinymce so tags aren't a problem. All Turkish characters öüğış are absent.


 
Posted : 06/03/2017 6:19 pm
(@ladama)
Posts: 44
Trusted Member
 

so today i installed this mod to our website. it's all fine, even though we had to hack our way in the database to change NONE setting to PURE, but it works nonetheless. now, two problems:

> some stories (not all of them) return a corrupt epub file.
> turkish characters don't exist at all. i tried the basic things from changing character settings to iso-8xxx-9 for turkish, to change the language from story settings etc. any suggestions?

Through lots of trial and error, what I've found is the Epub version seems to return invalid epubs when there is an ampersand(&) or any accented letter in the story title OR any of the chapter titles. I tried adding the code for ampersand to what appears to be an "allowed characters" section in the epubversion.php (I think) but no change. As far as I can tell, it's only when those characters appear in the Story and Chapter titles that is causes trouble, not in the rest of the story text.

It's an extra step but so far the program Calibre has been able to open all epub files I've downloaded from our archive even when iBooks or other apps won't. In Calibre it will let you convert the file to whatever, even "back" to an epub files, which will then open in the various eReader programs. If you're only having trouble with some stories, converting with Calibre may be an okay workaround? http://calibre-ebook.com/


 
Posted : 09/03/2017 4:28 am
Page 8 / 8
Share: