![]() |
|
Adding document link under thumbnail; file_exists function - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: General support (https://forum.zenphoto.org/forum-4.html) +--- Thread: Adding document link under thumbnail; file_exists function (/thread-7934.html) Pages:
1
2
|
Adding document link under thumbnail; file_exists function - nbruley - 09-12-2010 I would like to be able to add a document link under thumbnails if there is a matching name with a different extension. For instance, if there is both a "myphoto.jpg" and a "myphoto.pdf" I would like a hyperlink to appear under the thumbnail of "myphoto.jpg" that links to the pdf version of the file. I don't really know php but I made a guess as to what the code might look like. Can someone help me out with this? Thank you! (The main problem is figuring out how to ask if the particular file exists. I can't get even a hard-coded url to work.)
Adding document link under thumbnail; file_exists function - nbruley - 09-12-2010 Link to gallery= Adding document link under thumbnail; file_exists function - nbruley - 09-12-2010 Looks like there is a basename(path,suffix) function that would maybe work better than the substring function... Adding document link under thumbnail; file_exists function - nbruley - 09-12-2010 Another try that is probably just as bad... ` ` Adding document link under thumbnail; file_exists function - sbillard - 09-12-2010 You do not want to be using WEB links since the file will actually be on the server. What you need is Adding document link under thumbnail; file_exists function - nbruley - 09-12-2010 ah, I see. I will try that. Thanks much! Adding document link under thumbnail; file_exists function - nbruley - 09-12-2010 I tried Thanks. Adding document link under thumbnail; file_exists function - sbillard - 09-12-2010
Not sure what Adding document link under thumbnail; file_exists function - nbruley - 26-01-2011 Well, I'm back on this as I think this would best suit my needs, if you don't mind... I get the error I think I'm within the image loop because the folder name is repeated for each thumb, and it is located immediately after the printImageThumb command. I don't know php (beyond a few tutorials in w3schools, although I'm javaScript certified) so maybe this is something simple I'm overlooking? Thanks for your patience. I'm working with the test site at Adding document link under thumbnail; file_exists function - kagutsuchi - 26-01-2011
Adding document link under thumbnail; file_exists function - nbruley - 26-01-2011 Success!!! Thank you! Adding document link under thumbnail; file_exists function - nbruley - 26-01-2011 Ok, I'm making good progress now. Is there a cheat sheet on all the menthods and classes I would need to reference the actual file location? This is what I have so far. The if statement works, but I have the file location hard-coded because I don't know the best way to get that. Also, I don't think getBareImageTitle() is what I want-- I want the file name, not the title I give it in Zenphoto. ` Adding document link under thumbnail; file_exists function - nbruley - 26-01-2011 Edit: I got the bookmarks to flow by adding in some line breaks... probably not the "right" thing to do but seems to work... Edit2: Page 4 doesn't work with line breaks either... any ideas? Maybe the best thing to do would be to just create a link on the image page...? Adding document link under thumbnail; file_exists function - acrylian - 26-01-2011 You get the filename by using Adding document link under thumbnail; file_exists function - nbruley - 26-01-2011 Thanks acrylian for the tip-- this almost works for me. Regarding the line breaks- I took them out. Check my site and see if you see a problem with the formatting. I need a way to make the bookmarks wrap under the other bookmarks on the next line, not wrap only to the pdf link. http://test-gallery.gospelriver.com/bookmarks/English/ Adding document link under thumbnail; file_exists function - acrylian - 26-01-2011
No, Zenphoto does not skip the "albums" folder. The albums folder is not used in normal page links therefore it is not included. You can create a link to a file manually using: Adding document link under thumbnail; file_exists function - nbruley - 26-01-2011 @acrylian: The problem with your second suggestion is it gives me the following: the /home6/mysitecr/public_html/test-gallery is the link on the server and makes this link invalid- I don't know how to get a link without it... Thanks for your help. Adding document link under thumbnail; file_exists function - acrylian - 26-01-2011 Well, I meant getFullImageURL() (always good to refer to the doc as I not always look there myself). Of course the pdf is not indexed if you did not make a plugin similar to the textobject one. Ok, I got myself confused with "getAlbumsFolder()" - haven't used this in ages - as that means the folder of hte album, not the main albums folder. Use this: Adding document link under thumbnail; file_exists function - nbruley - 26-01-2011 ah, perfect. Works great; Thanks much for this. Finally found the documentation that addresses this... there's so much information to wade through, it's hard to find the function that works for you. I didn't find $_zp_current_album listed there though. Maybe that's because it is just a variable? Did you have any input on how I can get the bookmarks to go all the way over to the left on the second line without stopping at the first "PDF" link? Adding document link under thumbnail; file_exists function - acrylian - 26-01-2011 Exactly, as it is a global variable and listed on its own article: To use it you have to look at the object model tutorial: Regarding your bookmarks, you will have to change the css a little to leave room for them. Look at the source code. |