[Openfirst-cvscommit] photogallery/admin cleargallery.php,1.5,1.6 edit.php,1.5,1.6 editphoto.php,1.3
Brought to you by:
xtimg
Update of /cvsroot/openfirst/photogallery/admin In directory sc8-pr-cvs1:/tmp/cvs-serv14346/admin Modified Files: cleargallery.php edit.php editphoto.php index.php makethumb.php newgallery.php upload.php Log Message: Replace mysql functions with new database functions, allowing multiple database types to be used easily. Index: cleargallery.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/admin/cleargallery.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** cleargallery.php 22 Aug 2003 16:24:42 -0000 1.5 --- cleargallery.php 23 Aug 2003 20:32:49 -0000 1.6 *************** *** 39,44 **** // Retrieve gallery information ! $query = mysql_query("SELECT * FROM ofirst_photogallery_galleries WHERE ID = '".$_GET['ID']."'"); ! $gallery = mysql_fetch_object($query); // Check if user initiates the confirm of clearing the gallery --- 39,44 ---- // Retrieve gallery information ! $query = ofirst_dbquery("SELECT * FROM ofirst_photogallery_galleries WHERE ID = '".$_GET['ID']."'"); ! $gallery = ofirst_dbfetch_object($query); // Check if user initiates the confirm of clearing the gallery Index: edit.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/admin/edit.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** edit.php 22 Aug 2003 16:24:43 -0000 1.5 --- edit.php 23 Aug 2003 20:32:49 -0000 1.6 *************** *** 43,48 **** die(include($footer)); } elseif(isset($_GET["DELETE"]) == true && isset($_GET["CONFIRMED"]) == true) { ! $query = mysql_query("SELECT * FROM ofirst_photogallery_galleries WHERE ID = '".$_GET['DELETE']."'") or die(mysql_error()); ! $gallery = mysql_fetch_object($query); // Delete the directory as asked above --- 43,48 ---- die(include($footer)); } elseif(isset($_GET["DELETE"]) == true && isset($_GET["CONFIRMED"]) == true) { ! $query = ofirst_dbquery("SELECT * FROM ofirst_photogallery_galleries WHERE ID = '".$_GET['DELETE']."'") or die(ofirst_dberror()); ! $gallery = ofirst_dbfetch_object($query); // Delete the directory as asked above *************** *** 72,76 **** } ! mysql_query("DELETE FROM ofirst_photogallery_galleries WHERE ID = '".$_GET['DELETE']."'") or die(mysql_error()); echo "<br><br><center>The gallery has been deleted! [ <a href='index.php'>Manage</a> ]</center><br>"; die(include($footer)); --- 72,76 ---- } ! ofirst_dbquery("DELETE FROM ofirst_photogallery_galleries WHERE ID = '".$_GET['DELETE']."'") or die(ofirst_dberror()); echo "<br><br><center>The gallery has been deleted! [ <a href='index.php'>Manage</a> ]</center><br>"; die(include($footer)); *************** *** 80,85 **** // Check if user initiated delete of particular photo and run photo and thumb delete if(ISSET($_GET['DELETEPHOTO'])){ ! $query = mysql_query("SELECT * FROM ofirst_photogallery_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='index.php'>Manage</a> ]"); --- 80,85 ---- // Check if user initiated delete of particular photo and run photo and thumb delete if(ISSET($_GET['DELETEPHOTO'])){ ! $query = ofirst_dbquery("SELECT * FROM ofirst_photogallery_galleries WHERE ID = '".$_GET['ID']."'") or die(ofirst_dberror()); ! $gallery = ofirst_dbfetch_object($query); unlink("../".$gallerydir.$gallery->GalleryName."/".$_GET['PHOTO']) or die("<br><br><center>Can't remove gallery! [ <a href='index.php'>Manage</a> ]"); *************** *** 95,100 **** // Get information above the gallery ! $query = mysql_query("SELECT * FROM ofirst_photogallery_galleries WHERE ID = '".$_GET['ID']."'"); ! $gallery = mysql_fetch_object($query); ?> --- 95,100 ---- // Get information above the gallery ! $query = ofirst_dbquery("SELECT * FROM ofirst_photogallery_galleries WHERE ID = '".$_GET['ID']."'"); ! $gallery = ofirst_dbfetch_object($query); ?> Index: editphoto.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/admin/editphoto.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** editphoto.php 22 Aug 2003 16:24:43 -0000 1.3 --- editphoto.php 23 Aug 2003 20:32:49 -0000 1.4 *************** *** 39,48 **** // Get information relating to this particular image ! $query = mysql_query("SELECT * FROM ofirst_photogallery_galleries WHERE ID = '".$_GET['ID']."'"); ! $gallery = mysql_fetch_object($query); ! $imgquery = mysql_query("SELECT * FROM ofirst_photogallery_image WHERE ! Gallery = '".$_GET['ID']."' AND Image = '".$_GET['PHOTO']."'") or die(mysql_error()); ! $image = mysql_fetch_object($imgquery); // Check if a text file relating to this image is present then prepare to fill it into the descriptions box --- 39,48 ---- // Get information relating to this particular image ! $query = ofirst_dbquery("SELECT * FROM ofirst_photogallery_galleries WHERE ID = '".$_GET['ID']."'"); ! $gallery = ofirst_dbfetch_object($query); ! $imgquery = ofirst_dbquery("SELECT * FROM ofirst_photogallery_image WHERE ! Gallery = '".$_GET['ID']."' AND Image = '".$_GET['PHOTO']."'") or die(ofirst_dberror()); ! $image = ofirst_dbfetch_object($imgquery); // Check if a text file relating to this image is present then prepare to fill it into the descriptions box *************** *** 66,82 **** } ! if(mysql_num_rows($imgquery) == 0){ ! mysql_query("INSERT INTO ofirst_photogallery_image SET Image = '".$_GET['PHOTO']."', Gallery = '".$_GET['ID']."', ImageName = '".$_POST['imagename']."', Description = '".$description."', ! Dates = '".$_POST['date']."'") or die(mysql_error()); } else { ! mysql_query("UPDATE ofirst_photogallery_image SET ImageName = '".$_POST['imagename']."', Description = '".$description."', Dates = '".$_POST['date']."' ! WHERE Gallery = '".$_GET['ID']."' AND Image = '".$_GET['PHOTO']."'") or die(mysql_error()); } if(isset($_POST['deletefile'])){ --- 66,82 ---- } ! if(ofirst_dbnum_rows($imgquery) == 0){ ! ofirst_dbquery("INSERT INTO ofirst_photogallery_image SET Image = '".$_GET['PHOTO']."', Gallery = '".$_GET['ID']."', ImageName = '".$_POST['imagename']."', Description = '".$description."', ! Dates = '".$_POST['date']."'") or die(ofirst_dberror()); } else { ! ofirst_dbquery("UPDATE ofirst_photogallery_image SET ImageName = '".$_POST['imagename']."', Description = '".$description."', Dates = '".$_POST['date']."' ! WHERE Gallery = '".$_GET['ID']."' AND Image = '".$_GET['PHOTO']."'") or die(ofirst_dberror()); } if(isset($_POST['deletefile'])){ *************** *** 94,98 **** // Delete file information from the database upon request if(isset($_POST['deleteall'])){ ! mysql_query("DELETE FROM ofirst_photogallery_image WHERE Gallery = '".$_GET['ID']."' AND Image = '".$_GET['PHOTO']."'"); echo "<br><br>The description of this image has been removed! [ <a href='editphoto.php?ID=".$_GET['ID']."&PHOTO=".$_GET['PHOTO']."'>Manage</a> ]<br><br>"; die(include($footer)); --- 94,98 ---- // Delete file information from the database upon request if(isset($_POST['deleteall'])){ ! ofirst_dbquery("DELETE FROM ofirst_photogallery_image WHERE Gallery = '".$_GET['ID']."' AND Image = '".$_GET['PHOTO']."'"); echo "<br><br>The description of this image has been removed! [ <a href='editphoto.php?ID=".$_GET['ID']."&PHOTO=".$_GET['PHOTO']."'>Manage</a> ]<br><br>"; die(include($footer)); Index: index.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/admin/index.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** index.php 22 Aug 2003 16:24:43 -0000 1.5 --- index.php 23 Aug 2003 20:32:49 -0000 1.6 *************** *** 52,57 **** // Retrieve galleries from database and list them accordingly ! $query = mysql_query("SELECT * FROM ofirst_photogallery_galleries"); ! while($gallery = mysql_fetch_object($query)){ ?> --- 52,57 ---- // Retrieve galleries from database and list them accordingly ! $query = ofirst_dbquery("SELECT * FROM ofirst_photogallery_galleries"); ! while($gallery = ofirst_dbfetch_object($query)){ ?> *************** *** 69,73 **** // If there are no values then preview an error ! if (mysql_num_rows($query) == 0){ echo "\n <tr>\n <td> </td>\n <td><br>There are no galleries uploaded<br><br></td>\n"; } --- 69,73 ---- // If there are no values then preview an error ! if (ofirst_dbnum_rows($query) == 0){ echo "\n <tr>\n <td> </td>\n <td><br>There are no galleries uploaded<br><br></td>\n"; } Index: makethumb.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/admin/makethumb.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** makethumb.php 22 Aug 2003 16:24:43 -0000 1.4 --- makethumb.php 23 Aug 2003 20:32:49 -0000 1.5 *************** *** 36,41 **** if (isset($user->user)){ ! $query = mysql_query("SELECT * FROM ofirst_photogallery_galleries WHERE ID = '".$_GET['ID']."'") or die(mysql_error()); ! $gallery = mysql_fetch_object($query); $dirlocate = "../".$gallerydir.$gallery->GalleryName; --- 36,41 ---- if (isset($user->user)){ ! $query = ofirst_dbquery("SELECT * FROM ofirst_photogallery_galleries WHERE ID = '".$_GET['ID']."'") or die(ofirst_dberror()); ! $gallery = ofirst_dbfetch_object($query); $dirlocate = "../".$gallerydir.$gallery->GalleryName; Index: newgallery.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/admin/newgallery.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** newgallery.php 22 Aug 2003 16:24:43 -0000 1.5 --- newgallery.php 23 Aug 2003 20:32:49 -0000 1.6 *************** *** 43,47 **** 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_photogallery_galleries (GalleryName, Author, Dates, Description) values( '".$_POST['galleryname']."', '".$user->user."', '".time()."', '".$_POST['description']."')"); --- 43,47 ---- mkdir("../".$gallerydir.$_POST['galleryname']."/thumbs",0777) or die("<br><br><center>Can't create folder! [ <a href='manage.php'>Manage</a> ]"); ! ofirst_dbquery("INSERT INTO ofirst_photogallery_galleries (GalleryName, Author, Dates, Description) values( '".$_POST['galleryname']."', '".$user->user."', '".time()."', '".$_POST['description']."')"); Index: upload.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/admin/upload.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** upload.php 22 Aug 2003 16:24:43 -0000 1.7 --- upload.php 23 Aug 2003 20:32:49 -0000 1.8 *************** *** 38,43 **** } ! $query = mysql_query("SELECT * FROM ofirst_photogallery_galleries WHERE ID = '".$_GET['ID']."'"); ! $gallery = mysql_fetch_object($query); // Check if user initiates upload process and run upload process --- 38,43 ---- } ! $query = ofirst_dbquery("SELECT * FROM ofirst_photogallery_galleries WHERE ID = '".$_GET['ID']."'"); ! $gallery = ofirst_dbfetch_object($query); // Check if user initiates upload process and run upload process |