Follow along with the video below to see how to install our site as a web app on your home screen.
Примечание: This feature may not be available in some browsers.
Какой скрипт посоветуете?
<?php echo "<?xml version=\"1.0\" encoding=\"windows-1251\"?".">"; ?>
<?
$scale = 0;
$maxwidth = 640;
$maxheight = 480;
$thumbmaxw = 50;
$thumbmaxh = 50;
$imgperpage = 10;
$imgperrow = 5;
$pgperrow = 10;
$currentdir = getcwd ();
$typelist = array("jpg","jpeg","gif","png","JPG");
$imagelist = array();
$title = "Pics";
$stylesheet = '' ;
$home = "{$_SERVER['PHP_SELF']}";
$this_page = "{$_SERVER['PHP_SELF']}";
$caption = "";
$captionext = "txt";
//--- ind is put to zero when the script is first called uppon---
if(!isset($_GET['ind']))
$_GET['ind'] = 0;
$index = $_GET['ind'];
//---the following code iterates through the directory and puts any image found in the imagelist array---
$dp=opendir($currentdir);
while ( false != ( $file=readdir($dp) ) ) {
if (is_file($file) && $file!="." && $file!=".."){
$extention = explode(".",$file);
$extfield = count($extention)-1;
$extention = $extention[$extfield];
if( in_array($extention,$typelist) ){
array_push ($imagelist,$file);
}
}
}
?>
<title><?= $title ?></title>
<?
if ($stylesheet == ''){
} elseif ($stylesheet == 'none') {
//--no style sheet if that is what you want
} else {
echo "<link rel=\"STYLESHEET\" href=\"$stylesheet\" />";
}
?>
<table align="center">
<tr>
<td></td>
<?
$nrpages = ceil( count($imagelist)/$imgperpage );
for($j=0;$j<$nrpages;$j++)
{
if( $index >= ($j*$imgperpage) && ($index < (($j+1) * $imgperpage)) ) {
for($i=($j*$imgperpage);$i<(($j+1) * $imgperpage);$i++) {
if(($i%$imgperrow == 0) && ($i > 0)) { ?>
</tr>
<tr>
<? }
if($i <count($imagelist) ) {
$path = "$this_page?ind=".$i; ?>
<td>
<?
$sizeee = getimagesize ("$imagelist[$i]");
$imgwidth = $sizeee[0];
$imgheight = $sizeee[1];
$newthumbw = $imgwidth/($imgheight/$thumbmaxh);
$newthumbh = $imgheight/($imgwidth/$thumbmaxw);
if ($imgwidth < $imgheight) {
if ($newthumbw > $thumbmaxw)
{
?>
<a href="<?= $path ?>"> <img src="<?= $imagelist[$i] ?>" width="<?= $thumbmaxw ?>" height="<?= $newthumbh ?>" alt="" />
</a>
<?
} else {
?>
<a href="<?= $path ?>"> <img src="<?= $imagelist[$i] ?>" width="<?= $newthumbw ?>" height="<?= $thumbmaxh ?>" alt="" />
</a>
<?
}
} else {
if ($newthumbh > $thumbmaxh)
{
?>
<a href="<?= $path ?>"> <img src="<?= $imagelist[$i] ?>" width="<?= $newthumbw ?>" height="<?= $thumbmaxh ?>" />
</a>
<?
} else {
?>
<a href="<?= $path ?>"> <img src="<?= $imagelist[$i] ?>" width="<?= $thumbmaxw ?>" height="<?= $newthumbh ?>" alt="" />
</a>
<?
}}
?>
</td>
<?
}}}}
?>
</tr>
</table>
<table align="center" border="0">
<tr>
<td>
<? if($index-1 >= 0) {?>
<a href='<?= $this_page ?>?ind=<?= $index-1 ?>'>[ попередня ]</a>
<? } ?>
</td>
<td>
<?
$sizeee = getimagesize ("$imagelist[$index]");
$imgwidth = $sizeee[0];
$imgheight = $sizeee[1];
if ($scale == 1 || $imgwidth > $maxwidth || $imgheight > $maxheight) { // decide if img needs to be scaled
$newwidth = $imgwidth/($imgheight/$maxheight);
$newheight = $imgheight/($imgwidth/$maxwidth);
if ($imgwidth < $imgheight) {
if ($newwidth > $maxwidth)
{
?>
<a href="<?= $imagelist[$index] ?>" target="_blank">
<img src="<?= $imagelist[$index] ?>" width="<?= $maxwidth ?>" height="<?= $newheight ?>" alt="" />
</a>
<?
} else {
?>
<a href="<?= $imagelist[$index] ?>" target="_blank">
<img src="<?= $imagelist[$index] ?>" width="<?= $newwidth ?>" height="<?= $maxheight ?>" alt="" />
</a>
<?
}}
else
{
if ($newhight > $maxheight)
{
?>
<a href="<?= $imagelist[$index] ?>" target="_blank">
<img src="<?= $imagelist[$index] ?>" width="<?= $newwidth ?>" height="<?= $maxheight ?>" alt="" />
</a>
<?
} else {
?>
<a href="<?= $imagelist[$index] ?>" target="_blank">
<img src="<?= $imagelist[$index] ?>" width="<?= $maxwidth ?>" height="<?= $newheight ?>" alt="" />
</a>
<?
}}}
else
{ ?>
<a href="<?= $imagelist[$index] ?>" target="_blank">
<img src="<?= $imagelist[$index] ?>" width="<?= $imgwidth ?>" height="<?= $imgheight ?>" alt="" />
</a>
<? }
?>
</td>
<td>
<? if($index+1 < count($imagelist) ) {?>
<a href="<?= $this_page ?>?ind=<?= $index+1 ?>">[ наступна ]</a>
<? } ?>
</td>
</tr>
<tr>
<td>
</td>
<td>
<center><?
if (file_exists ($imagelist[$index]. "." . $captionext) &&
is_file ($imagelist[$index]. "." . $captionext) &&
!is_dir ($imagelist[$index]. "." . $captionext))
include $imagelist[$index]. "." . $captionext;
else
echo $caption; ?>
</center>
</td>
<td>
</td>
</tr>
</table>
<br />
<center>
<?
for($j=0;$j<$nrpages;$j++) {
if(($j%$pgperrow == 0) && ($j > 0)) { ?>
<br />
<? } ?>
<a href="<?= $this_page ?>?ind=<?= ($j*$imgperpage) ?>">[лист <?= ($j+1) ?>]</a>
<? } ?>
</center>
<center><a href="<?= $home ?>">[ початкова сторінка ]</a></center>
A slick, intuitive web based photo gallery. Gallery is easy to install, configure and use. Gallery photo management includes automatic thumbnails, resizing, rotation, and more. Authenticated users and privileged albums make this great for communities.
Coppermine is an easily set-up, fast, feature-rich photo gallery script with mySQL database, user management, private galleries, automatic thumbnail creation, ecard feature and a template system for easy customization to match the rest of a site.
Simple Picture Gallery Manager is a PHP script which generates online photo albums and features very simple setup and update procedures. Highly configurable though, it includes several options (such as new pictures highlighting) for smooth integration.
она тежолаяРекомендую coppermine-gallery.net