Notifications
Clear all

[MODULE] ePubVersion

113 Posts
19 Users
0 Reactions
53.4 K Views
 SJP
(@sjp)
Posts: 59
Trusted Member
 

Where would I need to add these tables?

p.s. thanks for responding, at least now I know what the solution is.

Are you comfortable going into your database with phpmyadmin? That's where you need to add the tables. If you're not used to modifying the database that way, you should probably set up a test database to practice on.


 
Posted : 10/01/2014 11:48 am
(@amalthia)
Posts: 93
Estimable Member
 

Where would I need to add these tables?

p.s. thanks for responding, at least now I know what the solution is.

Are you comfortable going into your database with phpmyadmin? That's where you need to add the tables. If you're not used to modifying the database that way, you should probably set up a test database to practice on.

I'm relatively comfortable with phpmyadmin, I've never set up tables through it before so I may just take your advice and practice on another database first. 🙂


 
Posted : 11/01/2014 2:23 am
(@piper)
Posts: 89
Estimable Member
Topic starter
 

Hi Everyone! Sorry for the delay, but I've updated my installer.php and update.php files to hopefully fix the errors mentioned above when installing or updating. The new version is named 1.3u1 or Update 1, but it won't actually add u1 or Update 1 to your module version, it will still say 1.3 but takes in account 1.3 to 1.3u1 upgrades and will upgrade from version 1.0 and higher.

I'm currently working on code for basic .mobi/azw support for Kindle devices and also PDF options. I know there are multiple new versions and forks of eFiction on the horizon, and was wondering if anyone wants me to keep updating this code with new features or just wait for the new eFiction code base?


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

 
Posted : 28/05/2014 1:47 am
 kali
(@kali)
Posts: 303
Reputable Member
 

I would definitely like to see an update for 3.0. Our sites are heavily modded so it will take awhile for us to move to the new version, even after it is released.


Skins made by Kali are no longer supported!

 
Posted : 28/05/2014 9:40 pm
(@piper)
Posts: 89
Estimable Member
Topic starter
 

Hi Piper, I'm glad you fixed a few bugs. I just tried to install the module to my demo archive, but I've got another error.  :help:


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

This error was durring the install? Was it a fresh install or an upgrade?

Also can you tell me what version of PHP and what version of MySQL you have installed on your server?


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

 
Posted : 08/06/2014 12:48 pm
(@piper)
Posts: 89
Estimable Member
Topic starter
 

Actually I can see where the error is, I'm going to re-write the install script today, and see if that works.

-Piper


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

 
Posted : 08/06/2014 1:12 pm
Grimmbart
(@grimmbart)
Posts: 13
Active Member
 

Hi Piper,

can you tell me where the filename of the downloaded epub is generated?

I want to change it to author - title.epub for single storys and author - series - title.epub for series.

Also i only like to add the [Chapter] part it only one chapter is downloaded.

Greets,

Grimmbart.


 
Posted : 08/06/2014 6:06 pm
 SJP
(@sjp)
Posts: 59
Trusted Member
 

Is the installer fixed now? Just wondering ...  😕

Nadia,
if you want to get this module installed, and don't want to enter the necessary tables, here's a quick and dirty fix for the install.php file that should help you. I had the same issue as you are having. The issue is when the installer checks if the module tables are already there. I didn't re-write the install file, but I removed the steps where it checks if the tables are there before it adds them. This fix will not work if you're upgrading or have any epubversion tables already added to your database. This way at least you'll be able to get the module up on your site.

Just remove the current code from the install.php file and paste this code in to replace it.

<?php
$current = "epubversion";
include ("../../header.php");

//make a new TemplatePower object
if(file_exists( "$skindir/default.tpl")) $tpl = new TemplatePower("$skindir/default.tpl" );
else $tpl = new TemplatePower(_BASEDIR."default_tpls/default.tpl");
$tpl->assignInclude( "header", "$skindir/header.tpl" );
$tpl->assignInclude( "footer", "$skindir/footer.tpl" );
include(_BASEDIR."includes/pagesetup.php");
include_once(_BASEDIR."languages/".$language."_admin.php");
if(!isADMIN) accessDenied( );
$confirm = isset($_GET['confirm']) ? $_GET['confirm'] : false;
if($confirm == "yesoff"||$confirm == "yeson") {
    dbquery("ALTER TABLE `".$settingsprefix."fanfiction_settings` ADD `epubimg` TINYINT( 1 ) default '0'");
    dbquery("ALTER TABLE `".$settingsprefix."fanfiction_settings` ADD `epubanon` TINYINT( 1 ) NOT NULL default '1'");
    dbquery("ALTER TABLE `".$settingsprefix."fanfiction_settings` ADD `epubtidy` TINYINT( 1 ) NOT NULL default '0'");
    dbquery("ALTER TABLE `".$settingsprefix."fanfiction_settings` ADD `epubrw` TINYINT( 1 ) NOT NULL default '0'");
    dbquery("ALTER TABLE `".$settingsprefix."fanfiction_settings` ADD `epubsitename` varchar(200) NOT NULL default 'Your SiteName Here!'");
    dbquery("ALTER TABLE `".$settingsprefix."fanfiction_settings` ADD `epubtagline` varchar(200) NOT NULL default 'Catchy Tag-Line Here!'");
    dbquery("ALTER TABLE `".$settingsprefix."fanfiction_settings` ADD `epuburl` varchar(200) NOT NULL default ' http://your-stie.url'");
    dbquery("ALTER TABLE `".$settingsprefix."fanfiction_settings` ADD `epubsitelogo` varchar(200) NOT NULL default 'modules/epubversion/banners/DEFAULT-Banner.png'");
    dbquery("ALTER TABLE `".$settingsprefix."fanfiction_settings` ADD `epubicon` varchar(200) NOT NULL default 'modules/epubversion/images/3-default-epub.png'");
    dbquery("ALTER TABLE `".$settingsprefix."fanfiction_settings` ADD `epubcover` varchar(200) NULL default NULL");
    dbquery("ALTER TABLE `".$settingsprefix."fanfiction_settings` ADD `epublang` varchar(2) NULL default NULL");
    dbquery("ALTER TABLE `".TABLEPREFIX."fanfiction_stories` ADD `epubcover` varchar(200) NULL default NULL");
    dbquery("ALTER TABLE `".TABLEPREFIX."fanfiction_stories` ADD `epubread` TINYINT( 1 ) NOT NULL default '0'");
    dbquery("ALTER TABLE `".TABLEPREFIX."fanfiction_stories` ADD `epublang` VARCHAR( 2 ) NULL DEFAULT NULL");
    dbquery("INSERT INTO `".TABLEPREFIX."fanfiction_codeblocks` (`code_text`, `code_type`, `code_module`) VALUES ('include(_BASEDIR."modules/epubversion/otherresults.php");', 'otherresults', 'epubversion');");
    dbquery("INSERT INTO `".TABLEPREFIX."fanfiction_codeblocks` (`code_text`, `code_type`, `code_module`) VALUES ('include(_BASEDIR."modules/epubversion/recentblock.php");', 'storyblock', 'epubversion');"); 
if($confirm == "yeson") {
    dbquery("ALTER TABLE `".TABLEPREFIX."fanfiction_stories` ADD `epub` TINYINT( 0 ) NOT NULL default '1'");
}
if($confirm == "yesoff") {
    dbquery("ALTER TABLE `".TABLEPREFIX."fanfiction_stories` ADD `epub` TINYINT( 0 ) NOT NULL default '0'");
}
dbquery("INSERT INTO `".TABLEPREFIX."fanfiction_codeblocks` (`code_text`, `code_type`, `code_module`) VALUES ( 'include(_BASEDIR."modules/epubversion/storyblock.php");', 'viewstory', 'epubversion');");
$subsquery1 = dbquery("SELECT panel_id FROM `".TABLEPREFIX."fanfiction_panels` WHERE panel_type = 'S' AND panel_hidden = '0'");
$subs1 = mysql_num_rows($subsquery1);
$subs++;
dbquery("INSERT INTO `".TABLEPREFIX."fanfiction_panels`(`panel_name`, `panel_title`, `panel_url`, `panel_level`, `panel_order`, `panel_hidden`, `panel_type` ) VALUES ('epubmanage', 'Manage ePub Stories', 'modules/epubversion/manage.php', '1', '$subs', '0', 'S');");
$subsquery2 = dbquery("SELECT panel_id FROM `".TABLEPREFIX."fanfiction_panels` WHERE panel_type = 'B' AND panel_hidden = '0'");
$subs2 = mysql_num_rows($subsquery2);
$subs++;
dbquery("INSERT INTO `".TABLEPREFIX."fanfiction_panels` (`panel_name` ,`panel_title` ,`panel_url` ,`panel_level` ,`panel_order` ,`panel_hidden` ,`panel_type` ) VALUES ('epubbrowse', 'ePub eBooks', 'modules/epubversion/browse.php', '0', '$subs2', 0, 'B');");
include("version.php");
dbquery("INSERT INTO `".TABLEPREFIX."fanfiction_modules`(`version`, `name`) VALUES('$moduleVersion', '$moduleName')");
$output = write_message(_ACTIONSUCCESSFUL);
}
elseif($confirm == "no") {
$output = write_message(_ACTIONCANCELLED);
}
else {
$output = write_message("<IMG SRC="" http://storyportal.net/wp-content/uploads/ePubVersion-Logo-L-300x225.png "><H1>"._CONFIRMINSTALL."</H1><H2><a" href="'install.php?confirm=yesoff'>"._YES."" (ePub Default OFF)</a></H2><H2><a href="'install.php?confirm=yeson'>"._YES."" (ePub Default ON)</a></H2><H2><a href="'install.php?confirm=no'>"._NO."</a></H2>");"
}
$tpl->assign("output", $output);
$tpl->printToScreen( );
?>

 
Posted : 30/06/2014 3:12 pm
(@banshee)
Posts: 64
Member Admin
 

Yay, thanks for this!


eFiction Archives: Tom Paris Dorm | Twice Bitten | Underground

 
Posted : 01/07/2014 8:29 pm
 SJP
(@sjp)
Posts: 59
Trusted Member
 

YAY, it's working!

Now I have another question: how can I remove the ePub icon and use a text link instead?

Glad I could help, Nadia and banshee.

If you want to remove the icon and use a text link, go to modules/epubversion/storyblock.php. You'll see

if($epubrw == "1") {
if(!empty($chapter) && $chapters > 1) $printepub = "<img src="'".(isset($epubicon)" ? $epubicon : $icon)."' border='0' alt='"._EPUB."'> <a href=""modules/epubversion/epubs/$sid/$chapter/$title_san.epub"" title="Download ePub File">"._CHAPTER."</a> "._OR." <a href=""modules/epubversion/epubs/$sid/all/$title_san.epub"" title="Download ePub File">"._STORY."</a>";
else $printepub = "<a href=""modules/epubversion/epubs/$sid/all/$title_san.epub"" title="Download ePub File"><img src="'".(isset($epubicon)" ? $epubicon :  $icon)."' border='0' alt='"._EPUB."'></a>";
}
else {
if(!empty($chapter) && $chapters > 1) $printepub = "<img src="'".(isset($epubicon)" ? $epubicon : $icon)."' border='0' alt='"._EPUB."'> <a href=""modules/epubversion/epubversion.php?sid=$sid&amp;chapter=$chapter"" title="Download ePub File">"._CHAPTER."</a> "._OR." <a href=""modules/epubversion/epubversion.php?sid=$sid&amp;chapter=all"" title="Download ePub File">"._STORY."</a>";
else $printepub = "<a href=""modules/epubversion/epubversion.php?sid=$sid&amp;chapter=all"" title="Download ePub File"><img src="'".(isset($epubicon)" ? $epubicon :  $icon)."' border='0' alt='"._EPUB."'></a>";

This controls the download link. The first section is if you use modrewrite for the links. If you're not sure if you want to use modrewrite or not (I don't since it can throw errors if the story title has certain characters or punctuation in it), you can modify both. However, here's what it would look like if you just modified the version that doesn't use modrewrite

if($epubrw == "1") {
if(!empty($chapter) && $chapters > 1) $printepub = "<img src="'".(isset($epubicon)" ? $epubicon : $icon)."' border='0' alt='"._EPUB."'> <a href=""modules/epubversion/epubs/$sid/$chapter/$title_san.epub"" title="Download ePub File">"._CHAPTER."</a> "._OR." <a href=""modules/epubversion/epubs/$sid/all/$title_san.epub"" title="Download ePub File">"._STORY."</a>";
else $printepub = "<a href=""modules/epubversion/epubs/$sid/all/$title_san.epub"" title="Download ePub File"><img src="'".(isset($epubicon)" ? $epubicon :  $icon)."' border='0' alt='"._EPUB."'></a>";
}
else {
if(!empty($chapter) && $chapters > 1) $printepub = "<a href=""modules/epubversion/epubversion.php?sid=$sid&amp;chapter=$chapter"" title="Download ePub File">Download Chapter ePub</a> "._OR." <a href=""modules/epubversion/epubversion.php?sid=$sid&amp;chapter=all"" title="Download ePub File">Download Story ePub</a>";
else $printepub = "<a href=""modules/epubversion/epubversion.php?sid=$sid&amp;chapter=all"" title="Download ePub File">Download Story ePub</a>";

I just wrote Download Chapter ePub and Download Story ePub as an example, you can make the text whatever you want 🙂 .


 
Posted : 01/07/2014 11:51 pm
 SJP
(@sjp)
Posts: 59
Trusted Member
 

Thanks again! That's awesome!

And I do have another prob. Within the epubs there are no German umlauts. Meaning no ä ö or ü which is a big problem. Is there any way to change the utf or whatever to make it compatible with German? Otherwise I can't use the module because the text is full of ? instead of the umlauts.  :sad1:

I never noticed this issue since I don't deal with umlauts all that often 🙂 . To test it, I just shoved some German text into a story on my test site, and when I went to download the ePub, the letters with umlauts showed up just fine in the story text. Since I'm not having the same problem, and I can't test it, I'm not sure what to tell you. I'm sorry I can't be more help.


 
Posted : 09/07/2014 4:43 pm
(@piper)
Posts: 89
Estimable Member
Topic starter
 

Just an FYI, I have migrated my private SVN to a public GitHib https://github.com/geekbrat/ePubVersion


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

 
Posted : 25/02/2016 3:25 pm
(@guest15229)
Posts: 0
 

I just did a fresh install of Efiction, followed by an install of this module. Everything went fine until I tried downloading an EPUB. It gave me a bunch of errors, most of which had to do with the time/date. I edited all of those instances out of the PHP files, which solved that issue, but I'm still having trouble with these:

Notice: Array to string conversion in /homepages/5/d609431004/htdocs/whimsicalwanderings/writing/modules/epubversion/epubversion.php on line 162

Notice: Undefined variable: img_filename in /homepages/5/d609431004/htdocs/whimsicalwanderings/writing/modules/epubversion/cover_img.php on line 90

Error: Unable to send file A Test Story [1].epub. HTML Headers have already been sent from /homepages/5/d609431004/htdocs/whimsicalwanderings/writing/modules/epubversion/epubversion.php in line 162

Any ideas?


 
Posted : 03/03/2016 3:11 pm
(@piper)
Posts: 89
Estimable Member
Topic starter
 

Can you tell me what version of PHP you are using?

-Piper


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

 
Posted : 26/04/2016 10:06 pm
(@piper)
Posts: 89
Estimable Member
Topic starter
 

I just did a fresh install of Efiction, followed by an install of this module. Everything went fine until I tried downloading an EPUB. It gave me a bunch of errors, most of which had to do with the time/date. I edited all of those instances out of the PHP files, which solved that issue, but I'm still having trouble with these:

Notice: Array to string conversion in /homepages/5/d609431004/htdocs/whimsicalwanderings/writing/modules/epubversion/epubversion.php on line 162

Notice: Undefined variable: img_filename in /homepages/5/d609431004/htdocs/whimsicalwanderings/writing/modules/epubversion/cover_img.php on line 90

Error: Unable to send file A Test Story [1].epub. HTML Headers have already been sent from /homepages/5/d609431004/htdocs/whimsicalwanderings/writing/modules/epubversion/epubversion.php in line 162

Any ideas?

Honestly, the 2 notices are just that, notices and that kind of error reporting should be turned off in a production site. The one fatal error stems from the fact that you have the error reporting turned on and so it's creating a page-header before the page header the script sends. Which causes a fatal error. If you turn off error reporting you should be fine, but I will try and work to improve my coding practices.

-Piper


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

 
Posted : 03/05/2016 3:59 pm
Page 7 / 8
Share: