10-28-2010, 09:21 PM | #31 |
Wizard
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
Very cool! I hadn't even heard of WSGI before this. I'll give it a shot with the next release.
|
10-29-2010, 12:51 PM | #32 |
Grand Sorcerer
Posts: 11,713
Karma: 6690879
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Well, after having my one user hassle me incessantly (aren't users wonderful to have?), the PHP-based calibre server is getting there. The user is now using it 'in production' successfully. It has been used on a nook, on Opera on my WM6.5 phone, and on Firefox & IE. Some screen shots are attached. Note that the library I was using is my test library, so the metadata for the books has been 'messed with'.
I have at least three things left to do before I will release source. First, one cannot yet view books for formats or user-defined categories. Second, I want to add some level of control over the fields that are displayed (a configuration option). Third, the configuration parameters need some explanation. I expect to do these this weekend. The system requirements are: - PHP 5.3 w/GD image processing & SQLite3 support. - A web server supporting PHP modules. I use Apache 2.2, but there is no Apache-specific code in it. - Smarty templates, either installed system-wide or in a private folder. I use Smarty 2.6.25. Smarty caching is not (yet) used. - Access to a calibre library (metadata.db, format, & cover files). The library is opened read-only, so there are no particular locking issues to deal with. It is re-opened on every request, so change synchronization is automatic. The generated URLs are relative; I have tested it as the root of a virtual host and in a subdirectory. Authentication is done using the web server's facilities. It is worth noting that this implementation is not as functional as calibre's content server, nor will it ever be. |
Advert | |
|
10-29-2010, 01:14 PM | #33 |
creator of calibre
Posts: 43,796
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Having family for users sucks
|
10-30-2010, 08:59 AM | #34 |
Grand Sorcerer
Posts: 11,713
Karma: 6690879
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Version 0.1.0 available at http://charles.the-haleys.org/calibre/.
The content of the INSTALL file contained in the archive is under the spoiler: Spoiler:
Next steps: 1) add sorting to the UI/templates. 2) make searching more capable (and/or and field name specification). 3) add an option to restrict visible content to the results of a search (a restriction in calibre terms). 4) fix bugs. Source is on launchpad, in case that is of interest to someone. If someone actually uses this thing, could you post here? I would be interested in hearing how the installation went, and whether there are prerequisites that I didn't mention. In particular, if you make it work on a cheap web hosting service (or fail to make it work), let me know. |
10-31-2010, 08:41 AM | #35 |
Grand Sorcerer
Posts: 11,713
Karma: 6690879
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Version 0.1.1 available at http://charles.the-haleys.org/calibre/.
Changes: 1) made searching more like calibre (but not quite the same). It accepts most string searches, such as tags:=Science and tags:~aaa. Regexps are perl-compatible. If you begin the regexp with /, then the flags uses (e.g., ignore case) are the ones you provide at the end. Example: /AaAa/ is case sensitive. /AaAa/i is not. The search also accepts field:true or field:false in many cases. Searches for dates and numbers are not implemented. 2) added an option to restrict visible content to the results of a search (a restriction in calibre terms). 3) added a demo library. It is my library (around 1200 books), restricted to some public domain books from Gutenberg and Diesel. Last edited by chaley; 10-31-2010 at 08:46 AM. |
Advert | |
|
10-31-2010, 08:53 AM | #36 |
Wizard
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
|
Purely out of idle curiosity, I checked out your demo library. I noticed that the layout seems to be somewhat broken (see screenshot attached), I'd guess the turquoise box on top should be a little bit larger.
If it matters, I'm running FF 3.6.12 on XP SP3. |
10-31-2010, 09:01 AM | #37 | |
Grand Sorcerer
Posts: 11,713
Karma: 6690879
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
I really don't like doing the visual stuff. Unfortunately, that is what people look at. |
|
11-03-2010, 08:45 PM | #38 |
Wizard
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
I just tried installing 0.1.1, and getting the following error:
Code:
Parse error: syntax error, unexpected T_FUNCTION in /home/myuserid/public_html/Calibre/utilities.php on line 78 My date timestamp from the main GUI looks like this: "10 Nov 2010" - sans quotes Pub date (publication date when I edit the book if I understand correctly): "Nov 2010" - sans quotes I modified the pub date in the config to match what I was seeing, but left the hyphens in place, i.e. 'dd-MMM-yyyy', and 'MMM-yyyy' I can post the config if need be, but it seems to be related to that file itself and not my config, no changes I've made seem to affect the error. Edit: One possible cause is I just double-checked my PHP version - my server is running 5.2.14, I just saw you mentioned 5.3 is required. My guess is it's due to anonymous functions: http://stackoverflow.com/questions/3...tion-expecting On a side note, haven't been able to get the WSGI option working - I don't have a full virtual server, so I don't have direct access to httpd.conf, just via CPanel. There seem to be some ways to get something done there still, but haven't researched further. Last edited by ldolse; 11-03-2010 at 09:36 PM. |
11-04-2010, 09:24 AM | #39 | |
Grand Sorcerer
Posts: 11,713
Karma: 6690879
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Thanks for the attempt, and for letting me know what happened.
Quote:
I uploaded a new version that will run under both PHP V5.2 and V5.3. I tested it under V5.2 on my development machine, and on V5.3 on my server. If it is running under V5.2, then SQLite PDO must be installed (it almost always is). If under V5.3, then SQLite3 must be installed. Give the new version a try. |
|
11-04-2010, 06:56 PM | #40 |
Wizard
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
Thanks so much!!
That did the trick. A few bits of feedback, (extremely minor):
That's all the minor feedback if you're interested in those sorts of improvements. Trying to figure out how to use the $config['restrict_display_to'] right now. I want to use a negative tag search, e.g. not tags:"=Nopub" in normal Calibre search terms. Last edited by ldolse; 11-04-2010 at 07:34 PM. |
11-04-2010, 07:05 PM | #41 |
Wizard
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
Hmm.. can't get tag searching to work in general - Used your demo library as a test case, just in case something was wrong with mine. I would expect the search 'tags:=Classics' (no quotes) to restrict the listed books to just that one tag in your library, but it doesn't seem to have any effect. Searching for just 'Classics' does restrict the results, but not by tag of course.
|
11-05-2010, 07:49 AM | #42 | |||||
Grand Sorcerer
Posts: 11,713
Karma: 6690879
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
You are welcome. Thanks for the feedback.
Quote:
Quote:
Quote:
Quote:
Quote:
Some search documentation might be useful. Supported search value tests are:
Example: series:="fu manchu" or authors:james Notes:
|
|||||
11-05-2010, 11:56 AM | #43 |
Grand Sorcerer
Posts: 11,713
Karma: 6690879
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Added release 0.1.4. This release tries hard to compensate for case mismatches in file names that happen when using both Windows (or Mac) and Linux.
|
11-06-2010, 03:27 AM | #44 | |
Wizard
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
Just got the update installed, Thanks!!
Quote:
Searches are working now. Only having one small problem now - the 'restrict_display_to' option is working if you don't do any searches, but it seems like any search overrides the filter set there. I'm using 'not tags:=Nopub' to prevent display of books I don't want cataloged, and this works without a search, but as soon as I search for any info that could match one of those books they turn up in the search results. I'm not sure if it's doing the boolean logic, or if the boolean logic is just broken when combining 'and' and 'not', as this particular test didn't work: Code:
testvalue and not tags:=Nopub |
|
11-06-2010, 04:27 AM | #45 | |
Grand Sorcerer
Posts: 11,713
Karma: 6690879
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
classics and not tags:=Tragedies There is a problem with searching for values containing a ':', but your example doesn't have one. One thing I am concerned about is unicode. PHP doesn't do a good job with multi-byte character comparison. If one of the characters in the tag is for some reason double-byte, or if a character in the search box is double-byte, then the match won't happen. Does searching for 'tags:=NoPub' get you what you expect? |
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Calibre Command Line usage with PHP | artoros | Related Tools | 13 | 07-01-2010 09:57 AM |
Web Content Server | mezme | Calibre | 7 | 01-08-2010 09:59 PM |
Calibre web server on MAC I cant get to work.. any help appreciated. | stustaff | Calibre | 5 | 01-06-2010 06:05 PM |
Calibre - web server problems | eclpmb | Calibre | 9 | 11-28-2008 02:04 PM |