Hi,
How can I place a picture under the leftside menu? Just like in the home page of this side. Is there a possibility to have that picture change every time one comes to the side?
Thanks,
G
picture under menu
Re: picture under menu
Code: Select all
<?
/*
This is a normal smarty plugin
you must copy it to the smarty/plugins folder
params:
path - the path of the folder where the pictures are placed with ending slash
example path="images/"
pictures with , separated names of the pictures
example pictures="p1.jpg,p2.jpg,p3.jpg,p4.jpg"
It is a good choice to have pictures with the same width and height, but it must not
the width and height in the imagetag comes automatically from the picture itself
full example tag
{randompicture path='images/' pictures="b1.jpg,b2.jpg,b3.jpg,b4.jpg,b5.jpg,b6.jpg,b7.jpg,b8.jpg,b9.jpg,b10.jpg"}
This plugin take a picture by random and show it
have a lot of fun
piratos@coftware.de
*/
function smarty_function_randompicture($params, &$smarty)
{
$path = isset($params['path']) ? $params['path']:'';
$pictures=array();
if (isset($params['pictures'])) $pictures=explode(',',$params['pictures']);
$max=count($pictures);
if ($max==0) return '';
$x=rand (0,$max-1);
$info = getimagesize($path.$pictures[$x]);
$w_h_string = $info[3];
echo "<img src='$path".$pictures[$x]."' $w_h_string alt='' />";
}
?>
Re: picture under menu
Thanks for the code!
In what templzte or stylesheet do I put this code to have the pictres shown under the menu bar on the left side?
In what templzte or stylesheet do I put this code to have the pictres shown under the menu bar on the left side?
Re: picture under menu
in that template you are using at the place you want.In what templzte
Re: picture under menu
If have created a file called function.randompicture.php and copied the source into the file. Next I uploaded the file to the smarty/plugins folder. When looking through the extensions menu, I don't see this function. Is that correct?
The function shows a picture
{randompicture path='uploads/images/' pictures="thumb_logo1.gif,thumb_perry_hanse311_1_0302.gif"}
The function shows a picture

{randompicture path='uploads/images/' pictures="thumb_logo1.gif,thumb_perry_hanse311_1_0302.gif"}
Last edited by Gregor on Wed May 10, 2006 10:02 am, edited 1 time in total.