Hi,
I am using zenphoto 1.2.8 with zpFocus theme and I am trying to show a "top rated images" in the left sidebar. I have managed to show 5 top rated images by adding this code to the sidebar.php file:
`<?php printTopRatedImages(5,'',false,false,false,40,'',85,85,false,false); ?>`
The problem is that I would like to show a 5filesx3colums images table but I can only get 1x5 dimension. When I show top 15 rated images (first parameter in the function) I get a 15 images with 15x1 dimension. I couldn´t manage to get more than one colum.
I am really poor php programer so maybe I am not seeing something obvious. ¿can anyone help me about wich functions should I use or pointing me to an example code doing something similar?
many thanks in advance for any help.
Comments
I could help if you provide a link, otherwise it is just guessing...(try floating the images....)
many thanks for your help. Finally I got what I want in a "dirty" way.
I have seen printTopRatedImages function calls printImageStatistic function so I copied this function to "printImageStatistic2" in order to keep original function without modification and changed it to this:
`
454 function printImageStatistic2($number, $option, $albumfolder='', $showtitle=false, $showdate=false, $showdesc=false, $desclength=40,$showstatistic='',$width=85,$height=85,$cro p=true,$collection=false) {
455 $images = getImageStatistic($number, $option, $albumfolder,$collection);
456 echo "\n
457 foreach ($images as $image) {
458 echo "getImageLink() . "\" title=\"" . html_encode($image->getTitle()) . "\">\n";
459 if($crop) {
460 echo "getCustomImage(NULL, $width, $height, $width, $height, NULL, NULL, TRUE)."\" alt=\"" . html_encode($image->getTitle()) . "\" />\n";
461 } else {
462 echo "getCustomImage($width, NULL, NULL, NULL, NULL, NULL, NULL, TRUE)."\" alt=\"" . html_encode($image->getTitle()) . "\" />\ n";
463 }
464 if($showtitle) {
465 echo "
getImageLink()."\" title=\"" . html_encode($image->getTitle()) . "\">\n";
\n";466 echo $image->getTitle()."
467 }
468 if($showdate) {
469 echo "". zpFormattedDate(getOption('date_format'),strtotime($image->getDateTime()))."
";
470 }
471 if($showstatistic === "rating" OR $showstatistic === "rating+hitcounter") {
472 $votes = $image->get("total_votes");
473 $value = $image->get("total_value");
474 if($votes != 0) {
475 $rating = round($value/$votes, 1);
476 }
477 echo "".sprintf(gettext('Rating: %1$u (Votes: %2$u)'),$rating,$votes)."
";
478 }
479 if($showstatistic === "hitcounter" OR $showstatistic === "rating+hitcounter") {
480 $hitcounter = $image->get("hitcounter");
481 if(empty($hitcounter)) { $hitcounter = "0"; }
482 echo "".sprintf(gettext("Views: %u"),$hitcounter)."
";
483 }
484 if($showdesc) {
485 echo "".truncate_string($image->getDesc(), $desclength)."
";
486 }
487 }
488 echo "
`
basically I have removed `
` and `- ` tags so that the output of my new function printImageStatistic2 is not an unordered list and now shows 3x5 dimension. for sure this is not the most elegant way to do it but well........it works
many thanks again.