Welcome to Geeklog, Anonymous Sunday, December 22 2024 @ 08:09 am EST

Geeklog Forums

Catalog Plugin for GeekLog 1.4.1

Page navigation


Status: offline

sk716

Forum User
Junior
Registered: 06/07/05
Posts: 16
Location:Arkansas
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

To download the package go here:

http://test.oddduck.net/easyfile/file.php?msg=file_uploaded&show=20070702213904355
 Quote

Status: offline

LWC

Forum User
Full Member
Registered: 02/19/04
Posts: 818
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".
 Quote

Status: offline

sk716

Forum User
Junior
Registered: 06/07/05
Posts: 16
Location:Arkansas
Quote 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.



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.
 Quote

Status: offline

LWC

Forum User
Full Member
Registered: 02/19/04
Posts: 818
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.
 Quote

Status: offline

sk716

Forum User
Junior
Registered: 06/07/05
Posts: 16
Location:Arkansas
Quote 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.



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>
 Quote

Status: offline

LWC

Forum User
Full Member
Registered: 02/19/04
Posts: 818
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).
 Quote

Status: offline

sk716

Forum User
Junior
Registered: 06/07/05
Posts: 16
Location:Arkansas
Quote 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).



Right.

If I new a better way to write it, I would have. I'm good with HTML and pretty weak on PHP.
 Quote

Status: offline

sk716

Forum User
Junior
Registered: 06/07/05
Posts: 16
Location:Arkansas
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
 Quote

Status: offline

LWC

Forum User
Full Member
Registered: 02/19/04
Posts: 818
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".
 Quote

Status: offline

sk716

Forum User
Junior
Registered: 06/07/05
Posts: 16
Location:Arkansas
Quote by: LWC

You'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.
 Quote

Status: offline

trampoline

Forum User
Full Member
Registered: 02/24/06
Posts: 392
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 !!!!
 Quote

Status: offline

trampoline

Forum User
Full Member
Registered: 02/24/06
Posts: 392
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 =

 Quote

Status: offline

sk716

Forum User
Junior
Registered: 06/07/05
Posts: 16
Location:Arkansas
You'll have to manually remove the duplicate entries in the SQL database. Was the first installation attempt interrupted?
 Quote

Status: offline

sk716

Forum User
Junior
Registered: 06/07/05
Posts: 16
Location:Arkansas
Quote 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 !!!!



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.
 Quote

Status: offline

trampoline

Forum User
Full Member
Registered: 02/24/06
Posts: 392
Quote by: sk716

You'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.
 Quote

Status: offline

trampoline

Forum User
Full Member
Registered: 02/24/06
Posts: 392
I am editing the Files now for this plugin to hopefuly create a sponsorship plugin.
Any code snipets or other pointer most appreciated.
 Quote

Status: offline

trampoline

Forum User
Full Member
Registered: 02/24/06
Posts: 392
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);
 Quote

Status: offline

trampoline

Forum User
Full Member
Registered: 02/24/06
Posts: 392
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 ?
 Quote

Status: offline

sk716

Forum User
Junior
Registered: 06/07/05
Posts: 16
Location:Arkansas
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 &amp; 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.
 Quote

Status: offline

trampoline

Forum User
Full Member
Registered: 02/24/06
Posts: 392
Tables were deleted,
just removing the one character did it !
Thanks..
 Quote

Page navigation

All times are EST. The time is now 08:09 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content