Advanced search  

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]

Pages: [1]   Go Down

Author Topic: List of image captions - can anyone help?  (Read 4447 times)

0 Members and 1 Guest are viewing this topic.

Fero

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
List of image captions - can anyone help?
« on: November 24, 2003, 03:28:21 am »

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
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
List of image captions - can anyone help?
« Reply #1 on: November 24, 2003, 08:01:15 am »

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
Logged

Fero

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
List of image captions - can anyone help?
« Reply #2 on: November 27, 2003, 10:19:21 pm »

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
Logged

Fero

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
List of image captions - can anyone help?
« Reply #3 on: November 27, 2003, 11:48:53 pm »

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
Logged

Fero

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
List of image captions - can anyone help?
« Reply #4 on: December 16, 2003, 04:06:11 am »

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:

Code: [Select]

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);
        }
}
Logged

Fero

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
list of thumbnail titles (thumb_title) - how to?
« Reply #5 on: February 24, 2004, 09:36:58 pm »

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
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
List of image captions - can anyone help?
« Reply #6 on: February 25, 2004, 07:08:07 am »

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
Logged

hyperion

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 1317
  • - retired -
List of image captions - can anyone help?
« Reply #7 on: March 10, 2004, 10:02:00 am »

You might look at this mod by fotofreek:

http://forum.coppermine-gallery.net/index.php?topic=4419
Logged
&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

(http://www.mozilla.org/products/firefox/buttons/getfirefox_small.png)
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 20 queries.