How can I add description to the photos? I tried to use the editCaption function to do it but realised that if I had to do it this way I have to create or edit many other files. I realised it wasnt as simple as adding fields to albums via editField
right now i am stuck here because I dont want to mess up my album.dat files
I tried something like this
in view_photo.php
----
<tr>
<td colspan=3 align=center>
<span class="caption"><b><?php echo editCaption($gallery->album, $index, $edit, caption) ?></b></span>
<br><br>
</td>
</tr>
<tr>
<td colspan=3 align=center>
<span class="description"><?php echo editCaption($gallery->album, $index, $edit, description) ?></span>
<br><br>
</td>
</tr>
----
and in util.php
----
function editCaption($album, $index, $edit, $field) {
global $gallery;
$buf = $album->getCaption($index);
if ($gallery->user->canChangeTextOfAlbum($album)) {
if (!strcmp($buf, "")) {
$buf = "<i><No " . $field . "></i>";
}
$url = "edit_caption.php?set_albumName={$album->fields[name]}&index=$index";
$buf .= "<span class=editlink>";
$buf .= '<a href="#" onClick="' . popup($url) . '">[edit ' . $field . ']</a>';
$buf .= "</span>";
}
return $buf;
}
----
Posts: 3473
Can you explain precisely what you want to acheive? Not in code terms, but as the user would experience it.
[You can already change the caption of photo by clicking the "edit" link, or of many photos by clicking "captions" on the album page.]
Posts: 34
i want a seperate caption and description for each photo that i can edit seperately
a caption will just be the title of the photo and description may provide more details about it
Posts: 3473
Something like this http://www.mcgalliard.org/gallery/album01?
Patch is here :<!-- BBCode Start --><A HREF="http://sourceforge.net/tracker/index.php?func=detail&aid=692300&group_id=7130&atid=307130" TARGET="_blank">Configurable extra fields</A><!-- BBCode End -->
Posts: 34
cool!
is the feature that says how many comments and last comment added included as well? thanks for your help!
Posts: 3473
Enjoy. The comments is separate. A search here for mostRecentComment should turn up some examples.
Posts: 34
I decided to do a simple change for the photo description, changed the keyword field to a description field and made it show up when viewing the photos