Posted on: 07/02/07 09:34pm
By: sk716
I thought I would go ahead and post this here. For months I've been looking for a plugin that I could use to catalog comic books. I finally got to a point where I had to go ahead and write one for a client.
I used the FAQ Plugin as the base (since there doesn't seem to be a universal plugin for GeekLog 1.4.x)
I'm not a php expert so I'm sure the code is really rough. But it does work. With a few language changes it could be used to catalog Books, Movies, or Music as well.
My demo server is running on PHP5 and it's working with no problems.
You can see it at work here:
http://oddduck.net/plugtest/catalog/index.php[*1]
To download the package go here:
http://test.oddduck.net/easyfile/file.php?msg=file_uploaded&show=20070702213904355[*2]
Re: Catalog Plugin for GeekLog 1.4.1
Posted on: 07/03/07 06:01am
By: LWC
Very nice! Geeklog really needed this.
Some questions:
1) Can you define your own type of fields? For example, currently each of your items has 11 text fields, 2 textareas and 1 image.
2) Can you decide which fields appear in the general lists? For example, currently your lists have 3 text fields, last update's date and hits.
*3) Do you have an interface to upload the image and can you later replace it?
*4) Must the attached media be in image form?
* Consider having Media Gallery taking care of those things. Then it would take care of handling the media and supporting anything MG does (remote videos, etc.). Unless Mark wants to combine MG with your plugin and make it the most powerful plugin ever, I think your biggest challenge should be to find ways to use MG to do those things. The uploading part would be probably be hard, but as for presenting, you can just accept MG's autotags.
P.S.
When going to your advanced search and clicking "Type", there's a blank where your plugin's title should go. However, if you choose the blank, the search generally does work. So you just need a title in the language files. Then again, it doesn't find some of the words from the category "Arc".
Re: Catalog Plugin for GeekLog 1.4.1
Posted on: 07/03/07 06:04pm
By: sk716
Quote by: LWCVery nice! Geeklog really needed this.
Some questions:
1) Can you define your own type of fields? For example, currently each of your items has 11 text fields, 2 textareas and 1 image.
They're all hand coded in, but with a little basic SQL and PHP Knowledge it's pretty easy to edit in some changes. But I'm not hard core enough to have programmed in the options.
Quote by: LWC2) Can you decide which fields appear in the general lists? For example, currently your lists have 3 text fields, last update's date and hits.
Yep, I hardcoded all of the options into the /catalog/index.php file and then just added the ones I wanted displayed to the function.
Quote by: LWC*3) Do you have an interface to upload the image and can you later replace it?
*4) Must the attached media be in image form?
Yes and any file type should be fine, I didn't add any blocks.
Quote by: LWC* Consider having Media Gallery taking care of those things. Then it would take care of handling the media and supporting anything MG does (remote videos, etc.). Unless Mark wants to combine MG with your plugin and make it the most powerful plugin ever, I think your biggest challenge should be to find ways to use MG to do those things. The uploading part would be probably be hard, but as for presenting, you can just accept MG's autotags.
I wouldn't even know where to begin, I love MediaGallery, but everytime I have to crack open a page of the code I feel like a noob.
Quote by: LWCP.S.
When going to your advanced search and clicking "Type", there's a blank where your plugin's title should go. However, if you choose the blank, the search generally does work. So you just need a title in the language files. Then again, it doesn't find some of the words from the category "Arc".[/p]
Whoops. I know it still needs a lot of work, but like I said, I'm a novice at this plugin business..
I also discovered late last night that my download file got all scrambled up and I have to get it fixed so someone can use the plugin.
Re: Catalog Plugin for GeekLog 1.4.1
Posted on: 07/03/07 07:17pm
By: LWC
any file type should be fine, I didn't add any blocks.
Ok, so you can upload and replace files, but how do you know how to handle them? For example, images need the "img src" HTML tag and other media types need other tags.
Re: Catalog Plugin for GeekLog 1.4.1
Posted on: 07/03/07 07:20pm
By: sk716
Quote by: LWCany file type should be fine, I didn't add any blocks.
Ok, so you can upload and replace files, but how do you know how to handle them? For example, images need the "img src" HTML tag and other media types need other tags.
I wrote the images tag into the display template.
Text Formatted Code
<td align="left" valign="top" width="50%"><img src="{site_url}/catalog/images/{catalog_coverimage}"></td>
Re: Catalog Plugin for GeekLog 1.4.1
Posted on: 07/04/07 06:05am
By: LWC
Then while you let one upload any type of media file, you always use "img src" for it (or always use something else, if the template is manually changed).
Re: Catalog Plugin for GeekLog 1.4.1
Posted on: 07/04/07 05:25pm
By: sk716
Quote by: LWCThen while you let one upload any type of media file, you always use "img src" for it (or always use something else, if the template is manually changed).
Right.
If I new a better way to write it, I would have. I'm good with HTML and pretty weak on PHP.
Re: Catalog Plugin for GeekLog 1.4.1
Posted on: 07/18/07 08:13pm
By: sk716
A few tweaks and various changes. Image uploading actually works all the time now.
I still have quite a lot of work to do on it, but it's serviceable for usage.
http://test.oddduck.net/easyfile/index.php?folder=2
Current demo here: http://simoneindex.com/catalog/index.php
Re: Catalog Plugin for GeekLog 1.4.1
Posted on: 07/19/07 06:37am
By: LWC
You've fixed the title in the advanced search, but I still can't search for words from the category "Arc".
Are there any changes backstage (especially in the hardcoding department)?
Also, in the main page it lists the item count and then their hits (in brackets), but it's very confusing. I only realized it's an item count + hits once I entered the categories and saw the same numbers but with the title "hits".
Re: Catalog Plugin for GeekLog 1.4.1
Posted on: 07/19/07 07:08pm
By: sk716
Quote by: LWCYou've fixed the title in the advanced search, but I still can't search for words from the category "Arc".
Hmmm... thought I got that Advanced Search fixed. I'll have to look at it again, I may have lost the change when I was working on the image upload.
Quote by: LWCAre there any changes backstage (especially in the hardcoding department)?
A few minor changes to make everything work smoother.
Quote by: LWCAlso, in the main page it lists the item count and then their hits (in brackets), but it's very confusing. I only realized it's an item count + hits once I entered the categories and saw the same numbers but with the title "hits".[/p]
I keep intending to remove those entirely, I just don't like the way the numbers look beside the category titles.
I'm going to add automatic image resizing, but that's going to have to go on hold for a little while.
Re: Catalog Plugin for GeekLog 1.4.1
Posted on: 07/20/07 09:53am
By: trampoline
Could you use this to achieve the following...
I think this is just what I was trying to start writing today.
I want a kind of database where a site User (based on Group permissions)
can create a number of entries for sponsorship of Projects and people.
so
User x for instance might want to create 2 sponsorships
1/ University education for person in India
2/ Building a school in Tibet...
the records being searchable by any user on the system but only editable by root user and the creator ??
Obviously I would have to create some fields etc for our own use...
???
I really hope this will work !!!!
Re: Catalog Plugin for GeekLog 1.4.1
Posted on: 07/20/07 10:20am
By: trampoline
Hmm just tried installing this...
got this error.... still not installed, tried twice....
Fri 20 Jul 15:15:43 2007 - Log File Cleared
Fri 20 Jul 15:16:34 2007 - Attempting to install the Catalog plugin
Fri 20 Jul 15:16:35 2007 - Attempting to create Catalog Admin group
Fri 20 Jul 15:16:35 2007 - 1062: Duplicate entry 'Catalog Admin' for key 2. SQL in question:
Fri 20 Jul 15:16:35 2007 - Dropping catalog table
Fri 20 Jul 15:16:35 2007 - ...success
Fri 20 Jul 15:16:35 2007 - Dropping catalog category table
Fri 20 Jul 15:16:35 2007 - ...success
Fri 20 Jul 15:16:35 2007 - Attempting to remove the Catalog Admin Group
Fri 20 Jul 15:16:35 2007 - ...success
Fri 20 Jul 15:16:35 2007 - Attempting to remove rights to catalog.edit from all groups
Fri 20 Jul 15:16:35 2007 - 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1. SQL in question: DELETE FROM gl_access WHERE acc_ft_id =
Re: Catalog Plugin for GeekLog 1.4.1
Posted on: 07/30/07 12:09am
By: sk716
You'll have to manually remove the duplicate entries in the SQL database. Was the first installation attempt interrupted?
Re: Catalog Plugin for GeekLog 1.4.1
Posted on: 07/30/07 12:11am
By: sk716
Quote by: trampolineCould you use this to achieve the following...
I think this is just what I was trying to start writing today.
I want a kind of database where a site User (based on Group permissions)
can create a number of entries for sponsorship of Projects and people.
so
User x for instance might want to create 2 sponsorships
1/ University education for person in India
2/ Building a school in Tibet...
the records being searchable by any user on the system but only editable by root user and the creator ??
Obviously I would have to create some fields etc for our own use...
???
I really hope this will work !!!!
It should. You would need to make a few language changes, but otherwise I don't see why it wouldn't. I've still got a bug in the Advanced Search function that has been mentioned previously in this thread.
Re: Catalog Plugin for GeekLog 1.4.1
Posted on: 07/30/07 03:31am
By: trampoline
Quote by: sk716You'll have to manually remove the duplicate entries in the SQL database. Was the first installation attempt interrupted?
No it was not interupted.
I'll try and remove these entries.
Re: Catalog Plugin for GeekLog 1.4.1
Posted on: 07/30/07 09:41am
By: trampoline
I am editing the Files now for this plugin to hopefuly create a sponsorship plugin.
Any code snipets or other pointer most appreciated.
Re: Catalog Plugin for GeekLog 1.4.1
Posted on: 07/30/07 10:41am
By: trampoline
Ok I have tried to install on a new geeklog site and got this error... Any suggestions ?
Mon 30 Jul 15:35:12 2007 - Attempting to install the Catalog plugin
Mon 30 Jul 15:35:12 2007 - Attempting to create Catalog Admin group
Mon 30 Jul 15:35:12 2007 - 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's time to bring in new blood! Who will be asked to join Oracle in her all-new Bi' at line 1. SQL in question: INSERT INTO `gl_catalog` VALUES ('bop_100', 'demo', 'DC Comics', 'Birds of Prey', '100', 'Blood & Circuits Part 1: A Chance To Do Good', '11-15-2006', 'January 2007', 'Gail Simone and Tony Bedard', 'Nicola Scott and Paulo Sequiera', 'Doug Hazlewood and Robin Riggs', 'Hi-Fi', 'Jerry Ordway', 'Mike Carlin and Tom Palmer Jr.', 'bop_100.jpg', 'It/'s time to bring in new blood! Who will be asked to join Oracle in her all-new Birds Of Prey? Who will refuse, and who will fly the coop for good? Plus, a backup story following Black Canary and her new role in the DCU!', 'Acrata,
Big Barda,
Bulleteer,
Bumblebee,
Doctor Light 04 (Kimiyo Hoshi),
Firehawk,
Grace,
Hawkgirl 02 (Kendra Saunders),
Huntress (Helena Bertinelli),
Janissary,
Judomaster 03,
Lady Blackhawk 01 (Zinda Blake),
Madame Xanadu,
Manhunter 06 (Kate Spencer),
Oracle,
Phantom Lady 03 (Stormy Knight),
Power Girl,
Skyrocket,
Spy Smasher 02 (Katarina Armstrong),
Thorn 02 (Rose Forrest),
Wonder Woman', 13, '2007-07-02 19:00:03', 2, 23, 3, 2, 2, 2);
Re: Catalog Plugin for GeekLog 1.4.1
Posted on: 07/30/07 01:49pm
By: trampoline
Ok I have removed the code for the Demo Catagories and that sorted some errors...
I have a UNI Code SQL database and suspect the syntax of the dummy entries were not correct.
However I now have this error...
Mon 30 Jul 18:44:53 2007 - Log File Cleared
Mon 30 Jul 18:45:06 2007 - Attempting to install the Catalog plugin
Mon 30 Jul 18:45:06 2007 - Attempting to create Catalog Admin group
Mon 30 Jul 18:45:06 2007 - 1062: Duplicate entry 'Catalog Admin' for key 2. SQL in question:
Mon 30 Jul 18:45:06 2007 - Dropping catalog table
Mon 30 Jul 18:45:06 2007 - ...success
Mon 30 Jul 18:45:06 2007 - Dropping catalog category table
Mon 30 Jul 18:45:06 2007 - ...success
Mon 30 Jul 18:45:06 2007 - Attempting to remove the Catalog Admin Group
Mon 30 Jul 18:45:06 2007 - ...success
Mon 30 Jul 18:45:06 2007 - Attempting to remove rights to catalog.edit from all groups
Mon 30 Jul 18:45:06 2007 - 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1. SQL in question: DELETE FROM gl_access WHERE acc_ft_id =
What do I do about this ?
Re: Catalog Plugin for GeekLog 1.4.1
Posted on: 07/30/07 06:45pm
By: sk716
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's time to bring in new blood!
Okay, again, manually remove the duplicate entries in the SQL database. Then go into /plugins/sql/install.php file in the dummy entry and remove the offending apostrophe. "
'It/'s time to bring in new blood!
"
Text Formatted Code
$_SQL[] = "INSERT INTO `gl_catalog` VALUES ('bop_100', 'demo', 'DC Comics', 'Birds of Prey', '100', 'Blood & Circuits Part 1: A Chance To Do Good', '11-15-2006', 'January 2007', 'Gail Simone and Tony Bedard', 'Nicola Scott and Paulo Sequiera', 'Doug Hazlewood and Robin Riggs', 'Hi-Fi', 'Jerry Ordway', 'Mike Carlin and Tom Palmer Jr.', 'bop_100.jpg', 'It/'s time to bring in new blood! Who will be asked to join Oracle in her all-new Birds Of Prey? Who will refuse, and who will fly the coop for good? Plus, a backup story following Black Canary and her new role in the DCU!', 'Acrata, \rBig Barda, \rBulleteer, \rBumblebee, \rDoctor Light 04 (Kimiyo Hoshi), \rFirehawk, \rGrace, \rHawkgirl 02 (Kendra Saunders), \rHuntress (Helena Bertinelli), \rJanissary, \rJudomaster 03, \rLady Blackhawk 01 (Zinda Blake), \rMadame Xanadu, \rManhunter 06 (Kate Spencer), \rOracle, \rPhantom Lady 03 (Stormy Knight), \rPower Girl, \rSkyrocket, \rSpy Smasher 02 (Katarina Armstrong), \rThorn 02 (Rose Forrest), \rWonder Woman', 13, '2007-07-02 19:00:03', 2, 23, 3, 2, 2, 2);";
With the apostrophe and slash removed, it will install with no more problems.
Re: Catalog Plugin for GeekLog 1.4.1
Posted on: 07/30/07 06:51pm
By: trampoline
Tables were deleted,
just removing the one character did it !
Thanks..
Re: Catalog Plugin for GeekLog 1.4.1
Posted on: 07/30/07 07:27pm
By: trampoline
Picture Upload error...
I got this error
An error has occurred:
2 - move_uploaded_file(/Library/WebServer/lightspace/geeklog//catalog/images/dl.jpg) [function.move-uploaded-file]: failed to open stream: No such file or directory @ /Library/WebServer/lightspace/Documents/admin/plugins/catalog/index.php line 373
I am looking for the path error but the path is held in a variable.
Also the plugin tells me I have version 1.0.0 installed but version 1.0.1 code and it asks me to upgrade but when I do it gives an error...
Re: Catalog Plugin for GeekLog 1.4.1
Posted on: 07/30/07 11:44pm
By: sk716
Quote by: trampolinePicture Upload error...
I got this error
An error has occurred:
2 - move_uploaded_file(/Library/WebServer/lightspace/geeklog//catalog/images/dl.jpg) [function.move-uploaded-file]: failed to open stream: No such file or directory @ /Library/WebServer/lightspace/Documents/admin/plugins/catalog/index.php line 373
I am looking for the path error but the path is held in a variable.
Also the plugin tells me I have version 1.0.0 installed but version 1.0.1 code and it asks me to upgrade but when I do it gives an error...
You've got two slashes in the address. That path variable is going to be located in the /admin/index.php file.
There isn't an upgrade. I think that's a typo on my part. There are still a few bits of code from the orignal basis of the plugin (FAQ). Open the plugin/catalog/config.php file and change the version to 1.0.0.
Re: Catalog Plugin for GeekLog 1.4.1
Posted on: 07/31/07 03:13am
By: trampoline
Hmm I think the problem is the path variable should it not be Site_url ? however if I change to site url an error says the wrapper does not support this action... ???
Currently the code is like this..
Text Formatted Code
$directory = $_CONF['path']."/catalog/images/".$coverimage; //kemper hack
but it should be something like this
Text Formatted Code
$directory = $_CONF['site_url]."catalog/images/".$coverimage; //kemper hack
Re: Catalog Plugin for GeekLog 1.4.1
Posted on: 07/31/07 03:16am
By: trampoline
are you sure..
this is all I have there
Text Formatted Code
require_once('../lib-common.php');
// MAIN
if (isset ($_GET['mode']) && ($_GET['mode'] == 'logout')) {
print COM_refresh($_CONF['site_url'] . '/users.php?mode=logout');
}
print COM_refresh($_CONF['site_admin_url'] . '/moderation.php');
?>
Re: Catalog Plugin for GeekLog 1.4.1
Posted on: 07/31/07 05:39pm
By: sk716
Quote by: trampolineHmm I think the problem is the path variable should it not be Site_url ? however if I change to site url an error says the wrapper does not support this action... ???
Currently the code is like this..
Text Formatted Code
$directory = $_CONF['path']."/catalog/images/".$coverimage; //kemper hack
but it should be something like this
Text Formatted Code
$directory = $_CONF['site_url]."catalog/images/".$coverimage; //kemper hack
You're right, that's where it's getting it from.
Because it's uploading to the server it has to be 'path' or GeekLog and PHP disagree on how to handle it.
Re: Catalog Plugin for GeekLog 1.4.1
Posted on: 07/31/07 06:16pm
By: trampoline
Quote by: sk716Quote by: trampolineHmm I think the problem is the path variable should it not be Site_url ? however if I change to site url an error says the wrapper does not support this action... ???
Currently the code is like this..
Text Formatted Code
$directory = $_CONF['path']."/catalog/images/".$coverimage; //kemper hack
but it should be something like this
Text Formatted Code
$directory = $_CONF['site_url]."catalog/images/".$coverimage; //kemper hack
You're right, that's where it's getting it from.
Because it's uploading to the server it has to be 'path' or GeekLog and PHP disagree on how to handle it.
but my variable $_CONF['path'] points to the geeklog diectory i.e ......geeklog/config.php
which is not the same as my public_html path and this is the problem...
Re: Catalog Plugin for GeekLog 1.4.1
Posted on: 07/31/07 06:23pm
By: sk716
Quote by: trampolineQuote by: sk716Quote by: trampolineHmm I think the problem is the path variable should it not be Site_url ? however if I change to site url an error says the wrapper does not support this action... ???
Currently the code is like this..
Text Formatted Code
$directory = $_CONF['path']."/catalog/images/".$coverimage; //kemper hack
but it should be something like this
Text Formatted Code
$directory = $_CONF['site_url]."catalog/images/".$coverimage; //kemper hack
You're right, that's where it's getting it from.
Because it's uploading to the server it has to be 'path' or GeekLog and PHP disagree on how to handle it.
but my variable $_CONF['path'] points to the geeklog diectory i.e ......geeklog/config.php
which is not the same as my public_html path and this is the problem...
Ah, I see. The change it to ['path_html'] instead of ['path'].
Re: Catalog Plugin for GeekLog 1.4.1
Posted on: 07/31/07 07:29pm
By: trampoline
And that sorted it out !
Should the path not always be path_html as the catalogue images folder will be in there ?
I imagine this is a show stopper for a lot of people.
Great Plugin, i have already hacked it about a lot for a sponsorship plugin and it looks good....
I now wish to link things like Media gallery albums and other area's to the sponsorship items (records) and I think it will be complete.
Thanks for your efforts I have been tying to hand code something like this as an external feature for my site for weeks.....Months....
Re: Catalog Plugin for GeekLog 1.4.1
Posted on: 07/31/07 07:44pm
By: sk716
Quote by: trampolineAnd that sorted it out !
Should the path not always be path_html as the catalogue images folder will be in there ?
....
Yeah, I've already changed it in my stored files. I still need to make a few more changes and updates before I zip it up and upload it though. Hopefully, by the end of the week.
Re: Catalog Plugin for GeekLog 1.4.1
Posted on: 07/31/07 07:54pm
By: trampoline
Quote by: sk716Quote by: trampolineAnd that sorted it out !
Should the path not always be path_html as the catalogue images folder will be in there ?
....
Yeah, I've already changed it in my stored files. I still need to make a few more changes and updates before I zip it up and upload it though. Hopefully, by the end of the week.
Wow great I'll stop hacking and wait for your update...
Cheers.
Re: Catalog Plugin for GeekLog 1.4.1
Posted on: 07/31/07 08:42pm
By: sk716
Finally had a few minutes to fix the Advanced Search API and most of the other problems/errors mentioned in this thread.
No database changes necessary, just overwrite the files on your server.
http://test.oddduck.net/easyfile/index.php?folder=2
trampoline - You've already made most of the corrections and changes, so all you'll need to overwrite is the api.inc file under plugins/catalog/ with the file in the new zip.
Re: Catalog Plugin for GeekLog 1.4.1
Posted on: 08/01/07 12:36pm
By: trampoline
Thank for that,
I am on my merry way hacking the plugin, i would likean Image (25%) size displayed on the category listings I have done this....
Text Formatted Code
array('text' => $LANG_CATALOG_COMMON['Picture'], 'field' => 'coverimage', 'sort' => false)
);
Which displays the file name and does not display the title, I am trying to get one better and display the image not the file name and hopefuly I would like an image diplayed at only 25% of it's actual size...
Any help greatly appreciated.
Thanks...
Re: Catalog Plugin for GeekLog 1.4.1
Posted on: 10/13/08 08:46pm
By: koalasoft
Hi !!
It installs in my geeklog 1.5.1, I settle without problems, I can enter the category of example from the block that adds this plugins to me, but when entering the administrative part it appears to me an error…
for example in my www.domaind.com/admin/plugins/catalog/index.php .. preview this message ...
Text Formatted Code
An SQL error has occurred. Please see error.log for details.
verifying I have this in my log' s…
Text Formatted Code
1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1. SQL in question: SELECT COUNT(*) FROM
Language "spanish" not found in $_CONF['language_files'] array!
I see last message, but the file spanish.php if exist in my language plugins .. :-/
what could be the problem?
Grettings !!
Re: Catalog Plugin for GeekLog 1.4.1
Posted on: 10/19/08 11:45am
By: sk716
Quote by: koalasoftHi !!
It installs in my geeklog 1.5.1, I settle without problems, I can enter the category of example from the block that adds this plugins to me, but when entering the administrative part it appears to me an error…
for example in my www.domaind.com/admin/plugins/catalog/index.php .. preview this message ...
Text Formatted Code
An SQL error has occurred. Please see error.log for details.
verifying I have this in my log' s…
Text Formatted Code
1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1. SQL in question: SELECT COUNT(*) FROM
Language "spanish" not found in $_CONF['language_files'] array!
I see last message, but the file spanish.php if exist in my language plugins .. :-/
what could be the problem?
Grettings !!
In my very limited experience, 1.5.* works through paths differently than 1.4.*. It looks to me like it's having a "path" issue. It seems to me that it's looking in the SQL database for the proper path to the Spanish language file and not finding it. My suggestion is to look in the SQL database and correct the path or move a copy of the file into the directory the database thinks it should be in.