1
Mods & Plugins (Requests & Discussions) / Re: how to add 2 random images in the main page instead of 1?
« on: April 25, 2010, 08:55:42 PM »
Lots of thanks!!!
4images code on GitHub Click here to visit GitHub.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
in "functions.php" 3 new lines:
// HV : resize to fit layout if necessary
unset($resized);
$dispwidth = 548;
if ($width > $dispwidth) {
$picratio = $height / $width;
$dispheight = floor($picratio * $dispwidth);
$width_height = " width=\"". $dispwidth . "\" height=\"" . $dispheight . "\"";
$resized = 1;
}
// end HV
if ($detailed_view && isset($info['APP13'])) {
$iptc_array = get_iptc_info($info['APP13']);
$bgcounter = 0;
foreach ($iptc_array as $key => $val) {
$row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
$site_template->register_vars(array(
"iptc_value" => $val,
"iptc_name" => $lang['iptc_'.$key],
"row_bg_number" => $row_bg_number
));
$iptc_info .= $site_template->parse_template("iptc_bit");
}
}
}
$site_template->register_vars(array(
"media_src" => $media_src,
"media_icon" => $media_icon,
"image_name" => $image_name,
// HV : resize to fit layout if necessary
"resized" => $resized,
"width_height" => $width_height,
"width" => $width,
"height" => $height,
"dispwidth" => $dispwidth,
"dispheight" => $dispheight,
"iptc_info" => $iptc_info
));
And in the "details.html" other new lines:
{if resized} The image on this page is reduced in size.
{download_button} to get the original size ({width} x {height} pixels).
{endif resized}