Video hack and latest photos/highest rated photos

Hello, I've a problem with these hacks. I installed the latest photos, highest rated photos hack and video hack. All three hacks are running perfect.If I'm in album I can see a video thumbnail so it's great too. But If I'm on index (where I've the latest photos etc.) I see only thumbnails of photos. I know where's a problem - in function latest_photos in code is

`image`

And it makes the problem. $filname mean full name of file - so if it is JPG file, it makes normal photo URL (....photo.jpg) but if it's video (myvideo.flv) it looks for thumbnail with the video name (myvideo.flv)

So how make that it will look for myvideo.jpg like in album where video thumbnails are running perfect?

Thanks

Comments

  • kenoji Member
    This is because zenphoto is meant for photos, and it pulls the thumbnail from the previous image's thumnail (index<-album<-image). Now the video thumbnail you are seeing in album is just a set image (not an actual thumbnail from your video), which is detected from template-functions if it has a .flv extention.

    To get around this replace function printAlbumThumbImage in template-functions.php with the code below-
    (you can pick any image as your default, but this code is just setting an image to anything that has an empty img src.)
    I made it point to myvideo.jpg.

    function printAlbumThumbImage($alt, $class=NULL, $id=NULL) {
    if (getAlbumThumb() == "" or getAlbumThumb() == NULL)
    {
    echo "<img src=\"" . "/ClientAreaZen/zen/images/myvideo.jpg" . "\" alt=\"" . htmlspecialchars($alt, ENT_QUOTES) . "\"" .
    (($class) ? " class=\"$class\"" : "") .
    (($id) ? " id=\"$id\"" : "") . " />";
    }
    else{
    echo "<img src=\"" . htmlspecialchars(getAlbumThumb()) . "\" alt=\"" . htmlspecialchars($alt, ENT_QUOTES) . "\"" .
    (($class) ? " class=\"$class\"" : "") .
    (($id) ? " id=\"$id\"" : "") . " />";
    }
    }
  • This is not the problem - I wrote it - it's in the $filename
    Code of highest rated photos, look down - you can see this - ...src="'.WEBPATH.'/zen/i.php?a='.$album.'&i='.$filename.'&s=thumb">....

    so if it's photo, thumbnail URL looks like this
    `/galerie/zen/i.php?a=fotky&i=photo.jpg&s=thumb`
    but if it's video, thumbnail URL looks like this
    `/galerie/zen/i.php?a=fotky&i=video.flv&s=thumb`

    And that's the problem!

    `function show_highest_rated($number) {

    $images = query_full_array("SELECT images.albumid, images.filename AS filename, images.title AS title, ratings.total_value AS totalvalue, ratings.total_votes as votes, albums.folder AS folder FROM ".prefix('images')." AS images, ".('ratings')." AS ratings, ".prefix('albums')." AS albums WHERE images.albumid = albums.id AND images.show = 1 ORDER BY (ratings.total_value/ratings.total_votes) DESC LIMIT $number");

    $size = '_'.zp_conf('thumb_size').'_cw'.zp_conf('thumb_crop_width').'_ch'.zp_conf('thumb_crop_height');

    foreach ($images as $image) {

    $filename = $image['filename'];

    $name = $image['name'];

    $album = $image['folder'];

    $desc = $image['title'];

    $totalvalue = @number_format($image['totalvalue']/$image['votes'],2);

    echo '


    ';

    if (zp_conf('mod_rewrite') == true) {

    echo '';

    } else {

    echo '
    ';

    }

    echo 'image
    ';

    echo '
    ';

    }

    } `
Sign In or Register to comment.