Jump to content

Basic help (i think)


brucehere

Recommended Posts

Hi,

I have some simple code that pulls some images from a gallery on my site and displays them on the frontpage. (Its in Drupal)

<?php

$numImage = 4;

$images = image_get_random($numImage);

 

for($i=0;$i<count($images);$i++) {

    echo l(image_display($images[$i], 'thumbnail'), 'node/'. $images[$i]->nid, array('html' => TRUE));

}

?>

 

That works and everything great.

But it displays the thumbnails all right next to each other. Id like there to be a small space between them and if possible on the same horizontal path. At the mo some are portrait orientation and some landscape, which makes it look a bit funny.

It isn't the biggest issue if that cant be done.

Otherwise just the spacing would be great. (sorry im not the strongest in php!)

Link to comment
https://forums.phpfreaks.com/topic/123513-basic-help-i-think/
Share on other sites

I cannot specify items to the image tag.

As its constantly changing with various random images from a single gallery.

All php based.

If that is the code i should add into the PHP, please show me exactly where to put it?

Sorry, my knowledge is very simple around this area.

Link to comment
https://forums.phpfreaks.com/topic/123513-basic-help-i-think/#findComment-637884
Share on other sites

We cannot modify your code, as the snippet posted does not produce the output. The snippet posted calls image_display(), which either generates the HTML itself, or passes the arguments to another function. You will need to look at the source for image_display() and let us know if it is creating the HTML <IMG> tag. Once we find the code that is actually producing the HTML, then we can modify it as necessary.

Link to comment
https://forums.phpfreaks.com/topic/123513-basic-help-i-think/#findComment-637941
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.