I don't know if this is the right forum for my question....
I would like to use the Thinkdream Theme, which I like very much, especially the way how the thumbs/random picture are shown up - cropped and with the reflections.
It would be nice to use that "look & feel" also for showing up a random picture in Wordpress.
Is there a way to implement that random picture - cropped and with reflections - into the sidebar of a wordpress theme?
And to control the dimensions (hight and width) to make it matching the sidebar dimensions.
I tried to install that "zenPressed" plugin for wordpress, but there is no way to crop the image, etc.
Comments
What I would need is really that effect of an wider thumb instead of a squared one, but without distorting it
Maybe I could combine it with this:
http://photomatt.net/scripts/randomimage/
..and no, I'm not comfortable with php, so If you could help me out with that "thumbnail" creation I would really appreciate that
Btw. It seems zenshow is unavaliable at the moment
-Raz88
This code here (from the index.php file) is an example:
`
Albums
<?php endwhile; ?>
`<?php while (next_album()): ?>
" title="View album: <?=getAlbumTitle();?>" class="img">
<?php printCustomAlbumThumbImage(getAlbumTitle(), null, 230, null, 210, 60, null, null, 'reflect', null); ?>
" title="View album: <?=getAlbumTitle();?>"><?php printAlbumTitle(); ?>
(<? $number = getNumImages(); if ($number > 1) $number .= " photos"; else $number .=" photo"; echo$number; ?>) <?php $text = getAlbumDesc(); if( strlen($text) > 50) $text = preg_replace("/[^ ]*$/", '', substr($text, 0, 50))."…"; echo$text; ?>
The `printCustomAlbumThumbImage(getAlbumTitle(), null, 230, null, 210, 60, null, null, 'reflect', null)` is where you can fiddle with numbers to get the crop sizes you want.
So, the parameters read as follows:
`($alt, $size, $width=NULL, $height=NULL, $cropw=NULL, $croph=NULL, $cropx=NULL, $cropy=null, $class=NULL, $id=NULL)`
$alt is the alt text you want to use.
$size is the preset size (like thumb), and for this example is NULL
$width
$height
$cropw is the crop width
$croph is the crop height
$cropx and $cropy helps to set where you want to have the crop on the image
$class sets the class for css styling or other javascripts like reflection (it just passes a class in the html)
$id (not sure what this does specifically, but I think it's similar to the $class item)
Zenshow is available here:
http://www.zenphoto.org/trac/wiki/ZenphotoPlugins
I hope that helps get you started. It will be MUCH easier to implement zenshow to do what you want to do though, especially if you are working with wordpress. Zenshow will help display that image for you in Wordpress without having to mess with integration of zenphoto and wordpress.
Let us know if you're having trouble with zenshow. While the author may not "lurk" here anymore, I have it running OK on my wordpress blog, and can help with simple problems during its implementation.
printCustomAlbumThumbImage(getAlbumTitle(), null, 230, null, 210, 60, null, null, 'reflect', null)
So, what would the code look like if I get a image to my site like this:
<img src="/albums/testalbum/image.jpg" alt="A Random Image" />
..yeah, and the reflection would also be fantastic
Well, I still can't find "zenShow" , but there is another "zenPress" Plugin I will take a look at.
What I have is called "zenPressed", so they might be different.
In "zenPressed" it isn't possible to set the cropsize, is it? I couldn't find the settings option.
And you can't use that code or function above directly in Wordpress (I'm sorry, I didn't really make that clear). Unless you've done some funky integration of your zenphoto and wordpress, you might not be able to make the function calls across from wordpress to zenphoto, which is why zenshow and zenpress make it easier for that sort of thing. You will have to find the comparable code in zenshow that performs the same duties, and modify it with the parameters you seek, as well as include the reflect class item to show the reflection.
`if ($Photos = $ZenDB->get_results($SQL_query))
foreach ($Photos as $Photo) {
echo 'zen_url .'?album='. $Photo->folder . '&image=' . $Photo->filename . '" title="' . $Photo->title . '" class="rpc_photo">'
. 'zen_tb_height . '" width="' . $RMCZS->zen_tb_width . '" src="' . $RMCZS->zen_url . 'zen/i.php?a='. $Photo->folder . '&i=' . $Photo->filename . '&s=thumb" alt="' . $Photo->title . '" />'
. '';
}`