Numbers below each thumbnail

I'm trying to get numbers below each thumbnail in my gallery. What I'd like is for them to start at 1 (at the top left) to however many thumbnails there are.

Now, I did a bit of reading on the forums about someone trying to get their image name below each image. This was all well and good (and I thought it could be the solution for me) but it didn't work 100%. I managed to get the titles showing (albeit unstyled) but an error came up:
Notice: printEditable() invalid function call. in /../zp-core/template-functions.php on line 1225

I managed to get the titles to show by inserting:
<?php while (next_image( printImageTitle() )):

in admin.php

But anyway, not sure how I can insert numbers below each thumbnail? Any ideas / help would be greatly appreciated.

Also, my theme is the JoshuaInk Theme but I'm not sure if that helps.

Thanks!

Comments

  • acrylian Administrator, Developer
    http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functionimageNumber

    `<?php while (next_image( printImageTitle() )):`
    You probably misstyped but this example is of course wrong...
    http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functionnext_image
    Correct is of course:
    `
    while(next_image()) :
    printImageTitle();.....
    endwhile;
    `
    Not that anyone tries to use that...
  • Thanks for that acrylian.

    Yeah, I don't know much php at all. I've had a look through that first link and it shows:

    function imageNumber( ) {

    in the template-functions.php file. Is that what I'm supposed to be editing?

    I had a look through http://www.zenphoto.org/news/how-to-read-the-zenphoto-functions-guide but I have no parameters for this function, so if I am supposed to be editing that particular bit of code, I'm not sure what I'm supposed to be changing. Also, in the first link you posted, it says 'int' so I'm assuming it should look something like:

    function imageNumber( [int $?? = ?? ) {

    Again, I've got no idea, so I could be way off (and probably am).

    Any help appreciated.
  • acrylian Administrator, Developer
    No, that function gets the number of the current image (based on the order) within the `next_image()` loop on album.php. Not all functions have parameters as this does not. Also You use it this way `echo imageNumber();` You should NEVER edit core files unless you know what you are doing (you are apparently not) and unless you want to run into trouble on upgrades.

    I strongly suggest to read the theming tutorial and learn some PHP basics before proceeding with anything. Sorry, I will not further respond to absolute basics like using the function above.
  • Thanks again acrylian.

    I've managed to get <?php echo imageNumber();?> to work but it only seems to work in non-dynamic albums. Is that supposed to be the case?
  • acrylian Administrator, Developer
    It should actually work in all albums. If it does not please open a ticket
  • Sorry about all the questions,

    I sent a ticket the other day. With it being the first time I've used the system, where am I expected to look for a response? http://www.zenphoto.org/trac/report/1 there?
  • acrylian Administrator, Developer
    Tickets are moderated and I haven't looked a while, sorry. We will respond on the ticket of course.
  • Thanks for all your hard work acrylian,

    I'm not sure if I can comment on the ticket so I'll just comment here.

    You stated "I took a look and it was a bug as the code was already there. Fixed in tonight's nightly build."

    Do I have do download one of these files? http://www.zenphoto.org/pages/nightly-builds

    Do I have to upgrade to another version of zenphoto first?

    Thanks again.
  • acrylian Administrator, Developer
    To comment on a ticket you need to login on the Trac system with the credentials you got when registering to create the ticket.

    Yes, you need to install one of those files (trunk version, not dev). Since you are on an older version I really recommend to upgrade to 1.4.1.2 first. Or you can wait until 1.4.13 is released, actually scheduled September 1st if nothing occurs.
Sign In or Register to comment.