[Openfirst-cvscommit] photogallery email.php,1.7,1.8 gallery.php,1.9,1.10 index.php,1.6,1.7 photogal
Brought to you by:
xtimg
From: <xt...@us...> - 2003-08-23 20:32:52
|
Update of /cvsroot/openfirst/photogallery In directory sc8-pr-cvs1:/tmp/cvs-serv14346 Modified Files: email.php gallery.php index.php photogallery.php viewphoto.php Log Message: Replace mysql functions with new database functions, allowing multiple database types to be used easily. Index: email.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/email.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** email.php 22 Aug 2003 15:49:12 -0000 1.7 --- email.php 23 Aug 2003 20:32:49 -0000 1.8 *************** *** 32,37 **** // Get gallery information ! $query = mysql_query("SELECT * FROM ofirst_photogallery_galleries WHERE ID = '".$_GET['ID']."'"); ! $gallery = mysql_fetch_object($query); // If user has hit the send option then --- 32,37 ---- // Get gallery information ! $query = ofirst_dbquery("SELECT * FROM ofirst_photogallery_galleries WHERE ID = '".$_GET['ID']."'"); ! $gallery = ofirst_dbfetch_object($query); // If user has hit the send option then Index: gallery.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/gallery.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** gallery.php 22 Aug 2003 16:49:33 -0000 1.9 --- gallery.php 23 Aug 2003 20:32:49 -0000 1.10 *************** *** 32,37 **** // Retrieve gallery information ! $query = mysql_query("SELECT * FROM ofirst_photogallery_galleries WHERE ID = '".$_GET['ID']."'"); ! $gallery = mysql_fetch_object($query); ?> --- 32,37 ---- // Retrieve gallery information ! $query = ofirst_dbquery("SELECT * FROM ofirst_photogallery_galleries WHERE ID = '".$_GET['ID']."'"); ! $gallery = ofirst_dbfetch_object($query); ?> Index: index.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/index.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** index.php 22 Aug 2003 15:49:12 -0000 1.6 --- index.php 23 Aug 2003 20:32:49 -0000 1.7 *************** *** 46,51 **** // List galleries from database ! $query = mysql_query("SELECT * FROM ofirst_photogallery_galleries"); ! while($gallery = mysql_fetch_object($query)){ ?> --- 46,51 ---- // List galleries from database ! $query = ofirst_dbquery("SELECT * FROM ofirst_photogallery_galleries"); ! while($gallery = ofirst_dbfetch_object($query)){ ?> *************** *** 60,64 **** // If there are no galleries then say there are none ! if (mysql_num_rows($query) == 0){ echo "<tr><td>--</td><td><br>There are no galleries uploaded<br><br></td>"; } --- 60,64 ---- // If there are no galleries then say there are none ! if (ofirst_dbnum_rows($query) == 0){ echo "<tr><td>--</td><td><br>There are no galleries uploaded<br><br></td>"; } Index: photogallery.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/photogallery.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** photogallery.php 22 Aug 2003 15:49:12 -0000 1.4 --- photogallery.php 23 Aug 2003 20:32:49 -0000 1.5 *************** *** 39,44 **** // If option is true then preview the image as a thumb else no thumb ! $query = mysql_query("SELECT * FROM ofirst_photogallery_galleries WHERE ID = '$gallery'"); ! $thisgallery = mysql_fetch_object($query); if($option){ --- 39,44 ---- // If option is true then preview the image as a thumb else no thumb ! $query = ofirst_dbquery("SELECT * FROM ofirst_photogallery_galleries WHERE ID = '$gallery'"); ! $thisgallery = ofirst_dbfetch_object($query); if($option){ Index: viewphoto.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/viewphoto.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** viewphoto.php 22 Aug 2003 16:27:47 -0000 1.8 --- viewphoto.php 23 Aug 2003 20:32:49 -0000 1.9 *************** *** 36,40 **** if(ISSET($_POST['addcomment'])){ ! mysql_query("INSERT INTO ofirst_photogallery_comments SET Image = '".$_GET['PHOTO']."', Gallery = '".$_GET['ID']."', --- 36,40 ---- if(ISSET($_POST['addcomment'])){ ! ofirst_dbquery("INSERT INTO ofirst_photogallery_comments SET Image = '".$_GET['PHOTO']."', Gallery = '".$_GET['ID']."', *************** *** 42,46 **** EMail = '".$_POST['email']."', Comment = '".$_POST['comment']."', ! Date = '".time()."'") or die(mysql_error()); echo "<br><br>Your comment has been successfully posted! [ <a href='viewphoto.php?ID=".$_GET['ID']."&PHOTO=".$_GET['PHOTO']."'>View Image</a> ]<br><br>"; --- 42,46 ---- EMail = '".$_POST['email']."', Comment = '".$_POST['comment']."', ! Date = '".time()."'") or die(ofirst_dberror()); echo "<br><br>Your comment has been successfully posted! [ <a href='viewphoto.php?ID=".$_GET['ID']."&PHOTO=".$_GET['PHOTO']."'>View Image</a> ]<br><br>"; *************** *** 52,56 **** if(ISSET($user->user)){ ! mysql_query("DELETE FROM ofirst_photogallery_comments WHERE ID = '".$_GET['COMMENT']."'"); echo "<br><br>Comment has been deleted, thank you! [ <a href='viewphoto.php?ID=".$_GET['ID']."&PHOTO=".$_GET['PHOTO']."'>View Image</a> ]<br><br>"; die(include($footer)); --- 52,56 ---- if(ISSET($user->user)){ ! ofirst_dbquery("DELETE FROM ofirst_photogallery_comments WHERE ID = '".$_GET['COMMENT']."'"); echo "<br><br>Comment has been deleted, thank you! [ <a href='viewphoto.php?ID=".$_GET['ID']."&PHOTO=".$_GET['PHOTO']."'>View Image</a> ]<br><br>"; die(include($footer)); *************** *** 60,69 **** // Retrieve image data from the database ! $imgquery = mysql_query("SELECT * FROM ofirst_photogallery_image WHERE Gallery = '".$_GET['ID']."' AND Image = '".$_GET['PHOTO']."'"); ! $image = mysql_fetch_object($imgquery); // Retrieve information about the photos related gallery ! $query = mysql_query("SELECT * FROM ofirst_photogallery_galleries WHERE ID = '".$_GET['ID']."'"); ! $gallery = mysql_fetch_object($query); ?> --- 60,69 ---- // Retrieve image data from the database ! $imgquery = ofirst_dbquery("SELECT * FROM ofirst_photogallery_image WHERE Gallery = '".$_GET['ID']."' AND Image = '".$_GET['PHOTO']."'"); ! $image = ofirst_dbfetch_object($imgquery); // Retrieve information about the photos related gallery ! $query = ofirst_dbquery("SELECT * FROM ofirst_photogallery_galleries WHERE ID = '".$_GET['ID']."'"); ! $gallery = ofirst_dbfetch_object($query); ?> *************** *** 79,83 **** <tr> <td width="20%"><a href="gallery.php?ID=<?php echo $gallery->ID; ?>"><img src="gallery.PNG" border="0"></a></td> ! <td width="80%"><?php if(mysql_num_rows($imgquery) == 0){ echo $_GET['PHOTO']; }else{ echo $image->ImageName; } ?></td> </tr> <tr> --- 79,83 ---- <tr> <td width="20%"><a href="gallery.php?ID=<?php echo $gallery->ID; ?>"><img src="gallery.PNG" border="0"></a></td> ! <td width="80%"><?php if(ofirst_dbnum_rows($imgquery) == 0){ echo $_GET['PHOTO']; }else{ echo $image->ImageName; } ?></td> </tr> <tr> *************** *** 91,95 **** <?php // If there are values for the query then preview the image ! if(! mysql_num_rows($imgquery) == 0){ ?> <tr> --- 91,95 ---- <?php // If there are values for the query then preview the image ! if(! ofirst_dbnum_rows($imgquery) == 0){ ?> <tr> *************** *** 155,162 **** <?php // Check if there are comments in the database ! $query = mysql_query("SELECT * FROM ofirst_photogallery_comments WHERE Gallery = '".$_GET['ID']."' AND Image = '".$_GET['PHOTO']."'"); // Run through the comments and display them ! while($comment = mysql_fetch_object($query)){ ?> --- 155,162 ---- <?php // Check if there are comments in the database ! $query = ofirst_dbquery("SELECT * FROM ofirst_photogallery_comments WHERE Gallery = '".$_GET['ID']."' AND Image = '".$_GET['PHOTO']."'"); // Run through the comments and display them ! while($comment = ofirst_dbfetch_object($query)){ ?> *************** *** 179,183 **** // If there are no values then preview no comments text ! if(mysql_num_rows($query) == 0){ echo "<tr><td> </td><td>There are no comments for this image!</td></tr>"; } --- 179,183 ---- // If there are no values then preview no comments text ! if(ofirst_dbnum_rows($query) == 0){ echo "<tr><td> </td><td>There are no comments for this image!</td></tr>"; } |