![]() |
|
Anyone had success with no_show? - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: Plugins (https://forum.zenphoto.org/forum-6.html) +--- Thread: Anyone had success with no_show? (/thread-8059.html) |
Anyone had success with no_show? - cfelicio - 07-01-2011 Hi There, Anyone tried to use this plugin? I've been trying to use it, and even with a stock installation of zenphoto 1.3.1.1 (which is the version this was designed for), it doesn't work. When enabled, it blocks all pictures from being shown (not just the unpublished). I'm trying to figure out since it's unsupported, but any help or clues are appreciated Anyone had success with no_show? - cfelicio - 07-01-2011 I narrowed it down to this line: $imageObj->exists = $imageObj->getShow(); If I comment this out, I can see all the images, but that defeats the purpose of the script. So probably need to make a change to this line, still trying to figure out what is wrong. Anyone had success with no_show? - cfelicio - 07-01-2011 ok, looks like getshow() calls get('show') under class-image.php, and that's where the value is supposed to come, but always returns false. For the album it's working fine (same syntax apparently). Anyone had success with no_show? - fretzl - 07-01-2011 It works in 1.4 ;-) Anyone had success with no_show? - sbillard - 07-01-2011 Just FYI, getShow() simply returns the value of the Anyone had success with no_show? - cfelicio - 07-01-2011 Thanks fretzl, that's encouraging, I tried with 1.4 but didn't work either, I'll try again with a fresh install! Sbillard, this info is very much appreciated, I was trying to figure out where the 'show' value comes from, now I know For some strange reason, show is always returning the same value, no matter what photo I try to display. I will check further in the database and also see if I can somehow trace the workflow. I thought maybe it was taking the value of one photo that is unpublished, but even setting all photos as visible has no effect. Anyone had success with no_show? - acrylian - 07-01-2011 Not familar with this plugin but generally the logged in admin even unpublished items. You should log out or use another browser to see the effect. Anyone had success with no_show? - cfelicio - 07-01-2011 Hi Acrylian, yes, with admin I can see all fine, just logged out doesn't work for all photos Anyone had success with no_show? - cfelicio - 07-01-2011 Umm, checked the database, values are fine there (0's and 1's for each individual image). I reinstalled everything from scratch (1.4 and latest nightly build), didn't change any stock settings (except enabled the no_show), but no luck. I got a warning during install about magic_quotes_gpc, maybe that's the culprit. Talking to my host now to get that fixed, let's see if that's the reason Anyone had success with no_show? - sbillard - 07-01-2011 Are you sure,then that Perhaps you shoud dump the $imageObj variable as a debugging tool to see if a) show is indeed true when it should not be and b) that the function is being called with the correct image object. [edit] dump the variable after that statement so we also see the results of the statement. Anyone had success with no_show? - cfelicio - 08-01-2011 Ok, so I enabled var_dump, and the problem is that not just show, but all other values (hitcounter, commentson, etc) are coming from the album, not from the image. So, once I change the album value, it changes the behavior for all images. You can see the values here: http://carlosfelicio.com/teste/schoolhouse5.gif.php Any ideas on how to get the values from images instead of album? I tried to disable the album filter (and just keep image filter), but it still catches the album values. Anyone had success with no_show? - acrylian - 08-01-2011 YOu probably called this in album context. You have to call the var dump in image context (on image.php or within the next_image loop). Anyone had success with no_show? - sbillard - 08-01-2011 Maybe you can explain more. BTW, a text file of the var_dump would have been more useful--easire to search and examine. The dump does indicate that the "show" value is 1 for this image. (The dump is indeed of the image.) I am not sure what you mean that the values are all coming from the album, though. How do you determine that? Anyone had success with no_show? - cfelicio - 08-01-2011 Sure, I'll be happy to explain more Basically what I did, inside of no_show.php, I added var_dump($imageobj) to the following function: function no_show_hideImage That's how I get the output on the image now showing the values. How do I determine that the values are actually coming from the album and not from the image? I looked at other values (like hitcounter), one image has a value of 22 and the other 15, but somehow I get hitcounter value of 11 for all images. I tracked down this number to the album. I also always get "1" for the "show" value, no matter what I set on the images. Then, the next test, I changed the value on the album, and voilá, the number also changed on var_dump. All of this still don't solve the mistery why all the photos won't display if I have no_show enabled. For the test above, I had to comment out this line: $imageObj->exists = $imageObj->getShow(); Now, I ran var_dump again with the line above enabled, and what happens is pretty interesting. Show has either a value of 1 or 0, but exists has either a value of true or false (according to var_dump). When I try to assign show to exists with the statement above, exists instead becomes NULL, that's why all images never display for unlogged users no matter what the value of show is. I think this 2nd part of the issue I can fix by changing the way no_show.php works, instead of assigning the value directly in one statement, I can use if statements to either change the value of exists to true or false. For the 1st part of the issue (filter getting values from album instead of image), I'm a bit clueless I also disabled magic_quotes_gpc, and tested this with other versions (1.3.1.1., 1.4, latest nightly build), there were significant changes in class-image.php between these, but for some reason I still get the same behavior. Is this just happening on my server or others have the same? I noticed from the var_dump some values get assigned correctly, from the image (like title, filename), and these are declared on class-image.php. Maybe if I add these others to class-image (hitcounter, show, commentson, etc), would they work as well? Thanks, Anyone had success with no_show? - sbillard - 08-01-2011 There is a long time bug in the class_image image_instantiate filter call. The fix is up here: http://www.zenphoto.org/trac/attachment/ticket/1776/ Essentially, the image object was not fully setup when the filter was called resulting in some data items (show in particular) not yet being available. Also note that depending on your PHP version you may get "deprecated" errors on the no_show plugin calls to checkAlbumPassword(). If so, remove the "&" form the $hint parameter Anyone had success with no_show? - cfelicio - 09-01-2011 nice, that fixed all the issues! Thanks so much! |