Friday, 25 April 2014 06:29
beggarly

Fetch thumb instead of big picture?

Groups your news by sections or by categories

Fetch thumb instead of big picture?

Postby BadaB » Mon Sep 28, 2009 1:19 pm

Currently I am displaying a number of articles on the frontpage with the picture from the article scaled to a smaller size via HTML. The problem is that the page loads these big pictures, just to show the smaller ones on the frontpage.

This is what I want to do:

Fetch the thumbnail instead of the big image when I call GN_image. It should be rather easy as this is the url to my big picture:
www.somesite.com/images/picture.png
thumbnail:
www.somesite.com/images/thumb/thumb_picture.png

I am guessing that it is here I need to ad a line or something:

helper.php

Code: Select all
              if ( preg_match("/GN_image/", $html) ) {
               $regex   = "/<img[^>]+src\s*=\s*[\"']\/?([^\"']+)[\"'][^>]*\>/";
               $search  = $row->introtext . $row->fulltext;
               preg_match ($regex, $search, $matches);
               $images = (count($matches)) ? $matches : array();
               if ( count($images) ) {
                 $gn_image  = modGlobalNewsHelper::getGN_Img ( $params, $link, $images[1], 'item' );
               }
              }


Thanks in advance.
BadaB
Fresh Boarder
Fresh Boarder
 
Posts: 2
Joined: Wed May 06, 2009 7:34 pm

Return to Global News



Who is online

Users browsing this forum: No registered users and 1 guest