Help with customisation

cutehobbes

Joined: 2010-10-26
Posts: 9
Posted: Tue, 2010-10-26 01:00

Trying to figure out how to go about achieving the following

1) I have photos in a folder and information about the photos in a database table. The information is like title, description, tags, photographer's name, location etc.

I want to import the photos and the data to Gallery2. So do I import the photos first and then write a script to import the data to additional columns created in the "item" table ? Is this the right table for the information to go under ?

2) The second thing i want to do is to display this information besides the displayed photo. Which file do I have to change to make the database call and retrieve this information.

Thanks,
Cutey

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Tue, 2010-10-26 01:30

I wrote a script to import data from an old XML DB backup if you care to have a look.
maybe you can modify for your DB info.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
cutehobbes

Joined: 2010-10-26
Posts: 9
Posted: Wed, 2010-10-27 05:15

Thanks mate, that's really helpful. However I am not a coder myself so had some difficulty understanding the code.

Can you please tell me if the additional columns of information which I want to add should go under the table "item" or is it some other table ?

Also to display this information on the photo page, which file do I have to edit. Is it the photo.tpl file of the theme ?

 
cutehobbes

Joined: 2010-10-26
Posts: 9
Posted: Wed, 2010-10-27 05:18

`g_id` int(11) NOT NULL,
`g_canContainChildren` int(1) NOT NULL,
`g_description` text,
`g_keywords` varchar(255) DEFAULT NULL,
`g_ownerId` int(11) NOT NULL,
`g_renderer` varchar(128) DEFAULT NULL,
`g_summary` varchar(255) DEFAULT NULL,
`g_title` varchar(128) DEFAULT NULL,
`g_viewedSinceTimestamp` int(11) NOT NULL,
`g_originationTimestamp` int(11) NOT NULL,

So the extra columns I want to add is for example

g_photographer
g_location

Is this the right table to put them ?

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Wed, 2010-10-27 11:15

Gallery has a custom fields module for displaying extra info, adding the extra columns could break gallery altogether.

Yes, photo.tpl would be correct.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
cutehobbes

Joined: 2010-10-26
Posts: 9
Posted: Wed, 2010-10-27 23:36

Thanks for the help.

Yes the "CustomFieldMap" table would be the ideal place for importing the data, but it puts the data in rows which I am guessing would be a pain later on to manage the data.

I have added columns to the "Item" table and it's not breaking the gallery. At least so far it hasn't.