![]() |
|
issue with isImagePage() ? - 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: issue with isImagePage() ? (/thread-9762.html) |
issue with isImagePage() ? - vincent3569 - 2012-03-10 Hi there is something I don't understand on Zenphoto version 1.4.2.2 [9450]. I have an album A which contains only subalbums (K, X, Y, Z). For personnal needs, I need to evaluate isAlbumPage() on album pages. Of course, I am sure that there is no picture under A, only subalbums. This is an issue ? issue with isImagePage() ? - vincent3569 - 2012-03-10 sorry, I wrote a mistake, and you should read this : For personnal needs, I need to evaluate isImagePage() on album pages. other information : If there is no pagination, isImagePage() = Null. at least, isImagePage() should return a boolean, but that is not the case, and if there is no picture, isImagePage returns Null issue with isImagePage() ? - sbillard - 2012-03-10
issue with isImagePage() ? - vincent3569 - 2012-03-11 for me boolean contains but indeed, the issue is that in a paginated albums wich contains only subalbum, in the second page page isImagePage() returns issue with isImagePage() ? - sbillard - 2012-03-11 If you are going to write PHP (or C) code you better get used to the fact that a variable is issue with isImagePage() ? - vincent3569 - 2012-03-12 never mind about boolean value, it is not the purpose. the issue is that in a paginated albums wich contains only subalbum, in the second page page, isImagePage() returns true. issue with isImagePage() ? - sbillard - 2012-03-12 It reports when a page might contain images. So if your albums do not "fill" the page then isImagePage will return true. Why are you testing this if there are no images? issue with isImagePage() ? - vincent3569 - 2012-03-13 in documentation, isImagePage returns true if there is image thumbs on album page (http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functionisImagePage) that is exactly what I want (and not have true if album page might contain images). I need that for displaying contextual help if there is image thumbs on album page (if isImagePage returns true). issue with isImagePage() ? - Wete - 2012-03-13 You could additional check if issue with isImagePage() ? - vincent3569 - 2012-03-13 hi so getNumImages returns I will have a look to have a workaround, but the simplest way is to solve the issue on the function isImagePage done for that, don't you think ? issue with isImagePage() ? - Wete - 2012-03-13 I am surprised that isImagePage() checks if the page /might/ contain images. I agree that this should be modified. Wete issue with isImagePage() ? - acrylian - 2012-03-13 @vincent: Then add a check for the page using issue with isImagePage() ? - sbillard - 2012-03-13 Ok, it is changed in the nightly build. But the function is not intended for use except on album pages. It could add a check for that, but then everyone will have to pay the price for your desire. I think it better that you make the check before calling the function that it is on an album page. issue with isImagePage() ? - Wete - 2012-03-13 What I like most on ZenPhoto is that the developers accept criticism by the users and not reject issues as irrelevant. issue with isImagePage() ? - vincent3569 - 2012-03-14 @sbillard : I do not report bugs to bother you but to contribute to make a better product. However I have found a workaround for my own business : issue with isImagePage() ? - acrylian - 2012-03-14 @wete: I hope that was not ironic... @vincent: I think you misunderstood smy collegue. We really do appreciate your active reports and contributions. I don't know how you might think we weren't! Even if we don't agree always. But sometimes the doc comment can be wrong or the function is just not intended for what someone wants to use it (as originally in this case). So right on with your reports. Also we hesitate to change some things too fast for backward compatibility. That only standard themes use it says nothing about custom themes out there (there are surely sites that neither use official nor 3rd party themes but own custom ones). We are really concerned about backward compatibility as far as possible for our convenience. Your check above is exactly what I meant above. issue with isImagePage() ? - Wete - 2012-03-14 Acrylian, it was absolutely not ironic. sbillard wrote, the function has been changed in the actual nightly, and that pleases me. After reading the last posting of vincet I see, that my posting could be misunderstood. Wete issue with isImagePage() ? - sbillard - 2012-03-15 @vincent: What I have said is that I do not think it appropriate to add significant overhead to a function so that someone can essentially mis-use it. The function was intended to be used to tell if a page could display any images thumbs. We have enhanced it so that it will check the image count as well and report if the album page WILL display any image thumbs. But this test is costly if you are not on an album page so it seems inappropriate to add When it is just as simple for you to be sure your code is active only on an page that could display image thumbs [specially since it seems that is the only place you want it to appear] Much of Zenphoto is context sensitive. Theme writers need to be cognoscenteof the context or there will be errors. |