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 <?php
10 $chk = strpos($_SERVER['HTTP_USER_AGENT'], 'Safari');
11 ?>
12 <script type="text/javascript">
13
14 var selbox = 0;
15 var isSafari = <?php ($chk === false) ? $r = 'false' : $r= 'true'; echo $r; ?>;
16
17 function checkForm(theForm)
18 {
19 if (theForm.aName.value == '')
20 {
21 alert("Please Enter a Name for the New Album");
22 rizwank 1.1 return false;
23 }
24 else if (theForm.upload.value == '')
25 {
26 alert("Please Select a File to Upload");
27 return false;
28 }
29 else
30 {
31 if (isSafari)
32 {
33 theForm.btn.disabled = true;
34 theForm.btn.value = 'Uploading...Please Wait';
35 } else {
36 document.getElementById('before').style.display = 'none';
37 document.getElementById('after').style.display = 'block';
38 progress();
39 }
40 return true;
41 }
42 }
43 rizwank 1.1
44 function progress()
45 {
46 var elem = document.getElementById('boxes-up');
47 var a = elem.getElementsByTagName('DIV');
48 if (selbox == 3)
49 selbox = 0;
50 if (selbox == 0)
51 a[2].className = 'pbox';
52 else
53 a[selbox-1].className = 'pbox';
54 a[selbox].className = 'pbox-sel';
55 selbox += 1;
56 setTimeout(progress, 500);
57 }
58 </script>
59 <style type="text/css">
60 div#after { display:none; }
61 div#boxes-up { width:216px; margin:0 auto; }
62 div.pbox { width:50px; height:50px; float:left; margin:10px; background:#c7c7c7; border:1px solid #555555;}
63 div.pbox-sel { width:50px; height:50px; float:left; margin:10px; background:#ffffff; border:1px solid #cc0000;}
64 rizwank 1.1 </style>
65 </head>
66
67 <body>
68 <div id="container">
69
70
71 <?php include "./inc/h1.php"; ?>
72 <div id="before">
73 <div class="album-wrap">
74 <h2>I Want to Upload My Files in a Zip Archive</h2>
75 <?php if ( @include( 'PEAR.php' ) ) { ?>
76
77 <p>Before proceeding, be sure you have created a proper Zip archive. When the archive opens, it should have the lg folder with your full size images, and optionally your tn folder with your thumbnails.</p>
78 <form action="add-album-up.php" method="post" enctype="multipart/form-data" onSubmit="return checkForm(this)">
79 <fieldset class="center">Give the Album Folder a Name: <input type="text" name="aName" /><br /><small>(Alphanumeric characters, spaces and underscores only!)</small>
80 </fieldset>
81 <fieldset class="center"><label>Zip File: </label><input type="file" name="upload"></fieldset><fieldset class="center"><input name="btn" type="submit" value="Upload Zip Archive of Pictures" /></fieldset>
82 </form>
83 <?php } else { ?>
84 <p>Using this feature requires the PEAR library for PHP. Contact your host for availability.</p>
85 rizwank 1.1 <?php } ?>
86 </div>
87 <div class="album-wrap">
88 <h2>I Want to Add Files One at a Time</h2>
89 <form action="add-album-up-single.php" method="post" enctype="multipart/form-data" onSubmit="return checkForm(this)">
90 <fieldset class="center">Give the Album Folder a Name: <input type="text" name="aName" /><br /><small>(Alphanumeric characters, spaces and underscores only!)</small>
91 </fieldset>
92
93 <fieldset class="center"><label>File to Upload: </label><input type="file" name="upload"></fieldset><fieldset class="center"><input name="btn" type="submit" value="Upload this Picture" /></fieldset></form></div>
94 <div class="album-wrap">
95 <h2>I Want to Scan an Existing Folder for Images</h2>
96 <p>Before proceeding, you should have uploaded your photos to their own directory within the album directory of the SSP Admin installation. Visit the <a href="http://slideshowpro.net">SlideShowPro Site</a> for more information on preparing your photos. Follow the example directory structure below:</p>
97 <div class="center"><img src="images/dir-ex.gif" class="figure-pic" /></div>
98 <p>Select the name of the album folder you would like to use below. For example, using the figure above, you would select "test-album" to use the photos in that directory to create a new album. You CAN use the same folder for different albums.</p>
99 <fieldset class="center"><form action="add-album-scan.php" method="post">
100 <?php
101
102 if ($handle = opendir('./albums')) {
103 $i = 0;
104 $output = '<select name="aDir">';
105 while (false !== ($file = readdir($handle))) {
106 rizwank 1.1
107 if ( $file != '.' && $file != '..' )
108 {
109 if ( is_dir ( './albums/'.$file ) )
110 {
111 $output .= "<option>$file</option>";
112 $i += 1;
113 }
114 }
115 }
116
117 closedir($handle);
118
119 if ( $i != 0 )
120 {
121 $output .= '</select>';
122 }
123 else
124 {
125 $output = 'No Albums Directories Found. You need to upload your photos first!';
126 }
127 rizwank 1.1 echo($output);
128 }
129 ?><input type="submit" value="Scan Folder for Pictures »" /></form></fieldset>
130 </div>
131 </div>
132 <div id="after" class="album-wrap center"><p><strong>Uploading...Please Wait</strong></p><div id="boxes-up"><div class="pbox"> </div><div class="pbox"> </div><div class="pbox"> </div></div><div style="clear:both"> </div></div>
133 </div>
134
135
136 </body>
137 </html>
|