Jump to content

Gallery Script


timmiejboi

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/271161-gallery-script/
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/271161-gallery-script/#findComment-1395151
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.