Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Related Tools

Notices

Reply
 
Thread Tools Search this Thread
Old 10-14-2011, 12:43 PM   #136
Pope Viper
Member
Pope Viper began at the beginning.
 
Pope Viper's Avatar
 
Posts: 21
Karma: 10
Join Date: Jun 2011
Device: none
Finally got this fixed. This error was appearing because I had PHP error reporting set to e_all.

I back it down to just fatal errors, and it went away.

I did poke around a bit, and found this on the smarty website:

Quote:
Q: PHP Error Reporting level is set to E_ALL and smarty throws "undefined index"-errors. What can I do?

A: If you're getting it in a section loop, and especially if smarty's returning a few empty loop products at the end of your loop, it's a bug. Work around it by including your section code in an {if} statement which checks that a value which should not be empty, really isn't empty.
Pope Viper is offline   Reply With Quote
Old 10-14-2011, 01:41 PM   #137
chaley
"chaley", not "charley"
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 5,818
Karma: 1216136
Join Date: Jan 2010
Location: France
Device: Many android devices
Glad you worked it out.
chaley is offline   Reply With Quote
Old 10-14-2011, 01:50 PM   #138
Pope Viper
Member
Pope Viper began at the beginning.
 
Pope Viper's Avatar
 
Posts: 21
Karma: 10
Join Date: Jun 2011
Device: none
Me too, I was seriously pounding my head against a wall.

I'd like to thank you, Charles. I can now use this and tie it into my website/forum. Just have to modify the colors/etc.

You're a prince.
Pope Viper is offline   Reply With Quote
Old 10-14-2011, 02:51 PM   #139
Pope Viper
Member
Pope Viper began at the beginning.
 
Pope Viper's Avatar
 
Posts: 21
Karma: 10
Join Date: Jun 2011
Device: none
OK, stupid questions:

1) How do I change the background color of the main page?
2) Change colors of the font.

Obviously, I'm not an HTML guy.
Pope Viper is offline   Reply With Quote
Old 10-15-2011, 03:35 AM   #140
chaley
"chaley", not "charley"
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 5,818
Karma: 1216136
Join Date: Jan 2010
Location: France
Device: Many android devices
All the presentation (color, layout, fonts, etc) are controlled by the smarty templates (smarty/templates/*.tpl). Change things there. For example, the "<div" on line 15 of header.tpl controls the font and color of the header block. Unfortunately, that does require html knowledge.

I didn't bother setting up a common .css for the templates, something that might have made this job easier. It isn't something I care about.
chaley is offline   Reply With Quote
Old 11-08-2011, 04:39 AM   #141
madifor
Junior Member
madifor began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Nov 2011
Device: none
I have an Windows 2003 system, with php 5.3.
All other sites configured (using mysql) working like a charm but i am not able to get the php-calibre operational.

I keep getting the following error message (turned e_all on under the php config):
Fatal error: Uncaught exception 'Exception' with message 'Unable to open database: unable to open database file' in D:\....\db.php:160 Stack trace: #0 D:\....\db.php(160): SQLite3->__construct('t:\ebooks\Calib...', 1) #1 D:\....\db.php(195): MySQLite->open('t:\ebooks\Calib...') #2 D:\....\index.php(51): CalDatabase->__construct('t:\ebooks\Calib...') #3 {main} thrown in D:\....\db.php on line 160

I have started the sqlite3 executable on the web server.
A thing i don't understand why it tries to make an database file at the location where my ebooks are located (network share with write access).

Any help to get it running under iiS is appreciated.
madifor is offline   Reply With Quote
Old 11-08-2011, 05:01 AM   #142
chaley
"chaley", not "charley"
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 5,818
Karma: 1216136
Join Date: Jan 2010
Location: France
Device: Many android devices
Quote:
Originally Posted by madifor View Post
I have started the sqlite3 executable on the web server.
No executable is required, at least on any configuration that I have seen.
Quote:
A thing i don't understand why it tries to make an database file at the location where my ebooks are located (network share with write access).
The file metadata.db must exist in the folder containing calibre's library and must be readable. Otherwise it isn't a calibre library and the server cannot deal with it.
chaley is offline   Reply With Quote
Old 11-08-2011, 05:17 AM   #143
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 8,889
Karma: 12755553
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
Quote:
Originally Posted by madifor View Post
Any help to get it running under iiS is appreciated.
You might want to look at post 1 in this thread to see how chaley decided to implement the calibre content server in this environment then post 131 to find out where to get the latest files needed to implement calibre content server on your host system.
DoctorOhh is offline   Reply With Quote
Old 11-19-2011, 12:11 PM   #144
edent
Enthusiast
edent began at the beginning.
 
edent's Avatar
 
Posts: 29
Karma: 20
Join Date: Dec 2009
Location: UK
Device: Kindle 3G, Nook STR, 511eb
No output from index.php

Hi,

Having a slight problem - when I access index.php I'm not getting any output, not even error messages.

I wonder if someone can tell me what incredibly simple thing I've done wrong?

Ubuntu Server, Apache/2.2.17, PHP Version 5.3.5-1ubuntu7.3, sqlite3, smarty 2.6.26-0.2ubuntu1, GD 2.0 - so I think that's everything I should need! I've restarted Apache.

config_local.php is
Code:
$config['library_dir'] = '/data/Dropbox/eBooks/Calibre Library';

$config['web_dir'] = '/data/www/calibre';

$config['smarty_web_dir'] = $config['web_dir'] . '/smarty';

$config['smarty_dir'] = '/data/www/calibre/.cache';

$config['smarty'] = '/usr/share/php/smarty/';
I've also tried
Code:
$config['library_dir'] = '/data/Dropbox/eBooks/Calibre\ Library';
But that doesn't make a difference.

Go on - what obvious thing have I overlooked?

T

Last edited by edent; 11-19-2011 at 12:31 PM. Reason: Added GD & Apache info
edent is offline   Reply With Quote
Old 11-19-2011, 01:24 PM   #145
edent
Enthusiast
edent began at the beginning.
 
edent's Avatar
 
Posts: 29
Karma: 20
Join Date: Dec 2009
Location: UK
Device: Kindle 3G, Nook STR, 511eb
I've stuck a try...catch loop on
PHP Code:
try {
    
$db = new CalDatabase($config['library_dir']);
}
catch (
Exception $e) {
    
var_dump($e->getMessage());
    echo 
$config['library_dir'];

Which pumps out
Code:
"Unable to open database: unable to open database file" 
/data/Dropbox/eBooks/Calibre Library
There's certainly a metadata.db file in that directory.

I'm utterly stumped. Any help?
edent is offline   Reply With Quote
Old 11-19-2011, 01:28 PM   #146
chaley
"chaley", not "charley"
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 5,818
Karma: 1216136
Join Date: Jan 2010
Location: France
Device: Many android devices
Check permissions. Normally the web server would not have permission to read Dropbox files.
chaley is offline   Reply With Quote
Old 11-19-2011, 05:11 PM   #147
edent
Enthusiast
edent began at the beginning.
 
edent's Avatar
 
Posts: 29
Karma: 20
Join Date: Dec 2009
Location: UK
Device: Kindle 3G, Nook STR, 511eb
D'oh! That did the trick. Thanks!

Is there any way to get the size of a file out of the DB? So I can format it "MOBI 2.5MB" etc?

It doesn't seem to work when I change the DB query to
PHP Code:
$data $this->db->query(sprintf('SELECT format,name,size 
(and then loop through the array).

EDIT: the column name is "uncompressed_size" - using that works to get file size.

Love the server - is there a more formal way to contribute patches / bugs / change request?

Last edited by edent; 11-19-2011 at 05:45 PM.
edent is offline   Reply With Quote
Old 11-20-2011, 04:15 AM   #148
chaley
"chaley", not "charley"
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 5,818
Karma: 1216136
Join Date: Jan 2010
Location: France
Device: Many android devices
Quote:
Originally Posted by edent View Post
Love the server - is there a more formal way to contribute patches / bugs / change request?
Nope. Never had any need for it.

This thread is a good place for bug reports and change requests. Patches can also go through here, either by including the entire files (I will do the diffs) or a 'patch'. If the volume gets high enough then I could probably set something up using launchpad & bzr, but it is hard to imagine the need given history.
chaley is offline   Reply With Quote
Old 11-20-2011, 06:39 AM   #149
edent
Enthusiast
edent began at the beginning.
 
edent's Avatar
 
Posts: 29
Karma: 20
Join Date: Dec 2009
Location: UK
Device: Kindle 3G, Nook STR, 511eb
Show the size of the file

The attached patch shows the size of the file next to each filetype.

So, if you're on a limited bandwidth connection, you may choose the epub over the PDF etc.

Screenshot shows a demonstration using the free "Hacking The BBC" eBook.
Attached Thumbnails
Click image for larger version

Name:	calibre size.png
Views:	57
Size:	50.3 KB
ID:	79173  
Attached Files
File Type: txt books_section.patch.txt (1.2 KB, 55 views)
File Type: txt db_size.patch.txt (832 Bytes, 53 views)
edent is offline   Reply With Quote
Old 11-20-2011, 07:02 AM   #150
edent
Enthusiast
edent began at the beginning.
 
edent's Avatar
 
Posts: 29
Karma: 20
Join Date: Dec 2009
Location: UK
Device: Kindle 3G, Nook STR, 511eb
Escape Ampersands

Patches to modules and index.tpl - to ensure that all & are correctly escaped as &amp;
Attached Files
File Type: txt modules_ampersand.patch.txt (4.2 KB, 90 views)
File Type: txt index_ampersand.patch.txt (606 Bytes, 58 views)
edent is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre Command Line usage with PHP artoros Related Tools 13 07-01-2010 10:57 AM
Web Content Server mezme Calibre 7 01-08-2010 10:59 PM
Calibre web server on MAC I cant get to work.. any help appreciated. stustaff Calibre 5 01-06-2010 07:05 PM
Calibre - web server problems eclpmb Calibre 9 11-28-2008 03:04 PM


All times are GMT -4. The time now is 01:34 AM.


MobileRead.com is a privately owned, operated and funded community.