Jump to content


Photo

Gallery Script


  • Please log in to reply
1 reply to this topic

#1 timmiejboi

timmiejboi

    Newbie

  • New Members
  • Pip
  • 1 posts

Posted 25 November 2012 - 05:39 PM

Hey,
This is my gallery script
But now i want to change the height of the pictures?
And i want that i can click on the pictures and show bigger
Someone please can help me :$?

Script:
<?php
ini_set('display_errors', 1); // 0 = uit, 1 = aan
error_reporting(E_ALL);

##########################################
//Even wat dingen instellen.
$dirname= "./fotoalbum/";// directory met plaatjes ten opzichte van de huidige directory
$naast_elkaar = 2;// aantal plaatjes naast elkaar
$onder_elkaar = 3;// aantal plaatjes onder elkaar
$breedte = 250;// width van de plaatjes
$hoogte = 250;// height van de plaatjes
$img_extensions = array('jpg', 'JPG', 'gif', 'png', 'PNG', 'JPEG', 'jpeg');// de toegestane plaatjes
##########################################

function check_file($filename)
{
global $img_extensions;
$file_array = explode(".", $filename);
return ((count($file_array) == 2) and (in_array($file_array[1], $img_extensions)));
}

function get_file_array($dir)
{
$file_array = array();
if($handle = opendir($dir))
{
while(false !== ($file = readdir($handle)))
{
if(check_file($file))
{
//Het is een plaatje, laat hem zien...
$file_array[] = $file;
}
}
closedir($handle);
}
return $file_array;
}

function showImages($image_array, $begin, $eind)
{
global $dirname, $naast_elkaar, $breedte, $hoogte;
$begin_check = $begin;
$return = '<tr>';
while ($begin < $eind and isset($image_array[$begin]))
{
$return .= '<td><img src="' . $dirname . $image_array[$begin] . '" width="' . $breedte . '"/></td>';
$begin++ ;
$return .= ($begin%$naast_elkaar == 0) ? '</tr><tr>' : '';
}
return $return . '</tr>';
}

function genPages($number_of_files, $page_limit)
{
$pages = ($number_of_files%$page_limit == 0) ? $number_of_files / $page_limit : $number_of_files / $page_limit + 1;
$i = 1 ;
$return = '<table><tr>';
while ($i <= $pages)
{
$return .= '<td><a href="?page=' . $i . '">' . $i . '</a></td>';
$i++;
}
return $return . '</tr></table>';
}

echo '<html><body><table>';
$page_limit = $naast_elkaar * $onder_elkaar;
$file_list = get_file_array($dirname);
$page = (isset($_GET["page"])) ? $_GET['page'] : 1;
$begin = ($page * $page_limit) - $page_limit;
$eind = $page * $page_limit;
echo showImages($file_list, $begin, $eind);
echo '</table>';
echo genPages(count($file_list), $page_limit) ;
echo '</body></html>';
?>
</p>

Cheers,
Timothy

#2 Erlis

Erlis

    Newbie

  • New Members
  • Pip
  • 3 posts

Posted 26 November 2012 - 07:27 AM

If the script came with a .css file (it can be style.css or gallery.css etc.) you can change those values in there.Or as I am seeing there are two values [$breedte = 250;// width van de plaatjes / $hoogte = 250;// height van de plaatjes].I am not sure what language it is, but I'm guessing those are the functions or values to set images height and width.Default as I'm seeing are 250x250.You can try and change those and see what happens.
And for the popup you can use javascript.There are lot's of them.http://www.google.lt...iw=1920&bih=946

Edited by Erlis, 26 November 2012 - 07:33 AM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com