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: Image number in thumbnail view  (Read 11946 times)

0 Members and 1 Guest are viewing this topic.

mala

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28
Image number in thumbnail view
« on: May 24, 2008, 04:22:06 pm »

I think the possibility to see the image number in the thumbnail view can be a useful feature
especially for albums spanning over many pages. I could be added in the configuration menus
or even toggled by the viewer.   
Logged
Andreas

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: Image number in thumbnail view
« Reply #1 on: May 25, 2008, 01:07:06 am »

what's an "image number"?
Logged

mala

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28
Re: Image number in thumbnail view
« Reply #2 on: June 01, 2008, 08:39:58 am »

When you are in the "image view" you can see the number of the picture displayed like x/Y, Y being the total number of pictures
in the album. This i what I meant, maybe "picture number" would be a better term. So when in the thumbnail view seeing the number
of the picture gives a fast reference without having to count or switch to the image view.
(Sorry for the delay).
Logged
Andreas

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: Image number in thumbnail view
« Reply #3 on: June 01, 2008, 10:14:35 am »

I still don't get the idea, sorry.
Logged

mala

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28
Re: Image number in thumbnail view
« Reply #4 on: June 02, 2008, 03:50:42 pm »

Probably I say silly things, I don't know.
Let me try to be more precise.
Have a look at http://sikinos.unige.ch/NOB/thumbnails.php?album=360
This is what I mean by "thumbnail view" of this album.

As you can see, there are four pages of pictures. Suppose I want to refer to one of them
(note that unfortunately all have the same title). For example, picture on the second row on the
third column of page two. In fact this is picture (file) no. 35 in this album
as you can see by clicking on it (FILE 35/89 in the "image view").

What I suggest is that this numbers (like 35, or 35/89) be displayed  under, (or next or over or whatever )
the corresponding thumbnails, in what I called the "thumbnail view".
This could be a configuration choice, like the "Display file name below the thumbnail" , for example something like
"Display the file number below the thumbnail".

I must also confess that I feel somehow embarrassed since  I am wasting much of your time for something rather secondary.


Logged
Andreas

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: Image number in thumbnail view
« Reply #5 on: June 02, 2008, 05:12:50 pm »

OK, I get the point now.
Well, the idea is that you should use the caption wisely: your thumbnail page shows 28 thumbnails, and all of the are labelled "Everyday Tricks training in Vouliagmeni". It would be wiser to use individual title/captions, like this one: http://coppermine-gallery.net/demo/cpg14x/thumbnails.php?album=20
Do you notice the difference? All files have meaningfull labels. There's no need to come up with a numbering scheme.
Logged

mala

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28
Re: Image number in thumbnail view
« Reply #6 on: June 02, 2008, 08:44:22 pm »

Yes, of course. But this depends on the people working  on the base (we are 4).
One can make good or bad choices, I do agree.

In fact, in the case you mentionned, the pictures are quite different and really deserve different names.
But in "my" case, they are very similar (it is a boy doing water skiing tricks, sequentially photographed-impressive!)
and, in fact, only numbers can differenciate them.

The numbering is just an "idiot independent" option which (I thought)
comes for free, since it appears in the "image view". Giving a reference to a number
is straightforward and non ambiguous. Therefore I still think  it is a useful feature and this is why, I guess,
it appears in the image view.


But of course, this whole issue  is far from being crucial.

Anyway, thanks for spending your time on it.
Logged
Andreas

mala

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28
Re: Image number in thumbnail view
« Reply #7 on: June 16, 2008, 04:39:13 pm »

I don't know if anybody will read this but, anyway, I implemented the "thumbnail numbering".

It is a configuration choice (like "Display filename under the thumbnails"), therefore it can be active or not.
For example see http://amorgos.unige.ch/NOB/thumbnails.php?album=360 , where the thumbnails are numbered from
1 to 89.
The modifications I did involved adding a row in the table cpg14x_config.
Although one can never be sure, it seems I have not introduced a bug.
If anybody is interested I can post the details of the modifications even if I am conscious that
it risks to become tedious to re-modify every upgrade of Coppermine.
Logged
Andreas

Nibbler

  • Guest
Re: Image number in thumbnail view
« Reply #8 on: June 16, 2008, 04:43:19 pm »

Post the code. If it gets added to 1.5 then you won't need to re-modify any more. It's good for everyone.

From what I can see though it's still ambiguous since it depends on the sort order.
Logged

mala

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28
Re: Image number in thumbnail view
« Reply #9 on: June 16, 2008, 05:53:26 pm »

The idea is to number the thumbnails for a quick reference. Of course it depends on the ordering, I guess like in the image view.

Here are the modifications (they are small).

1. Inserted a row in the cpg14x_config table. The field values for "name" and "value" are
               
  display_picture_number 0

2. Added a line
Quote
  array('Display file number below the thumbnail', 'display_picture_number', 1,'f=index.htm&as=admin_thumbnail_display_picture_number&ae=admin_thumbnail_display_picture_number_end'),

 in lang/english.php, just before the line
Quote
  array('Display file name below the thumbnail', 'display_filename', 1, 'f=index.htm&as=admin_thumbnail_display_filename&ae=admin_thumbnail_display_filename_end'), //cpg1.4
This should be added in the different lang files, if the feature gets its way in version 15 I can help with some of them (French, Greek, and some more).

3. Added
Quote
<a name="admin_thumbnail_display_picture_number"></a>
<h4>Display file number below the thumbnail</h4>
<p>Toggles the display of the file number below each thumbnail.</p>
<p class="small right_align">[cpg1.4.0 or better required]</p>
<a name="admin_thumbnail_display_picture_number_end"></a>
just before
Quote
<a name="admin_thumbnail_display_filename"></a>
<h4>Display the file name below the thumbnail</h4>
<p>Toggles the display of the file name below each thumbnail.</p>
<p class="small right_align">[cpg1.4.0 or better required]</p>
<a name="admin_thumbnail_display_filename_end"></a>
in docs/index.htm

If I got things right, these modifications settle the configuration part.

Now comes the "ugly part". I think I should do better (by passing variables) but I lost grip.

4. In the include/functions.inc.php , function  display_thumbnails I added in the declaration part
 
Quote
global $displayed_page_number;
and just after it, in the statement part
Quote
$displayed_page_number=$page;

5. In the include/functions.inc.php, function build_caption
I added in the declaration part
Quote
global $displayed_page_number;

and just after the beginning of the statement part (in the foreach loop, very first statment),
that is just after
Quote
    foreach ($rowset as $key => $row) {
        $caption='';

I added the following  lines

Quote
   if ($CONFIG['display_picture_number']) {
     $picture_number_in_page++;
     $picture_number=$picture_number_in_page+($displayed_page_number-1)*$CONFIG[thumbcols]*$CONFIG['thumbrows'];
          $caption .='<span class="thumb_filename">' . $picture_number . '</span>';
        }

(I know, part of the calculation should be done outside the loop!)


Thats all (I hope!). Also, I am not 100% certain I did not introduce a mistake somewhere. If you wish I can send you the admin password of the gallery, but over a "private" channel, i.e. email. Mine is andreas.malaspinas@gmail.com

Logged
Andreas
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 19 queries.