openfirst-cvscommit Mailing List for openFIRST (Page 84)
Brought to you by:
xtimg
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(41) |
Jun
(210) |
Jul
(39) |
Aug
(153) |
Sep
(147) |
Oct
(173) |
Nov
(81) |
Dec
(163) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(33) |
Feb
(18) |
Mar
|
Apr
(62) |
May
|
Jun
(100) |
Jul
(38) |
Aug
(58) |
Sep
(1) |
Oct
|
Nov
(25) |
Dec
(172) |
2005 |
Jan
(31) |
Feb
(12) |
Mar
(67) |
Apr
(92) |
May
(247) |
Jun
(34) |
Jul
(36) |
Aug
(192) |
Sep
(15) |
Oct
(42) |
Nov
(92) |
Dec
(4) |
2006 |
Jan
|
Feb
(21) |
Mar
|
Apr
|
May
|
Jun
(53) |
Jul
(7) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
(4) |
Apr
(4) |
May
|
Jun
(15) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <xt...@us...> - 2003-08-23 20:30:18
|
Update of /cvsroot/openfirst/logger/setup In directory sc8-pr-cvs1:/tmp/cvs-serv13990/setup Added Files: setup.mssql Log Message: Replace mysql functions with new database functions, allowing multiple database types to be used easily. --- NEW FILE: setup.mssql --- CREATE TABLE IF NOT EXISTS `ofirst_logger` (`ID` int(6) unsigned NOT NULL auto_increment, `IPAddress` tinytext, `Date` tinytext, `Location` tinytext, `QueryString` tinytext, `HostLookup` tinytext, `Browser` tinytext, PRIMARY KEY (`ID`)) TYPE=MyISAM; ALTER TABLE ofirst_logger ADD column Member TEXT; INSERT INTO ofirst_config SET modulename='logger',showonmenu='0',active='0',adminnavigation='<a href="$basepath/logger/reset.php">Reset Logger</a> | <a href="$basepath/logger/rawdata.php">Raw Data</a>',includes='logger.php'; |
From: <xt...@us...> - 2003-08-23 20:26:39
|
Update of /cvsroot/openfirst/sidebars In directory sc8-pr-cvs1:/tmp/cvs-serv13510 Modified Files: sidebar.php Log Message: Replace mysql functions with new database functions, allowing multiple database types to be used easily. Index: sidebar.php =================================================================== RCS file: /cvsroot/openfirst/sidebars/sidebar.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** sidebar.php 14 Aug 2003 02:38:52 -0000 1.1.1.1 --- sidebar.php 23 Aug 2003 20:26:36 -0000 1.2 *************** *** 77,92 **** <?php if ($sidebar == "GUESTBOOK") { ! $qu = mysql_query("SELECT guest, date FROM ofirst_guestbook ORDER BY guest LIMIT 5;"); ! while($q = mysql_fetch_object($qu)) { echo("<sub><strong><a href='/guestbook/' target='_content'>$q->guest</a></strong><br>$q->date</sub><br>"); } } elseif ($sidebar == "NEWS") { ! $qu = mysql_query("SELECT title, poster, date FROM ofirst_news ORDER BY ID desc LIMIT 5;"); ! while($q = mysql_fetch_object($qu)) { echo("<sub><strong><a href='$home$basepath/news' target='_content' >$q->title</a></strong> - $q->poster<br>$q->date</sub><br>"); } } elseif ($sidebar == "MANUAL") { ! $qu = mysql_query("SELECT document, title FROM ofirst_manual GROUP BY document;"); ! while($q = mysql_fetch_object($qu)) { echo("<sub><a href='$home$basepath/manual' target='_content'>$q->document</a> - $q->title</sub><br>"); } --- 77,92 ---- <?php if ($sidebar == "GUESTBOOK") { ! $qu = ofirst_dbquery("SELECT guest, date FROM ofirst_guestbook ORDER BY guest LIMIT 5;"); ! while($q = ofirst_dbfetch_object($qu)) { echo("<sub><strong><a href='/guestbook/' target='_content'>$q->guest</a></strong><br>$q->date</sub><br>"); } } elseif ($sidebar == "NEWS") { ! $qu = ofirst_dbquery("SELECT title, poster, date FROM ofirst_news ORDER BY ID desc LIMIT 5;"); ! while($q = ofirst_dbfetch_object($qu)) { echo("<sub><strong><a href='$home$basepath/news' target='_content' >$q->title</a></strong> - $q->poster<br>$q->date</sub><br>"); } } elseif ($sidebar == "MANUAL") { ! $qu = ofirst_dbquery("SELECT document, title FROM ofirst_manual GROUP BY document;"); ! while($q = ofirst_dbfetch_object($qu)) { echo("<sub><a href='$home$basepath/manual' target='_content'>$q->document</a> - $q->title</sub><br>"); } *************** *** 98,103 **** } } elseif ($sidebar == "AWARDS") { ! $qu = mysql_query("SELECT AwardName FROM ofirst_awards;"); ! while($q = mysql_fetch_object($qu)) { echo("<sub><a href='$home$basepath/awards' target='_content'>$q->AwardName</a></sub><br>"); } --- 98,103 ---- } } elseif ($sidebar == "AWARDS") { ! $qu = ofirst_dbquery("SELECT AwardName FROM ofirst_awards;"); ! while($q = ofirst_dbfetch_object($qu)) { echo("<sub><a href='$home$basepath/awards' target='_content'>$q->AwardName</a></sub><br>"); } |
From: <xt...@us...> - 2003-08-23 20:23:29
|
Update of /cvsroot/openfirst/manual In directory sc8-pr-cvs1:/tmp/cvs-serv13098 Modified Files: index.php Log Message: Replace mysql functions with new database functions, allowing multiple database types to be used easily. Index: index.php =================================================================== RCS file: /cvsroot/openfirst/manual/index.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** index.php 12 Aug 2003 21:01:08 -0000 1.2 --- index.php 23 Aug 2003 20:23:25 -0000 1.3 *************** *** 32,41 **** <h1>Manual</h1> <?php - mysql_select_db($sqldatabase); if(isset($_GET["chapter"]) == false && isset($_GET["id"]) == false && isset($_POST["ID"]) == false && isset($_GET["doc"]) == false) { echo("<p>The following manuals exist, and are able to be read and commented on:</p>"); ! $query = mysql_query("SELECT document FROM ofirst_manual GROUP BY document;"); ! if(mysql_num_rows($query) == 0) { echo("<p>There is currently no documentation available.</p>"); } ! while($q = mysql_fetch_object($query)) { echo($q->document); } --- 32,40 ---- <h1>Manual</h1> <?php if(isset($_GET["chapter"]) == false && isset($_GET["id"]) == false && isset($_POST["ID"]) == false && isset($_GET["doc"]) == false) { echo("<p>The following manuals exist, and are able to be read and commented on:</p>"); ! $query = ofirst_dbquery("SELECT document FROM ofirst_manual GROUP BY document;"); ! if(ofirst_dbnum_rows($query) == 0) { echo("<p>There is currently no documentation available.</p>"); } ! while($q = ofirst_dbfetch_object($query)) { echo($q->document); } *************** *** 44,49 **** echo("<h2>Table of Contents</h2>"); $query = "SELECT ID, title, chapter FROM ofirst_manual ORDER BY chapter, title WHERE document='" . $_GET["doc"] . "';"; ! $q = mysql_query($query); ! while($t = mysql_fetch_object($q)) { if($t->chapter != $lastchapter) { echo("<h3>Chapter $t->chapter</h3>"); --- 43,48 ---- echo("<h2>Table of Contents</h2>"); $query = "SELECT ID, title, chapter FROM ofirst_manual ORDER BY chapter, title WHERE document='" . $_GET["doc"] . "';"; ! $q = ofirst_dbquery($query); ! while($t = ofirst_dbfetch_object($q)) { if($t->chapter != $lastchapter) { echo("<h3>Chapter $t->chapter</h3>"); *************** *** 58,63 **** echo("<p><strong>Note Added.</strong></p>"); $query = "SELECT notes FROM ofirst_manual WHERE ID='$id';"; ! $q = mysql_query($query); ! $t = mysql_fetch_object($q); $query = "UPDATE ofirst_manual SET notes='$t->notes [note-break]<strong>" . --- 57,62 ---- echo("<p><strong>Note Added.</strong></p>"); $query = "SELECT notes FROM ofirst_manual WHERE ID='$id';"; ! $q = ofirst_dbquery($query); ! $t = ofirst_dbfetch_object($q); $query = "UPDATE ofirst_manual SET notes='$t->notes [note-break]<strong>" . *************** *** 67,71 **** $_POST["email"] . "<br /> " . $_POST["note"] . "' WHERE ID='$id' AND document='$doc';"; ! $q = mysql_query($query); } else { $id = $_GET["id"]; --- 66,70 ---- $_POST["email"] . "<br /> " . $_POST["note"] . "' WHERE ID='$id' AND document='$doc';"; ! $q = ofirst_dbquery($query); } else { $id = $_GET["id"]; *************** *** 73,78 **** $query = "SELECT * FROM ofirst_manual WHERE ID='$id' AND document='" . $doc . "';"; ! $q = mysql_query($query); ! $f = mysql_fetch_object($q); echo("<h2>$f->title</h2> <h3>$f->functionname</h3> --- 72,77 ---- $query = "SELECT * FROM ofirst_manual WHERE ID='$id' AND document='" . $doc . "';"; ! $q = ofirst_dbquery($query); ! $f = ofirst_dbfetch_object($q); echo("<h2>$f->title</h2> <h3>$f->functionname</h3> |
From: <xt...@us...> - 2003-08-23 20:23:29
|
Update of /cvsroot/openfirst/manual/setup In directory sc8-pr-cvs1:/tmp/cvs-serv13098/setup Added Files: setup.mssql Log Message: Replace mysql functions with new database functions, allowing multiple database types to be used easily. --- NEW FILE: setup.mssql --- CREATE table ofirst_manual (title TEXT, functionname TEXT, maintainer TEXT, creator TEXT, ID int(6) unsigned NOT NULL auto_increment, chapter int(3), description TEXT, notes TEXT, syntax TEXT, PRIMARY KEY (`ID`)); ALTER TABLE ofirst_manual ADD COLUMN document TEXT; UPDATE ofirst_manual SET document='1' WHERE document IS NULL; INSERT INTO ofirst_config SET modulename='manual',showonmenu='0',active='0',modulenavigation='<a href="$basepath/manual/">View Manual</a>'; |
From: <xt...@us...> - 2003-08-23 20:21:04
|
Update of /cvsroot/openfirst/guestbook/setup In directory sc8-pr-cvs1:/tmp/cvs-serv12815/setup Added Files: setup.mssql Log Message: Replace mysql functions with new database functions, allowing multiple database types to be used easily. --- NEW FILE: setup.mssql --- CREATE TABLE ofirst_guestbook (`guest` text, `email` text, `ICQ` text, `AIM` text, `MSN` text, `YIM` text, `IRC` text, `webpage` text, `location` text, `comment` text, `date` text, `deletecode` text) TYPE=MyISAM; INSERT INTO ofirst_config SET modulename='guestbook',showonmenu='0',active='0',adminnavigation='<a href="$basepath/guestbook/deleteentry.php">Delete Entry</a>',modulenavigation='<a href="$basepath/guestbook/">View Guestbook</a> | <a href="$basepath/guestbook/sign.php">Sign Guestbook</a>'; |
From: <xt...@us...> - 2003-08-23 20:21:03
|
Update of /cvsroot/openfirst/guestbook In directory sc8-pr-cvs1:/tmp/cvs-serv12815 Modified Files: deleteentry.php deleteyes.php index.php signthanks.php Log Message: Replace mysql functions with new database functions, allowing multiple database types to be used easily. Index: deleteentry.php =================================================================== RCS file: /cvsroot/openfirst/guestbook/deleteentry.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** deleteentry.php 24 Jul 2003 00:42:20 -0000 1.5 --- deleteentry.php 23 Aug 2003 20:21:00 -0000 1.6 *************** *** 39,49 **** $query = "SELECT * FROM ofirst_guestbook WHERE deletecode='$deletecode' and email='$email';"; ! $result = mysql_db_query("$sqldatabase",$query); if ($result) { ! while ($r = mysql_fetch_array($result)) { ! $date = $r["date"]; ! $email = $r["email"]; ! $deletecode = $r["deletecode"]; } ?> --- 39,49 ---- $query = "SELECT * FROM ofirst_guestbook WHERE deletecode='$deletecode' and email='$email';"; ! $result = ofirst_dbquery($query); if ($result) { ! while ($r = ofirst_dbfetch_object($result)) { ! $date = $r->date; ! $email = $r->email; ! $deletecode = $r->deletecode; } ?> Index: deleteyes.php =================================================================== RCS file: /cvsroot/openfirst/guestbook/deleteyes.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** deleteyes.php 24 Jul 2003 00:42:20 -0000 1.5 --- deleteyes.php 23 Aug 2003 20:21:00 -0000 1.6 *************** *** 39,43 **** $query = "DELETE FROM ofirst_guestbook where deletecode='$deletecode' and email='$email';"; ! $result = mysql_db_query("$sqldatabase",$query); ?> --- 39,43 ---- $query = "DELETE FROM ofirst_guestbook where deletecode='$deletecode' and email='$email';"; ! $result = ofirst_dbquery($query); ?> Index: index.php =================================================================== RCS file: /cvsroot/openfirst/guestbook/index.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** index.php 20 Aug 2003 15:33:41 -0000 1.5 --- index.php 23 Aug 2003 20:21:00 -0000 1.6 *************** *** 40,45 **** <?php - mysql_select_db("$sqldatabase"); - if(isset($_GET["perpage"]) == false || (int)$_GET["perpage"] == 0) { $_GET["perpage"] = 5; } --- 40,43 ---- *************** *** 53,65 **** $query = "SELECT * FROM ofirst_guestbook ORDER BY guest LIMIT " . $_GET["start"] . ", " . $_GET["perpage"] . ";"; ! $result = mysql_query($query); $querytotal = "SELECT * FROM ofirst_guestbook;"; ! $resulttotal = mysql_query($querytotal); ! echo("There has been a total of " . mysql_num_rows($resulttotal) . " messages posted to this guestbook."); if ($result) { ! while ($r = mysql_fetch_object($result)) { echo("<hr /><p>$r->date --- 51,63 ---- $query = "SELECT * FROM ofirst_guestbook ORDER BY guest LIMIT " . $_GET["start"] . ", " . $_GET["perpage"] . ";"; ! $result = ofirst_dbquery($query); $querytotal = "SELECT * FROM ofirst_guestbook;"; ! $resulttotal = ofirst_dbquery($querytotal); ! echo("There has been a total of " . ofirst_dbnum_rows($resulttotal) . " messages posted to this guestbook."); if ($result) { ! while ($r = ofirst_dbfetch_object($result)) { echo("<hr /><p>$r->date Index: signthanks.php =================================================================== RCS file: /cvsroot/openfirst/guestbook/signthanks.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** signthanks.php 15 Aug 2003 18:53:39 -0000 1.8 --- signthanks.php 23 Aug 2003 20:21:00 -0000 1.9 *************** *** 57,61 **** $query = "INSERT INTO ofirst_guestbook VALUES('" . $_POST["guest"] . "', '" . $_POST["email"] . "', '" . $_POST["icq"] . "', '" . $_POST["aim"] . "', '" . $_POST["msn"] . "', '" . $_POST["yim"] . "', '" . $_POST["irc"] . "', '" . $_POST["webpage"] . "', '" . $_POST["location"] . "', '" . $_POST["comment"] . "', '" . date("D M j G:i:s T Y") . "', '$deletecode');"; ! $result = mysql_db_query("$sqldatabase",$query); $message = "Someone has posted a message in your guestbook. --- 57,61 ---- $query = "INSERT INTO ofirst_guestbook VALUES('" . $_POST["guest"] . "', '" . $_POST["email"] . "', '" . $_POST["icq"] . "', '" . $_POST["aim"] . "', '" . $_POST["msn"] . "', '" . $_POST["yim"] . "', '" . $_POST["irc"] . "', '" . $_POST["webpage"] . "', '" . $_POST["location"] . "', '" . $_POST["comment"] . "', '" . date("D M j G:i:s T Y") . "', '$deletecode');"; ! $result = ofirst_dbquery($query); $message = "Someone has posted a message in your guestbook. |
From: <xt...@us...> - 2003-08-23 20:15:24
|
Update of /cvsroot/openfirst/awards In directory sc8-pr-cvs1:/tmp/cvs-serv12080 Modified Files: index.php Log Message: Replace mysql functions with new database functions Index: index.php =================================================================== RCS file: /cvsroot/openfirst/awards/index.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** index.php 23 Aug 2003 20:03:13 -0000 1.6 --- index.php 23 Aug 2003 20:15:21 -0000 1.7 *************** *** 31,35 **** // Query database for award information $query = ofirst_dbquery("SELECT * FROM ofirst_awards ORDER BY Date"); ! $amount = mysql_num_rows($query); ?> <h1>Team Awards</h1> --- 31,35 ---- // Query database for award information $query = ofirst_dbquery("SELECT * FROM ofirst_awards ORDER BY Date"); ! $amount = ofirst_dbnum_rows($query); ?> <h1>Team Awards</h1> |
From: <xt...@us...> - 2003-08-23 20:14:47
|
Update of /cvsroot/openfirst/emoticon In directory sc8-pr-cvs1:/tmp/cvs-serv11958 Modified Files: emoticonf.php Log Message: Replace mysql functions with new database functions Index: emoticonf.php =================================================================== RCS file: /cvsroot/openfirst/emoticon/emoticonf.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** emoticonf.php 23 Aug 2003 20:06:38 -0000 1.9 --- emoticonf.php 23 Aug 2003 20:14:44 -0000 1.10 *************** *** 35,39 **** $query = ofirst_dbquery("SELECT * FROM ofirst_emoticon"); ! if (mysql_num_rows($query) != 0){ while ($er = ofirst_dbfetch_object($query)) { $text = str_replace($er->emoticon, $er->substitution, $text); --- 35,39 ---- $query = ofirst_dbquery("SELECT * FROM ofirst_emoticon"); ! if (ofirst_dbnum_rows($query) != 0){ while ($er = ofirst_dbfetch_object($query)) { $text = str_replace($er->emoticon, $er->substitution, $text); *************** *** 65,69 **** $query = ofirst_dbquery("SELECT * FROM ofirst_slurblock"); ! if (mysql_num_rows($query) != 0){ while ($er = ofirst_dbfetch_object($query)) { $text = str_replace($er->slur, $er->substitution, $text); --- 65,69 ---- $query = ofirst_dbquery("SELECT * FROM ofirst_slurblock"); ! if (ofirst_dbnum_rows($query) != 0){ while ($er = ofirst_dbfetch_object($query)) { $text = str_replace($er->slur, $er->substitution, $text); |
From: <xt...@us...> - 2003-08-23 20:13:23
|
Update of /cvsroot/openfirst/feedback/admin In directory sc8-pr-cvs1:/tmp/cvs-serv11766/admin Modified Files: index.php Log Message: Add support for multiple database types Index: index.php =================================================================== RCS file: /cvsroot/openfirst/feedback/admin/index.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** index.php 29 Jul 2003 15:04:19 -0000 1.3 --- index.php 23 Aug 2003 20:13:19 -0000 1.4 *************** *** 32,36 **** echo("<p>The feedback users have been modified as per your request.</p>"); // Delete current users, as they will all be replaced with new users. ! $query = mysql_query("DELETE FROM ofirst_feedbackusers;"); $line = explode("\n", $_POST["feedbackusers"]); foreach ($line as $lin) { --- 32,36 ---- echo("<p>The feedback users have been modified as per your request.</p>"); // Delete current users, as they will all be replaced with new users. ! $query = ofirst_dbquery("DELETE FROM ofirst_feedbackusers;"); $line = explode("\n", $_POST["feedbackusers"]); foreach ($line as $lin) { *************** *** 39,43 **** if(trim($fname) != "" && trim($femail) != "") { // Create the new users for the feedback list ! $query = mysql_query("INSERT INTO ofirst_feedbackusers (name, email) VALUES ('$fname', '$femail');"); } } --- 39,43 ---- if(trim($fname) != "" && trim($femail) != "") { // Create the new users for the feedback list ! $query = ofirst_dbquery("INSERT INTO ofirst_feedbackusers (name, email) VALUES ('$fname', '$femail');"); } } *************** *** 51,59 **** "); ! $query = mysql_query("SELECT * FROM ofirst_feedbackusers ORDER BY name;"); ! if (mysql_num_rows($query) != 0){ echo("<textarea name='feedbackusers' rows='10' cols='50'>"); ! while($feedback = mysql_fetch_object($query)){ echo("$feedback->email$feedback->name\n"); } --- 51,59 ---- "); ! $query = ofirst_dbquery("SELECT * FROM ofirst_feedbackusers ORDER BY name;"); ! if (ofirst_dbnum_rows($query) != 0){ echo("<textarea name='feedbackusers' rows='10' cols='50'>"); ! while($feedback = ofirst_dbfetch_object($query)){ echo("$feedback->email$feedback->name\n"); } |
From: <xt...@us...> - 2003-08-23 20:13:23
|
Update of /cvsroot/openfirst/feedback/setup In directory sc8-pr-cvs1:/tmp/cvs-serv11766/setup Added Files: setup.mssql Log Message: Add support for multiple database types --- NEW FILE: setup.mssql --- CREATE TABLE ofirst_feedbackusers (name CHAR(150) UNIQUE NOT NULL, email CHAR(50) UNIQUE NOT NULL); INSERT INTO ofirst_config SET modulename='feedback',showonmenu='0',active='0',adminnavigation='<a href="$basepath/feedback/admin/">Manage Feedback Users</a>',modulenavigation='<a href="$basepath/feedback/">Give Feedback</a>'; |
From: <xt...@us...> - 2003-08-23 20:13:22
|
Update of /cvsroot/openfirst/feedback In directory sc8-pr-cvs1:/tmp/cvs-serv11766 Modified Files: index.php Log Message: Add support for multiple database types Index: index.php =================================================================== RCS file: /cvsroot/openfirst/feedback/index.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** index.php 27 Jul 2003 20:58:12 -0000 1.4 --- index.php 23 Aug 2003 20:13:19 -0000 1.5 *************** *** 31,40 **** echo("<h1>Feedback</h1>"); - mysql_select_db($sqldatabase,$sqlconnection); - // Get a list of the users able to be contacted via the feedback form. ! $query = mysql_query("SELECT * FROM ofirst_feedbackusers ORDER BY name;"); ! if (mysql_num_rows($query) != 0){ if(isset($_POST["to"]) == true) { $messageallowed = false; --- 31,38 ---- echo("<h1>Feedback</h1>"); // Get a list of the users able to be contacted via the feedback form. ! $query = ofirst_dbquery("SELECT * FROM ofirst_feedbackusers ORDER BY name;"); ! if (ofirst_dbnum_rows($query) != 0){ if(isset($_POST["to"]) == true) { $messageallowed = false; *************** *** 46,50 **** <?php } ! while($feedback = mysql_fetch_object($query)){ if(! isset($_POST["to"])) { echo("<option value='$feedback->email'>$feedback->name</option>"); --- 44,48 ---- <?php } ! while($feedback = ofirst_dbfetch_object($query)){ if(! isset($_POST["to"])) { echo("<option value='$feedback->email'>$feedback->name</option>"); |
From: <xt...@us...> - 2003-08-23 20:10:15
|
Update of /cvsroot/openfirst/base/config In directory sc8-pr-cvs1:/tmp/cvs-serv11273 Modified Files: dbase.php Log Message: Add ofirst_dbnum_rows() function Index: dbase.php =================================================================== RCS file: /cvsroot/openfirst/base/config/dbase.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dbase.php 23 Aug 2003 19:54:34 -0000 1.1 --- dbase.php 23 Aug 2003 20:10:12 -0000 1.2 *************** *** 142,144 **** --- 142,161 ---- exit(0); } + + function ofirst_dbnum_rows($resource) { + global $dbasetype; + if($dbasetype == "mysql") { + if(function_exists("mysql_num_rows") == false) { + die("MySQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable MySQL support, or choose another database type."); + } + return(mysql_num_rows($resource)); + } elseif($dbasetype == "mssql") { + if(function_exists("mssql_num_rows") == false) { + die("Microsoft SQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable Microsoft SQL support, or choose another database type."); + } + return(mssql_num_rows($resource)); + } + + exit(0); + } ?> |
From: <xt...@us...> - 2003-08-23 20:06:41
|
Update of /cvsroot/openfirst/emoticon In directory sc8-pr-cvs1:/tmp/cvs-serv10717 Modified Files: emoticonf.php Log Message: Add support for multiple database types Index: emoticonf.php =================================================================== RCS file: /cvsroot/openfirst/emoticon/emoticonf.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** emoticonf.php 19 Aug 2003 22:44:39 -0000 1.8 --- emoticonf.php 23 Aug 2003 20:06:38 -0000 1.9 *************** *** 33,40 **** function emoticon_translate ($text) { ! $query = mysql_query("SELECT * FROM ofirst_emoticon"); if (mysql_num_rows($query) != 0){ ! while ($er = mysql_fetch_object($query)) { $text = str_replace($er->emoticon, $er->substitution, $text); } --- 33,40 ---- function emoticon_translate ($text) { ! $query = ofirst_dbquery("SELECT * FROM ofirst_emoticon"); if (mysql_num_rows($query) != 0){ ! while ($er = ofirst_dbfetch_object($query)) { $text = str_replace($er->emoticon, $er->substitution, $text); } *************** *** 50,56 **** function emoticon_preview ($limit = 5, $start = 0) { global $basepath; ! $query = mysql_query("SELECT * FROM ofirst_emoticon LIMIT $start,$limit"); echo "<table><th>Emoticons</th><th></th>"; ! while ($emot = mysql_fetch_object($query)) { echo "<tr><td>".$emot->substitution."</td><td>".$emot->emoticon."</td></tr>"; } --- 50,56 ---- function emoticon_preview ($limit = 5, $start = 0) { global $basepath; ! $query = ofirst_dbquery("SELECT * FROM ofirst_emoticon LIMIT $start,$limit"); echo "<table><th>Emoticons</th><th></th>"; ! while ($emot = ofirst_dbfetch_object($query)) { echo "<tr><td>".$emot->substitution."</td><td>".$emot->emoticon."</td></tr>"; } *************** *** 63,70 **** function slur_block ($text) { ! $query = mysql_query("SELECT * FROM ofirst_slurblock"); if (mysql_num_rows($query) != 0){ ! while ($er = mysql_fetch_object($query)) { $text = str_replace($er->slur, $er->substitution, $text); } --- 63,70 ---- function slur_block ($text) { ! $query = ofirst_dbquery("SELECT * FROM ofirst_slurblock"); if (mysql_num_rows($query) != 0){ ! while ($er = ofirst_dbfetch_object($query)) { $text = str_replace($er->slur, $er->substitution, $text); } |
From: <xt...@us...> - 2003-08-23 20:03:23
|
Update of /cvsroot/openfirst/awards/admin In directory sc8-pr-cvs1:/tmp/cvs-serv10278/admin Modified Files: index.php Log Message: Add support for multiple database types Index: index.php =================================================================== RCS file: /cvsroot/openfirst/awards/admin/index.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** index.php 23 Jul 2003 21:08:37 -0000 1.6 --- index.php 23 Aug 2003 20:03:13 -0000 1.7 *************** *** 35,39 **** // If user has posted delete then delete specified record in querystring DELETE if (ISSET($_GET['DELETE'])){ ! mysql_query("DELETE FROM ofirst_awards WHERE ID = '".$_GET['DELETE']."'") or die("DELETE: ".mysql_error()); echo("<p>Award information has been deleted. [ <a href='./'>Manage Award</a> ]</p>"); --- 35,39 ---- // If user has posted delete then delete specified record in querystring DELETE if (ISSET($_GET['DELETE'])){ ! ofirst_dbquery("DELETE FROM ofirst_awards WHERE ID = '".$_GET['DELETE']."'") or die("DELETE: ".mysql_error()); echo("<p>Award information has been deleted. [ <a href='./'>Manage Award</a> ]</p>"); *************** *** 43,47 **** // If user has posted create then insert new award record if (ISSET($_POST['create'])){ ! mysql_query("INSERT INTO ofirst_awards (AwardName,Event,Date,Image,Recipient) values( '".$_POST['award']."', '".$_POST['event']."', '".$_POST['date']. "', '".$_POST['type']."', '".$_POST['recipient']."')") --- 43,47 ---- // If user has posted create then insert new award record if (ISSET($_POST['create'])){ ! ofirst_dbquery("INSERT INTO ofirst_awards (AwardName,Event,Date,Image,Recipient) values( '".$_POST['award']."', '".$_POST['event']."', '".$_POST['date']. "', '".$_POST['type']."', '".$_POST['recipient']."')") *************** *** 55,59 **** if (ISSET($_POST['modify'])){ ! mysql_query("UPDATE ofirst_awards SET AwardName='".$_POST['award']."', Event = '".$_POST['event']."', Date = '".$_POST['date'] . "', --- 55,59 ---- if (ISSET($_POST['modify'])){ ! ofirst_dbquery("UPDATE ofirst_awards SET AwardName='".$_POST['award']."', Event = '".$_POST['event']."', Date = '".$_POST['date'] . "', *************** *** 69,73 **** // If the user has elected to modify an award, fill the form with those details. if(isset($_GET["MODIFY"])) { ! $award = mysql_fetch_object(mysql_query("SELECT * FROM ofirst_awards WHERE ID='" . $_GET["MODIFY"] . "';")); } else { $award = ""; --- 69,73 ---- // If the user has elected to modify an award, fill the form with those details. if(isset($_GET["MODIFY"])) { ! $award = ofirst_dbfetch_object(ofirst_dbquery("SELECT * FROM ofirst_awards WHERE ID='" . $_GET["MODIFY"] . "';")); } else { $award = ""; *************** *** 159,164 **** <?php // Loop through awards ordered by date ! $query = mysql_query("SELECT * FROM ofirst_awards ORDER BY Date"); ! while($awards = mysql_fetch_object($query)){ ?> <tr> --- 159,164 ---- <?php // Loop through awards ordered by date ! $query = ofirst_dbquery("SELECT * FROM ofirst_awards ORDER BY Date"); ! while($awards = ofirst_dbfetch_object($query)){ ?> <tr> |
From: <xt...@us...> - 2003-08-23 20:03:23
|
Update of /cvsroot/openfirst/awards/setup In directory sc8-pr-cvs1:/tmp/cvs-serv10278/setup Added Files: setup.mssql Log Message: Add support for multiple database types --- NEW FILE: setup.mssql --- CREATE TABLE `ofirst_awards` (`ID` int(6) unsigned NOT NULL auto_increment, `AwardName` tinytext, `Event` tinytext, `Date` date default NULL, `Recipient` tinytext, `Image` tinytext, PRIMARY KEY (`ID`)) TYPE=MyISAM; INSERT INTO ofirst_config SET modulename='awards',showonmenu='0',active='0',adminnavigation='<a href="$basepath/awards/admin/">Manage Awards</a>',modulenavigation='<a href="$basepath/awards/">View Awards</a>'; |
From: <xt...@us...> - 2003-08-23 20:03:19
|
Update of /cvsroot/openfirst/awards In directory sc8-pr-cvs1:/tmp/cvs-serv10278 Modified Files: index.php Log Message: Add support for multiple database types Index: index.php =================================================================== RCS file: /cvsroot/openfirst/awards/index.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** index.php 27 Jun 2003 23:16:06 -0000 1.5 --- index.php 23 Aug 2003 20:03:13 -0000 1.6 *************** *** 28,35 **** include("../config/globals.php"); include($header); - mysql_select_db($sqldatabase,$sqlconnection); // Query database for award information ! $query = mysql_query("SELECT * FROM ofirst_awards ORDER BY Date"); $amount = mysql_num_rows($query); ?> --- 28,34 ---- include("../config/globals.php"); include($header); // Query database for award information ! $query = ofirst_dbquery("SELECT * FROM ofirst_awards ORDER BY Date"); $amount = mysql_num_rows($query); ?> *************** *** 50,54 **** <?php // Loop through awards ordered by date ! while($awards = mysql_fetch_object($query)){ ?> <tr> --- 49,53 ---- <?php // Loop through awards ordered by date ! while($awards = ofirst_dbfetch_object($query)){ ?> <tr> |
From: <xt...@us...> - 2003-08-23 19:54:37
|
Update of /cvsroot/openfirst/base/config In directory sc8-pr-cvs1:/tmp/cvs-serv9363 Modified Files: first.php Added Files: dbase.php Log Message: Add new database wrappers which will allow Microsoft SQL Support --- NEW FILE: dbase.php --- <?php /* * openFIRST.base - config/functions/dbase.php * * Copyright (C) 2003, * openFIRST Project * Original Author: Tim Ginn <tim...@po...> * * 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 * */ // Purpose: Provide database functionality so that each module is // able to easily switch between, say, MySQL and MSSQL databases // without having to be completely rewritten or released as two // different versions. if(isset($dbasetype) == false) { $dbasetype = "mysql"; } // Wrapper for database selection. function ofirst_dbconnect($server = "", $username = "", $password = "", $newlink = "", $intclientflags = "") { global $dbasetype; if($dbasetype == "mysql") { if(function_exists("mysql_connect") == false) { die("MySQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable MySQL support, or choose another database type."); } if($intclientflags != "") { return(mysql_connect($server, $username, $password, $newlink, $intclientflags)); } elseif($newlink != "") { return(mysql_connect($server, $username, $password, $newlink)); } else { return(mysql_connect($server, $username, $password)); } } elseif ($dbasetype == "mssql") { if(function_exists("mssql_connect") == false) { die("Microsoft SQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable Microsoft SQL support, or choose another database type."); } return(mssql_connect($server, $username, $password)); } exit; } function ofirst_select_db($databasename, $linkidentifier) { global $dbasetype; if($dbasetype == "mysql") { if(function_exists("mysql_select_db") == false) { die("MySQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable MySQL support, or choose another database type."); } if($linkidentifier != "") { return(mysql_select_db($databasename, $linkidentifier)); } else { return(mysql_select_db($databasename)); } } elseif ($dbasetype == "mssql") { if(function_exists("mssql_select_db") == false) { die("Microsoft SQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable Microsoft SQL support, or choose another database type."); } if($linkidentifier != "") { return(mysql_select_db($databasename, $linkidentifier)); } else { return(mysql_select_db($databasename)); } } exit; } function ofirst_dberrno($linkidentifier = "") { global $dbasetype; if($dbasetype == "mysql") { if(function_exists("mysql_errno") == false) { die("MySQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable MySQL support, or choose another database type."); } if($linkidentifier != "") { return(mysql_errno($linkidentifier)); } else { return(mysql_errno()); } } elseif ($dbasetype == "mssql") { if(function_exists("mssql_connect") == false) { die("Microsoft SQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable Microsoft SQL support, or choose another database type."); } return(0); } exit; } function ofirst_dbquery($string, $linkidentifier = "", $batchsize = "") { global $dbasetype; if($dbasetype == "mysql") { if(function_exists("mysql_query") == false) { die("MySQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable MySQL support, or choose another database type."); } if($linkidentifier != "") { return(mysql_query($string, $linkidentifier)); } else { return(mysql_query($string)); } } elseif($dbasetype == "mssql") { if(function_exists("mssql_query") == false) { die("Microsoft SQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable Microsoft SQL support, or choose another database type."); } if($batchsize != "") { return(mssql_query($string, $linkidentifier, $batchsize)); } elseif($linkidentifier != "") { return(mssql_query($string, $linkidentifier)); } else { return(mssql_query($string)); } } exit(0); } function ofirst_dbfetch_object($resource) { global $dbasetype; if($dbasetype == "mysql") { if(function_exists("mysql_fetch_object") == false) { die("MySQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable MySQL support, or choose another database type."); } return(mysql_fetch_object($resource)); } elseif($dbasetype == "mssql") { if(function_exists("mssql_query") == false) { die("Microsoft SQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable Microsoft SQL support, or choose another database type."); } return(mssql_fetch_object($resource)); } exit(0); } ?> Index: first.php =================================================================== RCS file: /cvsroot/openfirst/base/config/first.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** first.php 20 Aug 2003 14:40:09 -0000 1.19 --- first.php 23 Aug 2003 19:54:34 -0000 1.20 *************** *** 51,59 **** --- 51,62 ---- * database, in the ofirst_config table. */ + \$dbasetype = \"" . $_POST["dbasetype"] . "\"; \$ostype = '" . $_POST["ostype"] . "'; if (\$ostype == \"windows\") { ini_set(\"include_path\",\"../config/;.\"); + include('dbase.php'); } else { ini_set(\"include_path\",\"../config/:.\"); + include('dbase.php'); } \$title = '" . $_POST["title"] . "'; *************** *** 63,70 **** \$sqlpassword = '" . $_POST["sqlpassword"] . "'; \$sqldatabase = '" . $_POST["sqldatabase"] . "'; ! if(function_exists(\"mysql_connect\") == false) { die(\"Your version of PHP has not been compiled with MySQL support, therefore the openFIRST web portal system cannot run on this system. Please contact your system administrator to request MySQL support for your version of PHP.\"); } ! \$sqlconnection = mysql_connect(\"\$sqlserver\",\"\$sqluser\",\"\$sqlpassword\"); \$home = '" . $_POST["home"] . "'; --- 66,73 ---- \$sqlpassword = '" . $_POST["sqlpassword"] . "'; \$sqldatabase = '" . $_POST["sqldatabase"] . "'; ! if(function_exists(\"ofirst_dbconnect\") == false) { die(\"Your version of PHP has not been compiled with MySQL support, therefore the openFIRST web portal system cannot run on this system. Please contact your system administrator to request MySQL support for your version of PHP.\"); } ! \$sqlconnection = ofirst_dbconnect(\"\$sqlserver\",\"\$sqluser\",\"\$sqlpassword\"); \$home = '" . $_POST["home"] . "'; *************** *** 103,113 **** \$headers = \"\"; ! mysql_select_db(\$sqldatabase, \$sqlconnection); ! \$incl = mysql_query(\"SELECT * FROM ofirst_config\"); // If there is no error then run the module add feature ! if(mysql_errno() == 0) { // Begin to loop through modules from the databaes ! while(\$module = mysql_fetch_object(\$incl)) { // Check if the value is try, if it is then run an include if( (bool) \$module->active == true) { --- 106,116 ---- \$headers = \"\"; ! ofirst_select_db(\$sqldatabase, \$sqlconnection); ! \$incl = ofirst_dbquery(\"SELECT * FROM ofirst_config\"); // If there is no error then run the module add feature ! if(ofirst_dberrno() == 0) { // Begin to loop through modules from the databaes ! while(\$module = ofirst_dbfetch_object(\$incl)) { // Check if the value is try, if it is then run an include if( (bool) \$module->active == true) { *************** *** 199,208 **** </select> (UNIX includes variants, such as Linux, Mac OS X, and BeOS) </td></tr> <tr><td>Title of Software</td><td><input type="text" name="title" value="openFIRST" /></td></tr> <tr><td>Version of Software</td><td><input type="text" name="version" value="CVS" /></td></tr> ! <tr><td>MySQL Server Address</td><td><input type="text" name="sqlserver" value="localhost" /></td></tr> ! <tr><td>MySQL User Name</td><td><input type="text" name="sqluser" value="sqluser" /></td></tr> ! <tr><td>MySQL User Password</td><td><input type="password" name="sqlpassword" /></td></tr> ! <tr><td>MySQL Database Name (this database must already exist, it will not be automatically created)</td><td><input type="text" name="sqldatabase" value="openfirst" /></td></tr> <tr><td>Home site (the address scripts will use for linking to your main page)</td><td> <input type="text" name="home" value="http://openfirst.sourceforge.net"></td></tr> --- 202,215 ---- </select> (UNIX includes variants, such as Linux, Mac OS X, and BeOS) </td></tr> + <tr><td>Database Type</td><td><select name="dbasetype"> + <option value="mysql" selected="selected">MySQL</option> + <option value="mssql">Microsoft SQL</option> + </select> <tr><td>Title of Software</td><td><input type="text" name="title" value="openFIRST" /></td></tr> <tr><td>Version of Software</td><td><input type="text" name="version" value="CVS" /></td></tr> ! <tr><td>Database Server Address</td><td><input type="text" name="sqlserver" value="localhost" /></td></tr> ! <tr><td>Database User Name</td><td><input type="text" name="sqluser" value="sqluser" /></td></tr> ! <tr><td>Database User Password</td><td><input type="password" name="sqlpassword" /></td></tr> ! <tr><td>Database Name (this database must already exist, it will not be automatically created)</td><td><input type="text" name="sqldatabase" value="openfirst" /></td></tr> <tr><td>Home site (the address scripts will use for linking to your main page)</td><td> <input type="text" name="home" value="http://openfirst.sourceforge.net"></td></tr> |
From: <dav...@us...> - 2003-08-22 22:53:43
|
Update of /cvsroot/openfirst/photogallery In directory sc8-pr-cvs1:/tmp/cvs-serv664 Modified Files: comment.PNG Log Message: Changed image to have white background. Index: comment.PNG =================================================================== RCS file: /cvsroot/openfirst/photogallery/comment.PNG,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsDYJtJa and /tmp/cvsWZmmib differ |
From: <xt...@us...> - 2003-08-22 21:20:17
|
Update of /cvsroot/openfirst/photogallery In directory sc8-pr-cvs1:/tmp/cvs-serv12477 Modified Files: viewphoto.php Log Message: Fix missing ) errors Index: viewphoto.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/viewphoto.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** viewphoto.php 22 Aug 2003 15:49:12 -0000 1.7 --- viewphoto.php 22 Aug 2003 16:27:47 -0000 1.8 *************** *** 170,175 **** ?></td> <td width="67%"> ! <?php if(function_exists("slur_block") { $comment = slur_block($comment->Comment); } ! if(function_exists("emoticon_translate") { $comment = emoticon_translate($comment->Comment); } echo ($comment->Comment); ?> </td> --- 170,175 ---- ?></td> <td width="67%"> ! <?php if(function_exists("slur_block")) { $comment = slur_block($comment->Comment); } ! if(function_exists("emoticon_translate")) { $comment = emoticon_translate($comment->Comment); } echo ($comment->Comment); ?> </td> |
Update of /cvsroot/openfirst/photogallery/admin In directory sc8-pr-cvs1:/tmp/cvs-serv11940 Modified Files: cleargallery.php edit.php editphoto.php galleryglobals.php index.php makethumb.php newgallery.php preview.php upload.php Log Message: Make auditing changes (mainly small things, like header info, tabs instead of spaces, etc.) Index: cleargallery.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/admin/cleargallery.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** cleargallery.php 22 Aug 2003 14:58:04 -0000 1.4 --- cleargallery.php 22 Aug 2003 16:24:42 -0000 1.5 *************** *** 1,5 **** <?php /* ! * openFIRST.photogallery - cleargallery.php * * Copyright (C) 2003, --- 1,5 ---- <?php /* ! * openFIRST.photogallery - admin/cleargallery.php * * Copyright (C) 2003, *************** *** 33,37 **** // Check if user is an admin then allow processes ! if(! ISSET($user->user)){ showlogin(); die(include($footer)); --- 33,37 ---- // Check if user is an admin then allow processes ! if(! isset($user->user)){ showlogin(); die(include($footer)); *************** *** 41,74 **** $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 - - if (ISSET($_GET['CONFIRM'])){ - - $dirlocate = "../".$gallerydir.$gallery->GalleryName; - $dir = opendir($dirlocate); ! // Run through the files in the current folder ! while(! (($file = readdir($dir) === false)){ ! // Delete file and its thumbs in the folder ! if (is_file($dirlocate."/".$file)){ ! unlink($dirlocate."/".$file); ! if (file_exists($dirlocate."/thumbs/".$file)){ ! unlink($dirlocate."/thumbs/".$file); ! } ! } ! echo "<br><br><center>The <b>".$gallery->GalleryName."</b> gallery has been reset. [ <a href='index.php'>Manage</a> ]<br><br>"; ! die(include($footer)); ! } } - ! ?> <br><br><br> <br> ! 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><br><br><br><br><br> <?php include($footer); ?> --- 41,70 ---- $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 ! if (isset($_GET['CONFIRM'])){ ! $dirlocate = "../".$gallerydir.$gallery->GalleryName; ! $dir = opendir($dirlocate); ! // Run through the files in the current folder ! while(! (($file = readdir($dir) === false)){ ! // Delete file and its thumbs in the folder ! if (is_file($dirlocate."/".$file)){ ! unlink($dirlocate."/".$file); ! if (file_exists($dirlocate."/thumbs/".$file)){ ! unlink($dirlocate."/thumbs/".$file); ! } ! } ! echo "<br><br><center>The <b>".$gallery->GalleryName."</b> gallery has been reset. [ <a href='index.php'>Manage</a> ]<br><br>"; ! die(include($footer)); ! } } ! ! ?><p> 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); ?> Index: edit.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/admin/edit.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** edit.php 22 Aug 2003 14:58:04 -0000 1.4 --- edit.php 22 Aug 2003 16:24:43 -0000 1.5 *************** *** 1,5 **** <?php /* ! * openFIRST.photogallery - edit.php * * Copyright (C) 2003, --- 1,5 ---- <?php /* ! * openFIRST.photogallery - admin/edit.php * * Copyright (C) 2003, *************** *** 33,49 **** // Check if user is an admin then allow processes ! if(! ISSET($user->user)){ showlogin(); die(include($footer)); } ! // Check if user initiated delete and run delete process if(ISSET($_GET['DELETE']) == true && isset($_GET["CONFIRMED"]) == false) { echo("<p>Are you absolutely sure you want to delete this gallery? All pictures in the gallery will be removed from the server.</p> <a href='edit.php?DELETE=" . $_GET["DELETE"] . "&CONFIRMED=1'>Yes, I am sure</a> <a href='edit.php'>No, I've changed my mind</a>"); 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 function deldir($dir){ --- 33,49 ---- // Check if user is an admin then allow processes ! if(! ISSET($user->user) || $user->membertype != "administrator"){ showlogin(); die(include($footer)); } ! // Check if user initiated delete and run delete process if(ISSET($_GET['DELETE']) == true && isset($_GET["CONFIRMED"]) == false) { echo("<p>Are you absolutely sure you want to delete this gallery? All pictures in the gallery will be removed from the server.</p> <a href='edit.php?DELETE=" . $_GET["DELETE"] . "&CONFIRMED=1'>Yes, I am sure</a> <a href='edit.php'>No, I've changed my mind</a>"); 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 function deldir($dir){ *************** *** 56,61 **** } } ! ! // Close the directory for future reading closedir($current_dir); rmdir(${dir}); --- 56,61 ---- } } ! ! // Close the directory for future reading closedir($current_dir); rmdir(${dir}); *************** *** 72,105 **** } ! 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)); } ! // 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> ]"); ! ! // If the file exists then delete the image and its thumbs ! 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='index.php'>Manage</a> ]"); die("<br><br><center>The photo and its thumbnail have been deleted! [ <a href='index.php?ID=".$_GET['ID']."'>Manage</a> ]</center>"); ! }else{ ! die("<br><br><center>The photo has been deleted! [ <a href='index.php?ID=".$_GET['ID']."'>Manage</a> ]</center>"); ! } } ! // Get information above the gallery $query = mysql_query("SELECT * FROM ofirst_photogallery_galleries WHERE ID = '".$_GET['ID']."'"); $gallery = mysql_fetch_object($query); ! ?> <h2>Edit Gallery</h2> ! <em><?php echo $gallery->GalleryName; ?></em> Options -<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> --- 72,105 ---- } ! 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)); } ! // 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> ]"); ! ! // If the file exists then delete the image and its thumbs ! 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='index.php'>Manage</a> ]"); die("<br><br><center>The photo and its thumbnail have been deleted! [ <a href='index.php?ID=".$_GET['ID']."'>Manage</a> ]</center>"); ! } else { ! die("<br><br><center>The photo has been deleted! [ <a href='index.php?ID=".$_GET['ID']."'>Manage</a> ]</center>"); ! } } ! // Get information above the gallery $query = mysql_query("SELECT * FROM ofirst_photogallery_galleries WHERE ID = '".$_GET['ID']."'"); $gallery = mysql_fetch_object($query); ! ?> <h2>Edit Gallery</h2> ! <em><?php echo $gallery->GalleryName; ?></em> Options -<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> *************** *** 108,116 **** <table width="388" align="center"> ! <tr> ! <th width="48" valign="top"> <div align="center"> </div></th> ! <th width="149"><strong>Photo Name </strong></th> ! <th width="87"><strong>Thumbnail</strong></th> ! <th width="84"><strong>Option</strong></th> </tr> <?php --- 108,116 ---- <table width="388" align="center"> ! <tr> ! <th width="48"></th> ! <th width="149">Photo Name</th> ! <th width="87">Thumbnail</th> ! <th width="84">Option</th> </tr> <?php *************** *** 127,144 **** ?> ! <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 // Check if the file exists then print if it has a thumb or not ! if (file_exists($dirlocate."/thumbs/".$file)){ ! echo "Yes"; ! }else{ ! echo "No"; ! } ! ?> </td> <td valign="top">[ <a href="editphoto.php?ID=<?php echo $_GET['ID']; ?>&PHOTO=<?php echo $file; ?>">Edit</a> ]<br> --- 127,144 ---- ?> ! <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 // Check if the file exists then print if it has a thumb or not ! if (file_exists($dirlocate."/thumbs/".$file)){ ! echo "Yes"; ! } else { ! echo "No"; ! } ! ?> </td> <td valign="top">[ <a href="editphoto.php?ID=<?php echo $_GET['ID']; ?>&PHOTO=<?php echo $file; ?>">Edit</a> ]<br> *************** *** 149,156 **** } } ! // If there is no record then preview no photos message if($num == 0){ ! echo "<tr><td> </td><td><br>No photos in gallery!<br><br></td><td> </td><td> </td></tr>"; } ?> --- 149,156 ---- } } ! // If there is no record then preview no photos message if($num == 0){ ! echo "<tr><td> </td><td><br>No photos in gallery!<br><br></td><td> </td><td> </td></tr>"; } ?> *************** *** 161,163 **** <br> </center> ! <?php include($footer); ?> --- 161,163 ---- <br> </center> ! <?php include($footer); ?> \ No newline at end of file Index: editphoto.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/admin/editphoto.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** editphoto.php 22 Aug 2003 14:58:04 -0000 1.2 --- editphoto.php 22 Aug 2003 16:24:43 -0000 1.3 *************** *** 1,5 **** <?php /* ! * openFIRST.photogallery - edit.php * * Copyright (C) 2003, --- 1,5 ---- <?php /* ! * openFIRST.photogallery - admin/editphoto.php * * Copyright (C) 2003, *************** *** 33,37 **** // Check if user is an admin then allow processes ! if(! ISSET($user->user)){ showlogin(); die(include($footer)); --- 33,37 ---- // Check if user is an admin then allow processes ! if(! isset($user->user) || $user->membertype != "administrator"){ showlogin(); die(include($footer)); *************** *** 45,49 **** 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 $textfile = substr($_GET['PHOTO'],0,-4).".txt"; --- 45,49 ---- 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 $textfile = substr($_GET['PHOTO'],0,-4).".txt"; *************** *** 51,170 **** $file = fopen("../gallery/$gallery->GalleryName/".$textfile,'r'); $description = ""; ! while(! feof($file)){ $line = fgets($file,1024); $description .= $line."<br>"; } ! fclose($file); } // Check if user initiated delete and run delete process ! if(ISSET($_POST['update'])){ ! ! // Check to see if the user wants to update with the textfile or the posted description ! if(! ISSET($_POST['txtupdate'])){ ! $description = $_POST['description']; ! } ! ! 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()); ! } ! ! // Delete the textfile that goes with the actual image ! if(ISSET($_POST['deletefile'])){ ! $textfile = substr($_GET['PHOTO'],0,-4).".txt"; ! unlink("../gallery/$gallery->GalleryName/".$textfile); ! echo "<br><br>Image information updated. Relating text file has been deleted in the process!"; ! }else{ ! echo "<br><br>Image information updated."; ! } ! echo " [ <a href='editphoto.php?ID=".$_GET['ID']."&PHOTO=".$_GET['PHOTO']."'>Manage</a> ]<br><br>"; ! die(include($footer)); } ! // 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)); } ! ?> <h2>Edit Gallery</h2> <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> ! | <a href="edit.php?DELETE=<?php echo $_GET['ID']; ?>">Delete Gallery</a> (Must be empty to perform operation)</p> <p align="center"><img src="../gallery/<?php echo $gallery->GalleryName; ?>/<?php echo $_GET['PHOTO']; ?>" width="300" height="225"><br> <br>[ <a href="makethumb.php?ID=<?php echo $_GET['ID']; ?>&PHOTO=<?php echo $_GET['PHOTO']; ?>">Make Thumbnail</a> ]</p> <form action='editphoto.php?ID=<?php echo $_GET['ID']; ?>&PHOTO=<?php echo $_GET['PHOTO']; ?>' method='POST'> ! <table width="456" align="center"> ! <tr> ! <th width="101" valign="top"> <div align="center"> </div></th> ! <th width="275"><strong>Photo Information</strong></th> </tr> ! <tr> ! <td valign="top"><div align="right"><strong>File Name:</strong></div></td> ! <td valign="top"><?php echo $_GET['PHOTO']; ?></td> </tr> ! <tr> ! <td valign="top"><div align="right"><strong>Photo Name:</strong></div></td> ! <td valign="top"><input name="imagename" type="text" id="imagename" value="<?php if(ISSET($image->ImageName)){ echo $image->ImageName; } ?>" size="30"></td> </tr> ! <tr> ! <td valign="top"><div align="right"><strong>Date:</strong></div></td> ! <td valign="top"><input name="date" type="text" id="date" value="<?php if(ISSET($image->Dates)){ echo $image->Dates; }else{ echo date("F j, Y, g:i a",time()); } ?>" size="30"></td> </tr> ! <tr> ! <td valign="top"> <div align="right"><strong>Description:</strong></div></td> ! <td valign="top"> <textarea name="description" cols="40" rows="10" id="description"><?php echo $image->Description; ?></textarea> </td> </tr> ! <?php if(ISSET($description)){ ?> ! <tr> ! <td valign="top"> </td> ! <td valign="top"><table width="85%" bordercolor="#000000"> ! <tr> <th><div align="center">Text File Found</div></th> </tr> ! <tr> <td><?php echo $description; ?></td> </tr> </table></td> </tr> ! <tr> ! <td valign="top"><div align="right"> ! <input name="txtupdate" type="checkbox" id="deletefile5" value="checkbox"> ! </div></td> ! <td valign="top">Use description from .txt file in updating the image description. The .txt contets are in the above table.</td> </tr> ! <tr> ! <td valign="top"><div align="right"> ! <input name="deletefile" type="checkbox" id="deletefile4" value="checkbox"> ! </div></td> ! <td valign="top">Delete .txt file after adding this description to the image.</td> </tr> ! <?php } ?> ! <tr> ! <td valign="top"> </td> ! <td valign="top"> <input name='update' type='submit' id='update' value='Update Image Info'> ! <input name='deleteall' type='submit' id='update3' value='Delete Description'> </td> </tr> </table> ! </form><br><br> ! <?php include($footer); ?> --- 51,168 ---- $file = fopen("../gallery/$gallery->GalleryName/".$textfile,'r'); $description = ""; ! while(! feof($file)){ $line = fgets($file,1024); $description .= $line."<br>"; } ! fclose($file); } // Check if user initiated delete and run delete process ! if(isset($_POST['update'])){ ! // Check to see if the user wants to update with the textfile or the posted description ! if(! isset($_POST['txtupdate'])){ ! $description = $_POST['description']; ! } + 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'])){ + // Delete the textfile that goes with the actual image + $textfile = substr($_GET['PHOTO'],0,-4).".txt"; + unlink("../gallery/$gallery->GalleryName/".$textfile); + echo "<br><br>Image information updated. Relating text file has been deleted in the process!"; + } else { + echo "<br><br>Image information updated."; + } + echo " [ <a href='editphoto.php?ID=".$_GET['ID']."&PHOTO=".$_GET['PHOTO']."'>Manage</a> ]<br><br>"; + die(include($footer)); } ! // 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)); } ! ?> <h2>Edit Gallery</h2> <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> ! | <a href="edit.php?DELETE=<?php echo $_GET['ID']; ?>">Delete Gallery</a></p> <p align="center"><img src="../gallery/<?php echo $gallery->GalleryName; ?>/<?php echo $_GET['PHOTO']; ?>" width="300" height="225"><br> <br>[ <a href="makethumb.php?ID=<?php echo $_GET['ID']; ?>&PHOTO=<?php echo $_GET['PHOTO']; ?>">Make Thumbnail</a> ]</p> <form action='editphoto.php?ID=<?php echo $_GET['ID']; ?>&PHOTO=<?php echo $_GET['PHOTO']; ?>' method='POST'> ! <table width="456"> ! <tr> ! <th width="101"> </th> ! <th width="275">Photo Information</th> </tr> ! <tr> ! <th>File Name</th> ! <td><?php echo $_GET['PHOTO']; ?></td> </tr> ! <tr> ! <th>Photo Name</th> ! <td><input name="imagename" type="text" id="imagename" value="<?php if(isset($image->ImageName)){ echo $image->ImageName; } ?>" size="30"></td> </tr> ! <tr> ! <th>Date</th> ! <td><input name="date" type="text" id="date" value="<?php if(isset($image->Dates)){ echo $image->Dates; }else{ echo date("F j, Y, g:i a",time()); } ?>" size="30"></td> </tr> ! <tr> ! <th>Description:</th> ! <td> <textarea name="description" cols="40" rows="10" id="description"><?php echo $image->Description; ?></textarea> </td> </tr> ! <?php if(isset($description)){ ?> ! <tr> ! <th> </th> ! <td><table width="85%"> ! <tr> <th><div align="center">Text File Found</div></th> </tr> ! <tr> <td><?php echo $description; ?></td> </tr> </table></td> </tr> ! <tr> ! <td> ! <input name="txtupdate" type="checkbox" id="deletefile5" value="checkbox"> ! </td> ! <td>Use description from .txt file in updating the image description. The .txt contets are in the above table.</td> </tr> ! <tr> ! <td> ! <input name="deletefile" type="checkbox" id="deletefile4" value="checkbox"> ! </td> ! <td>Delete .txt file after adding this description to the image.</td> </tr> ! <?php } ?> ! <tr> ! <td> </td> ! <td> <input name='update' type='submit' id='update' value='Update Image Info'> ! <input name='deleteall' type='submit' id='update3' value='Delete Description'> </td> </tr> </table> ! </form> ! <?php ! include($footer); ! ?> Index: galleryglobals.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/admin/galleryglobals.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** galleryglobals.php 22 Aug 2003 14:58:04 -0000 1.2 --- galleryglobals.php 22 Aug 2003 16:24:43 -0000 1.3 *************** *** 1,5 **** <?php /* ! * openFIRST.photogallery - galleryglobals.php * * Copyright (C) 2003, --- 1,5 ---- <?php /* ! * openFIRST.photogallery - admin/galleryglobals.php * * Copyright (C) 2003, Index: index.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/admin/index.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** index.php 22 Aug 2003 14:58:04 -0000 1.4 --- index.php 22 Aug 2003 16:24:43 -0000 1.5 *************** *** 33,37 **** // Check if user is an admin then allow processes ! if(! ISSET($user->user)){ showlogin(); die(include($footer)); --- 33,37 ---- // Check if user is an admin then allow processes ! if(! isset($user->user) || $user->membertype != "administrator"){ showlogin(); die(include($footer)); *************** *** 40,50 **** ?> <h2>Gallery Manager</h2> ! Here is a list of current galleries installed on our website.<br> <table width="633" align="center"> ! <tr> ! <th valign="top"><div align="center"></div></th> ! <th><strong>Gallery Name</strong></th> ! <th><strong>Description</strong></th> ! <th> <div align="left"><strong>Option</strong></div></th> </tr> <?php --- 40,51 ---- ?> <h2>Gallery Manager</h2> ! <p>Here is a list of current galleries installed on our website.</p> ! <p> <table width="633" align="center"> ! <tr> ! <th> </th> ! <th>Gallery Name</th> ! <th>Description</th> ! <th>Option</th> </tr> <?php *************** *** 55,63 **** ?> ! <tr> ! <td width="58" valign="top"><a href="../gallery.php?ID=<?php echo $gallery->ID; ?>"><img src="../gallery.PNG" width="58" height="51" border="0"></a></td> ! <td width="145" valign="top"><?php echo $gallery->GalleryName; ?></td> ! <td width="307" valign="top"><?php echo $gallery->Description; ?></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> --- 56,64 ---- ?> ! <tr> ! <td width="58"><a href="../gallery.php?ID=<?php echo $gallery->ID; ?>"><img src="../gallery.PNG" width="58" height="51" border="0"></a></td> ! <td width="145"><?php echo $gallery->GalleryName; ?></td> ! <td width="307"><?php echo $gallery->Description; ?></td> ! <td width="75">[ <a href="edit.php?ID=<?php echo $gallery->ID; ?>">Edit</a> ]<br> [ <a href="edit.php?DELETE=<?php echo $gallery->ID; ?>">Delete</a> ]</td> *************** *** 69,78 **** // 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"; } - ?> </table> ! <br></p> ! <p align="center"> </p> ! <?php include($footer); ?> --- 70,79 ---- // 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"; } ?> </table> ! </p> ! <?php ! include($footer); ! ?> Index: makethumb.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/admin/makethumb.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** makethumb.php 21 Aug 2003 14:19:21 -0000 1.3 --- makethumb.php 22 Aug 2003 16:24:43 -0000 1.4 *************** *** 1,5 **** <?php /* ! * openFIRST.photogallery - makethumb.php * * Copyright (C) 2003, --- 1,5 ---- <?php /* ! * openFIRST.photogallery - admin/makethumb.php * * Copyright (C) 2003, *************** *** 36,68 **** 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; ! // Make thumbnail for particular photo ! if(ISSET($_GET['PHOTO'])){ ! makethumb($dirlocate,$_GET['PHOTO'],$imgtypes); ! echo "<br><br><center>Thumbnail created! [ <a href='edit.php?ID=".$_GET['ID']."'>Edit</a> ]"; ! die(include($footer)); ! } ! ! // Make thumbnail for entire gallery ! if(ISSET($_GET['OPTION'])){ ! $dir = opendir($dirlocate); ! while(! (($file = readdir($dir)) === false)){ ! if (is_file($dirlocate."/".$file)){ ! makethumb($dirlocate,$file,$imgtypes); ! } } - echo "<br><br><center>Thumbnails created for gallery! [ <a href='edit.php?ID=".$_GET['ID']."'>Edit</a> ]"; - die(include($footer)); - } ! }else{ showlogin(); } include($footer); - ?> --- 36,67 ---- 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; ! // Make thumbnail for particular photo ! if(isset($_GET['PHOTO'])){ ! makethumb($dirlocate,$_GET['PHOTO'],$imgtypes); ! echo "<p>Thumbnail created! [ <a href='edit.php?ID=".$_GET['ID']."'>Edit</a> ]</p>"; ! die(include($footer)); ! } ! // Make thumbnail for entire gallery ! if(isset($_GET['OPTION'])){ ! ! $dir = opendir($dirlocate); ! while(! (($file = readdir($dir)) === false)){ ! if (is_file($dirlocate."/".$file)){ ! makethumb($dirlocate,$file,$imgtypes); ! } ! } ! echo "<p>Thumbnails created for gallery! [ <a href='edit.php?ID=".$_GET['ID']."'>Edit</a> ]</p>"; ! die(include($footer)); } ! } else { showlogin(); } include($footer); ?> Index: newgallery.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/admin/newgallery.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** newgallery.php 22 Aug 2003 14:58:04 -0000 1.4 --- newgallery.php 22 Aug 2003 16:24:43 -0000 1.5 *************** *** 1,5 **** <?php /* ! * openFIRST.photogallery - newgallery.php * * Copyright (C) 2003, --- 1,5 ---- <?php /* ! * openFIRST.photogallery - admin/newgallery.php * * Copyright (C) 2003, *************** *** 26,30 **** * */ ! // Import globals and estbalish database connection include("../../config/globals.php"); --- 26,30 ---- * */ ! // Import globals and estbalish database connection include("../../config/globals.php"); *************** *** 32,36 **** include("galleryglobals.php"); ! if(! ISSET($user->user)){ showlogin(); die(include($footer)); --- 32,36 ---- include("galleryglobals.php"); ! if(! isset($user->user)){ showlogin(); die(include($footer)); *************** *** 38,53 **** // 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_photogallery_galleries (GalleryName, Author, Dates, Description) values( ! '".$_POST['galleryname']."' ! ,'".$user->user."' ! ,'".time()."' ! ,'".$_POST['description']."')") or die(mysql_error()); ! echo "<br><br><center>New gallery added! [ <a href='index.php'>Manage</a> ]</center><br><br>"; ! die(include($footer)); } --- 38,51 ---- // 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_photogallery_galleries (GalleryName, Author, Dates, Description) values( ! '".$_POST['galleryname']."', '".$user->user."', '".time()."', ! '".$_POST['description']."')"); ! echo "<br><br><center>New gallery added! [ <a href='index.php'>Manage</a> ]</center><br><br>"; ! die(include($footer)); } *************** *** 57,84 **** images from this script, you can only create the folders first.</p> <form method="POST" action="newgallery.php"> ! <table width="499" align="center"> ! <tr bgcolor="#999999"> ! <th valign="top"> <div align="center"> </div></th> ! <th><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>New ! Gallery Options</strong></font></th> </tr> ! <tr> ! <td width="130" valign="top"><div align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Gallery ! Name:</font></div></td> ! <td width="345" 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">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); ?> --- 55,82 ---- images from this script, you can only create the folders first.</p> <form method="POST" action="newgallery.php"> ! <table width="499"> ! <tr> ! <th> </th> ! <th>New Gallery Options</th> </tr> ! <tr> ! <th width="130">Gallery Name</th> ! <td width="345"><input name="galleryname" type="text" id="galleryname"></td> </tr> ! <tr> ! <th>Date</th> ! <td><?php echo date("F j, Y, g:i a",time()); ?></td> </tr> ! <tr> ! <th>Description</th> ! <td> <textarea name="description" cols="40" rows="10" id="description"></textarea></td> </tr> ! <tr> ! <th> </th> ! <td><input name="create" type="submit" id="create" value="Create Gallery"></td> </tr> </table> </form> ! <?php ! include($footer); ! ?> Index: preview.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/admin/preview.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** preview.php 8 Jun 2003 02:40:59 -0000 1.1 --- preview.php 22 Aug 2003 16:24:43 -0000 1.2 *************** *** 1,5 **** <?php /* ! * openFIRST.photogallery - preview.php * * Copyright (C) 2003, --- 1,5 ---- <?php /* ! * openFIRST.photogallery - admin/preview.php * * Copyright (C) 2003, *************** *** 135,137 **** } ! ?> \ No newline at end of file --- 135,137 ---- } ! ?> Index: upload.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/admin/upload.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** upload.php 22 Aug 2003 14:58:04 -0000 1.6 --- upload.php 22 Aug 2003 16:24:43 -0000 1.7 *************** *** 1,5 **** <?php /* ! * openFIRST.photogallery - upload.php * * Copyright (C) 2003, --- 1,5 ---- <?php /* ! * openFIRST.photogallery - admin/upload.php * * Copyright (C) 2003, *************** *** 31,100 **** include($header); include("galleryglobals.php"); ! // Check if user is an admin then allow processes ! if(! ISSET($user->user)){ showlogin(); die(include($footer)); } ! $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 if(ISSET($_POST['upload'])){ ! ini_set("max_execution_time",$gallery_execution_time); ! $dirlocate = "../".$gallerydir.$gallery->GalleryName; ! $imgtypes .= ",txt"; ! $imgtypes = explode(",",$imgtypes); ! ! for ($num=1;$num<=$_POST['NUM_UPLOADS'];$num++){ ! ! // If upload field is empty then exit the particular loop ! ! if (! $_FILES['upload'.$num]['name'] == ""){ ! $continue = false; ! ! // NOTE: The change to uppercase in the if statement helps remove errors ! // I noticed this when I found that some software applications save images ! // extensions as upper case, so just making sure it doesn't give people problems. ! foreach($imgtypes As $type){ ! $extension = substr($_FILES['upload'.$num]['name'],-3); ! if(strtoupper($extension) == strtoupper($type)){ ! $continue = true; ! continue; ! } ! } ! if(! $continue){ ! echo "<center><br>".$_FILES['upload'.$num]['name']." - ".$_FILES['upload'.$num]['size']." - ".$_FILES['upload'.$num]['type']." - <font color='Red'>Illegal file type!</font></center>"; ! continue; ! } ! ! // Copy files to the proper directory ! 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><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 Allowed: <?php echo $imgtypes; ?></p> --- 31,99 ---- include($header); include("galleryglobals.php"); ! // Check if user is an admin then allow processes ! if(! ISSET($user->user) || $user->membertype != "administrator"){ showlogin(); die(include($footer)); } ! $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 if(ISSET($_POST['upload'])){ ! ini_set("max_execution_time",$gallery_execution_time); ! $dirlocate = "../".$gallerydir.$gallery->GalleryName; ! $imgtypes .= ",txt"; ! $imgtypes = explode(",",$imgtypes); ! for ($num=1;$num<=$_POST['NUM_UPLOADS'];$num++){ ! // If upload field is empty then exit the particular loop ! ! if (! $_FILES['upload'.$num]['name'] == ""){ ! $continue = false; ! ! foreach($imgtypes As $type){ ! $extension = substr($_FILES['upload'.$num]['name'],-3); ! // NOTE: The change to uppercase in the if statement helps remove errors ! // I noticed this when I found that some software applications save images ! // extensions as upper case, so just making sure it doesn't give people problems. ! if(strtoupper($extension) == strtoupper($type)){ ! $continue = true; ! continue; ! } ! } ! ! if(! $continue){ ! echo "<center><br>".$_FILES['upload'.$num]['name']." - ".$_FILES['upload'.$num]['size']." - ".$_FILES['upload'.$num]['type']." - <font color='Red'>Illegal file type!</font></center>"; ! continue; ! } ! ! // Copy files to the proper directory ! 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><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 Allowed: <?php echo $imgtypes; ?></p> *************** *** 109,113 **** // 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"; } --- 108,112 ---- // 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"; } *************** *** 116,118 **** <input name="upload" type="submit" value="Upload To Gallery"> </form> ! <?php include($footer); ?> --- 115,117 ---- <input name="upload" type="submit" value="Upload To Gallery"> </form> ! <?php include($footer); ?> \ No newline at end of file |
From: <xt...@us...> - 2003-08-22 16:49:39
|
Update of /cvsroot/openfirst/photogallery In directory sc8-pr-cvs1:/tmp/cvs-serv15538 Modified Files: gallery.php Log Message: Remove duplicate image preview bug introduced by me when I incorrectly handled CVS conflicts. Index: gallery.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/gallery.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** gallery.php 22 Aug 2003 15:49:12 -0000 1.8 --- gallery.php 22 Aug 2003 16:49:33 -0000 1.9 *************** *** 62,83 **** // Begin reading the directory for images while(! (($file = readdir($dir)) === false)){ - - // If the directory is not a dir then continue the process - if (! is_dir($dirlocate."/".$file)){ - if ($num > 3){ - echo "</tr><tr>"; - $num = 1; - } - echo "<td width='34%'><center><a target='_blank' href='viewphoto.php?ID=".$_GET['ID']."&PHOTO=".$file."'>"; - - if(file_exists($dirlocate."/thumbs/".$file)){ - echo "<img border='1px' height=100 width=152 src='".$dirlocate."/thumbs/".$file."'>"; - } else { - echo "<img border='1px' height=100 width=152 src='".$dirlocate."/".$file."'>"; - } - - echo "</a><br><a href='email.php?PHOTO=".$dirlocate."/".$file."'><img border='0' src=email.PNG alt='Email to a friend'></a><img border='0' src='spacer.PNG'><a target='_blank' href='viewphoto.php?ID=".$_GET['ID']."&PHOTO=".$file."'><img border='0' alt='Enlarge' src='enlarge.PNG'> - </a></center></a></td>"; - // Explode file type then check if the file is allowed by the photogallery globals $imgtype = explode(",",$imgtypes); --- 62,65 ---- *************** *** 121,125 **** } } - } // If no photos have been found then preview a no photos message --- 103,106 ---- |
From: <xt...@us...> - 2003-08-22 15:49:16
|
Update of /cvsroot/openfirst/photogallery In directory sc8-pr-cvs1:/tmp/cvs-serv5277 Modified Files: email.php gallery.php index.php photogallery.php viewphoto.php Log Message: Commit largely minor auditing changes, add some function_exists checking where required Index: email.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/email.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** email.php 22 Aug 2003 14:57:28 -0000 1.6 --- email.php 22 Aug 2003 15:49:12 -0000 1.7 *************** *** 26,30 **** * */ - // Include important globals related to this module include("../config/globals.php"); --- 26,29 ---- *************** *** 36,43 **** $gallery = mysql_fetch_object($query); - // If user has hit the send option then ! if(ISSET($_POST['send'])){ // Set the max execution time for the script so that it will not time out, then set the SMTP server to send with ini_set("MAX_EXECUTION_TIME",$gallery_execution_time); --- 35,82 ---- $gallery = mysql_fetch_object($query); // If user has hit the send option then ! if(isset($_POST['send'])){ ! ! ini_set("MAX_EXECUTION_TIME",$gallery_execution_time); ! ini_set("SMTP",$SMTP); ! ! $from = $_POST['name']; ! $email = $_POST['email']; ! ! $recipient = $_POST['recipient']; ! $recipientemail = $_POST['recipientemail']; ! ! $comment = $_POST['comment']; + $headers = "MIME-Version: 1.0\r\n"; + $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; + $headers .= "From: ".$title." Photo Gallery <".$mailfrom.">\r\n"; + $headers .= "Reply-To: ".$mailfrom."\r\n"; + $headers .= "X-Priority: 1\r\n"; + $headers .= "X-MSMail-Priority: High\r\n"; + + $message = "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'> + <html><head><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'> + </head><body><div align='center'> + <table width='550' border='0' cellspacing='0' cellpadding='0'> + <tr> + <td height='23'><p>Hello ".$recipient.",</p> + <p>This is a message from the <b>".$title."</b> photo + gallery mailing system. <b>".$from." (".$email.")</b> + has requested that you peview this image. Here are his comments:</p> + <table width='400' border='1' align='center' cellpadding='6' cellspacing='0' bordercolor='#333333'> + <tr> + <td height='23'><p>".$comment."<br> + </p> + </td> + </tr> + </table> + <p align='center'><img src='".$home.$basepath."/photogallery/gallery/$gallery->GalleryName".$_POST['photo']."' width='300' height='200'></p> + <p align='left'>Thank you for your time,</p> + <p align='left'>The <b>".$title."</b> photo gallery.<br> + </p></td> + </tr> + </table> + </div></body></html>"; // Set the max execution time for the script so that it will not time out, then set the SMTP server to send with ini_set("MAX_EXECUTION_TIME",$gallery_execution_time); *************** *** 80,95 **** <p align='left'>Thank you for your time,</p> <p align='left'>The <b>".$title."</b> photo gallery.<br></p> ! </td> </tr> </table></div></body></html>"; // Check if multipartmail is declared or else use regular mailing function ! if(function_exists("multipartmail")){ ! multipartmail($recipientemail, $title."Gallery Photo Sender", $message); ! }else{ ! mail($recipientemail,$title." Gallery Photo Sender",$message,$headers) or die("<br><br><br><center>E-Mail was <b>not</b> successfully sent!</center>"); } ! ! // Print out the completion of the e-mailing then die out echo "<br><br><br>Photo was successfully sent to the recipient, thank you! [ <a href='index.php'>Galleries</a> ]<br><br><br>"; die(include($footer)); --- 119,134 ---- <p align='left'>Thank you for your time,</p> <p align='left'>The <b>".$title."</b> photo gallery.<br></p> ! </td> </tr> </table></div></body></html>"; // Check if multipartmail is declared or else use regular mailing function ! if(funcion_exists("multipartmail")){ ! multipartmail($recipientemail, $title."Gallery Photo Sender", $message); ! } else { ! mail($recipientemail,$title." Gallery Photo Sender",$message,$headers) or die("<br><br><br><center>E-Mail was <b>not</b> successfully sent!</center>"); } ! ! // Print out the completion of the e-mailing then die out echo "<br><br><br>Photo was successfully sent to the recipient, thank you! [ <a href='index.php'>Galleries</a> ]<br><br><br>"; die(include($footer)); *************** *** 108,152 **** <table width="521" 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"><b>Gallery ! Name</b></font></td> </tr> ! <tr> ! <td width="140" valign="top"> <div align="right">Your Name: </div> ! <div align="right"></div></td> ! <td width="266" valign="top"><div align="left"> ! <input name="name" type="text" id="name"> ! </div></td> </tr> ! <tr> ! <td valign="top"><div align="right">Your E-Mail:</div></td> ! <td valign="top"><div align="left"> ! <input name="email" type="text" id="email" size="40"> ! </div></td> </tr> ! <tr> ! <td valign="top"><div align="right">Recipients Name:</div></td> ! <td valign="top"><div align="left"> ! <input name="recipient" type="text" id="recipient"> ! </div></td> </tr> ! <tr> ! <td valign="top"><div align="right">Recipients E-Mail:</div></td> ! <td valign="top"><div align="left"> ! <input name="recipientemail" type="text" id="recipientemail" size="40"> ! </div></td> </tr> ! <tr> ! <td valign="top"><div align="right">Comments:</div></td> ! <td valign="top"><div align="left"> ! <textarea name="comment" cols="35" rows="9" id="comment"></textarea> ! </div></td> </tr> <tr> ! <td valign="top"> </td> ! <td valign="top"><input name="send" type="submit" id="send" value="Send E-Mail"></td> </tr> </table> </form> ! <?php include($footer); ?> --- 147,188 ---- <table width="521" border="0" align="center" cellpadding="6" cellspacing="0"> ! <tr bgcolor="#999999"> ! <th> </th> ! <th>Gallery Name</th> </tr> ! <tr> ! <th>Your Name</th> ! <td width="266"><input name="name" type="text" id="name"></td> </tr> ! <tr> ! <th>Your E-Mail</th> ! <td> ! <input name="email" type="text" id="email" size="40"> ! </td> </tr> ! <tr> ! <th>Recipients Name</th> ! <td> ! <input name="recipient" type="text" id="recipient"> ! </td> </tr> ! <tr> ! <th>Recipients E-Mail</th> ! <td> ! <input name="recipientemail" type="text" id="recipientemail" size="40"> ! </td> </tr> ! <tr> ! <th>Comments</th> ! <td> ! <textarea name="comment" cols="35" rows="9" id="comment"></textarea> ! </td> </tr> <tr> ! <th> </th> ! <td><input name="send" type="submit" id="send" value="Send E-Mail"></td> </tr> </table> </form> ! ! <?php include($footer); ?> Index: gallery.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/gallery.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** gallery.php 22 Aug 2003 14:57:28 -0000 1.7 --- gallery.php 22 Aug 2003 15:49:12 -0000 1.8 *************** *** 26,43 **** * */ - // Include important globals related to this module include("../config/globals.php"); include($header); include("admin/galleryglobals.php"); ! // Retrieve gallery information $query = mysql_query("SELECT * FROM ofirst_photogallery_galleries WHERE ID = '".$_GET['ID']."'"); $gallery = mysql_fetch_object($query); ! ?> <h2>Gallery Viewer</h2> <table width="497"> ! <tr> <td><b>Description:</b> <?php echo $gallery->Description; ?></td> </tr> --- 26,42 ---- * */ // Include important globals related to this module include("../config/globals.php"); include($header); include("admin/galleryglobals.php"); ! // Retrieve gallery information $query = mysql_query("SELECT * FROM ofirst_photogallery_galleries WHERE ID = '".$_GET['ID']."'"); $gallery = mysql_fetch_object($query); ! ?> <h2>Gallery Viewer</h2> <table width="497"> ! <tr> <td><b>Description:</b> <?php echo $gallery->Description; ?></td> </tr> *************** *** 47,52 **** <tr> <th width="150"> </th> ! <th width="150"><?php echo $gallery->GalleryName; ?></th> ! <th width="150"> </th> </tr> <?php --- 46,51 ---- <tr> <th width="150"> </th> ! <th width="150"><?php echo $gallery->GalleryName; ?></th> ! <th width="150"> </th> </tr> <?php *************** *** 63,121 **** // Begin reading the directory for images while(! (($file = readdir($dir)) === false)){ ! ! // If the directory is not a dir then continue the process if (! is_dir($dirlocate."/".$file)){ ! ! // Explode file type then check if the file is allowed by the photogallery globals ! $imgtype = explode(",",$imgtypes); ! $continue = false; ! foreach($imgtype As $type){ ! $extension = substr($file,-3); ! if(strtoupper($extension) == strtoupper($type)){ ! $continue = true; ! continue; ! } } - - // If continue, which is set true/false above, is false then stop the loop for this image - if($continue){ ! // If the current loop if greater then three then create a new row and set value back to 1 ! if ($num > 3){ ! echo " </tr>\n <tr>\n"; ! $num = 1; ! } ! ! // Setup column for the next image echo " <td width='34%'><center><a target='_blank' href='viewphoto.php?ID=".$_GET['ID']."&PHOTO=".$file."'>"; // Check if there is a thumb available for this image, if so then use it or else preview the actual reduced image ! if(file_exists($dirlocate."/thumbs/".$file)){ ! echo "<img border='1px' height=100 width=152 src='".$dirlocate."/thumbs/".$file."'>"; ! }else{ ! echo "<img border='1px' height=100 width=152 src='".$dirlocate."/".$file."'>"; ! } // Add e-mail and image expand buttons as well as close column ! echo "</a><br><a href='email.php?PHOTO=$file&ID=".$_GET['ID']."'><img border='0' src=email.PNG alt='Email to a friend'></a> ! <img border='0' src='spacer.PNG'><a target='_blank' href='viewphoto.php?ID=".$_GET['ID']."&PHOTO=".$file."'><img border='0' alt='Enlarge' src='enlarge.PNG'></a> ! </center></td>\n"; ! ! // Add number for amount of images previewed ! $num++; ! $photo++; } } } ! // If no photos have been found then preview a no photos message if($photo == 0){ echo "<td> </td>\n <td><br><br>No photos in gallery!<br><br><br></td>\n <td> </td>\n </tr>"; } - ?> ! </table><br> ! The content within the galleries are copyright by the owners of this website.<br> ! In order to use or copy its content please contact the teams webmaster or team leader.</p> <?php include($footer); ?> --- 62,134 ---- // Begin reading the directory for images while(! (($file = readdir($dir)) === false)){ ! ! // If the directory is not a dir then continue the process if (! is_dir($dirlocate."/".$file)){ ! if ($num > 3){ ! echo "</tr><tr>"; ! $num = 1; ! } ! echo "<td width='34%'><center><a target='_blank' href='viewphoto.php?ID=".$_GET['ID']."&PHOTO=".$file."'>"; ! if(file_exists($dirlocate."/thumbs/".$file)){ ! echo "<img border='1px' height=100 width=152 src='".$dirlocate."/thumbs/".$file."'>"; ! } else { ! echo "<img border='1px' height=100 width=152 src='".$dirlocate."/".$file."'>"; ! } ! ! echo "</a><br><a href='email.php?PHOTO=".$dirlocate."/".$file."'><img border='0' src=email.PNG alt='Email to a friend'></a><img border='0' src='spacer.PNG'><a target='_blank' href='viewphoto.php?ID=".$_GET['ID']."&PHOTO=".$file."'><img border='0' alt='Enlarge' src='enlarge.PNG'> ! </a></center></a></td>"; ! ! // Explode file type then check if the file is allowed by the photogallery globals ! $imgtype = explode(",",$imgtypes); ! $continue = false; ! ! foreach($imgtype As $type){ ! $extension = substr($file,-3); ! if(strtoupper($extension) == strtoupper($type)){ ! $continue = true; ! continue; ! } } ! // If continue, which is set true/false above, is false then stop the loop for this image ! if($continue){ ! ! // If the current loop if greater then three then create a new row and set value back to 1 ! if ($num > 3){ ! echo " </tr>\n <tr>\n"; ! $num = 1; ! } ! ! // Setup column for the next image echo " <td width='34%'><center><a target='_blank' href='viewphoto.php?ID=".$_GET['ID']."&PHOTO=".$file."'>"; // Check if there is a thumb available for this image, if so then use it or else preview the actual reduced image ! if(file_exists($dirlocate."/thumbs/".$file)){ ! echo "<img border='1px' height=100 width=152 src='".$dirlocate."/thumbs/".$file."'>"; ! } else { ! echo "<img border='1px' height=100 width=152 src='".$dirlocate."/".$file."'>"; ! } // Add e-mail and image expand buttons as well as close column ! echo "</a><br><a href='email.php?PHOTO=$file&ID=".$_GET['ID']."'><img border='0' src=email.PNG alt='Email to a friend'></a> ! <img border='0' src='spacer.PNG'><a target='_blank' href='viewphoto.php?ID=".$_GET['ID']."&PHOTO=".$file."'><img border='0' alt='Enlarge' src='enlarge.PNG'></a> ! </center></td>\n"; ! ! // Add number for amount of images previewed ! $num++; ! $photo++; } } } ! // If no photos have been found then preview a no photos message if($photo == 0){ echo "<td> </td>\n <td><br><br>No photos in gallery!<br><br><br></td>\n <td> </td>\n </tr>"; } ?> ! </table> ! <p>The content within the galleries is copyright. ! In order to use or copy content contained within the galleries please contact the team's webmaster ! or leader.</p> <?php include($footer); ?> Index: index.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/index.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** index.php 22 Aug 2003 14:57:28 -0000 1.5 --- index.php 22 Aug 2003 15:49:12 -0000 1.6 *************** *** 32,43 **** include("admin/galleryglobals.php"); ! ?> ! <h2>View Galleries</h2>Welcome to the gallery viewer. Please select a gallery from the list below:<br><br> ! <table width="701" align="center"> ! <tr> ! <th valign="top"> <div align="center"> </div></th> ! <th><strong>Gallery Name</strong></th> ! <th> <div align="center"><strong>Description</strong></div></th> ! <th width="176"><b>Date</b></th> </tr> <?php --- 32,45 ---- include("admin/galleryglobals.php"); ! ?> ! <h2>View Galleries</h2> ! <p>Welcome to the gallery viewer. Please select a gallery from the list below:<br> ! </p> ! <table width="701"> ! <tr> ! <th> </th> ! <th>Gallery Name</th> ! <th>Description</th> ! <th width="176">Date</th> </tr> <?php *************** *** 49,56 **** ?> <tr onMouseOver="this.style.backgroundColor='#cccccc'" onMouseOut="this.style.backgroundColor='#ffffff'" bgcolor="#ffffff"> ! <td width="61" valign="top"><div align="center"><a href="gallery.php?ID=<?php echo $gallery->ID; ?>"><img src="gallery.PNG" border="0"></a></div></td> ! <td width="147" valign="top"><a href='gallery.php?ID=<?php echo $gallery->ID; ?>'><?php echo $gallery->GalleryName; ?></a></td> ! <td width="297" valign="top"><?php echo $gallery->Description; ?></td> ! <td width="176" valign="top"><?php echo date("F j, Y, g:i a",$gallery->Dates); ?></td> </tr> <?php --- 51,58 ---- ?> <tr onMouseOver="this.style.backgroundColor='#cccccc'" onMouseOut="this.style.backgroundColor='#ffffff'" bgcolor="#ffffff"> ! <td width="61"><div align="center"><a href="gallery.php?ID=<?php echo $gallery->ID; ?>"><img src="gallery.PNG" border="0"></a></div></td> ! <td width="147"><a href='gallery.php?ID=<?php echo $gallery->ID; ?>'><?php echo $gallery->GalleryName; ?></a></td> ! <td width="297"><?php echo $gallery->Description; ?></td> ! <td width="176"><?php echo date("F j, Y, g:i a",$gallery->Dates); ?></td> </tr> <?php *************** *** 59,68 **** // 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>"; } ?> </table> ! <p align="center">The content within the galleries are copyright of this website and its ownering team.<br> ! In order to use or copy its content please contact the teams webmaster.</p> ! <?php include($footer); ?> \ No newline at end of file --- 61,71 ---- // 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>"; } ?> </table> ! <p>The content within the galleries is copyright. ! In order to use or copy content contained within the galleries please contact the team's webmaster ! or leader.</p> ! <?php include($footer); ?> Index: photogallery.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/photogallery.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** photogallery.php 22 Aug 2003 14:57:28 -0000 1.3 --- photogallery.php 22 Aug 2003 15:49:12 -0000 1.4 *************** *** 33,50 **** function galleryimage($gallery,$image,$option = true,$height = "",$width = ""){ ! // Call global basepath variable for use in this function ! global $basepath; ! // 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){ ! echo "<a href='$basepath/photogallery/viewphoto.php?ID=$gallery&PHOTO=$image'><img border='0' alt='Gallery Image' height='$height' width='$width' src='$basepath/photogallery/gallery/$thisgallery->GalleryName/thumbs/$image'></a>"; ! }else{ ! echo "<a href='$basepath/photogallery/viewphoto.php?ID=$gallery&PHOTO=$image'><img border='0' alt='Gallery Image' height='$height' width='$width' src='$basepath/photogallery/gallery/$thisgallery->GalleryName/$image'></a>"; ! } ! } ! ?> \ No newline at end of file --- 33,50 ---- function galleryimage($gallery,$image,$option = true,$height = "",$width = ""){ ! // Call global basepath variable for use in this function ! global $basepath; ! // 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){ ! echo "<a href='$basepath/photogallery/viewphoto.php?ID=$gallery&PHOTO=$image'><img border='0' alt='Gallery Image' height='$height' width='$width' src='$basepath/photogallery/gallery/$thisgallery->GalleryName/thumbs/$image'></a>"; ! } else { ! echo "<a href='$basepath/photogallery/viewphoto.php?ID=$gallery&PHOTO=$image'><img border='0' alt='Gallery Image' height='$height' width='$width' src='$basepath/photogallery/gallery/$thisgallery->GalleryName/$image'></a>"; ! } ! } ! ?> Index: viewphoto.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/viewphoto.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** viewphoto.php 22 Aug 2003 14:57:28 -0000 1.6 --- viewphoto.php 22 Aug 2003 15:49:12 -0000 1.7 *************** *** 32,51 **** include($header); include("admin/galleryglobals.php"); ! // If a comment is being added then run process if(ISSET($_POST['addcomment'])){ ! mysql_query("INSERT INTO ofirst_photogallery_comments SET ! Image = '".$_GET['PHOTO']."', ! Gallery = '".$_GET['ID']."', ! Author = '".$_POST['name']."', ! 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>"; ! die(include($footer)); } ! // If a comment is being deleted then check if the user is looged in then delete if(ISSET($_GET['COMMENT'])){ --- 32,51 ---- include($header); include("admin/galleryglobals.php"); ! // If a comment is being added then run process if(ISSET($_POST['addcomment'])){ ! mysql_query("INSERT INTO ofirst_photogallery_comments SET ! Image = '".$_GET['PHOTO']."', ! Gallery = '".$_GET['ID']."', ! Author = '".$_POST['name']."', ! 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>"; ! die(include($footer)); } ! // If a comment is being deleted then check if the user is looged in then delete if(ISSET($_GET['COMMENT'])){ *************** *** 53,62 **** 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)); ! } } ! // Retrieve image data from the database $imgquery = mysql_query("SELECT * FROM ofirst_photogallery_image WHERE Gallery = '".$_GET['ID']."' AND Image = '".$_GET['PHOTO']."'"); --- 53,62 ---- 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)); ! } } ! // Retrieve image data from the database $imgquery = mysql_query("SELECT * FROM ofirst_photogallery_image WHERE Gallery = '".$_GET['ID']."' AND Image = '".$_GET['PHOTO']."'"); *************** *** 67,128 **** $gallery = mysql_fetch_object($query); ! ?> <h2>View Photo From Gallery</h2> <form action='viewphoto.php?ID=<?php echo $_GET['ID']; ?>&PHOTO=<?php echo $_GET['PHOTO']; ?>' method='POST'> <table width="753"> ! <tr> ! <th valign="top">Photo Information</th> <th>Photo</th> </tr> ! <tr> ! <td width="308" valign="top"><table width="100%"> ! <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> ! <td><div align="right"><strong>Gallery:</strong></div></td> <td><?php echo $gallery->GalleryName; ?></td> </tr> ! <tr> ! <td><div align="right"><strong>Author:</strong></div></td> <td><?php echo $gallery->Author; ?></td> </tr> ! <?php ! // If there are values for the query then preview the image ! if(! mysql_num_rows($imgquery) == 0){ ! ?> ! <tr> ! <td valign="top"><div align="right"><strong>Description:</strong></div></td> <td><?php echo $image->Description; ?></td> </tr> ! <tr> ! <td valign="top"><div align="right"><strong>Date:</strong></div></td> <td><?php echo date("F j, Y, g:i a",$image->Dates); ?></td> </tr> ! <?php ! } ! ?> ! <tr> <td> </td> ! <td><a href="email.php?ID=<?php echo $_GET['ID']; ?>&PHOTO=<?php echo $_GET['PHOTO']; ?>">Send To A Friend</a></td> </tr> </table> <table width="100%"> ! <tr> ! <td width="37%"><div align="center"><a href="gallery.php?ID=<?php echo $gallery->ID; ?>"><img src="comment.PNG" width="23" height="25" border="0"></a></div></td> ! <td width="63%"><strong>You May Comment</strong></td> </tr> ! <tr> ! <td><div align="right"><strong>Name:</strong></div></td> <td><input name="name" type="text" id="name"></td> </tr> ! <tr> ! <td><div align="right"><strong>E-Mail:</strong></div></td> <td><input name="email" type="text" id="email"></td> </tr> ! <tr> ! <td> </td> <td><textarea name="comment" id="comment"></textarea> <br> --- 67,128 ---- $gallery = mysql_fetch_object($query); ! ?> <h2>View Photo From Gallery</h2> <form action='viewphoto.php?ID=<?php echo $_GET['ID']; ?>&PHOTO=<?php echo $_GET['PHOTO']; ?>' method='POST'> <table width="753"> ! <tr> ! <th>Photo Information</th> <th>Photo</th> </tr> ! <tr> ! <td width="308"><table width="100%"> ! <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> ! <th>Gallery</th> <td><?php echo $gallery->GalleryName; ?></td> </tr> ! <tr> ! <th>Author</th> <td><?php echo $gallery->Author; ?></td> </tr> ! <?php ! // If there are values for the query then preview the image ! if(! mysql_num_rows($imgquery) == 0){ ! ?> ! <tr> ! <th>Description</th> <td><?php echo $image->Description; ?></td> </tr> ! <tr> ! <tth>Date</th> <td><?php echo date("F j, Y, g:i a",$image->Dates); ?></td> </tr> ! <?php ! } ! ?> ! <tr> <td> </td> ! <td><a href="email.php?ID=<?php echo $_GET['ID']; ?>&PHOTO=<?php echo $_GET['PHOTO']; ?>">Send To A Friend</a></td> </tr> </table> <table width="100%"> ! <tr> ! <th width="37%"><a href="gallery.php?ID=<?php echo $gallery->ID; ?>"><img src="comment.PNG" width="23" height="25" border="0"></a></td> ! <th width="63%">You May Comment</td> </tr> ! <tr> ! <th>Name</th> <td><input name="name" type="text" id="name"></td> </tr> ! <tr> ! <th>E-Mail</th> <td><input name="email" type="text" id="email"></td> </tr> ! <tr> ! <th> </th> <td><textarea name="comment" id="comment"></textarea> <br> *************** *** 130,134 **** </tr> <tr> ! <td> </td> <td><input name="addcomment" type="submit" id="addcomment" value="Submit Comment"></td> </tr> --- 130,134 ---- </tr> <tr> ! <th> </th> <td><input name="addcomment" type="submit" id="addcomment" value="Submit Comment"></td> </tr> *************** *** 136,140 **** </form> </td> ! <td width="433" valign="top"> <?php --- 136,140 ---- </form> </td> ! <td width="433"> <?php *************** *** 149,189 **** <br> <table width="53%"> ! <tr> <th> </th> ! <th valign="top">Comments for this image:</th> </tr> <?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)){ ?> <tr onMouseOver="this.style.backgroundColor='#cccccc'" onMouseOut="this.style.backgroundColor='#ffffff'" bgcolor="#ffffff"> <td width="33%"><strong><?php echo $comment->Author; ?><br></strong><a href='mailto:<?php echo $comment->EMail; ?>'>E-Mail Now</a><br> ! <?php ! // If user is logged in then offer the option of deleting the comment ! if(ISSET($user->user)){ ! echo "<a href='viewphoto.php?ID=".$_GET['ID']."&PHOTO=".$_GET['PHOTO']."&COMMENT=".$comment->ID."'>Delete</a>"; ! } ! ?></td> ! <td width="67%" valign="top"> ! <?php echo slur_block(emoticon_translate($comment->Comment)); ?> ! </td> </tr> <?php } ! ! // 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>"; ! } ! ?> </table> <p> </p> ! <p>The content within the galleries are copyright of this website and its ownering ! team.<br> ! In order to use or copy its content please contact the teams webmaster.</p></p> <?php include($footer); ?> --- 149,191 ---- <br> <table width="53%"> ! <tr> <th> </th> ! <th>Comments for this image:</th> </tr> <?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)){ ?> <tr onMouseOver="this.style.backgroundColor='#cccccc'" onMouseOut="this.style.backgroundColor='#ffffff'" bgcolor="#ffffff"> <td width="33%"><strong><?php echo $comment->Author; ?><br></strong><a href='mailto:<?php echo $comment->EMail; ?>'>E-Mail Now</a><br> ! <?php ! // If user is logged in then offer the option of deleting the comment ! if(ISSET($user->user)){ ! echo "<a href='viewphoto.php?ID=".$_GET['ID']."&PHOTO=".$_GET['PHOTO']."&COMMENT=".$comment->ID."'>Delete</a>"; ! } ! ?></td> ! <td width="67%"> ! <?php if(function_exists("slur_block") { $comment = slur_block($comment->Comment); } ! if(function_exists("emoticon_translate") { $comment = emoticon_translate($comment->Comment); } ! echo ($comment->Comment); ?> ! </td> </tr> <?php } ! ! // 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>"; ! } ! ?> </table> <p> </p> ! <p>The content within the galleries is copyright. ! In order to use or copy content contained within the galleries please contact the team's webmaster ! or leader.</p> <?php include($footer); ?> |
From: <xt...@us...> - 2003-08-22 15:42:41
|
Update of /cvsroot/openfirst/photogallery/admin In directory sc8-pr-cvs1:/tmp/cvs-serv17381 Modified Files: edit.php Log Message: Make gallery removal prompt for certainty, and recursively remove files and directories from within the gallery before attempting to remove it. Also fix some broken links. Index: edit.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/admin/edit.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** edit.php 21 Aug 2003 14:17:28 -0000 1.2 --- edit.php 21 Aug 2003 14:32:58 -0000 1.3 *************** *** 36,49 **** // Check if user initiated delete and run delete process ! if(ISSET($_GET['DELETE'])){ ! $query = mysql_query("SELECT * FROM ofirst_photogallery_galleries WHERE ID = '".$_GET['DELETE']."'") or die(mysql_error()); ! $gallery = mysql_fetch_object($query); ! ! rmdir("../".$gallerydir.$gallery->GalleryName."/thumbs") or die("<br><br><center>Can't remove gallery! [ <a href='index.php'>Manage</a> ]"); ! rmdir("../".$gallerydir.$gallery->GalleryName) or die("<br><br><center>Can't remove gallery! [ <a href='index.php'>Manage</a> ]"); 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='manage.php'>Manage</a> ]</center><br>"; die(include($footer)); } --- 36,68 ---- // Check if user initiated delete and run delete process ! if(ISSET($_GET['DELETE']) == true && isset($_GET["CONFIRMED"]) == false) { ! echo("<p>Are you absolutely sure you want to delete this gallery? All pictures in the gallery will be removed from the server.</p> <a href='edit.php?DELETE=" . $_GET["DELETE"] . "&CONFIRMED=1'>Yes, I am sure</a> <a href='edit.php'>No, I've changed my mind</a>"); ! 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); ! ! function deldir($dir){ ! $current_dir = opendir($dir); ! while($entryname = readdir($current_dir)){ ! if(is_dir("$dir/$entryname") and ($entryname != "." and $entryname!="..")){ ! deldir("${dir}/${entryname}"); ! } elseif($entryname != "." and $entryname!="..") { ! unlink("${dir}/${entryname}"); ! } ! } ! closedir($current_dir); ! rmdir(${dir}); ! } ! if(file_exists("../" . $gallerydir.$gallery->GalleryName."/thumbs")) { ! deldir("../".$gallerydir.$gallery->GalleryName."/thumbs"); ! } ! if(file_exists("../" . $gallerydir.$gallery->GalleryName)) { ! deldir("../".$gallerydir.$gallery->GalleryName); ! } 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)); } *************** *** 55,64 **** $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>"); } } --- 74,83 ---- $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> ]"); 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='index.php'>Manage</a> ]"); ! die("<br><br><center>The photo and its thumbnail have been deleted! [ <a href='index.php?ID=".$_GET['ID']."'>Manage</a> ]</center>"); }else{ ! die("<br><br><center>The photo has been deleted! [ <a href='index.php?ID=".$_GET['ID']."'>Manage</a> ]</center>"); } } |
Update of /cvsroot/openfirst/photogallery/admin In directory sc8-pr-cvs1:/tmp/cvs-serv19520 Modified Files: cleargallery.php edit.php editphoto.php galleryglobals.php index.php newgallery.php upload.php Log Message: Changed system syntax. Made some bug changes. Prepared this module for complete audit. Index: cleargallery.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/admin/cleargallery.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** cleargallery.php 21 Aug 2003 17:53:12 -0000 1.3 --- cleargallery.php 22 Aug 2003 14:58:04 -0000 1.4 *************** *** 27,34 **** --- 27,36 ---- */ + // Include important globals related to this module include("../../config/globals.php"); include($header); include("galleryglobals.php"); + // Check if user is an admin then allow processes if(! ISSET($user->user)){ showlogin(); *************** *** 36,39 **** --- 38,42 ---- } + // Retrieve gallery information $query = mysql_query("SELECT * FROM ofirst_photogallery_galleries WHERE ID = '".$_GET['ID']."'"); $gallery = mysql_fetch_object($query); *************** *** 46,60 **** $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); ! } ! } ! echo "<br><br><center>The <b>".$gallery->GalleryName."</b> gallery has been reset. [ <a href='index.php'>Manage</a> ]<br><br>"; ! die(include($footer)); ! } } --- 49,68 ---- $dir = opendir($dirlocate); ! // Run through the files in the current folder ! while(! (($file = readdir($dir) === false)){ ! // Delete file and its thumbs in the folder ! if (is_file($dirlocate."/".$file)){ ! unlink($dirlocate."/".$file); ! ! if (file_exists($dirlocate."/thumbs/".$file)){ ! unlink($dirlocate."/thumbs/".$file); ! } ! ! } ! ! echo "<br><br><center>The <b>".$gallery->GalleryName."</b> gallery has been reset. [ <a href='index.php'>Manage</a> ]<br><br>"; ! die(include($footer)); ! } } Index: edit.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/admin/edit.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** edit.php 21 Aug 2003 14:32:58 -0000 1.3 --- edit.php 22 Aug 2003 14:58:04 -0000 1.4 *************** *** 27,31 **** */ ! // Import globals and estbalish database connection include("../../config/globals.php"); include($header); --- 27,31 ---- */ ! // Include important globals related to this module include("../../config/globals.php"); include($header); *************** *** 33,37 **** // Check if user is an admin then allow processes ! if (isset($user->user)){ // Check if user initiated delete and run delete process --- 33,40 ---- // Check if user is an admin then allow processes ! if(! ISSET($user->user)){ ! showlogin(); ! die(include($footer)); ! } // Check if user initiated delete and run delete process *************** *** 39,46 **** echo("<p>Are you absolutely sure you want to delete this gallery? All pictures in the gallery will be removed from the server.</p> <a href='edit.php?DELETE=" . $_GET["DELETE"] . "&CONFIRMED=1'>Yes, I am sure</a> <a href='edit.php'>No, I've changed my mind</a>"); 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); function deldir($dir){ $current_dir = opendir($dir); --- 42,50 ---- echo("<p>Are you absolutely sure you want to delete this gallery? All pictures in the gallery will be removed from the server.</p> <a href='edit.php?DELETE=" . $_GET["DELETE"] . "&CONFIRMED=1'>Yes, I am sure</a> <a href='edit.php'>No, I've changed my mind</a>"); 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 function deldir($dir){ $current_dir = opendir($dir); *************** *** 52,62 **** --- 56,71 ---- } } + + // Close the directory for future reading closedir($current_dir); rmdir(${dir}); } + // If the files exist then delete them if(file_exists("../" . $gallerydir.$gallery->GalleryName."/thumbs")) { deldir("../".$gallerydir.$gallery->GalleryName."/thumbs"); } + + // If the files exist then delete them if(file_exists("../" . $gallerydir.$gallery->GalleryName)) { deldir("../".$gallerydir.$gallery->GalleryName); *************** *** 66,86 **** echo "<br><br><center>The gallery has been deleted! [ <a href='index.php'>Manage</a> ]</center><br>"; die(include($footer)); } // 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> ]"); ! 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='index.php'>Manage</a> ]"); ! die("<br><br><center>The photo and its thumbnail have been deleted! [ <a href='index.php?ID=".$_GET['ID']."'>Manage</a> ]</center>"); ! }else{ ! die("<br><br><center>The photo has been deleted! [ <a href='index.php?ID=".$_GET['ID']."'>Manage</a> ]</center>"); ! } } $query = mysql_query("SELECT * FROM ofirst_photogallery_galleries WHERE ID = '".$_GET['ID']."'"); $gallery = mysql_fetch_object($query); --- 75,98 ---- echo "<br><br><center>The gallery has been deleted! [ <a href='index.php'>Manage</a> ]</center><br>"; die(include($footer)); + } // 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> ]"); ! ! // If the file exists then delete the image and its thumbs ! 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='index.php'>Manage</a> ]"); ! die("<br><br><center>The photo and its thumbnail have been deleted! [ <a href='index.php?ID=".$_GET['ID']."'>Manage</a> ]</center>"); ! }else{ ! die("<br><br><center>The photo has been deleted! [ <a href='index.php?ID=".$_GET['ID']."'>Manage</a> ]</center>"); ! } } + // Get information above the gallery $query = mysql_query("SELECT * FROM ofirst_photogallery_galleries WHERE ID = '".$_GET['ID']."'"); $gallery = mysql_fetch_object($query); *************** *** 88,96 **** ?> <h2>Edit Gallery</h2> ! <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> | ! <a href="edit.php?DELETE=<?php echo $_GET['ID']; ?>">Delete Gallery</a> (Must ! be empty to perform operation)</p> <table width="388" align="center"> <tr> --- 100,110 ---- ?> <h2>Edit Gallery</h2> ! ! <em><?php echo $gallery->GalleryName; ?></em> Options -<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> ! | <a href="edit.php?DELETE=<?php echo $_GET['ID']; ?>">Delete Gallery</a> ! (Must be empty to perform operation)<br><br> ! <table width="388" align="center"> <tr> *************** *** 111,114 **** --- 125,129 ---- if (is_file($dirlocate."/".$file)){ $num++; + ?> <tr> *************** *** 116,121 **** <td valign="top"><?php echo $file; ?></td> <td valign="top"> ! <?php if (file_exists($dirlocate."/thumbs/".$file)){ echo "Yes"; --- 131,137 ---- <td valign="top"><?php echo $file; ?></td> <td valign="top"> ! <?php + // Check if the file exists then print if it has a thumb or not if (file_exists($dirlocate."/thumbs/".$file)){ echo "Yes"; *************** *** 126,133 **** ?> </td> ! <td valign="top">[ <a href="editphoto.php?ID=<?php echo $_GET['ID']; ?>&PHOTO=<?php echo $file; ?>">Edit</a> ! ]<br> ! [ <a href='edit.php?ID=<?php echo $_GET['ID']; ?>&DELETEPHOTO=True&PHOTO=<?php echo $file; ?>'> ! Delete</a> ] </td> </tr> <?php --- 142,147 ---- ?> </td> ! <td valign="top">[ <a href="editphoto.php?ID=<?php echo $_GET['ID']; ?>&PHOTO=<?php echo $file; ?>">Edit</a> ]<br> ! [ <a href='edit.php?ID=<?php echo $_GET['ID']; ?>&DELETEPHOTO=True&PHOTO=<?php echo $file; ?>'>Delete</a> ] </td> </tr> <?php *************** *** 135,140 **** } } if($num == 0){ ! echo "<tr><td>--</td><td><br>No photos in gallery!<br><br></td><td>--</td><td>--</td></tr>"; } ?> --- 149,156 ---- } } + + // If there is no record then preview no photos message if($num == 0){ ! echo "<tr><td> </td><td><br>No photos in gallery!<br><br></td><td> </td><td> </td></tr>"; } ?> *************** *** 145,152 **** <br> </center> ! <?php ! }else{ ! showlogin(); ! } ! include($footer); ! ?> --- 161,163 ---- <br> </center> ! <?php include($footer); ?> Index: editphoto.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/admin/editphoto.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** editphoto.php 21 Aug 2003 17:51:06 -0000 1.1 --- editphoto.php 22 Aug 2003 14:58:04 -0000 1.2 *************** *** 27,34 **** --- 27,36 ---- */ + // Import globals and estbalish database connection include("../../config/globals.php"); include($header); include("galleryglobals.php"); + // Check if user is an admin then allow processes if(! ISSET($user->user)){ showlogin(); *************** *** 66,72 **** --- 68,77 ---- 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 *************** *** 76,79 **** --- 81,86 ---- WHERE Gallery = '".$_GET['ID']."' AND Image = '".$_GET['PHOTO']."'") or die(mysql_error()); } + + // Delete the textfile that goes with the actual image if(ISSET($_POST['deletefile'])){ $textfile = substr($_GET['PHOTO'],0,-4).".txt"; *************** *** 83,90 **** --- 90,100 ---- echo "<br><br>Image information updated."; } + echo " [ <a href='editphoto.php?ID=".$_GET['ID']."&PHOTO=".$_GET['PHOTO']."'>Manage</a> ]<br><br>"; die(include($footer)); + } + // 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']."'"); *************** *** 96,105 **** <h2>Edit Gallery</h2> <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> | ! <a href="edit.php?DELETE=<?php echo $_GET['ID']; ?>">Delete Gallery</a> (Must be empty to perform operation)</p> <p align="center"><img src="../gallery/<?php echo $gallery->GalleryName; ?>/<?php echo $_GET['PHOTO']; ?>" width="300" height="225"><br> ! <br> ! [ <a href="makethumb.php?ID=<?php echo $_GET['ID']; ?>&PHOTO=<?php echo $_GET['PHOTO']; ?>">Make Thumbnail</a> ]</p> <form action='editphoto.php?ID=<?php echo $_GET['ID']; ?>&PHOTO=<?php echo $_GET['PHOTO']; ?>' method='POST'> <table width="456" align="center"> --- 106,114 ---- <h2>Edit Gallery</h2> <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> ! | <a href="edit.php?DELETE=<?php echo $_GET['ID']; ?>">Delete Gallery</a> (Must be empty to perform operation)</p> <p align="center"><img src="../gallery/<?php echo $gallery->GalleryName; ?>/<?php echo $_GET['PHOTO']; ?>" width="300" height="225"><br> ! <br>[ <a href="makethumb.php?ID=<?php echo $_GET['ID']; ?>&PHOTO=<?php echo $_GET['PHOTO']; ?>">Make Thumbnail</a> ]</p> <form action='editphoto.php?ID=<?php echo $_GET['ID']; ?>&PHOTO=<?php echo $_GET['PHOTO']; ?>' method='POST'> <table width="456" align="center"> *************** *** 159,163 **** </table> </form><br><br> ! <?php ! include($footer); ! ?> --- 168,170 ---- </table> </form><br><br> ! <?php include($footer); ?> Index: galleryglobals.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/admin/galleryglobals.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** galleryglobals.php 20 Aug 2003 16:54:21 -0000 1.1 --- galleryglobals.php 22 Aug 2003 14:58:04 -0000 1.2 *************** *** 27,43 **** */ ! // Declare gallery location compared to galleryglobals.php ! $gallerydir = "gallery/"; ! //Declare image types allowed for uploading/previewing ! $imgtypes = "gif,jpg,peg,png,bmp"; // Note that any extensions that you have beyond // 4 characters must be added to this variable // only as the last three digits. ie. jpeg = peg ! // Declare maximum execution time for the galleries ! $gallery_execution_time = "1200"; ! // Declare SMTP to use when sending photo's by e-mail ! $SMTP = "smtp.localhost.com"; ?> --- 27,43 ---- */ ! // Declare gallery location compared to galleryglobals.php ! $gallerydir = "gallery/"; ! //Declare image types allowed for uploading/previewing ! $imgtypes = "gif,jpg,peg,png,bmp"; // Note that any extensions that you have beyond // 4 characters must be added to this variable // only as the last three digits. ie. jpeg = peg ! // Declare maximum execution time for the galleries ! $gallery_execution_time = "1200"; ! // Declare SMTP to use when sending photo's by e-mail ! $SMTP = "smtp.localhost.com"; ?> Index: index.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/admin/index.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** index.php 21 Aug 2003 17:53:12 -0000 1.3 --- index.php 22 Aug 2003 14:58:04 -0000 1.4 *************** *** 32,35 **** --- 32,36 ---- include("galleryglobals.php"); + // Check if user is an admin then allow processes if(! ISSET($user->user)){ showlogin(); *************** *** 39,53 **** ?> <h2>Gallery Manager</h2> ! Here is a list of current galleries installed on our website. ! <p align="center"> <table width="633" align="center"> <tr> ! <th valign="top"> <div align="center"> </div></td> ! <th><strong>Gallery Name</strong></th> <th><strong>Description</strong></th> <th> <div align="left"><strong>Option</strong></div></th> </tr> ! <?php // Retrieve galleries from database and list them accordingly --- 40,52 ---- ?> <h2>Gallery Manager</h2> ! Here is a list of current galleries installed on our website.<br> <table width="633" align="center"> <tr> ! <th valign="top"><div align="center"></div></th> <th><strong>Gallery Name</strong></th> <th><strong>Description</strong></th> <th> <div align="left"><strong>Option</strong></div></th> </tr> ! <?php // Retrieve galleries from database and list them accordingly *************** *** 64,72 **** [ <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>"; } --- 63,73 ---- [ <a href="edit.php?DELETE=<?php echo $gallery->ID; ?>">Delete</a> ]</td> </tr> ! <?php ! } + // 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"; } *************** *** 75,79 **** <br></p> <p align="center"> </p> ! <?php ! include($footer); ! ?> --- 76,78 ---- <br></p> <p align="center"> </p> ! <?php include($footer); ?> Index: newgallery.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/admin/newgallery.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** newgallery.php 21 Aug 2003 17:53:12 -0000 1.3 --- newgallery.php 22 Aug 2003 14:58:04 -0000 1.4 *************** *** 82,86 **** </table> </form> ! <?php ! include($footer); ! ?> --- 82,84 ---- </table> </form> ! <?php include($footer); ?> Index: upload.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/admin/upload.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** upload.php 21 Aug 2003 18:04:13 -0000 1.5 --- upload.php 22 Aug 2003 14:58:04 -0000 1.6 *************** *** 32,35 **** --- 32,36 ---- include("galleryglobals.php"); + // Check if user is an admin then allow processes if(! ISSET($user->user)){ showlogin(); *************** *** 43,60 **** if(ISSET($_POST['upload'])){ ! ini_set("max_execution_time",$gallery_execution_time); ! $dirlocate = "../".$gallerydir.$gallery->GalleryName; ! ! $imgtypes .= ",txt"; ! $imgtypes = explode(",",$imgtypes); ! for ($num=1;$num<=$_POST['NUM_UPLOADS'];$num++){ ! ! // If upload field is empty then exit the particular loop ! if (! $_FILES['upload'.$num]['name'] == ""){ ! $continue = false; // NOTE: The change to uppercase in the if statement helps remove errors --- 44,59 ---- if(ISSET($_POST['upload'])){ ! ini_set("max_execution_time",$gallery_execution_time); ! $dirlocate = "../".$gallerydir.$gallery->GalleryName; ! $imgtypes .= ",txt"; ! $imgtypes = explode(",",$imgtypes); ! for ($num=1;$num<=$_POST['NUM_UPLOADS'];$num++){ ! // If upload field is empty then exit the particular loop ! if (! $_FILES['upload'.$num]['name'] == ""){ ! $continue = false; // NOTE: The change to uppercase in the if statement helps remove errors *************** *** 74,79 **** continue; } ! ! 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']." - "; --- 73,78 ---- continue; } ! ! // Copy files to the proper directory 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']." - "; *************** *** 97,102 **** ?> <h2>Upload to Gallery</h2> ! <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 Allowed: <?php echo $imgtypes; ?></p> --- 96,100 ---- ?> <h2>Upload to Gallery</h2> ! <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 Allowed: <?php echo $imgtypes; ?></p> *************** *** 113,121 **** 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); ! ?> --- 111,118 ---- 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); ?> |
From: <dav...@us...> - 2003-08-22 14:57:31
|
Update of /cvsroot/openfirst/photogallery In directory sc8-pr-cvs1:/tmp/cvs-serv19444 Modified Files: email.php gallery.php gallery.PNG index.php photogallery.php viewphoto.php Log Message: Changed system syntax. Made some bug changes. Prepared this module for complete audit. Index: email.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/email.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** email.php 21 Aug 2003 18:02:40 -0000 1.5 --- email.php 22 Aug 2003 14:57:28 -0000 1.6 *************** *** 27,88 **** */ ! // Import globals and estbalish database connection include("../config/globals.php"); include($header); include("admin/galleryglobals.php"); $query = mysql_query("SELECT * FROM ofirst_photogallery_galleries WHERE ID = '".$_GET['ID']."'"); $gallery = mysql_fetch_object($query); ! if(ISSET($_POST['send'])){ ! ini_set("MAX_EXECUTION_TIME",$gallery_execution_time); ! ini_set("SMTP",$SMTP); ! $from = $_POST['name']; ! $email = $_POST['email']; ! $recipient = $_POST['recipient']; ! $recipientemail = $_POST['recipientemail']; ! $comment = $_POST['comment']; ! $headers = "MIME-Version: 1.0\r\n"; ! $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; ! $headers .= "From: ".$title." Photo Gallery <".$mailfrom.">\r\n"; ! $headers .= "Reply-To: ".$mailfrom."\r\n"; ! $headers .= "X-Priority: 1\r\n"; ! $headers .= "X-MSMail-Priority: High\r\n"; ! $message = "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'> ! <html><head><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'> ! </head><body><div align='center'> ! <table width='550' border='0' cellspacing='0' cellpadding='0'> ! <tr> ! <td height='23'><p>Hello ".$recipient.",</p> ! <p>This is a message from the <b>".$title."</b> photo ! gallery mailing system. <b>".$from." (".$email.")</b> ! has requested that you peview this image. Here are his comments:</p> ! <table width='400' border='1' align='center' cellpadding='6' cellspacing='0' bordercolor='#333333'> ! <tr> ! <td height='23'><p>".$comment."<br> ! </p> ! </td> ! </tr> ! </table> ! <p align='center'><img src='".$home.$basepath."/photogallery/gallery/$gallery->GalleryName".$_POST['photo']."' width='300' height='200'></p> ! <p align='left'>Thank you for your time,</p> ! <p align='left'>The <b>".$title."</b> photo gallery.<br> ! </p></td> ! </tr> ! </table> ! </div></body></html>"; ! if(funcion_exists("multipartmail")){ multipartmail($recipientemail, $title."Gallery Photo Sender", $message); }else{ mail($recipientemail,$title." Gallery Photo Sender",$message,$headers) or die("<br><br><br><center>E-Mail was <b>not</b> successfully sent!</center>"); } ! echo "<br><br><br><center>Photo was successfully sent recipient, thank you! [ <a href='index.php'>Galleries</a> ]</center>"; die(include($footer)); --- 27,96 ---- */ ! // Include important globals related to this module include("../config/globals.php"); include($header); include("admin/galleryglobals.php"); + // 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 if(ISSET($_POST['send'])){ ! // Set the max execution time for the script so that it will not time out, then set the SMTP server to send with ! ini_set("MAX_EXECUTION_TIME",$gallery_execution_time); ! ini_set("SMTP",$SMTP); ! // Prepare information to be placed in e-mail ! $from = $_POST['name']; ! $email = $_POST['email']; ! $recipient = $_POST['recipient']; ! $recipientemail = $_POST['recipientemail']; ! $comment = $_POST['comment']; ! // Set header information in case the multipartmail function is not present ! $headers = "MIME-Version: 1.0\r\n"; ! $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; ! $headers .= "From: ".$title." Photo Gallery <".$mailfrom.">\r\n"; ! $headers .= "Reply-To: ".$mailfrom."\r\n"; ! $headers .= "X-Priority: 1\r\n"; ! $headers .= "X-MSMail-Priority: Medium\r\n"; ! // Declare the information to be placed in the email ! $message = "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'> ! <html><head><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'> ! </head><body><div align='center'> ! <table width='550' border='0' cellspacing='0' cellpadding='0'> ! <tr> ! <td height='23'><p>Hello ".$recipient.",</p><p>This is a message from the <b>".$title."</b> photo ! gallery mailing system. <b>".$from." (".$email.")</b> ! has requested that you peview this image. Here are his comments:</p> ! <table width='400' border='1' align='center' cellpadding='6' cellspacing='0' bordercolor='#333333'> ! <tr> ! <td height='23'><p>".$comment."<br></p></td> ! </tr> ! </table> ! ! <p align='center'><img src='".$home.$basepath."/photogallery/gallery/$gallery->GalleryName".$_POST['photo']."' width='300' height='200'></p> ! <p align='left'>Thank you for your time,</p> ! <p align='left'>The <b>".$title."</b> photo gallery.<br></p> ! </td> ! </tr> ! </table></div></body></html>"; ! ! // Check if multipartmail is declared or else use regular mailing function ! if(function_exists("multipartmail")){ multipartmail($recipientemail, $title."Gallery Photo Sender", $message); }else{ mail($recipientemail,$title." Gallery Photo Sender",$message,$headers) or die("<br><br><br><center>E-Mail was <b>not</b> successfully sent!</center>"); } ! ! // Print out the completion of the e-mailing then die out ! echo "<br><br><br>Photo was successfully sent to the recipient, thank you! [ <a href='index.php'>Galleries</a> ]<br><br><br>"; die(include($footer)); *************** *** 91,102 **** ?> <h2>Send To A Friend</h2> ! <p>[ <a href="index.php">View Galleries</a> ] ! <p align="center"><br> ! <img border="1px" src="gallery/<?php echo $gallery->GalleryName."/".$_GET['PHOTO']; ?>" width="200" height="150"><br> ! <br> ! You have requested to send this photo to a friend. Please enter the required<br> ! information below. <form method="POST" action="email.php?ID=<?php echo $_GET['ID']; ?>&PHOTO=<?php echo $_GET['PHOTO']; ?>"> ! <input type="hidden" name="photo" value="<?php echo $_GET['PHOTO']; ?>"> <table width="521" border="0" align="center" cellpadding="6" cellspacing="0"> <tr bgcolor="#999999"> --- 99,110 ---- ?> <h2>Send To A Friend</h2> ! <p>[ <a href="index.php">View Galleries</a> ]<br><br> ! ! <img border="1px" src="gallery/<?php echo $gallery->GalleryName."/".$_GET['PHOTO']; ?>" width="200" height="150"><br><br> ! You have requested to send this photo to a friend. Please enter the required<br>information below. ! <form method="POST" action="email.php?ID=<?php echo $_GET['ID']; ?>&PHOTO=<?php echo $_GET['PHOTO']; ?>"> ! <input type="hidden" name="photo" value="<?php echo $_GET['PHOTO']; ?>"> ! <table width="521" border="0" align="center" cellpadding="6" cellspacing="0"> <tr bgcolor="#999999"> *************** *** 142,145 **** </table> </form> - <p> <?php include($footer); ?> --- 150,152 ---- Index: gallery.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/gallery.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** gallery.php 20 Aug 2003 19:03:31 -0000 1.6 --- gallery.php 22 Aug 2003 14:57:28 -0000 1.7 *************** *** 27,31 **** */ ! // Import globals and estbalish database connection include("../config/globals.php"); include($header); --- 27,31 ---- */ ! // Include important globals related to this module include("../config/globals.php"); include($header); *************** *** 43,51 **** </tr> </table> ! <p> </p> ! <div align="center"></div> ! <div align="center"></div> ! <table width="75" border="0" align="center" cellpadding="5" cellspacing="0"> ! <tr><th></th><th><?php echo $gallery->GalleryName; ?></th><th></th></tr> <?php --- 43,53 ---- </tr> </table> ! <br> ! <table width="450" border="0" align="center" cellpadding="5" cellspacing="0"> ! <tr> ! <th width="150"> </th> ! <th width="150"><?php echo $gallery->GalleryName; ?></th> ! <th width="150"> </th> ! </tr> <?php *************** *** 54,86 **** $dir = opendir($dirlocate); $num = 1; ! echo "<tr>"; while(! (($file = readdir($dir)) === false)){ if (! is_dir($dirlocate."/".$file)){ if ($num > 3){ ! echo "</tr><tr>"; $num = 1; } ! echo "<td width='34%'><center><a target='_blank' href='viewphoto.php?ID=".$_GET['ID']."&PHOTO=".$file."'>"; ! if(file_exists($dirlocate."/thumbs/".$file)){ ! echo "<img border='1px' height=100 width=152 src='".$dirlocate."/thumbs/".$file."'>"; ! }else{ ! echo "<img border='1px' height=100 width=152 src='".$dirlocate."/".$file."'>"; ! } ! echo "</a><br><a href='email.php?PHOTO=".$dirlocate."/".$file."'><img border='0' src=email.PNG alt='Email to a friend'></a><img border='0' src='spacer.PNG'><a target='_blank' href='viewphoto.php?ID=".$_GET['ID']."&PHOTO=".$file."'><img border='0' alt='Enlarge' src='enlarge.PNG'> ! </a></center></a></td>"; $num++; } ! } ?> ! </table> ! <p align="center"> </p> ! <p align="center">The content within the galleries are copyright of this website ! and its ownering team.<br> ! In order to use ! or copy its content please contact the teams webmaster.</p> ! <p align="center"> </p> <?php include($footer); ?> --- 56,121 ---- $dir = opendir($dirlocate); + // Set image count as 1 and echo the beginning row + $photo = 0; $num = 1; ! echo " <tr>\n"; ! ! // Begin reading the directory for images while(! (($file = readdir($dir)) === false)){ + + // If the directory is not a dir then continue the process if (! is_dir($dirlocate."/".$file)){ + + // Explode file type then check if the file is allowed by the photogallery globals + $imgtype = explode(",",$imgtypes); + $continue = false; + + foreach($imgtype As $type){ + $extension = substr($file,-3); + if(strtoupper($extension) == strtoupper($type)){ + $continue = true; + continue; + } + } + + // If continue, which is set true/false above, is false then stop the loop for this image + if($continue){ + + // If the current loop if greater then three then create a new row and set value back to 1 if ($num > 3){ ! echo " </tr>\n <tr>\n"; $num = 1; } ! ! // Setup column for the next image ! echo " <td width='34%'><center><a target='_blank' href='viewphoto.php?ID=".$_GET['ID']."&PHOTO=".$file."'>"; ! // Check if there is a thumb available for this image, if so then use it or else preview the actual reduced image ! if(file_exists($dirlocate."/thumbs/".$file)){ ! echo "<img border='1px' height=100 width=152 src='".$dirlocate."/thumbs/".$file."'>"; ! }else{ ! echo "<img border='1px' height=100 width=152 src='".$dirlocate."/".$file."'>"; ! } ! // Add e-mail and image expand buttons as well as close column ! echo "</a><br><a href='email.php?PHOTO=$file&ID=".$_GET['ID']."'><img border='0' src=email.PNG alt='Email to a friend'></a> ! <img border='0' src='spacer.PNG'><a target='_blank' href='viewphoto.php?ID=".$_GET['ID']."&PHOTO=".$file."'><img border='0' alt='Enlarge' src='enlarge.PNG'></a> ! </center></td>\n"; ! ! // Add number for amount of images previewed $num++; + $photo++; + } } ! } ! ! // If no photos have been found then preview a no photos message ! if($photo == 0){ ! echo "<td> </td>\n <td><br><br>No photos in gallery!<br><br><br></td>\n <td> </td>\n </tr>"; ! } ?> ! </table><br> ! The content within the galleries are copyright by the owners of this website.<br> ! In order to use or copy its content please contact the teams webmaster or team leader.</p> <?php include($footer); ?> Index: gallery.PNG =================================================================== RCS file: /cvsroot/openfirst/photogallery/gallery.PNG,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 Binary files /tmp/cvsioP7lD and /tmp/cvs8UCQv6 differ Index: index.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/index.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** index.php 20 Aug 2003 19:03:31 -0000 1.4 --- index.php 22 Aug 2003 14:57:28 -0000 1.5 *************** *** 27,41 **** */ ! // Import globals and estbalish database connection include("../config/globals.php"); include($header); include("admin/galleryglobals.php"); - mysql_select_db($sqldatabase,$sqlconnection); - ?> ! <h2>View Galleries</h2> ! <p>Welcome to the gallery viewer. Please select a gallery from the list below:<br> ! </p> <table width="701" align="center"> <tr> --- 27,37 ---- */ ! // Include important globals related to this module include("../config/globals.php"); include($header); include("admin/galleryglobals.php"); ?> ! <h2>View Galleries</h2>Welcome to the gallery viewer. Please select a gallery from the list below:<br><br> <table width="701" align="center"> <tr> *************** *** 43,49 **** <th><strong>Gallery Name</strong></th> <th> <div align="center"><strong>Description</strong></div></th> ! <th width="229"><b>Date</b></th> </tr> ! <?php // List galleries from database --- 39,45 ---- <th><strong>Gallery Name</strong></th> <th> <div align="center"><strong>Description</strong></div></th> ! <th width="176"><b>Date</b></th> </tr> ! <?php // List galleries from database *************** *** 52,72 **** ?> ! <tr> ! <td width="59" valign="top"><a href="gallery.php?ID=<?php echo $gallery->ID; ?>"><img src="gallery.PNG" width="58" height="51" border="0"></a></td> ! <td width="142" valign="top"><a href='gallery.php?ID=<?php echo $gallery->ID; ?>'><?php echo $gallery->GalleryName; ?></a></td> ! <td width="223" valign="top"><?php echo $gallery->Description; ?></td> ! <td width="223" valign="top"><?php echo date("F j, Y, g:i a",$gallery->Dates); ?></td> </tr> <?php } if (mysql_num_rows($query) == 0){ ! echo "<tr><td>--</td><td><br>There are no galleries uploaded<br><br></td>"; } ?> </table> ! <p align="center">The content within the galleries are copyright of this website ! and its ownering team.<br> ! In order to use or copy its content please contact the teams webmaster.</p> ! <?php include($footer); ?> --- 48,68 ---- ?> ! <tr onMouseOver="this.style.backgroundColor='#cccccc'" onMouseOut="this.style.backgroundColor='#ffffff'" bgcolor="#ffffff"> ! <td width="61" valign="top"><div align="center"><a href="gallery.php?ID=<?php echo $gallery->ID; ?>"><img src="gallery.PNG" border="0"></a></div></td> ! <td width="147" valign="top"><a href='gallery.php?ID=<?php echo $gallery->ID; ?>'><?php echo $gallery->GalleryName; ?></a></td> ! <td width="297" valign="top"><?php echo $gallery->Description; ?></td> ! <td width="176" valign="top"><?php echo date("F j, Y, g:i a",$gallery->Dates); ?></td> </tr> <?php } + // 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>"; } ?> </table> ! <p align="center">The content within the galleries are copyright of this website and its ownering team.<br> ! In order to use or copy its content please contact the teams webmaster.</p> ! <?php include($footer); ?> \ No newline at end of file Index: photogallery.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/photogallery.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** photogallery.php 20 Aug 2003 23:09:49 -0000 1.2 --- photogallery.php 22 Aug 2003 14:57:28 -0000 1.3 *************** *** 27,32 **** */ ! // NOTE: The galleryrandimg() function still needs to be developed, although will not be available yet for time restraints. ! // Function to preview images from any gallery on command. --- 27,32 ---- */ ! // NOTE: The galleryrandimg() function still needs to be developed, ! // although will not be available yet for time restraints. // Function to preview images from any gallery on command. *************** *** 38,42 **** // 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); --- 38,41 ---- *************** *** 46,51 **** }else{ echo "<a href='$basepath/photogallery/viewphoto.php?ID=$gallery&PHOTO=$image'><img border='0' alt='Gallery Image' height='$height' width='$width' src='$basepath/photogallery/gallery/$thisgallery->GalleryName/$image'></a>"; ! } ! } --- 45,49 ---- }else{ echo "<a href='$basepath/photogallery/viewphoto.php?ID=$gallery&PHOTO=$image'><img border='0' alt='Gallery Image' height='$height' width='$width' src='$basepath/photogallery/gallery/$thisgallery->GalleryName/$image'></a>"; ! } } Index: viewphoto.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/viewphoto.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** viewphoto.php 21 Aug 2003 18:02:40 -0000 1.5 --- viewphoto.php 22 Aug 2003 14:57:28 -0000 1.6 *************** *** 27,31 **** */ ! // Import globals and estbalish database connection $header_condense = true; include("../config/globals.php"); --- 27,31 ---- */ ! // Include important globals related to this module $header_condense = true; include("../config/globals.php"); *************** *** 33,37 **** --- 33,39 ---- include("admin/galleryglobals.php"); + // If a comment is being added then run process if(ISSET($_POST['addcomment'])){ + mysql_query("INSERT INTO ofirst_photogallery_comments SET Image = '".$_GET['PHOTO']."', *************** *** 46,50 **** --- 48,54 ---- } + // If a comment is being deleted then check if the user is looged in then delete if(ISSET($_GET['COMMENT'])){ + if(ISSET($user->user)){ mysql_query("DELETE FROM ofirst_photogallery_comments WHERE ID = '".$_GET['COMMENT']."'"); *************** *** 52,59 **** die(include($footer)); } } ! $imgquery = mysql_query("SELECT * FROM ofirst_photogallery_image WHERE Gallery = '".$_GET['ID']."' AND Image = '".$_GET['PHOTO']."'"); ! $image = mysql_fetch_object($query); ?> --- 56,69 ---- die(include($footer)); } + } ! ! // 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); ?> *************** *** 65,79 **** <th>Photo</th> </tr> - <?php - - // Retrieve information about the photos related gallery - $query = mysql_query("SELECT * FROM ofirst_photogallery_galleries WHERE ID = '".$_GET['ID']."'"); - $gallery = mysql_fetch_object($query); - - ?> <tr> <td width="308" valign="top"><table width="100%"> <tr> ! <td width="20%"><a href="gallery.php?ID=<?php echo $gallery->ID; ?>"><img src="gallery.PNG" width="58" height="51" border="0"></a></td> <td width="80%"><?php if(mysql_num_rows($imgquery) == 0){ echo $_GET['PHOTO']; }else{ echo $image->ImageName; } ?></td> </tr> --- 75,82 ---- <th>Photo</th> </tr> <tr> <td width="308" valign="top"><table width="100%"> <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> *************** *** 87,91 **** </tr> <?php ! if(mysql_num_rows($query) == 0){ ?> <tr> --- 90,95 ---- </tr> <?php ! // If there are values for the query then preview the image ! if(! mysql_num_rows($imgquery) == 0){ ?> <tr> *************** *** 97,101 **** <td><?php echo date("F j, Y, g:i a",$image->Dates); ?></td> </tr> ! <?php } ?> <tr> <td> </td> --- 101,107 ---- <td><?php echo date("F j, Y, g:i a",$image->Dates); ?></td> </tr> ! <?php ! } ! ?> <tr> <td> </td> *************** *** 131,135 **** </td> <td width="433" valign="top"> ! <?php // Declare dir location --- 137,141 ---- </td> <td width="433" valign="top"> ! <?php // Declare dir location *************** *** 148,157 **** </tr> <?php $query = mysql_query("SELECT * FROM ofirst_photogallery_comments WHERE Gallery = '".$_GET['ID']."' AND Image = '".$_GET['PHOTO']."'"); ! while($comment = mysql_fetch_object($query)){ ?> ! <tr> <td width="33%"><strong><?php echo $comment->Author; ?><br></strong><a href='mailto:<?php echo $comment->EMail; ?>'>E-Mail Now</a><br> <?php if(ISSET($user->user)){ echo "<a href='viewphoto.php?ID=".$_GET['ID']."&PHOTO=".$_GET['PHOTO']."&COMMENT=".$comment->ID."'>Delete</a>"; --- 154,168 ---- </tr> <?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)){ ! ?> ! <tr onMouseOver="this.style.backgroundColor='#cccccc'" onMouseOut="this.style.backgroundColor='#ffffff'" bgcolor="#ffffff"> <td width="33%"><strong><?php echo $comment->Author; ?><br></strong><a href='mailto:<?php echo $comment->EMail; ?>'>E-Mail Now</a><br> <?php + // If user is logged in then offer the option of deleting the comment if(ISSET($user->user)){ echo "<a href='viewphoto.php?ID=".$_GET['ID']."&PHOTO=".$_GET['PHOTO']."&COMMENT=".$comment->ID."'>Delete</a>"; *************** *** 165,171 **** } if(mysql_num_rows($query) == 0){ ! echo "<tr><td>--</td><td>There are no comments for this image!</td></tr>"; } ?> </table> --- 176,184 ---- } + // 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>"; } + ?> </table> |