Custom Thumbnail on Index Page

I would like to know how to set the thumbnail on the index page (the main page) to a custom thumbnail that has been cropped by me. I have uploaded a custom thumbnail to my /zenphoto/cache/album folder and made it appear manually through Firebug.

I would like to know how I can get it to stay there. In the Admin > Edit tab, under the Thumbnail drop down, I do not get an option that would allow this to happen. I must choose between "most recent, random, or a particular image that Zenphoto crops for me".

Note that the Custom thumbnail cropping feature in Admin > Edit > Images tab does not work. Not 100% sure why, but from the info I gathered, it is because my theme is a custom theme.

Apologies if this has been addressed, but I cannot find this in the forums. Any help would be appreciated.
«1

Comments

  • Are you using the getCustomAlbumThumb() function? Try using it and adjusting the variables via it:

    http://www.zenphoto.org/documentation/functions/_template-functions.php.html
  • I'm using Zenpage so how could it be possible to hide albums appearing on main page?
  • @captain1 probably best to start a new thread for your issue, or tack it to one of your other threads, leave this one for ryan_nerone's post. I'll go help over on one of your threads.
  • acrylian Administrator, Developer
    @Captain1: You question has already been answered on another thread. Unpublish them.
  • We'll disregard captain1's stuff and begin again here.

    I am using the printCustomAlbumThumb() function and it's variables have been adjusted. How can I adjust this to direct it to the URL of the "customthumb.jpg" that I would like to place in the /zenphot/cache for each album on the index page?

    Bet the answer is just right in front of me, but I'm new to this stuff.

    Here is the code (please let me know if it is wrong to post this here; can't seem to find the guidelines for posting)

    `
  • acrylian Administrator, Developer
    If you want to use the custom cropping values from the admin cropping tool you can't use the customimage functions. These do not use the values from the backend.
  • So should I delete the custom cropping values and keep the code as is or should I change what the code is calling for? I just want to upload "customthumb.jpg" to each cache folder with the correct dimensions already present and have the code call for that. I'm confused.
  • acrylian Administrator, Developer
    You have to use the default image functions. Take a look at the default theme and/or the theming tutorial.
  • Please inclose "code" in peck marks so that the formum formatting is not destroyed.
  • Thanks, I'll work through it when I get the chance and post the code correctly next time.
  • I can't get this to work. Any chance you could expand on "use the default image functions"? My default theme has been deleted so I can't reference it. Tried to download again, but I keep getting corrupted downloads of the Zenphoto.zip/.tar.gz

    Now I can't find the functions guide. Seems to have vanished from the site. All I see is "How to read..."
  • for the function guide click "user guide" from the top menu in the header, it's the first item then listed on the left.
  • i'm starting to feel like a complete moron with this stuff. can't even find the guide. so here is where i navigate to like micheall said.

    http://www.zenphoto.org/documentation/index.html

    seriously, where is it? a direct link would be key.

    found the elements index however.
  • That is the function guide, then on the right you have the links for the different functions/classes etc of zenphoto. For instance, if you click on functions it will show you the three categories of functions, then click on template-functions.php and you can look through all the functions that are specifically for templating and theme work.
  • thanks. i got it. sometimes i think my brain has a filter on blatantly-obvious content. i'll get it together one day. so, now i'll delve into getting these custom thumbnails going and post back when i can. cheers.
  • acrylian Administrator, Developer
    The easiest to search on the functions guide is to click on "element index" and then use the page search function every browser has.
  • i really need to reference the default template for learning how to do this, but i deleted it. not sure why, but, here in thailand, i cannot download the latest zenphoto 1.2.6 or any other content from zenphoto (themes,etc.) without the download breaking every time. i've tried numerous times and using different browsers. no luck. is there another way i can access the default theme?
  • acrylian Administrator, Developer
    I have no idea why you are not able to download. The official Zenphoto release package is actually hosted on Google code, maybe try that directly:
    http://code.google.com/p/zenphoto/
  • tried it. broke again. always at 3.9MB. i don't know why either. i'll get friend in the states to download it and send it another way. crazy.

    so, while the help is appreciated, i gather from this forum, that you can't walk me through the steps in getting this task done. i'm positive this is not difficult and could probably be resolved quickly, but it seems like you are not wanting to directly post the code that i need. while i understand every case is different and maintaining this forum is a busy job, it seems like just posting the code would help both me and others who are confused over this same thing.
  • Sorry, I try to teach people how to help themselves via the tools available here. Normally it's more helpful, but then again I'm a user who learned that way. As far as I understand it, you've selected an image and did your own cropping via the admin-backend. What acrylian said is that we can't use the getCustomImageThumb call, you have to use the default one.

    So you'd want to use `printAlbumThumbImage()` which will then call the default album thumb image (which you've assigned via the backend tool already).
  • thanks. i'm getting there. just getting frustrated over this. here is my problem.

    i want the index to have 350x150 custom cropped images. they will be uploaded as "customcropalbum1.jpg" with dimensions already set. when i upload them, i cannot select the image from the thumbnail dropdown in edit>album. it only has the photos in the album folder.

    on the album pages, i want to have 85x85 crops that can be randomly generated by Zenphoto.

    when i deleted the printCustomAlbumThumbImage and used printAlbumThumbImage, i had to go into options>theme options and change the Crop Thumbnails to 300x150. this then throws off the album thumbnails. i do not want the index page and the album page to have the same thumbnail dimensions.

    when using the printCustomAlbumThumbImage, my only issue is that i don't like Zenphoto choice of crops from the index page and would like them to be my own. the sizes are all correct both on the index and album pages.

    again, thanks for the help. maybe we can keep the dialogue going now and i can relieve myself of a headache.
  • sorry that first mention should be 300x150
  • Alright, if that's the case then your first question makes more sense, the customalbumthumb since you're not using the zenphoto admin-crop. So the issue then gets to your initial question which was "how to point it to the url?". The way the printCustomAlbumThumb image works is that you set your variables, and where on the picture the thumb is centered. You don't actually point it to a separate file.

    Now there's a couple ways you could accomplish what you're looking to do. You could create your own index.php/splash page into the gallery and use standard html/img tags linking to your gallery albums.

    Another way would be to upload those customcrops you made into your different albums, setting them as the custom thumbs. The only problem with doing it that way is that where you're putting the printCustomAlbumThumImage is in a loop, so it's going to use the same dimensions etc for each time through the loop.

    Probably the best way to accomplish what you're looking to do is blend the two. Modify the zenphoto index.php so that it's not looping and use the printCustomAlbumThumImage calls placed on your index page and styled how you want with the html/css elements. Doing that gets more into the theming aspects, which you'd want to familiarize yourself with by visiting the theme guide (sorry habit):

    http://www.zenphoto.org/2009/03/theming-tutorial/
  • acrylian Administrator, Developer
    You can't uploaded images with already set dimensions to be used as custom thumbs separatly, unless you want to do a lot of extra coding. Zenphoto considers every image within the albums as full size image and use them to generate the thumbs and the sized images.
  • yeah this is getting beyond my knowledge level. i think i will just work with the custom image thumb attributes and find a crop that is "suitable enough" to go with. seemed like a straightforward thing that i thought was easily available to do. upload an pre-cropped image with whatever extra design you add to it, select it as your thumbnail, have it link to your gallery. guess it is more complicated.

    could you tell me how this site is doing their thumbnails? it does not seem possible that Zenphoto generated those exact thumbnails for each album. maybe, but it seems to me that he has cropped the faces for each separate album just how he likes them, and then has it link to the album.

    http://www.stefanoginella.com

    guess i don't have to write it every time, but thanks. :)
  • If you're willing to invest the time to make your own thumbnails manually, you may be able to set individual thumbnails similar to the way described here: http://www.zenphoto.org/2009/03/troubleshooting-zenphoto/#19 (I don't know if this only works for videos or not, but it may be worth a try)
  • acrylian Administrator, Developer
    @kagutsuchi: That will only work for videos and audio files as we of course can't create thumbs from those.

    If someone wants special predefined thumbs not generated from the uploaded images you have to store them elsewhere and create a function that links to them maybe using an image filter or whatever.

    @ryan_nerone: We of course don't know anything about that site's theme but it will surely use the custom image functions we mentioned above.
  • Thanks for all the assistance. I've abandoned the need for the custom thumbnail of my own, but now I need to understand how to use Zenphoto's custom thumbnail cropping. I cannot get it to function in my admin. I understand from reading that if you use any functions that include "Custom" then it will override the Zenphoto cropping. So, I have changed them but it is still not working and now I cannot have different thumbnail sizes for my index and album pages.

    Backticks with the code is not working correctly for me, so, to keep this forum's formatting clean, here are links to the code.

    Here is the index.php

    http://www.thegoldbrick.net/wp-content/uploads/2009/11/Index.txt

    Here is the album.php

    http://www.thegoldbrick.net/wp-content/uploads/2009/11/Album.txt

    Again, I want 300x150 thumbs on the index and 85x85 crops on the album. I also want to be able to use the custom thumbnail cropping feature from the backend (mostly for the index page only, it is no problem if the album page is randomly generated).

    In my options>theme options>crop thumbnails; I have the setting at 300 and 150 with a checkmark. this makes both the index and album have the same which is a problem.

    Could someone please take me through the steps to do this? I have been referencing the theming tutuorial and other code (i don't have the default theme to reference), but I cannot get it working. Posting the exact functions to use would be a huge benefit. Thanks in advance.
  • Ok, what I would do in this situation then is to have your index.php use the `defaultAlbumThumbImage()` call in it's loop. Set your default image thumb sizes in your backend to 300x150.

    Then in your album.php I'd use the `printCustomSizedImage()`. Based on your album.txt you'd want to use:
    `<?php printCustomeSizedImage(getImageTitle(),NULL,85,85,85,85); ?>`

    Now your album.php file is missing stuff for if it's got sub-albums etc, you may want to compare your album.php to the original default theme to see what I mean.

    You can see what it would look like here (my dev gallery):
    http://michealmalone.com/zenphoto/
  • i used the defaultAlbumThumbImage() in my index.php and it returned errors. when i look in the functions guide, i don't see this function. seems like everything i am doing is exactly in line with what you mentioned. however, i cannot get the custom thumbnail cropping to work in the admin. is there something else i need to do. i assume when i navigate to that page, it will have a crosshair or something to let me select the custom crop. right now, it just shows the image.

    also, in the string <?php printCustomeSizedImage(getImageTitle(),NULL,85,85,85,85); ?> what can i add to adjust the scale of the crop. i would like it to zoom in more. i have read the functions guide and experimented with the x and y axis, but it came out very distorted. what is the range of values for that attribute?

    i also have the default theme to reference now should you need me to look there.

    really, it is pretty simple, everything is how i want it. only thing is that i cannot crop my index thumbs and i would like to change the scale/zoom of the album thumbs.
Sign In or Register to comment.