ZenphotoCMS Forum
printImageStatistic and Hitcounter - 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: printImageStatistic and Hitcounter (/thread-2975.html)



printImageStatistic and Hitcounter - ZenTryOuter - 27-05-2008

Hi all,

Just a lil' question :

When you use the printImageStatistic (option:popular ) for one image, does that increment the hitcounter of that image ?

thx




printImageStatistic and Hitcounter - sbillard - 27-05-2008

The hitcounter is only incremented when the hitcounter() function is called and it is not the admin viewing the page that calls it. printImageStatistics does not call the function.




printImageStatistic and Hitcounter - ZenTryOuter - 28-05-2008

Oh , ok then. Thanks for replying ;-)
But now I have another question :
If I print out the most popular images, how can i get also the amount of viewing ?
I want in fact to have the 5 most popular images of all the albums and then just under the amount of views of each images.

`




printImageStatistic and Hitcounter - acrylian - 28-05-2008

Sorry, there is currently no option to get the actual hitcount together with the most popular functions. But it seems to make sense, I will add that the next days to the nightly.

(BTW, it must be `




printImageStatistic and Hitcounter - ZenTryOuter - 28-05-2008

Thanks a lot ;-)

Is it also possible to choose the orientation of the thumbnail ?
In place of vertical => horizontal ?




printImageStatistic and Hitcounter - acrylian - 28-05-2008

Yes, with CSS. There is an CSS id attached to the list with the same name as the option ("popular" in this case) you can use.




printImageStatistic and Hitcounter - ZenTryOuter - 28-05-2008

Oh :O
I didn't understand what you mean, sorry.
Can you explain it please ?




printImageStatistic and Hitcounter - acrylian - 28-05-2008

The function for popular images generates a unordered html list that you can style via CSS to be horizontal. There is a CSS id attached named "popular" you can use to do that.




printImageStatistic and Hitcounter - ZenTryOuter - 28-05-2008

Ok ;-)
Now, I get it. The function make a DIV with ID popular.
So I Can make myself a CSS for that or integrate it in my default CSS.
I will do it.
Thanks for everything ;-)




printImageStatistic and Hitcounter - acrylian - 28-05-2008

Actually the function generates a (....), not a .




printImageStatistic and Hitcounter - ZenTryOuter - 28-05-2008

Are you sure ?
I see this echo "nn"; in zp-core/image_album_statistics.php

`/**

  • Prints image statistic according to $option as an unordered HTML list

  • A css class is attached by default named accordingly'$option'

  • @param string $number the number of albums to get

  • @param string $option "popular" for the most popular images,

  • "latest" for the latest uploaded,

  • "latest" for the latest uploaded,

  • "mostrated" for the most voted,

  • "toprated" for the best voted

  • @param string $album title of an specific album

  • @return string

*/

function printImageStatistic($number, $option, $album='', $showtitle=false, $showdate=false, $showdesc=false, $desclength=40) {

$images = getImageStatistic($number, $option, $album);

echo "nn";

echo "[list]";

foreach ($images as $image) {

    echo "[*]getImageLink() . "\" title=\"" . htmlspecialchars($image->getTitle(), ENT_QUOTES) . "\">n";

    echo "getThumb() . "\"  alt=\"" . htmlspecialchars($image->getTitle(),ENT_QUOTES) . "\" />n";

    if($showtitle) {

        echo "name)."\" title=\"" . $image->getTitle() . "\">n";

        echo $image->getTitle()."n";

    }

    echo "";

    if($showdate) {

        echo "". zpFormattedDate(getOption('date_format'),strtotime($image->getDateTime()))."

";

    }

    if($showdesc) {

        echo "".my_truncate_string($image->getDesc(), $desclength)."

";

    }

}

echo "";

echo "[/list]n";

}`




printImageStatistic and Hitcounter - acrylian - 29-05-2008

Sorry, you are right, it's an div in the 1.1.6 release, I confused it with the nightly that I as you might guess work mostly with and there it's been changed to a
unordered list, because it's more semantic to do that since there are new options for title, description and date.

EDIT: You are more that right, I really confused something (too much functions). It's of course surrounded by a DIV...I am sorry for confusion.




printImageStatistic and Hitcounter - ZenTryOuter - 29-05-2008

No problem ;-)
You do great job !
Thanks for everything !




printImageStatistic and Hitcounter - Barbara - 01-06-2008

[i] Sorry, there is currently no option to get the actual hitcount together with the most popular functions. But it seems to make sense, I will add that the next days to the nightly.
[/i]
Just out of curiosity, is this function implemented in the latest nightly build yet?
I'm quite interested in this functionality too (only, I need it with 'latest')




printImageStatistic and Hitcounter - acrylian - 01-06-2008

Yes, the option to show the hitcount is in the nightly, but only for the "popular" option since that is where the hitcounter is directly related to. Does the hitcount makes sense with the latest??

Anyway, additionally you can there are now option to show rating and votes with "mostrated" ("votes (rating)") and "toprated" ("rating (votes)").




printImageStatistic and Hitcounter - Barbara - 01-06-2008

I think yes. I frequently update my gallery, the image count could help giving an idea of what's new (newer > less views, older > more views)
Or, for example, if I choose to display the latest 10 pics I could immediately tell by the hit count which item is 'hot' inside the album.




printImageStatistic and Hitcounter - acrylian - 01-06-2008

But for that we actually have the "popular" images/albums function...:-) But well, it's not a big deal to add that. I will change the last parameter ($showstatistic) so that you can choose it for all options. I will add this the next days.




printImageStatistic and Hitcounter - Barbara - 01-06-2008

Thanks a lot acrylian!