示例#1
0
文件: photos.php 项目: wleddy/sor
<?php

function printPhotos($directory)
{
    $scanned_directory = array_diff(scandir($directory), array('..', '.'));
    foreach ($scanned_directory as $value) {
        $foto_loc = $directory . '/' . $value;
        echo '<a href="' . $foto_loc . '" ><img src="' . $foto_loc . '" height="100" /> </a>';
    }
}
?>

<h2>Photo Gallery</h2>
<p>Photos of Africa and the school sponsored by <a href="http://www.africahopefund.org" target="_blank">The Africa Hope Fund</a><br><br></font></p>

<div class="photo-gallery">
<h3>Photos from Safari on the River 2014</h3>
<div class="gallery-group">
    <?php 
printPhotos('photo-gallery/sor_2014');
?>
</div>
</div>
<div class="photo-gallery">
<h3>Photos from Africa</h3>
<div class="gallery-group">
    <?php 
printPhotos('photo-gallery/sor_2013');
?>
</div>
</div>
示例#2
0
    $result = "";
    if (isAlbum($targetNick, $album)) {
        if (isset($nick)) {
            if (strcmp($targetNick, $nick) == 0 or strcmp($role, "admin") == 0) {
                $result = printPhotos(getPhotos($targetNick, $album), true);
                addAction($nick, $email, $ip, "self_photos");
                // EXTRA: Añadir privileged access.
            } elseif (strcmp($accessType, "private") != 0) {
                $result = printPhotos(getPhotos($targetNick, $album), false);
                addAction($nick, $email, $ip, "others_photos");
            } else {
                echo "Este álbum no puede ser visionado.";
            }
        } else {
            if (strcmp(getAlbumAccess($nick, $album), "public") == 0) {
                $result = printPhotos(getPhotos($targetNick, $album), false);
                addAction($nick, $email, $ip, "others_photos");
            } else {
                echo "Este álbum no es público.";
            }
        }
    } else {
        echo "El álbum no existe para el usuario seleccionado.";
    }
    echo $result;
} else {
    echo "No se ha especificado ningún usuario.";
}
function printPhotos($album, $self)
{
    $line = "";