Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.
<?php include('admin/conn.php');
function generate_thumb($path, $prefix, $type = 'small') {
global $config;
require_once("./galeria/lib/phpthumb/phpthumb.class.php"); //PHP thumb class
if (substr($path,0,1) != '/') {
$source_file_name = $config['basedir'] . 'images/' . $path;
} else {
$source_file_name = $path;
}
if (!is_readable($source_file_name)) {
return false;
};
$imgdata = @getimagesize($source_file_name);
if (!$imgdata) {
return false;
}
$base_filename = sanitize_filename(basename($path));
global $thumbnail_config;
$thumb_config = $thumbnail_config[$type];
$prefix = $thumb_config['filename_prefix'] . $prefix . "-";
$thumbpath = $config['basedir'] . 'thumbs/'.$prefix.$base_filename;
$thumburl = $config['baseurl'] . 'thumbs/'.$prefix.$base_filename;
list($width, $height, $type, $attr) = @getimagesize($thumbpath);
if (!file_exists($thumbpath) ||
($thumb_config['filename_prefix'] == '' && !$config['square_thumbs'] && $thumb_config['size'] != $height) ||
($thumb_config['filename_prefix'] == '' && !$config['square_thumbs'] && $width == $height) ||
($thumb_config['filename_prefix'] == '' && $config['square_thumbs'] && $width != $height) ||
($thumb_config['filename_prefix'] != '' && $thumb_config['size'] != $width) ||
($thumb_config['filename_prefix'] == '' && $config['square_thumbs'] && $thumb_config['size'] != $height && $thumb_config['size'] != $width)) {
$phpThumb = new phpThumb();
$phpThumb->setSourceFileName($source_file_name);
$phpThumb->w = $thumb_config['size'];
$phpThumb->q = $config['compression'];
if ($thumb_config['filename_prefix'] == '' && $config['square_thumbs']) {
$phpThumb->zc = 1;
$phpThumb->h = $thumb_config['size'];
}
$phpThumb->config_use_exif_thumbnail_for_speed = false;
if (!$config['square_thumbs']) {
$phpThumb->h = $thumb_config['size'];
$phpThumb->w = '';
}
$phpThumb->config_error_die_on_error = false;
if ($phpThumb->GenerateThumbnail()) {
$phpThumb->RenderToFile($thumbpath);
}
else {
die('Failed: '.implode("\n", $phpThumb->debugmessages));
}
}
return $thumburl;
}
?>
<?
$result=mysql_query("SELECT * FROM plogger_albums ORDER BY id DESC LIMIT 0,5",$conn);
while($reg=mysql_fetch_array($result)) {
$result2=mysql_query("SELECT * FROM `plogger_pictures` WHERE parent_album='".$reg['id']. "' ORDER BY id;",$conn);
$reg2=mysql_fetch_assoc($result2);
?>
</h4>
<div class="ultimos"> <a href="/galeria/index.php?level=album&id=<?=$reg['id']?>"><img src="/galeria/thumbs/<?=$reg2["id"]."-".basename($reg2["path"])?>" alt="<?=$reg['name']?>" /></a>
<p></p>
<h4><a href="/galeria/index.php?level=album&id=<?=$reg['id']?>">
<?=$reg['name']?>
</a></h4>
<p><a href="/galeria/index.php?level=album&id=<?=$reg['id']?>">
<?=$reg['description']?>
</a></p>
<p></p>
</div>
<p>
<?
}
mysql_free_result($result);
?>
1 to 1 of 1