[Openfirst-cvscommit] photogallery cleargallery.php,NONE,1.1 edit.php,NONE,1.1 email.PNG,NONE,1.1 en
Brought to you by:
xtimg
From: <dav...@us...> - 2003-06-05 01:57:00
|
Update of /cvsroot/openfirst/photogallery In directory sc8-pr-cvs1:/tmp/cvs-serv16841 Modified Files: gallery.php galleryglobals.php index.php openFIRST.photogallery.sql viewphoto.php Added Files: cleargallery.php edit.php email.PNG enlarge.PNG manage.php newgallery.php photo.PNG upload.php Log Message: Extreme changes made to photogallery. New scripts uploaded: newgallery.php, cleargallery.php, upload.php. Changes were mostly of manager options. I had to change a field in the sql setup. More images were uploaded also. --- NEW FILE: cleargallery.php --- <?php /* * openFIRST.photogallery - cleargallery.php * * Copyright (C) 2003, * openFIRST Project * Original Author: David Di Biase <dav...@ea...> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ // Import globals and estbalish database connection include("../config/globals.php"); include($header); include("galleryglobals.php"); mysql_select_db($sqldatabase,$sqlconnection); $query = mysql_query("SELECT * FROM ofirst_galleries WHERE ID = '".$_GET['ID']."'"); $gallery = mysql_fetch_object($query); // Check if user initiates the confirm of clearing the gallery if (ISSET($_GET['CONFIRM'])){ $dirlocate = $gallerydir.$gallery->GalleryName; $dir = opendir($dirlocate); while(! (($file = readdir($dir)) === false)){ if (is_file($dirlocate."/".$file)){ unlink($dirlocate."/".$file); if (file_exists($dirlocate."/thumbs/".$file)){ unlink($dirlocate."/thumbs/".$file); } } die("<br><br><center>The <b>".$gallery->GalleryName."</b> gallery has been reset. [ <a href='manage.php'>Manage</a> ]"); } } ?> <h2>Edit Gallery</h2><p>[ <a href="manage.php">Manager</a> ] [ <a href="newgallery.php">Add New Gallery</a> ]</p> <p><em><?php echo $gallery->GalleryName; ?> Options -</em> [ <a href="edit.php?ID=<?php echo $_GET['ID']; ?>">Edit</a> ] [ <a href="upload.php?ID=<?php echo $_GET['ID']; ?>">Upload Photos</a> ] [ <a href="cleargallery.php?ID=<?php echo $_GET['ID']; ?>">Clear Gallery</a> ]</p> <br><br><p align="center">You are trying to clear the entire <b><?php echo $gallery->GalleryName; ?></b> gallery! <a href="cleargallery.php?ID=<?php echo $_GET['ID']; ?>&CONFIRM=True">Confirm</a></p> <?php include($footer); ?> --- NEW FILE: edit.php --- <?php /* * openFIRST.photogallery - edit.php * * Copyright (C) 2003, * openFIRST Project * Original Author: David Di Biase <dav...@ea...> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ // Import globals and estbalish database connection include("../config/globals.php"); include($header); include("galleryglobals.php"); mysql_select_db($sqldatabase,$sqlconnection); // Check if user initiated delete and run delete process if(ISSET($_GET['DELETE'])){ $query = mysql_query("SELECT * FROM ofirst_galleries WHERE ID = '".$_GET['DELETE']."'") or die(mysql_error()); $gallery = mysql_fetch_object($query); rmdir($gallerydir.$gallery->GalleryName) or die("<br><br><center>Can't remove gallery! [ <a href='manage.php'>Manage</a> ]"); mysql_query("DELETE FROM ofirst_galleries WHERE ID = '".$_GET['DELETE']."'") or die(mysql_error()); die("<br><br><center>The gallery has been deleted! [ <a href='manage.php'>Manage</a> ]</center>"); } // Check if user initiated delete of particular photo and run photo and thumb delete if(ISSET($_GET['DELETEPHOTO'])){ $query = mysql_query("SELECT * FROM ofirst_galleries WHERE ID = '".$_GET['ID']."'") or die(mysql_error()); $gallery = mysql_fetch_object($query); unlink($gallerydir.$gallery->GalleryName."/".$_GET['PHOTO']) or die("<br><br><center>Can't remove gallery! [ <a href='manage.php'>Manage</a> ]"); if (file_exists($gallerydir.$gallery->GalleryName."/thumbs/".$_GET['PHOTO'])){ unlink($gallerydir.$gallery->GalleryName."/thumbs/".$_GET['PHOTO']) or die("<br><br><center>Can't remove gallery! [ <a href='manage.php'>Manage</a> ]"); die("<br><br><center>The photo and its thumbnail have been deleted! [ <a href='edit.php?ID=".$_GET['ID']."'>Manage</a> ]</center>"); }else{ die("<br><br><center>The photo has been deleted! [ <a href='edit.php?ID=".$_GET['ID']."'>Manage</a> ]</center>"); } } $query = mysql_query("SELECT * FROM ofirst_galleries WHERE ID = '".$_GET['ID']."'"); $gallery = mysql_fetch_object($query); ?> <h2>Edit Gallery</h2><p>[ <a href="manage.php">Manager</a> ] [ <a href="newgallery.php">Add New Gallery</a> ]</p> <p><em><?php echo $gallery->GalleryName; ?> Options - </em>[ <a href="edit.php?ID=<?php echo $_GET['ID']; ?>">Edit</a> ] [ <a href="upload.php?ID=<?php echo $_GET['ID']; ?>">Upload Photos</a> ] [ <a href="cleargallery.php?ID=<?php echo $_GET['ID']; ?>">Clear Gallery</a> ]</p> <table width="457" border="0" align="center" cellpadding="6" cellspacing="0"> <tr bgcolor="#999999"> <td valign="top"> <div align="center"> </div></td> <td><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Photo Name </font></strong></td> <td><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Thumbnail</font></strong></td> <td><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Option</font></strong></td> </tr> <?php // List photos in current gallery $dirlocate = $gallerydir.$gallery->GalleryName; $dir = opendir($dirlocate); $num = 0; while(! (($file = readdir($dir)) === false)){ if (is_file($dirlocate."/".$file)){ $num++; ?> <tr> <td valign="top"><div align="center"> <a href="viewphoto.php?ID=<?php echo $_GET['ID']; ?>&PHOTO=<?php echo $file; ?>" target="_blank"><img src="photo.PNG" width="27" height="31" border="0"></a></div></td> <td valign="top"><?php echo $file; ?></td> <td valign="top"> <?php if (file_exists($dirlocate."/thumbs/".$file)){ echo "Yes"; }else{ echo "No"; } ?> </td> <td valign="top">[ <a href='makethumb.php?ID=<?php echo $_GET['ID']; ?>&PHOTO=<?php echo $file; ?>'>Make Thumbnail</a> ]<br> [ <a href='edit.php?ID=<?php echo $_GET['ID']; ?>&DELETEPHOTO=True&PHOTO=<?php echo $file; ?>'>Delete</a> ]</td> </tr> <?php } } if($num == 0){ echo "<tr><td>--</td><td><br>No photos in gallery!<br><br></td><td>--</td><td>--</td></tr>"; } ?> </table> <?php include($footer); ?> --- NEW FILE: email.PNG --- (This appears to be a binary file; contents omitted.) --- NEW FILE: enlarge.PNG --- (This appears to be a binary file; contents omitted.) --- NEW FILE: manage.php --- <?php /* * openFIRST.photogallery - manage.php * * Copyright (C) 2003, * openFIRST Project * Original Author: David Di Biase <dav...@ea...> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ // Import globals and estbalish database connection include("../config/globals.php"); include($header); include("galleryglobals.php"); mysql_select_db($sqldatabase,$sqlconnection); ?> <h2>Gallery Manager</h2> <p>[ <a href="manage.php">Manager</a> ] [ <a href="newgallery.php">Add New Gallery</a> ]</p> <p align="center"> <table width="633" border="0" align="center" cellpadding="6" cellspacing="0"> <tr bgcolor="#999999"> <td valign="top"> <div align="center"> </div></td> <td><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Gallery Name</strong></font></td> <td><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Description</font></strong></td> <td> <div align="left"><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Option</font></strong></div></td> </tr> <?php // Retrieve galleries from database and list them accordingly $query = mysql_query("SELECT * FROM ofirst_galleries"); while($gallery = mysql_fetch_object($query)){ ?> <tr> <td width="58" valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><a href="gallery.php?ID=<?php echo $gallery->ID; ?>"><img src="gallery.PNG" width="58" height="51" border="0"></a></font></td> <td width="145" valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $gallery->GalleryName; ?></font></td> <td width="307" valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $gallery->Description; ?></font></td> <td width="75" valign="top">[ <a href="edit.php?ID=<?php echo $gallery->ID; ?>">Edit</a> ]<br> [ <a href="edit.php?DELETE=<?php echo $gallery->ID; ?>">Delete</a> ]</td> </tr> <?php } if (mysql_num_rows($query) == 0){ echo "<tr><td>--</td><td><br>There are no galleries uploaded<br><br></td>"; } ?> </table> <br> </p> <p align="center"> </p> <?php include($footer); ?> --- NEW FILE: newgallery.php --- <?php /* * openFIRST.photogallery - newgallery.php * * Copyright (C) 2003, * openFIRST Project * Original Author: David Di Biase <dav...@ea...> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ // Import globals and estbalish database connection include("../config/globals.php"); include($header); include("galleryglobals.php"); mysql_select_db($sqldatabase,$sqlconnection); // Check if user initiates create option and run create options if(ISSET($_POST['create'])){ mkdir($gallerydir.$_POST['galleryname'],0777) or die("<br><br><center>Can't create folder! [ <a href='manage.php'>Manage</a> ]"); mkdir($gallerydir.$_POST['galleryname']."/thumbs",0777) or die("<br><br><center>Can't create folder! [ <a href='manage.php'>Manage</a> ]"); mysql_query("INSERT INTO ofirst_galleries (GalleryName, Author, Date, Description) values( '".$_POST['galleryname']."' ,'".$_POST['author']."' ,'".time()."' ,'".$_POST['description']."')") or die(mysql_error()); die("<br><br><center>New gallery added! [ <a href='manage.php'>Manage</a> ]</center>"); } ?> <h2>New Gallery</h2> <p>[ <a href="manage.php">Manager</a> ] [ <a href="newgallery.php">Add New Gallery</a> ]</p> <form method="POST" action="newgallery.php"> <table width="499" border="0" align="center" cellpadding="6" cellspacing="0"> <tr bgcolor="#999999"> <td valign="top"> <div align="center"> </div></td> <td><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Gallery Name</strong></font></td> </tr> <tr> <td width="135" valign="top"><div align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Gallery Name:</font></div></td> <td width="275" valign="top"><input name="galleryname" type="text" id="galleryname"></td> </tr> <tr> <td valign="top"><div align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Author:</font></div></td> <td valign="top"><font size="2"> <input name="author" type="text" id="author"> (Temporarily an option until openfirst.members is released)</font></td> </tr> <tr> <td valign="top"><div align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Date:</font></div></td> <td valign="top"><?php echo date("F j, Y, g:i a",time()); ?></td> </tr> <tr> <td valign="top"><div align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Description:</font></div></td> <td valign="top"> <textarea name="description" cols="40" rows="10" id="description"></textarea></td> </tr> <tr> <td valign="top"> </td> <td valign="top"><input name="create" type="submit" id="create" value="Create Gallery"></td> </tr> </table> </form> <?php include($footer); ?> --- NEW FILE: photo.PNG --- (This appears to be a binary file; contents omitted.) --- NEW FILE: upload.php --- <?php /* * openFIRST.photogallery - upload.php * * Copyright (C) 2003, * openFIRST Project * Original Author: David Di Biase <dav...@ea...> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ // Import globals and estbalish database connection include("../config/globals.php"); include($header); include("galleryglobals.php"); mysql_select_db($sqldatabase,$sqlconnection); $query = mysql_query("SELECT * FROM ofirst_galleries WHERE ID = '".$_GET['ID']."'"); $gallery = mysql_fetch_object($query); // Check if user initiates upload process and run upload process if(ISSET($_POST['upload'])){ ini_set("max_execution_time",$gallery_execution_time); $dirlocate = $gallerydir.$gallery->GalleryName; for ($num=1;$num<=$_POST['NUM_UPLOADS'];$num++){ if (! $_FILES['upload'.$num]['name'] == ""){ copy($_FILES['upload'.$num]['tmp_name'], $dirlocate."/".$_FILES['upload'.$num]['name']) or $error = true; echo "<center><br>".$_FILES['upload'.$num]['name']." - ".$_FILES['upload'.$num]['size']." - ".$_FILES['upload'.$num]['type']." - "; if(empty($error)){ echo "<font color='Green'>Successful</font><br></center>\n"; }else{ echo "<font color='Red'>Not Successful</font><br></center>\n"; } } } } // Prepare fields for uploading next time if(ISSET($_POST['setuploads'])){ $uploads = $_POST['uploads']; }else{ $uploads = 5; } ?> <h2>Upload to Gallery</h2> <p>[ <a href="manage.php">Manager</a> ] [ <a href="newgallery.php">Add New Gallery</a> ]</p> <p><em><?php echo $gallery->GalleryName; ?> Options - </em>[ <a href="edit.php?ID=<?php echo $_GET['ID']; ?>">Edit </a>] [ <a href="upload.php?ID=<?php echo $_GET['ID']; ?>">Upload Photos</a> ] [ <a href="cleargallery.php?ID=<?php echo $_GET['ID']; ?>">Clear Gallery</a> ]</p> <p align="center">Current Files Allowd: <?php echo $imgtypes; ?></p> <p align="center"> <form action='upload.php?ID=<?php echo $_GET['ID']; ?>' enctype="multipart/form-data" method='POST'> <input name="uploads" type="text" id="uploads" size="2" maxlength="2"> <input name="setuploads" type="submit" id="setuploads" value="Add Spaces"> <input type="hidden" name="MAX_FILE_SIZE" size="5200000"> <input type="hidden" name="NUM_UPLOADS" value="<?php echo $uploads; ?>"> <?php // Output upload fields depending on the user request or not for($n = 1; $n <= $uploads ; $n++ ){ echo $n.". <input type='file' name='upload".$n."' size='29'><br>\n"; } ?> <br> <input name="upload" type="submit" value="Upload To Gallery"> </form> <?php include($footer); ?> Index: gallery.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/gallery.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** gallery.php 2 Jun 2003 11:42:03 -0000 1.3 --- gallery.php 5 Jun 2003 01:56:56 -0000 1.4 *************** *** 26,30 **** * */ ! include("../config/globals.php"); include($header); --- 26,31 ---- * */ ! ! // Import globals and estbalish database connection include("../config/globals.php"); include($header); *************** *** 33,44 **** mysql_select_db($sqldatabase,$sqlconnection); - if(! ISSET($_GET['MAX']) && ! ISSET($_GET['MIN'])){ - $min = 0; - $max = 9; - }else{ - $min = $_GET['MIN']; - $max = $_GET['MAX']; - } - ?> <h2>Gallery Viewer</h2> --- 34,37 ---- *************** *** 56,66 **** <?php $query = mysql_query("SELECT * FROM ofirst_galleries WHERE ID = '".$_GET['ID']."'"); $gallery = mysql_fetch_object($query); - if (! is_dir($gallerydir.$gallery->GalleryName)){ - die("<h2><br><br><center>Gallery not setup!</h2><br>"); - } - ?> <tr> --- 49,56 ---- <?php + // Retrieve gallery information $query = mysql_query("SELECT * FROM ofirst_galleries WHERE ID = '".$_GET['ID']."'"); $gallery = mysql_fetch_object($query); ?> <tr> *************** *** 68,72 **** <td width="127" valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $gallery->GalleryName; ?></font></td> <td width="150" valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $gallery->Author; ?></font></td> ! <td width="185" valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $gallery->Date; ?></font></td> </tr> </table> --- 58,62 ---- <td width="127" valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $gallery->GalleryName; ?></font></td> <td width="150" valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $gallery->Author; ?></font></td> ! <td width="185" valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><?php echo date("F j, Y, g:i a",$gallery->Date); ?></font></td> </tr> </table> *************** *** 80,83 **** --- 70,74 ---- <?php + // List photos in the gallery $dirlocate = $gallerydir.$gallery->GalleryName; $dir = opendir($dirlocate); *************** *** 91,95 **** $num = 1; } ! echo "<td width='34%'><a target='_blank' href='viewphoto.php?ID=".$_GET['ID']."&PHOTO=".$file."'><center><img height=100 width=152 src='preview.php?img=$dirlocate/$file'></center></a></td>"; $num++; } --- 82,88 ---- $num = 1; } ! echo "<td width='34%'><a target='_blank' href='viewphoto.php?ID=".$_GET['ID']."&PHOTO=".$file."'> ! <center><img height=100 width=152 src='preview.php?img=$dirlocate/$file'><br><a href=email.php> ! <img src=email.PNG alt='Email to a friend'></a><a target='_blank' href='viewphoto.php?ID=".$_GET['ID']."&PHOTO=".$file."'><img alt='Enlarge' src='enlarge.PNG'></a></center></a></td>"; $num++; } Index: galleryglobals.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/galleryglobals.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** galleryglobals.php 2 Jun 2003 23:26:49 -0000 1.2 --- galleryglobals.php 5 Jun 2003 01:56:56 -0000 1.3 *************** *** 33,35 **** --- 33,38 ---- $imgtypes = "gif,jpg,jpeg,png,bmp"; + // Declare maximum execution time for the galleries + $gallery_execution_time = "1200"; + ?> Index: index.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/index.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** index.php 1 Jun 2003 22:54:49 -0000 1.2 --- index.php 5 Jun 2003 01:56:56 -0000 1.3 *************** *** 27,30 **** --- 27,31 ---- */ + // Import globals and estbalish database connection include("../config/globals.php"); include($header); *************** *** 46,49 **** --- 47,51 ---- <?php + // List galleries from database $query = mysql_query("SELECT * FROM ofirst_galleries"); while($gallery = mysql_fetch_object($query)){ Index: openFIRST.photogallery.sql =================================================================== RCS file: /cvsroot/openfirst/photogallery/openFIRST.photogallery.sql,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** openFIRST.photogallery.sql 2 Jun 2003 11:22:42 -0000 1.1 --- openFIRST.photogallery.sql 5 Jun 2003 01:56:56 -0000 1.2 *************** *** 14,29 **** `GalleryName` tinytext, `Author` text, ! `Date` timestamp(6) NOT NULL, `Description` text, `NumPhotos` tinyint(6) unsigned default '0', PRIMARY KEY (`ID`) ! ) TYPE=MyISAM; ! ! ! ! # ! # Dumping data for table 'ofirst_galleries' ! # ! INSERT INTO `ofirst_galleries` VALUES("1","Testing","David Di Biase","000000","Doesnt doesnt doesnt doesnt","6"); ! INSERT INTO `ofirst_galleries` VALUES("2","Testing","David Di Biase","000000","Doesnt doesnt doesnt doesnt","6"); ! INSERT INTO `ofirst_galleries` VALUES("3","Testing","David Di Biase","000000","Doesnt doesnt doesnt doesnt","6"); --- 14,20 ---- `GalleryName` tinytext, `Author` text, ! `Date` time(10) NOT NULL, `Description` text, `NumPhotos` tinyint(6) unsigned default '0', PRIMARY KEY (`ID`) ! ) TYPE=MyISAM; \ No newline at end of file Index: viewphoto.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/viewphoto.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** viewphoto.php 1 Jun 2003 22:56:20 -0000 1.1.1.1 --- viewphoto.php 5 Jun 2003 01:56:56 -0000 1.2 *************** *** 27,30 **** --- 27,31 ---- */ + // Import globals and estbalish database connection $header_condense = true; include("../config/globals.php"); *************** *** 47,57 **** <?php $query = mysql_query("SELECT * FROM ofirst_galleries WHERE ID = '".$_GET['ID']."'"); $gallery = mysql_fetch_object($query); - if(! is_dir($gallerydir.$gallery->GalleryName)){ - die("<h2><br><br><center>Gallery not setup!</h2><br>"); - } - ?> <tr> --- 48,55 ---- <?php + // Retrieve information about the photos related gallery $query = mysql_query("SELECT * FROM ofirst_galleries WHERE ID = '".$_GET['ID']."'"); $gallery = mysql_fetch_object($query); ?> <tr> *************** *** 59,63 **** <td width="127" valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $gallery->GalleryName; ?></font></td> <td width="150" valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $gallery->Author; ?></font></td> ! <td width="185" valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $gallery->Date; ?></font></td> </tr> </table> --- 57,61 ---- <td width="127" valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $gallery->GalleryName; ?></font></td> <td width="150" valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $gallery->Author; ?></font></td> ! <td width="185" valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><?php echo date("F j, Y, g:i a",$gallery->Date); ?></font></td> </tr> </table> *************** *** 70,75 **** <table width="75" border="0" align="center" cellpadding="5" cellspacing="0"> <?php $dirlocate = $gallerydir.$gallery->GalleryName."/"; ! echo "<img src=".$dirlocate.$_GET['PHOTO'].">"; ?> </table> --- 68,76 ---- <table width="75" border="0" align="center" cellpadding="5" cellspacing="0"> <?php + + // Declare dir location $dirlocate = $gallerydir.$gallery->GalleryName."/"; ! echo "<img src='".$dirlocate.$_GET['PHOTO']."'>"; ! ?> </table> |