Support Forums | Demo Gallery [1.x] [2.x] | Downloads | News | Site Map ]
Nuked Gallery
  Create a FREE account or Login   As a guest, you don't have access to our FULL navigation system.
 Forum FAQForum FAQ   StatisticsStatistics   SearchSearch   UsergroupsUsergroups   FavoritesFavorites  

Finally! G1 Featured Photo Block Uses Thumbnail

 
Post new topic   Reply to topic    NukedGallery.net Forum Index » PHP-Nuke Issues » Blocks View previous topicPrinter friendly versionView next topic
Author Message
keyrat

Beginner
Beginner


Joined: May 23, 2005
Posts: 19

PostPosted: Fri Mar 16, 2007 9:19 am    Post subject: Finally! G1 Featured Photo Block Uses Thumbnail Reply with quote

I've been running my Nuke/G1.5 setup for almost 2 years now, and the whole time I've had the problem where the featured photo block would use a fullsized image instead of a thumbnail. This would result in a 100kb jpg having to load with every pageview.

Now, with my almost zero knowledge of PHP, and a couple of hours of tinkering, I've figured it out. It's a little late (who's using G1 anymore?), but w/e.

find this:
Code: ›       if ($album && $id) {
         $index = $album->getPhotoIndex($id);
         $photo = $album->getPhoto($index);
         $dir = $album->getAlbumDirURL("full");
         $image = $photo->image;
         $PHOTO_URL = makeAlbumUrl($album->fields['name'], $id);
         $ALBUM_URL = makeAlbumUrl($album->fields['name']);
         $IMG = "<center><a href=\"$PHOTO_URL\">".$image->getTag($dir,0,$scaleTo)."</a>";
         $CAPTION = $album->getCaption($index);
         $FROM = "From: <a href=\"$ALBUM_URL\">" . $album->fields['title'] . '</a>';


in featured_photo.php change it to this:
Code: ›
      if ($album && $id) {
         $index = $album->getPhotoIndex($id);
         $photo = $album->getPhoto($index);
                        $photo = $album->getThumbnailTag($index);
         $dir = $album->getAlbumDirURL("full");
         $PHOTO_URL = makeAlbumUrl($album->fields['name'], $id);
         $ALBUM_URL = makeAlbumUrl($album->fields['name']);
         $IMG = "<center><a href=\"$PHOTO_URL\">".$photo."</a>";
         $CAPTION = $album->getCaption($index);
         $FROM = "From: <a href=\"$ALBUM_URL\">" . $album->fields['title'] . '</a>';


Works perfectly for me. It grabs the thumbnail of the featured photo instead of the fullsize. The image that displays will be your thumbnail, and the scaling is disabled. I'm not sure how you would add scaling of the thumbnails at this point, because I don't really need it. Hope this helps someone!
Back to top
Offline View user's profile Send private message
AdBot
   Post subject: Finally! G1 Featured Photo Block Uses Thumbnail  

Back to top
Display posts from previous:   
Post new topic   Reply to topic    NukedGallery.net Forum Index » PHP-Nuke Issues » Blocks View previous topicPrinter friendly versionView next topic

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours

Powered by phpBB © phpBB Group



Sponsors: Web HostingDedicated ServersDomain NamesDomain Name RegistrationDedicated Web HostingSearch Engine OptimisationSEOWeb Design New YorkSEO Web DesignWeb hosting AustraliaSEO

6th year online! 2003-2008
Legal • Use of this site consitutes agreement to the Acceptable Use Policy
Hosted by Implosion WorksSourceForge.net Logo • Theme by TonicMedia