1 rizwank 1.1 <?php
2 require "./inc/head.php";
3 ?>
4 <?php include "./inc/doctype.php"; ?>
5 <head>
6 <?php include "./inc/charset.php"; ?>
7 <title>SSP Admin :: Add an Album</title>
8 <?php include "./inc/head_elem.php"; ?>
9 </head>
10
11 <body>
12 <div id="container">
13
14 <?php include "./inc/h1.php"; ?>
15
16 <?php
17 $d = $_REQUEST['aDir'];
18 $d = str_replace("/", "", $d);
19
20 $album_photos_dir = 'albums/'.$d.'/lg';
21 $dh = @opendir($album_photos_dir) or die('<p>Folder <strong>'.$d.'</strong> does not exist, <a href="add-album.php">go back</a> and try again</p>');
22 rizwank 1.1 while (false !== ($filename = readdir($dh))) {
23 if ( eregi("jpg",$filename) || eregi("swf", $filename) || eregi("flv", $filename)) {
24 $album_photos[] = $filename;
25 }
26 }
27
28 if (sizeof($album_photos) != 0)
29 {
30 ?>
31 <h2>Add a New Album</h2>
32 <p>To add a new album with the images found below, simply give it a name and click "Add Album". You will be able to edit this later.</p>
33
34 <form action="add-album-exe.php" method="post">
35 <fieldset class="center"><input type="text" name="aName" /> <input type="submit" value="Add Album" /><input type="hidden" name="aDir" value="<?php echo $d; ?>" /></fieldset>
36 </form>
37 <?php
38 echo '<p>The Following Files Were Found</p>';
39 echo '<ul>';
40
41 for($j = 0; $j < sizeof($album_photos); $j++) {
42 echo '<li>'.$album_photos[$j].'</li>';
43 rizwank 1.1 }
44
45 echo '</ul>';
46 }
47 else
48 {
49 echo '<p>No Jpegs Found in the <strong>'.$d.'/lg</strong> directory!</p>';
50 }
51
52 ?>
53
54 </div>
55
56 </body>
57 </html>
|