Any image uploaded even those for forum or story submission shows up as the latest image - how to restrict latest image to those images which has been added to gallery ( or various galleries ) for the sole purpose as photo pix etc .

Even if an image is uploaded via image assist and it is ultimately not used in a story etc the image shows up as the latest image :(

Thus I will like 'latest image' from those which has been uploaded a gallery only.

Any help will be gratefully acknowledged.

[ My million thanks to luyendao shouchen somebodysysop benshell and others for kindly replying my previous posts ]

Comments

kuahyeow’s picture

jsloan’s picture

The image block function for the 4.7 image module can be configured for both number of photos and category.

Look for function image_block() on line 206 of image.module. You'll find the code for "latest" block on line 217 $images = image_get_latest()

By adding arguments to the call image_get_latest() you can "Fetch the latest N image(s) - optionally from a given term."

To get the latest image from a gallery change to $images = image_get_latest(1,3) Where 3 is the tid # of the gallery you want.

toonopoly’s picture

ok, that works GREAT! thanks.

Now.....what if I don't want people to be able to click on that image?

jsloan’s picture

... around line 219 you'll see this:

$block['content'] = l(image_display($images[0], 'thumbnail'), 'node/'.$images[0]->nid, array(), NULL, NULL, FALSE, TRUE);

change it to this:

$block['content'] = image_display($images[0], 'thumbnail');