List of image captions - can anyone help? List of image captions - can anyone help?
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

List of image captions - can anyone help?

Started by Fero, November 24, 2003, 03:28:21 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Fero

I am a nature photographer and I use CPG, which I love to run my archive of images.

I would like to add a list of species photographed. Since I alwasy use species name as a caption it should be really easy.

Can anyone help with the php script? I guess you just need to extract the names from mySQL and put some conditions, don't repeat, also I use ? if I am not sure about id, so another condition would be if ? present don't list.

Any helps is appreciated.

Fero
www.wnp.sk

Joachim Müller

what exactly do you want to script to do? Run through all pic database entries, extract the caption into an array including a link to the pic, sort the array alphabetically and output the list on the screen?

GauGau

Fero

Thanks GauGau, that is exactly what I want. Unfortunately I am not so good in php, is anyone willing to help? At least which functions to use or which file to use as a base.

Fero

Fero

tp be exact: I would like to list 'title' from 'cpg_pictures' database and sort it alphabetically (possibly with a link to midsize picture)

ideally in this format

category A
   album 1
      titles (list in alphabetical order)
   album 2
      titles
category B
.
.
.

I don't know where to start from, the code is not so clear for me, a lot of references, etc.

Thanks

Fero

Fero

OK, I already managed to make a list of image captions only:
http://www.wnp.sk/list.php?album=18

I basicaly eliminated thumbnails and page numbering

I don't want to list same captions many times. Any idea how to do this condition?

Something like if 'caption' same as previous one, don't list it

Here is copy of the function:


function display_captions($album, $cat, $page, $display_tabs)
{
        global $CONFIG, $AUTHORIZED, $HTTP_GET_VARS;
        global $album_date_fmt, $lang_display_thumbnails, $lang_errors, $lang_byte_units;

        $thumb_per_page = 9999;
        $lower_limit = ($page-1) * $thumb_per_page;

        $pic_data = get_pic_data($album, $thumb_count, $album_name, $lower_limit, $thumb_per_page);
        $total_pages = ceil($thumb_count / $thumb_per_page);

        $i = 0;
        if (count($pic_data) > 0) {
                foreach ($pic_data as $key => $row) {
                        $i++;

                        $image_size = compute_img_size($row['pwidth'], $row['pheight'], $CONFIG['thumb_width']);
                       
                        $thumb_list[$i]['pos'] = $key < 0 ? $key : $i - 1 + $lower_limit;
                        //$thumb_list[$i]['image'] = "<img src=\"" . get_pic_url($row, 'thumb') . "\" class=\"image\" {$image_size['geom']} border=\"0\" alt=\"{$row['filename']}\" title=\"$pic_title\"></a>";
                        $thumb_list[$i]['caption'] = $row['caption_text'];                
                        $thumb_list[$i]['admin_menu'] = '';

                }
                theme_display_thumbnails($thumb_list, $thumb_count, $album_name, $album, $cat, $page, $total_pages, is_numeric($album), $display_tabs);
        } else {
                theme_no_img_to_display($album_name);
        }
}

Fero

I have posted this before, but still haven't figured otu how to do it.

I wouldlike to list thumbnail titles in alphabetic order within each album:

category
  A title (# of pictures)
  B title (# of pictures)
 ......

idealy with a link to show all the thumbnails for each title

I photograph nature and I use species name as a title. This would allow me to list species I have photographed, f.i.

BIRDS
  eagle (3)
  sparrow (5)
 
 .....

Can anyone help me to do it? How difficult is to make list itself, number of pictures, and links?

Thank you

Fero
Wildlife and Nature Photography
www.wnp.sk

Joachim Müller

Merged your posting into one thread and moved it to feature requests. Next time, please don't start a new thread on an identical request. Please read http://forum.coppermine-gallery.net/index.php?topic=3997

GauGau

hyperion

&quot;Then, Fletch,&quot; that bright creature said to him, and the voice was very kind, &quot;let&#039;s begin with level flight . . . .&quot;

-Richard Bach, Jonathan Livingston Seagull

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.mozilla.org%2Fproducts%2Ffirefox%2Fbuttons%2Fgetfirefox_small.png&hash=9f6d645801cbc882a52f0ee76cfeda02625fc537)