printMostRatedAlbums in sidebar zpFocus

Hello,
I have an issue with a function I am trying to use for the sidebar in the current version of zpFocus. I have tried many combinations of this code and am still unsure of what I can do.
The sidebar is set up to print random images and I want to show printMostRatedAlbums so I tried the following on the sidebar.php:

'if (($zpfocus_showrandom) != 'none') {
if (($zpfocus_showrandom) == 'single') { $sscount=1; } else { $sscount=5; }
if ((in_context(ZP_ALBUM)) || (in_context(ZP_IMAGE))) { $sstitle = gettext('Random Album Image'); } else { $sstitle = gettext('Random Gallery Image'); }
?>
<div id="random-wrap">
<?php printMostRatedAlbums( $number = 5, $showtitle = false, $showdate = false, $showdesc = false, $width = 300, $height = 300, $crop = false, $albumfolder = '', $firstimglink = false ); ?>
<div id="random-title">
<?php echo $sstitle; ?>'
I set the option for rotator.

I am using zenPhoto version 1.4.3.1 [10646] (Official build).

I rated an album with 5 stars to test. But after I change the sidebar.php, all I get is the menu at the top of a page everything else is blank.

What confuses me is that the code I used above worked just fine with the previous version of zenPhoto and zpFocus.

I have always cleared the browser cache and history, even used different browsers still the same result.

I even tried printLatestAlbums (the same result).

All I really want is to print the first image from selected albums in the sidebar and that image to link to the associated album.

printMostRatedAlbums seemed to be the best solution, but I don't know what else to change to have it work with this version of zpFocus.

This function is very important to the design of my sight. If there is another function that you know would obtain my goal or if you can show me what code to alter, it would be very much appreciated!
Thank-you. Renee
P.S. I posted this on gjr-web also, but I thought someone else may have suggestions, too.

Comments

  • I would suggest you find your PHP error file and see what error you are generating.
  • acrylian Administrator, Developer
    Just to ask the obvious: Did you enable the image_album_statistics plugin?
  • Hello,
    This is in the error log: [14-Sep-2012 08:14:17] PHP Parse error: syntax error, unexpected '}' in /home6/advertk3/public_html/themes/zpfocus/inc-sidebar.php on line 16.
    I will check the code in sidebar.php, but it was copied directly from the page I used in the version that did work.

    I also tried duplicating sidebar.php and renaming. Same results.

    Yes the image_album_statistics plugin is enabled. I have always used this.
  • acrylian Administrator, Developer
    That error indicates that in the theme page some brackets are not closed or nested correctly. If it worked with the original page your change is the culprit..:-) A quick look at your code example seems to tell that the first if seems not to be closed.
  • Amazing thing: The PHP error log! I should have reviewed that first. Could have saved so much time! Thank-you for your assistance. Renee
Sign In or Register to comment.