hi all -

i've never programmed and so struggle with some basic syntax stuff. i thought i'd post in case others like me might benefit from snippets. thanks for your patience!

i'm trying to override the themed output of the image module's random image block. i created a function in my theme's template.php file. which i copied from image.module:

/**
 * Theme a random block
 */
function theme_image_block_random($images, $size) {
  return l(image_display($images[0], $size), 'node/'. $images[0]->nid, array('html' => TRUE));
}
 

i then changed it to

function MYTHEMENAME_image_block_random($images, $size) {
  return image_display($images[0], $size);
}
 

and successfully ditched the link to the full size image.

my question is now how i pass the $size variable without hacking line 47 of image.module. by default it displays the thumbnail, but i want it to display the original image size: 'IMAGE_ORIGINAL'

thanks in advance everybody!

-ryan

Comments

ainigma32’s picture

I could be wrong but couldn't you just do:

function MYTHEMENAME_image_block_random($images, $size) {
  return image_display($images[0], IMAGE_ORIGINAL);
}

- Arie

ryanrain’s picture

worked! thank you arie, i had tried a bunch of different things and didn't know what to try next.