Extra fields - Description, location, whatever you like

joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Thu, 2003-02-06 12:05

***NEWS FLASH***

This patch is no longer availble. The changes have been rolled into 1.3.4, and are now called Custom Fields. This thread is now locked. Please start a thread in a suitable forum for any discussion on Custom Fields.
***NEWS FLASH***

I've written a hack that enables you to define any fields you like to be attached to images.

You can define default fields that will be available in every new album, and this list can then be individually tailored on an album by album basis or based on nested albums.

The fields are searchable.

The fields can be edited for each image in the edit_captions window, and each one that is defined will be displayed under the caption and before the comments on the photo page.

Anyone interested in this?

http://www.mcgalliard.org/gallery/album01

 
dtdgoomba

Joined: 2002-11-04
Posts: 185
Posted: Thu, 2003-02-06 13:48

yes, definitely interested and I would say a lot of people are since in the last week, I've noticed like 2 threads or more on it :smile: Looks great!

 
MysticGirl
MysticGirl's picture

Joined: 2003-01-06
Posts: 81
Posted: Thu, 2003-02-06 15:10

Oh bless you sweet, sweet heart!!! :lol: I have been trying to get this to work myself! I am very interested in this.

 
pbyjp
pbyjp's picture

Joined: 2002-11-12
Posts: 260
Posted: Thu, 2003-02-06 15:34

I think you'll get another vote from me!
do you want to make it available as a download from your website or smth?
Thanks for your hard work, I can't wait to try it.
Paul

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Thu, 2003-02-06 20:59

[edited 15 June, 03]
Patch is no longer available. Please upgrade to 1.3.4 to use this feature, now called Custom Fields
Here it is!

To install, get the file <!-- BBCode Start --><A HREF="http://www.mcgalliard.org/content/gallery/extra_fields_new.zip" TARGET="_blank">extra_fields_new.zip</A><!-- BBCode End --> and unzip it. Copy extra_fields.php to your gallery directory, then change to your gallery directory, user configure.(sh|bat) to make sure you can write to the setup directory, and apply the patch. Eg:
sh configure.sh
patch -p0 < extra_fields_new.patch
sh secure.sh

To use the new fields, go to an album to which you can write, and click on the new option extra fields. In the popup window, type in the number of new fields you want in this album, and click Apply. Then type a unique key name for each of the new fields, and click Apply again. Now, when you pop up the edit caption window for any of the images in that album, you can populate these new fields.

That's the basics. Here's few minor points.

Search will go through every one of these fields, and display the key name,. as well as the text, for matching fields

Extra fields are inheritied in nested albums and can be applied to nested albums. You can use the configuration wizard to set up default extra fields for the gallery.

Any fields with values in them are displayed on the image page If they are undefined, or an empty string, they are not displayed.

The patch was build against RELEASE_1_3_3. It has not been tested against earlier versions. If you have the latest CVS, you will get an error when patching do_command.php. That's because some code has been turned into a function, and moved from do_command.php to util.php. To make the change by hand, leave do_command.php as it is and open util.php in your favourite editor, find this line:
$gallery->album->fields["public_comments"]=$parentAlbum->fields["public_comments"];
and put this underneath
$gallery->album->fields["extra_fields"]=$parentAlbum->fields["extra_fields"];

 
MysticGirl
MysticGirl's picture

Joined: 2003-01-06
Posts: 81
Posted: Thu, 2003-02-06 22:17

This works great Joan! Thanks. I was looking for something that was a global (pre-arranged) setup - something the users couldn't change. So, when someone uploads a picture, the extra fields are already there for them to enter the information. But, I should be able to figure something out based on this. You are a life saver! :grin:

 
maccas

Joined: 2003-01-11
Posts: 16
Posted: Sun, 2003-02-09 01:59

I have made a extra field called title, how could I add this in the <title> tag and not on the page itself, if posible?

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Mon, 2003-02-10 01:25
Quote:
I have made a extra field called title, how could I add this in the <title> tag and not on the page itself, if posible?

Just a matter of coding it up.

Open view_photo.php, and find <head>. Put this immediately below it:
<!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="pn-sub">Code:</font><HR></TD></TR><TR><TD><FONT class="pn-sub"><PRE>
<?php
$title=$gallery->album->getExtraField($index, "title");
if (!$title) {
$title=$index;
}
?>
</TD></TR></TABLE><!-- BBCode End -->

and in the line below, change
<?php echo $index ?>
to
<?php echo $title ?>

You'll still have the title below the image as well, but fixing this is left as an exercise for the reader

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Mon, 2003-02-10 12:29

Sharp eyed readers will have noticed that there were a couple of problems with above patch. They are to do with the way the way default values are stored. If you've already installed the patch, and are happy with it - leave it as it is. If you do want to update your code, I've put a patch file up at <!-- BBCode Start --><A HREF="http://www.mcgalliard.org/content/gallery/extra_fields_update.patch" TARGET="_blank">extra_fields_update.patch</A><!-- BBCode End -->
This will move you from the patch released as extra_fields.zip and the one released as extra_fields_new.zip. You'll need to re-run the config wizard to put the default values in again.

If you haven't installed thee patch yet, then just grab the new one:<!-- BBCode Start --><A HREF="http://www.mcgalliard.org/content/gallery/extra_fields_new.zip" TARGET="_blank">extra_fields_new.zip</A><!-- BBCode End -->

 
psjames

Joined: 2002-10-11
Posts: 19
Posted: Mon, 2003-02-10 15:28

It would be nice if the extra fields could be added into captionator.php. If it could be done could somebody post the code.

Thank you,
PJ

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Mon, 2003-02-10 18:04

<!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="pn-sub">Code:</font><HR></TD></TR><TR><TD><FONT class="pn-sub"><PRE>
*** captionator.php 3 Jan 2003 13:47:50 -0000 1.1.1.2
--- captionator.php 10 Feb 2003 18:03:19 -0000
***************
*** 67,72 ****
--- 67,76 ----
} else {
$gallery->album->setCaption($i, stripslashes(${"new_captions_" . $i}));
$gallery->album->setKeywords($i, stripslashes(${"new_keywords_" . $i}));
+ foreach ($extra_fields[$i] as $field => $value)
+ {
+ $gallery->album->setExtraField($i, $field, trim(strip_tags($value)));
+ }
}

$i++;
***************
*** 255,260 ****
--- 259,273 ----
<span class="admin">Keywords:</span><br>
<input type=text name="new_keywords_<?php echo $i?>" size=65 value="<?php echo $oldKeywords ?>">

+ <?php
+ foreach ($gallery->album->getExtraFields() as $field)
+ {
+ $value=$gallery->album->getExtraField($i, $field);
+ print "<br><span class="admin">$field:</span><br>";
+ print "<textarea name="extra_fields[$i][$field]" rows=2 cols=60>";
+ print "$value</textarea>";
+ }
+ ?>
<?php
}
?>

</TD></TR></TABLE><!-- BBCode End -->

 
cyberlok
cyberlok's picture

Joined: 2003-01-14
Posts: 6
Posted: Mon, 2003-02-10 20:14

I agree with everyone else. This has been a long time comming and I cant wait to try and apply it to my gallery. I wish my hoster has shell it would make patching way easier.

 
D-Iivil
D-Iivil's picture

Joined: 2003-01-18
Posts: 12
Posted: Mon, 2003-02-10 21:32

Ok... I screwed up myseld :smile:

I didn't kow what a hell to do with .patch file so I uploaded those two files and ran extra_fields.php
I know, I'm an idiot, I know it now...
But well, I can't login anymore, it doesn't give me error, it just wont go in.
Any ideas? What file / files should be recovered from my back up?

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Mon, 2003-02-10 23:58

D-Iivil

Oh no! Don't know what happened to you, but here's a hint. List all your files in the gallery directory with the dates, and see which ones have changed most recently, and restore them.

Generally, always make a backup (of your gallery andalbum directories) before installing any new code.

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Tue, 2003-02-11 00:08
Quote:
I agree with everyone else. This has been a long time comming and I cant wait to try and apply it to my gallery. I wish my hoster has shell it would make patching way easier.

Well, if you are running a pure 1.3.3 install, you could just copy the files over. The complete set of changed files is at <!-- BBCode Start --><A HREF="http://www.mcgalliard.org/content/gallery/extra_fields_files.zip" TARGET="_blank">extra_fields_files.zip</A><!-- BBCode End -->

If you need to run patch from your windows machine, you can get it (along with 100+ other programs) at <!-- BBCode Start --><A HREF="http://unxutils.sourceforge.net/" TARGET="_blank">http://unxutils.sourceforge.net/</A><!-- BBCode End -->

 
Gaile

Joined: 2002-07-20
Posts: 1301
Posted: Tue, 2003-02-11 04:57

Hi Joan

This is GREAT! I discovered I have shell access and ran the first patch (extra_fields.patch). Because I was using a later version of Gallery I had to do the one manual change you mentioned and it all worked.

Just now I tried to apply the extra_fields_update.patch, and got the following message:
<!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="pn-sub">Code:</font><HR></TD></TR><TR><TD><FONT class="pn-sub"><PRE>patching file util.php
Hunk #1 succeeded at 1498 with fuzz 1 (offset 223 lines).
patching file classes/Album.php
can't find file to patch at input line 78
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
-----------------------------------------
| Index: setup/config.data inc</TD></TR></TABLE><!-- BBCode End -->

I used:

patch -p0 < extra_fields_update.patch

-- should I have done something differently or am I going to have to try something else?

(new to this - so try to explain in LOW tech terminology if possible! Thanks!) :smile:

Gaile

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Tue, 2003-02-11 05:43

Oops! Permissions!

I forgot to mention you need to run
sh configure.sh
before applying either patch.

joan

 
D-Iivil
D-Iivil's picture

Joined: 2003-01-18
Posts: 12
Posted: Tue, 2003-02-11 11:20
Quote:
D-Iivil

Oh no! Don't know what happened to you, but here's a hint. List all your files in the gallery directory with the dates, and see which ones have changed most recently, and restore them.

Generally, always make a backup (of your gallery andalbum directories) before installing any new code.

Lucky me, I had a backup from day ago... so I'm running fine again :wink:

 
psjames

Joined: 2002-10-11
Posts: 19
Posted: Tue, 2003-02-11 13:56

Thank you for the code. I am running 1.3.4 b11 and everything is working great. I had to manually place the code that your patch puts into do_command.php into util.php. I have also placed the additional code into captionator.php and it works great.

Thank you,

Paul James

 
Agatka
Agatka's picture

Joined: 2002-10-19
Posts: 140
Posted: Thu, 2003-02-13 01:51

Hello,

I would like to try it, but I don't have shell access and have no idea how to implement these changes.

I looked at the file and I don't know what "!" mean. Anyway, I have version 1.3.2 and looks like some of the files are diferent.

Is there an easier way than manually adding code? I tried and got weird errors.

Thanks,
Agatka

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Thu, 2003-02-13 07:00
Quote:
Hello,

I would like to try it, but I don't have shell access and have no idea how to implement these changes.

I looked at the file and I don't know what "!" mean. Anyway, I have version 1.3.2 and looks like some of the files are diferent.

Is there an easier way than manually adding code? I tried and got weird errors.

Thanks,
Agatka

It's based on 1.3.3. You probably should think about upgrading to 1.3.3, read <!-- BBCode Start --><A HREF="http://gallery.menalto.com/modules.php?op=modload&amp;name=News&amp;file=article&amp;sid=65&amp;mode=thread&amp;order=0&amp;thold=0" TARGET="_blank">this</A><!-- BBCode End --> . If you do that, you can then just copy the files in <!-- BBCode Start --><A HREF="http://www.mcgalliard.org/content/gallery/extra_fields_files.zip" TARGET="_blank">extra_fields_files.zip</A><!-- BBCode End -->

Otherwise, the best idea would be to copy all your files to your local machine (windows, right?), get patch.exe from http://unxutils.sourceforge.net/, apply the patch
patch -i extra_fields_new.patch -p0
then copy the files back to your server. You'll need to test it, as it hasn't been tested aainst 1.3.2

If you must do it by hand, "+" means "add this line", "-" means "delete this line" and "!" means "change this line"

 
psjames

Joined: 2002-10-11
Posts: 19
Posted: Thu, 2003-02-13 16:12
Quote:
<!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="pn-sub">Code:</font><HR></TD></TR><TR><TD><FONT class="pn-sub"><PRE>
*** captionator.php 3 Jan 2003 13:47:50 -0000 1.1.1.2
--- captionator.php 10 Feb 2003 18:03:19 -0000
***************
*** 67,72 ****
--- 67,76 ----
} else {
$gallery->album->setCaption($i, stripslashes(${"new_captions_" . $i}));
$gallery->album->setKeywords($i, stripslashes(${"new_keywords_" . $i}));
+ foreach ($extra_fields[$i] as $field => $value)
+ {
+ $gallery->album->setExtraField($i, $field, trim(strip_tags($value)));
+ }
}

$i++;
***************
*** 255,260 ****
--- 259,273 ----
<span class="admin">Keywords:</span><br>
<input type=text name="new_keywords_<?php echo $i?>" size=65 value="<?php echo $oldKeywords ?>">

+ <?php
+ foreach ($gallery->album->getExtraFields() as $field)
+ {
+ $value=$gallery->album->getExtraField($i, $field);
+ print "<br><span class="admin">$field:</span><br>";
+ print "<textarea name="extra_fields[$i][$field]" rows=2 cols=60>";
+ print "$value</textarea>";
+ }
+ ?>
<?php
}
?>

</TD></TR></TABLE><!-- BBCode End -->

I am getting the following error when I try and save:
Warning: Invalid argument supplied for foreach() in /usr/local/psa/home/vhosts/brandywinehouse.com/httpdocs/sailing/captionator.php on line 70

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Thu, 2003-02-13 18:32
Quote:
I am getting the following error when I try and save:
Warning: Invalid argument supplied for foreach() in /usr/local/psa/home/vhosts/brandywinehouse.com/httpdocs/sailing/captionator.php on line 70

Sorry about that - it was a bit of a quick knockup, so I never tested it with no extra fields defined.

all you need to do is wrap an if clause around the for loop:
<!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="pn-sub">Code:</font><HR></TD></TR><TR><TD><FONT class="pn-sub"><PRE> if ($extra_fields)
{
foreach ($extra_fields[$i] as $field => $value)
{
$gallery->album->setExtraField($i, $field, trim(strip_tags($value)));
}
} </TD></TR></TABLE><!-- BBCode End -->

 
psjames

Joined: 2002-10-11
Posts: 19
Posted: Mon, 2003-02-17 16:14

Thanks that solved my problem.

PJ

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Mon, 2003-02-17 23:03

I've made an extra tweak to this: added two new features.

    <LI>Special fields<LI>Paragraphs in field display<LI>The captionator fix described above

The special fields are Title, Upload Date and Capture Date. If Title is defined, then it will be displayed in the page title, as well as under the photo. If the date fields are defined, the values already stored with each photo will displayed.

When displaying text fields, every embedded "n" will be replaced with a <p>, so the paragraph structure will be retained.

To patch from 1.3.3 to this version, get the file <!-- BBCode Start --><A HREF="http://www.mcgalliard.org/content/gallery/extra_fields_new_2.zip" TARGET="_blank">http://www.mcgalliard.org/content/gallery/extra_fields_new_2.zip</A><!-- BBCode End --> and apply the patch. If you've already installed the extra_fields_new.zip version, you can patch it with <!-- BBCode Start --><A HREF="http://www.mcgalliard.org/content/gallery/extra_fields_update_2.patch" TARGET="_blank">extra_fields_update_2.patch</A><!-- BBCode End -->. If you want all changed files, then get <!-- BBCode Start --><A HREF="http://www.mcgalliard.org/content/gallery/extra_fields_files_2.zip" TARGET="_blank">extra_fields_files_2.zip</A><!-- BBCode End -->.

Phew!

joan[/]

 
psjames

Joined: 2002-10-11
Posts: 19
Posted: Wed, 2003-02-19 15:44

I took the extra_fields_files_2.zip and replaced my files and I am now getting the following error:
Fatal error: Call to undefined function: restorequotes() in /usr/local/psa/home/vhosts/domain.com/httpdocs/sailing/classes/Album.php on line 74

any suggestions?

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Wed, 2003-02-19 17:31
Quote:
I took the extra_fields_files_2.zip and replaced my files and I am now getting the following error:
Fatal error: Call to undefined function: restorequotes() in /usr/local/psa/home/vhosts/domain.com/httpdocs/sailing/classes/Album.php on line 74

Looks like maybe all the files from the zip haven't been updated in your directory. Open util.php. restoreQuotes should be the last function in it. If it's not, you need to get the version from extra_fields_files_2.zip, and copy it into the directory.

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Thu, 2003-02-20 01:34
Quote:
This works great Joan! Thanks. I was looking for something that was a global (pre-arranged) setup - something the users couldn't change. So, when someone uploads a picture, the extra fields are already there for them to enter the information. But, I should be able to figure something out based on this. You are a life saver! :grin:

I thought this was worth while, so added one more patch: <!-- BBCode Start --><A HREF="http://www.mcgalliard.org/content/gallery/extra_fields_upload.zip" TARGET="_blank">extra_fields_upload.zip</A><!-- BBCode End -->

This is in addition to all the others, and adds a new option on the album page, add photo. This will allow you to fill in all extra fields defined for this album at upload time.

 
MysticGirl
MysticGirl's picture

Joined: 2003-01-06
Posts: 81
Posted: Sun, 2003-02-23 12:24

Hi Joan, I just got around to trying this one out. Your add_photo.php has taken out a bunch of the features I liked in the original version. I tried to go through and add the different pieces of code to add_photos.php and save_photos.php, but I got some errors. I even tried adding the extra stuff from both files into your customized file, but I didn't get it right either. If you get a chance, could you add to the patch file the necessary changes that need to be made to add_photos.php and save_photos.php? Or just tell me here if you don't feel like patching it...

 
gothballoon
gothballoon's picture

Joined: 2003-02-17
Posts: 68
Posted: Mon, 2003-02-24 09:03

Joan i am getting 2 odd errors i thought maybe you might be able to help me figure this out
when i try to use the caption tool
Fatal error: Call to a member function on a non-object in /home/htdocs/latexnballoons/www/members/gallery/captionator.php on line 43

$numPhotos = $gallery->album->numPhotos($gallery->user->canWriteToAlbum($gallery->album));

when i try to change the name of an added caption
Fatal error: Call to a member function on a non-object in /home/htdocs/latexnballoons/www/members/gallery/extra_fields.php on line 41

$gallery->album->setExtraFields($extra_fields);

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Mon, 2003-02-24 14:33
Quote:
Hi Joan, I just got around to trying this one out. Your add_photo.php has taken out a bunch of the features I liked in the original version. I tried to go through and add the different pieces of code to add_photos.php and save_photos.php, but I got some errors. I even tried adding the extra stuff from both files into your customized file, but I didn't get it right either. If you get a chance, could you add to the patch file the necessary changes that need to be made to add_photos.php and save_photos.php? Or just tell me here if you don't feel like patching it...

I don't really understand what you are trying to do. I've only removed the things that make no sense in this context. Say if you had 3 extra fields. Then if you could set each field on multiple uploads, you'd have 25 text areas to fill in. This seemed impractical, so I didn't allow multiple files. Similary, a zip file or a URL could contain any number of images - how would you allow the user to input all the values required, and match them up with the right images?

I haven't been near gallery remote, so that's not included eiterh. Any volunteers?

So I decided to only allow the user to set the extra fields on upload if s/he was uploading a single file. If s/he was uploading multiple files, s/he'd have to populate the extra fields later, using "edit caption".

If you can describe - from a user viewpoint - what you want to achieve, I see if I can help you.

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Mon, 2003-02-24 14:34
Quote:
Joan i am getting 2 odd errors i thought maybe you might be able to help me figure this out
when i try to use the caption tool

Please try to be specific: captionator.php or edit_captions.php?

 
gothballoon
gothballoon's picture

Joined: 2003-02-17
Posts: 68
Posted: Mon, 2003-02-24 15:14

each one depending on what i am doing when changing the extra feild names it pops up in the extra_feilds.php with
Fatal error: Call to a member function on a non-object in /home/htdocs/latexnballoons/www/members/gallery/extra_fields.php on line 48

when going to add captions is shows up in the captionator.php with
Fatal error: Call to a member function on a non-object in /home/htdocs/latexnballoons/www/members/gallery/captionator.php on line 43

I was hoping that maybe the two errors may be some how linked by one of the class files or something.

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Mon, 2003-02-24 15:46

Let's try some diagnostics.

print "gallery<br>"; var_dump($gallery); print "<p>";
print "gallery->album<br>"; var_dump($gallery->album); print "<p>";
print "gallery->user<br>"; var_dump($gallery->user); print "<p>";
$numPhotos = $gallery->album->numPhotos($gallery->user->canWriteToAlbum($gallery->album));

and
print "gallery<br>"; var_dump($gallery); print "<p>";
print "gallery->album<br>"; var_dump($gallery->album); print "<p>";

$gallery->album->setExtraFields($extra_fields);

 
gothballoon
gothballoon's picture

Joined: 2003-02-17
Posts: 68
Posted: Mon, 2003-02-24 17:36

Joan sounds great but whare do i put it? :grin:

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Mon, 2003-02-24 19:20

They're diagnostic print statements - the go just above the line of code you are getting an error on (see, i have included the two lines of code you reported as giving an error).

Then, when you visit the page, you will get a lot of rubbish. Cut and paste that into a PM to me.

 
matadler

Joined: 2003-01-23
Posts: 11
Posted: Fri, 2003-02-28 11:09

Hi!

A nice feature would be a field named 'Camera', which reads the EXIF data and displays the camera model. If there's no EXIF data available one should be able to enter the camera model manually.

:grin: Mathias

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Fri, 2003-02-28 11:45
Quote:
Hi!

A nice feature would be a field named 'Camera', which reads the EXIF data and displays the camera model. If there's no EXIF data available one should be able to enter the camera model manually.

:grin: Mathias

Good suggestion. I'm not modifying this for a while, because I am waiting to see if it becomes part of gallery 1.3.4. I'll note down this as a feature request.

 
fingery
fingery's picture

Joined: 2003-03-15
Posts: 38
Posted: Sat, 2003-03-29 00:47

I must be simple....having problems here.

I have shell access. I've upload the 2 files to to the gallery directory and have run sh configure.sh.

Where is patch? Is it a Nuke thing or something? How do i install/run the patch?

Thanks in advance.

Chris

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Sat, 2003-03-29 01:19
Quote:
I must be simple....having problems here.
I have shell access. I've upload the 2 files to to the gallery directory and have run sh configure.sh.
Where is patch? Is it a Nuke thing or something? How do i install/run the patch?

I'm not surprised, this is getting complicated. I'm losing track.

First, make sure you've got the latest version. Get if from <!-- BBCode Start --><A HREF="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=692300&amp;group_id=7130&amp;atid=307130" TARGET="_blank">Sourceforge</A><!-- BBCode End -->

Then go back to the beginning of this thread, and read the posting by me on the 6 Feb, particularly this part:

Quote:
To install, get the file extra_fields_new.zip and unzip it. Copy extra_fields.php to your gallery directory, then change to your gallery directory, user configure.(sh|bat) to make sure you can write to the setup directory, and apply the patch. Eg:
sh configure.sh
patch -p0 < extra_fields_new.patch
sh secure.sh

Let me know how you do.

 
fingery
fingery's picture

Joined: 2003-03-15
Posts: 38
Posted: Sat, 2003-03-29 10:54

Sorry Joan, just looked at my last post and it wasn't very clear.

When i said it doesnt look like i've got the patch i meant the patch program (i presume).
When entering patch -0 < extra_fields_release_candidate_1_3_3.patch i get the following..

bash: patch: command not found

Any ideas?

Thanks in advance,

Chris

 
Amberlight

Joined: 2003-03-29
Posts: 2
Posted: Sat, 2003-03-29 20:27

Hi Joan,

I'm a total newbie, so forgive me. I am very very much in need of the extra fields scrip you've written, but I am not at all familiar with SSH. My partner does most of my code work, and he's asking me if I can get the ftp commands to accomplish this. Am I way off base? Can you enlighten me? And while I have your often bent ear, can you tell me where to change the text and link color of the main gallery page? We found the style sheet you instructed in another string that changes the page color, but no luck on the text. Your wisdom is much appreciated! :roll:

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Sat, 2003-03-29 22:53

Amberlight, Fingerly,

Instructions on patching found in this thread: <!-- BBCode Start --><A HREF="http://gallery.menalto.com/modules.php?op=modload&amp;name=phpBB_14&amp;file=index&amp;action=viewtopic&amp;topic=4936&amp;2" TARGET="_blank">patch question</A><!-- BBCode End -->
That's probably the right place to ask further questions on patching - so others can find them.

Text and link colour: copy css/standalone_style.css.default to css/standalone_style.css. Link colours should be obvious, and text is in the TD, P section.

 
Amberlight

Joined: 2003-03-29
Posts: 2
Posted: Mon, 2003-03-31 14:56

Hi Joan,

Thank you for your help. Sadly, your advice is still over my partner's head (way over mine) so we've had no luck making it all work. Would you or anyone else you can reccomend have the time to help me add your new field customization and make a few other code edits for me? I am obviously willing to pay. Can someone hold my newbie hand? :cry:

my email is

.

 
skicrave

Joined: 2002-10-25
Posts: 89
Posted: Tue, 2003-04-08 08:26

Thanks for the great mod Joan. I'm not to familar with the Gallery database scheme, so I was wondering if you could answer a quick question for me. Can this same method be applied to albums (with the appropriate changes of course)?

Thanks again!

 
tessa

Joined: 2003-03-13
Posts: 35
Posted: Tue, 2003-04-08 22:44

I think I killed my gallery. :sad:

I was trying the installation on my files. I don't have shell access only FTP. So I tried to make the changes myself. Now I cannot even get the config.php page to come up to attempt to see if my changes work.

The error i'm getting is:
Parse error: parse error, unexpected '"' in /home/spa/public_html/spagallery/util.php on line 1282

Fatal error: Call to undefined function: broken_link() in /home/spa/public_html/spagallery/util.php on line 874

I have uploaded my original files back to my server. I not shure how to go about placing this code. I have read and re-read the patch tutorial, but it doesn't seem to work for me either. I have downloaded the http://unxutils.sourceforge.net/ --->not sure how to use this, or if I can use it.

Index: captionator.php
================================
RCS file: /home/cvs/gallery/captionator.php,v
retrieving revision 1.1.1.2
retrieving revision 1.1.1.2.8.3
diff -c -r1.1.1.2 -r1.1.1.2.8.3
*** captionator.php 3 Jan 2003 13:47:50 -0000 1.1.1.2
--- captionator.php 18 Feb 2003 01:52:04 -0000 1.1.1.2.8.3
***************
*** 67,72 ****
--- 67,79 ----

I went to line 67-72 (original file) and copied from the patch file and placed the code from 67 to 69.
I tried to follow this same procedure through the entire document. where I saw the + symbols i removed the + (but kept the new text lines). However, I only resulted in the errors listed above.

I will try again, of course, but i'm not sure what i'm doing wrong.

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Thu, 2003-04-10 21:03

Not sure what you're doing, but if you see this
<!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="pn-sub">Code:</font><HR></TD></TR><TR><TD><FONT class="pn-sub"><PRE>
***************
*** 67,72 ****
--- 67,79 ----
} else {
$gallery->album->setCaption($i, stripslashes(${"new_captions_" . $i}));
$gallery->album->setKeywords($i, stripslashes(${"new_keywords_" . $i}));
+ if ($extra_fields)
+ {
+ foreach ($extra_fields[$i] as $field => $value)
+ {
+ $gallery->album->setExtraField($i, $field, trim(strip_tags($value)));
+ }
+ }
}

$i++;
</TD></TR></TABLE><!-- BBCode End -->

then you need to find this line:
$gallery->album->setKeywords($i, stripslashes(${"new_keywords_" . $i}));
and add these lines after it:
<!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="pn-sub">Code:</font><HR></TD></TR><TR><TD><FONT class="pn-sub"><PRE>
if ($extra_fields)
{
foreach ($extra_fields[$i] as $field => $value)
{
$gallery->album->setExtraField($i, $field, trim(strip_tags($value)));
}
}
</TD></TR></TABLE><!-- BBCode End -->

Is that what you're doing?

 
CHEETAH
CHEETAH's picture

Joined: 2003-02-26
Posts: 37
Posted: Sat, 2003-04-12 08:37

ok am i dumb or what? i cant get this to work! I uplaoded "extra_fields.php" to the gallery directory, "extra_fields_new.patch" to the setup-directory inside the gallery directory, went to the gallery-directory with the ssh-thing on my webserver, said sh configure.sh, went to the setup directory, wrote patch -p0 < extra_fields_new.patch and got this:

jailshell -2. 05a$ cd setup
jailshell -2. 05a$ patch -p0 < extra_fields_new.patch
can't find file to patch at input line 19
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
------------------------------
|? .htaccess
|? config.php
|? CVS.tar
|? extra_fields.patch
|? extra_fields.zip
|? extra_fields_new.patch
|? extra_fields_update.patch
|? x
|? xx
|? setup/x
|Index: do_command.php
|===================================================================
|RCS file: /home/cvs/gallery/do_command.php,v
|retrieving revision 1.1.1.2
|retrieving revision 1.1.1.2.8.1
|diff -c -r1.1.1.2 -r1.1.1.2.8.1
|*** do_command.php 3 Jan 2003 13:47:50 -0000 1.1.1.2
|--- do_command.php 7 Feb 2003 12:54:53 -0000 1.1.1.2.8.1
--------------------------

so what did i do wrong!=?????

thx for help!
/CHEETAH

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Sat, 2003-04-12 08:48
Quote:
ok am i dumb or what? i cant get this to work! I uplaoded "extra_fields.php" to the gallery directory, "extra_fields_new.patch" to the setup-directory inside the gallery directory, went to the gallery-directory with the ssh-thing on my webserver, said sh configure.sh, went to the setup directory, wrote patch -p0 < extra_fields_new.patch and got this:

Not sure why you are going to the setup directory: DON'T!

move the patch to your /gallery directory, and run it from there.

 
CHEETAH
CHEETAH's picture

Joined: 2003-02-26
Posts: 37
Posted: Sat, 2003-04-12 08:54
Quote:
>> ok am i dumb or what? i cant get this to work! I uplaoded "extra_fields.php" to the gallery directory, "extra_fields_new.patch" to the setup-directory inside the gallery directory, went to the gallery-directory with the ssh-thing on my webserver, said sh configure.sh, went to the setup directory, wrote patch -p0 < extra_fields_new.patch and got this:
<<

Not sure why you are going to the setup directory: DON&amp;#039;T!

move the patch to your /gallery directory, and run it from there.

oh ok gonna try that one then! :razz:

 
CHEETAH
CHEETAH's picture

Joined: 2003-02-26
Posts: 37
Posted: Sat, 2003-04-12 09:09

One question:

i can only edit the extra fields pic by pic, gong in the edit photo-dropmenu and choose edit caption. how to make it possible to edit them through "[captions]" in that gallery's menu, and edit them all at once?
cheers and GREAT MOD!