openfirst-cvscommit Mailing List for openFIRST (Page 97)
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: <dav...@us...> - 2003-06-08 01:45:56
|
Update of /cvsroot/openfirst/awards/admin In directory sc8-pr-cvs1:/tmp/cvs-serv6752/admin Log Message: Directory /cvsroot/openfirst/awards/admin added to the repository |
From: <xt...@us...> - 2003-06-08 01:37:53
|
Update of /cvsroot/openfirst/awards In directory sc8-pr-cvs1:/tmp/cvs-serv4304 Removed Files: manage.php Log Message: Delete files as they are being moved to new locations. --- manage.php DELETED --- |
From: <xt...@us...> - 2003-06-08 01:35:55
|
Update of /cvsroot/openfirst/awards In directory sc8-pr-cvs1:/tmp/cvs-serv3866 Removed Files: awards.php openFIRST.awards.sql openFirst.awards Notes.txt Log Message: Delete files as they are being moved to new locations. --- awards.php DELETED --- --- openFIRST.awards.sql DELETED --- --- openFirst.awards Notes.txt DELETED --- |
Update of /cvsroot/openfirst/config In directory sc8-pr-cvs1:/tmp/cvs-serv25864 Modified Files: README.txt globals.php Added Files: auth.php first.php globals-default.php index.php install.php Log Message: Update config module to have an easy to use graphical wizard that will guide you through setup, and to include module install capabilities. --- NEW FILE: auth.php --- <?php /* * openFIRST.config - auth.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 * */ if(isset($encryption) == false) { $encryption = "crypt"; } mysql_select_db($sqldatabase,$sqlconnection); // Provide functions for the various encryption types... // syntax: cryptpassword(password, encryption-type, salt); function cryptpassword ($password, $encryption = "md5", $salt="") { if ($encryption == "crc32") { return(crc32($password)); } elseif ($encryption == "sha1") { return(sha1($password)); } elseif ($encryption == "crypt") { return(crypt($password, $salt)); } else { return(md5($password)); } } function membersmenu($membertype) { echo("<p><a href='../members'>Members Home</a> <a href='../awards/manage.php'>Manage Awards</a> <a href='../members/profile.php'>Members Profiles</a> <a href='../members/updateprofile.php'>Update Profile</a> <a href='../members/skills.php'>Update Skills</a> "); if($membertype == "administrator") { echo("<a href='../members/sqlinstall.php'>Install SQL Tables</a> <a href='../members/adduser.php'>Add User</a>"); if(is_readable("../news/addnews.php") == true) { echo(" <a href='../news/addnews.php'>Add news</a>"); } } echo(" <a href='../members/logout.php'>Logout</a></p>"); return(0); } function showlogin () { echo("<form action='".$_SERVER["PHP_SELF"] . "' method='post'> Login: <input name='login' type='text' /> <br />Password: <input name='password' type='password' /> <br /><input type='submit' value='Login'> </form>"); return(0); } // Determine if the user has already logged in with this session. If // they have, set variables indicating this. If they have not, make a // note of this so that components requiring them to log in are disabled. if(isset($_SESSION['authcode'])) { $authcode = $_SESSION['authcode']; $query = mysql_query("SELECT * FROM ofirst_members WHERE authcode='$authcode';"); if(mysql_errno() == 0 && mysql_num_rows($query) == 1) { $user = mysql_fetch_object($query); } else { unset($_SESSION['authcode']); $query = mysql_query("SELECT * FROM ofirst_members WHERE user='" . $_POST["login"] . "';"); if(mysql_errno() == 0) { $user = mysql_fetch_object($query); if(mysql_num_rows($query) == 1) { if(cryptpassword($_POST["password"], $encryption, $user->password) == $user->password) { session_register("authcode"); $_SESSION["authcode"] = rand(1,50000000); $aquery = mysql_query("UPDATE ofirst_members SET authcode='" . $_SESSION["authcode"] . "' WHERE user='" . $_POST["login"] . "';"); } else { unset($user); } }} } } elseif(isset($_POST["login"]) == true && isset($_POST["password"]) == true) { $query = mysql_query("SELECT * FROM ofirst_members WHERE user='" . $_POST["login"] . "';"); if(mysql_errno() == 0) { $user = mysql_fetch_object($query); if(mysql_num_rows($query) == 1) { if(cryptpassword($_POST["password"], $encryption, $user->password) == $user->password) { session_register("authcode"); $_SESSION["authcode"] = rand(1,50000000); $aquery = mysql_query("UPDATE ofirst_members SET authcode='" . $_SESSION["authcode"] . "' WHERE user='" . $_POST["login"] . "';"); } else { unset($user); } } } } if(mysql_errno() != 0) { // There was an error, check if it's because they didn't create the // members table. if(mysql_errno() == 1146) { echo("<p>Members table does not exist, therefore I am creating it.</p>"); $query = mysql_query("CREATE TABLE ofirst_members ( UNIQUE(user), user CHAR(128), firstname TINYTEXT, lastname TINYTEXT, lastseen TINYTEXT, ip TINYTEXT, password TEXT, authcode TEXT, membertype TINYTEXT, division TINYTEXT, year INTEGER, email TEXT, icq INTEGER, aim TINYTEXT, msn TINYTEXT, yim TINYTEXT, description TEXT, signature TINYTEXT, dateregistered TINYTEXT, picturelocation TINYTEXT, team INTEGER, skills TEXT );"); if(mysql_errno() == 0) { // Insert a default user 'administrator' and set them to have // administrative access and some password. $query = mysql_query("INSERT INTO ofirst_members (user, membertype, password) VALUES('admin', 'administrator', '" . cryptpassword("openfirst", $encryption) ."');"); echo("<p>Members table has been created. Please login as <b>admin</b> using the password <b>openfirst</b> to set configuration options.</p>"); showlogin(); die(); } else { die(mysql_error()); } } } if(isset($user->user)) { $query = "UPDATE ofirst_members SET lastseen='" . date("h:m:s M d, Y") . "' WHERE user='$user->user';"; $q = mysql_query($query); unset($q); } ?> --- NEW FILE: first.php --- <?php if(isset($_POST["login"])) { die("You have successfully logged in. <a href='index.php'>Access Administrative Configuration Options</a>"); } if(isset($_POST["ostype"])) { if(is_writable("./globals.php")) { $of = fopen("./globals.php", "w"); fputs($of, "<?php /* * OpenFIRST base configuration file * This file has been automatically generated by first.php. * it contains the basic configuration options required to * operate the OpenFIRST web portal software. Note, that * most configuration options are now stored in the MySQL * database, in the ofirst_config table. */ \$ostype = '" . $_POST["ostype"] . "'; if (\$ostype == \"windows\") { ini_set(\"include_path\",\"../config/;.\"); } else { ini_set(\"include_path\",\"../config/:.\"); } \$title = '" . $_POST["title"] . "'; \$version = '" . $_POST["version"] . "'; \$sqlserver = '" . $_POST["sqlserver"] . "'; \$sqluser = '" . $_POST["sqluser"] . "'; \$sqlpassword = '" . $_POST["sqlpassword"] . "'; \$sqldatabase = '" . $_POST["sqldatabase"] . "'; \$sqlconnection = mysql_connect(\"\$sqlserver\",\"\$sqluser\",\"\$sqlpassword\"); \$home = '" . $_POST["home"] . "'; \$header = '" . $_POST["header"] . "'; \$footer = '" . $_POST["footer"] . "'; \$mailnotify = '" . $_POST["mailnotify"] . "'; \$mailfrom = '" . $_POST["mailfrom"] . "'; \$basepath = '" . $_POST["basepath"] . "'; session_start(); include('auth.php'); session_write_close(); ?>"); fclose($of); include("../config/globals.php"); include("$header"); echo("<h1>OpenFIRST Software Configured</h1> <p>If this page does not display errors elsewhere, then your openFIRST has now been successfully configured. If there are errors, check your configuration options and try again. You may now wish to change the permissions on <b>globals.php</b> to prevent unwanted changes to the configuration options. You should be able to login below using the username <b>admin</b> and the password <b>openfirst</b>, if not, then either the password for that account has been changed, or the MySQL settings are incorrect.</p> "); showlogin(); include("$footer"); } else { include("../config/headers.php"); echo("<h1>Base Configuration Error</h1> <p>Cannot write to configuration file. Please check permissions on <b>globals.php</b> and ensure that the web user has the ability to write to this file.</p> <p>For unix, this would typically require the command: <br /> <code> chmod 655 globals.php </code></p> "); } } else { include("../config/headers.php"); ?> <h1>Base Configuration</h1> <p>Congratulations on your choice of OpenFIRST software. Please proceed through this setup wizard to get your new OpenFIRST portal software set up and working quickly and painlessly.</p> <table> <form action="../config/first.php" method="post"> <tr><th>Option</th><th>Value</th></tr> <tr><td>Operating System of Web Server</td><td><select name="ostype"> <option value="unix" selected="selected">UNIX</option> <option value="windows">Windows</option> </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</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> <tr><td>Header file</td><td><input type="text" name="header" value="headers.php" /></td></tr> <tr><td>Footer file</td><td><input type="text" name="footer" value="footers.php" /></td></tr> <tr><td>Mail Notification (the e-mail address used to notify you when significant events occur)</td><td><input type="text" name="mailnotify" value="nobody@localhost"></td></tr> <tr><td>Mail From (the e-mail address that mail from the openFIRST site should appear to be from</td><td><input type="text" name="mailfrom" value="no...@op..."></td></tr> <tr><td>The base path to the OpenFIRST software</td><td><input type="text" name="basepath" value="/openfirst/"></td></tr> <tr><td></td><td><input type="submit" value="Set up OpenFIRST"></td></tr> </form> </table> <?php } include("../config/footers.php"); ?> --- NEW FILE: globals-default.php --- <?php /* * openFIRST globals.php * This is a placeholder file. It will be recreated * by first.php when you first access and configure * your OpenFIRST portal software. */ die(include("../config/first.php")); ?> --- NEW FILE: index.php --- <?php include("./globals.php"); include($header); if(isset($user->user) == true && $user->membertype == "administrator") { membersmenu($user->membertype); ?> <h1>OpenFIRST Configuration Area</h1> <p><a href="install.php">Install Component</a> - required to install several new openFIRST modules.</p> <?php } else { showlogin(); } include($footer); ?> --- NEW FILE: install.php --- <?php /* * openFIRST.config - install.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 * */ include("../config/globals.php"); include($header); membersmenu($user->membertype); if($user->membertype == "administrator") { ?> <h1>SQL Install</h1> <p>This utility will create the tables required for certain openFIRST components to run. Select the SQL scripts you would like to install...</p> <form method="post" action="install.php"> <?php if(function_exists(glob)) { foreach (glob("../*/config/*.mysql") as $filename) { $sqlf = str_replace(".", "-", str_replace(".sql", "",substr(strrchr($filename, "/"), 1))); echo("<br /> <input type='checkbox' name='$sqlf'>$sqlf</input>"); if($_POST[$sqlf] == "on") { // This doesn't quite work. I'm not sure why. $sf = fopen($filename, "r"); $query = ""; while($line = fgets($sf)) { if(substr($line, 0, 2) != "--" && substr($line, 0, 1) != "#") { $query = $query . $line; } } $q = mysql_query(trim($query)); echo(" - <b>Submitted, and added.</b>"); } } } else { echo("<p>Sorry, but your version of PHP does not have the <b>glob</b> function required by this module. Please submit a bug report.</p>"); } ?> <br /><input type="submit" value="Create Tables" /> </form> <?php } else { showlogin(); } include($footer); ?> Index: README.txt =================================================================== RCS file: /cvsroot/openfirst/config/README.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** README.txt 31 May 2003 00:26:19 -0000 1.2 --- README.txt 7 Jun 2003 15:26:25 -0000 1.3 *************** *** 1,16 **** openFIRST.config ! ======================== This module allows the configuration of all modules and of the appearance of the openFIRST software. Configuration ! =========== ! - Tables Used ! ========== ! - openFIRST.config is distributed under the GNU GPL. For more information, see --- 1,19 ---- openFIRST.config ! ================ This module allows the configuration of all modules and of the appearance of the openFIRST software. Configuration ! ============= ! Access an openFIRST page without having changed globals.php and a configuration ! wizard will pop up. Tables Used ! =========== ! ofirst_config ! ofirst_members ! openFIRST.config is distributed under the GNU GPL. For more information, see Index: globals.php =================================================================== RCS file: /cvsroot/openfirst/config/globals.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** globals.php 6 Jun 2003 21:34:27 -0000 1.10 --- globals.php 7 Jun 2003 15:26:25 -0000 1.11 *************** *** 2,107 **** /* * openFIRST globals.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 ! * ! */ ! ! // OS Type, uncomment the line ! // appropriate to the Operating System ! // of your web server. Either Windows ! // or UNIX (includes Linux, FreeBSD, etc.). ! ! // $ostype = "windows"; ! // $ostype = "unix"; ! ! if (ISSET($ostype)){ ! if ($ostype == "windows") { ! ini_set("include_path","../config/;."); ! } else { ! ini_set("include_path","../config/:."); ! } ! }else{ ! die("<center>Configuration error. OS Type is not specified. Please edit ! the <a href='http://openfirst.sourceforge.net'>openFIRST</a> ! configuration file <b>globals.php</b> to fix this error.</center>"); ! } ! ! $title = "openFIRST"; // Title of software ! $version = "CVS"; // Version of software ! $sqlserver = "localhost"; // Change this to the MySQL Server Address ! $sqluser = "sqluser"; // Change this to the MySQL Server User ! $sqlpassword = "sqlpassword"; //Change this to the MySQL Server Password ! $sqldatabase = "sqldatabase"; //Change this to the MySQL Database ! $home = "http://openfirst.sourceforge.net"; // The address scripts will use for ! // linking to your main page. PLEASE NOTE: do not place ! // a slash after the link. You will get broken links if you do. ! $header = "headers.php"; // Change this to the location of a file ! // containing the headers for your pages. ! $footer = "footers.php"; // Change this to the location of a file ! // containing the footers for your pages. ! $mailnotify = "nobody@localhost"; // Change this to the e-mail ! // address that should be ! // notified when significant ! // events occur. ! $mailfrom = "no...@op...";// Change this to the e-mail ! // address that mail should be ! // directed from. ! $domain = "openfirst.sourceforge.net"; // Change this to the domain that ! // scripts will refer people to. ! ! $sqlconnection = mysql_connect("$sqlserver","$sqluser","$sqlpassword"); // Connect to the ! // SQL database ! ! session_start(); ! ! //MODULE ACTIVATION - To activate any ! // of these modules simply extract them into the appropriate ! // directory. If they require SQL tables to set up, then ! // place double slashes infront of their repective include() ! // line, and set them up in the members area by logging in as ! // an administrator and selecting SQL Tables Install, then ! // remove the double slashes. ! ! if(file_exists("../logger/logger.php") == true) { ! include("../logger/logger.php"); ! } ! ! if(file_exists("../messenger/messenger.php") == true) { ! include("../messenger/messenger.php"); ! } ! ! if(file_exists("../emoticon/emoticonf.php") == true) { ! include("../emoticon/emoticonf.php"); ! } ! ! if(file_exists("../members/auth.php") == true) { ! // Set the type of encryption to use for members passwords. ! ! $encryption = "crypt"; // You should probably leave this ! // available values are: ! // md5, sha1, crypt, crc32 ! include("../members/auth.php"); ! } ! ! session_write_close(); ?> --- 2,9 ---- /* * openFIRST globals.php ! * This is a placeholder file. It will be recreated ! * by first.php when you first access and configure ! * your OpenFIRST portal software. ! */ ! die(include("../config/first.php")); ?> |
From: <dav...@us...> - 2003-06-07 03:09:24
|
Update of /cvsroot/openfirst/photogallery In directory sc8-pr-cvs1:/tmp/cvs-serv28982 Modified Files: cleargallery.php edit.php makethumb.php manage.php newgallery.php upload.php Log Message: openFIRST.photogallery is now configured to work with the members module authentication system. Index: cleargallery.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/cleargallery.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** cleargallery.php 5 Jun 2003 01:56:56 -0000 1.1 --- cleargallery.php 7 Jun 2003 03:09:21 -0000 1.2 *************** *** 56,64 **** ?> ! <h2>Edit Gallery</h2><p>[ <a href="manage.php">Manager</a> ] [ <a href="newgallery.php">Add New Gallery</a> ! ]</p> ! <p><em><?php echo $gallery->GalleryName; ?> Options -</em> [ <a href="edit.php?ID=<?php echo $_GET['ID']; ?>">Edit</a> ! ] [ <a href="upload.php?ID=<?php echo $_GET['ID']; ?>">Upload Photos</a> ] [ ! <a href="cleargallery.php?ID=<?php echo $_GET['ID']; ?>">Clear Gallery</a> ]</p> <br><br><p align="center">You are trying to clear the entire <b><?php echo $gallery->GalleryName; ?></b> gallery! <a href="cleargallery.php?ID=<?php echo $_GET['ID']; ?>&CONFIRM=True">Confirm</a></p> --- 56,63 ---- ?> ! <h2>Edit Gallery</h2><p><a href="manage.php">Manager</a> <a href="newgallery.php">Add New Gallery</a><?php membersmenu($user->membertype); ?></p> ! <p><em><?php echo $gallery->GalleryName; ?> Options -</em><a href="edit.php?ID=<?php echo $_GET['ID']; ?>">Edit</a> ! <a href="upload.php?ID=<?php echo $_GET['ID']; ?>">Upload Photos</a> ! <a href="cleargallery.php?ID=<?php echo $_GET['ID']; ?>">Clear Gallery</a></p> <br><br><p align="center">You are trying to clear the entire <b><?php echo $gallery->GalleryName; ?></b> gallery! <a href="cleargallery.php?ID=<?php echo $_GET['ID']; ?>&CONFIRM=True">Confirm</a></p> Index: edit.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/edit.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** edit.php 5 Jun 2003 18:36:16 -0000 1.2 --- edit.php 7 Jun 2003 03:09:21 -0000 1.3 *************** *** 34,37 **** --- 34,40 ---- mysql_select_db($sqldatabase,$sqlconnection); + // Check if user is an admin then allow processes + if (isset($user->user)){ + // Check if user initiated delete and run delete process if(ISSET($_GET['DELETE'])){ *************** *** 65,73 **** ?> ! <h2>Edit Gallery</h2><p>[ <a href="manage.php">Manager</a> ] [ <a href="newgallery.php">Add New Gallery</a> ! ]</p> ! <p><em><?php echo $gallery->GalleryName; ?> Options - </em>[ <a href="edit.php?ID=<?php echo $_GET['ID']; ?>">Edit</a> ! ] [ <a href="upload.php?ID=<?php echo $_GET['ID']; ?>">Upload Photos</a> ] [ ! <a href="cleargallery.php?ID=<?php echo $_GET['ID']; ?>">Clear Gallery</a> ]</p> <table width="457" border="0" align="center" cellpadding="6" cellspacing="0"> <tr bgcolor="#999999"> --- 68,75 ---- ?> ! <h2>Edit Gallery</h2><p><a href="manage.php">Manager</a> <a href="newgallery.php">Add New Gallery</a><?php membersmenu($user->membertype); ?></p> ! <p><em><?php echo $gallery->GalleryName; ?> Options - </em><a href="edit.php?ID=<?php echo $_GET['ID']; ?>">Edit</a> ! <a href="upload.php?ID=<?php echo $_GET['ID']; ?>">Upload Photos</a> ! <a href="cleargallery.php?ID=<?php echo $_GET['ID']; ?>">Clear Gallery</a></p> <table width="457" border="0" align="center" cellpadding="6" cellspacing="0"> <tr bgcolor="#999999"> *************** *** 104,109 **** ?> </td> ! <td valign="top">[ <a href='makethumb.php?ID=<?php echo $_GET['ID']; ?>&PHOTO=<?php echo $file; ?>'>Make Thumbnail</a> ]<br> ! [ <a href='edit.php?ID=<?php echo $_GET['ID']; ?>&DELETEPHOTO=True&PHOTO=<?php echo $file; ?>'>Delete</a> ]</td> </tr> <?php --- 106,111 ---- ?> </td> ! <td valign="top"><a href='makethumb.php?ID=<?php echo $_GET['ID']; ?>&PHOTO=<?php echo $file; ?>'>Make Thumbnail</a> <br> ! <a href='edit.php?ID=<?php echo $_GET['ID']; ?>&DELETEPHOTO=True&PHOTO=<?php echo $file; ?>'>Delete</a></td> </tr> <?php *************** *** 116,119 **** ?> </table> ! <center><br>[ <a href='makethumb.php?ID=<?php echo $_GET['ID']; ?>; ?>&OPTION=all'>Make Thumbnail's for Entire Gallery</a> ]<br><br></center> ! <?php include($footer); ?> \ No newline at end of file --- 118,126 ---- ?> </table> ! <center><br><a href='makethumb.php?ID=<?php echo $_GET['ID']; ?>; ?>&OPTION=all'>Make Thumbnail's for Entire Gallery</a><br><br></center> ! <?php ! }else{ ! showlogin(); ! } ! include($footer); ! ?> \ No newline at end of file Index: makethumb.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/makethumb.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** makethumb.php 5 Jun 2003 18:36:19 -0000 1.1 --- makethumb.php 7 Jun 2003 03:09:21 -0000 1.2 *************** *** 34,37 **** --- 34,40 ---- mysql_select_db($sqldatabase,$sqlconnection); + + // Check if user is an admin then allow processes + if (isset($user->user)){ $query = mysql_query("SELECT * FROM ofirst_galleries WHERE ID = '".$_GET['ID']."'") or die(mysql_error()); *************** *** 58,61 **** --- 61,67 ---- } + }else{ + showlogin(); + } include($footer); Index: manage.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/manage.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** manage.php 5 Jun 2003 01:56:56 -0000 1.1 --- manage.php 7 Jun 2003 03:09:21 -0000 1.2 *************** *** 33,41 **** mysql_select_db($sqldatabase,$sqlconnection); ?> <h2>Gallery Manager</h2> ! <p>[ <a href="manage.php">Manager</a> ] [ <a href="newgallery.php">Add New Gallery</a> ! ]</p> <p align="center"> <table width="633" border="0" align="center" cellpadding="6" cellspacing="0"> --- 33,43 ---- mysql_select_db($sqldatabase,$sqlconnection); + + // Check if user is an admin then allow processes + if (isset($user->user)){ ?> <h2>Gallery Manager</h2> ! <p><a href="manage.php">Manager</a> <a href="newgallery.php">Add New Gallery</a><?php membersmenu($user->membertype); ?></p> <p align="center"> <table width="633" border="0" align="center" cellpadding="6" cellspacing="0"> *************** *** 73,75 **** </p> <p align="center"> </p> ! <?php include($footer); ?> \ No newline at end of file --- 75,82 ---- </p> <p align="center"> </p> ! <?php ! }else{ ! showlogin(); ! } ! include($footer); ! ?> \ No newline at end of file Index: newgallery.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/newgallery.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** newgallery.php 5 Jun 2003 01:56:56 -0000 1.1 --- newgallery.php 7 Jun 2003 03:09:21 -0000 1.2 *************** *** 34,37 **** --- 34,41 ---- mysql_select_db($sqldatabase,$sqlconnection); + + // Check if user is an admin then allow processes + if (isset($user->user)){ + // Check if user initiates create option and run create options if(ISSET($_POST['create'])){ *************** *** 51,56 **** ?> <h2>New Gallery</h2> ! <p>[ <a href="manage.php">Manager</a> ] [ <a href="newgallery.php">Add New Gallery</a> ! ]</p> <form method="POST" action="newgallery.php"> <table width="499" border="0" align="center" cellpadding="6" cellspacing="0"> --- 55,59 ---- ?> <h2>New Gallery</h2> ! <p><a href="manage.php">Manager</a> <a href="newgallery.php">Add New Gallery</a><?php membersmenu($user->membertype); ?></p> <form method="POST" action="newgallery.php"> <table width="499" border="0" align="center" cellpadding="6" cellspacing="0"> *************** *** 85,87 **** </table> </form> ! <?php include($footer); ?> --- 88,97 ---- </table> </form> ! <?php ! ! }else{ ! showlogin(); ! } ! include($footer); ! ! ?> Index: upload.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/upload.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** upload.php 5 Jun 2003 14:16:27 -0000 1.2 --- upload.php 7 Jun 2003 03:09:21 -0000 1.3 *************** *** 34,37 **** --- 34,40 ---- mysql_select_db($sqldatabase,$sqlconnection); + // Check if user is an admin then allow processes + if (isset($user->user)){ + $query = mysql_query("SELECT * FROM ofirst_galleries WHERE ID = '".$_GET['ID']."'"); $gallery = mysql_fetch_object($query); *************** *** 89,98 **** ?> <h2>Upload to Gallery</h2> ! <p>[ <a href="manage.php">Manager</a> ] [ <a href="newgallery.php">Add New Gallery</a> ! ]</p> ! <p><em><?php echo $gallery->GalleryName; ?> Options - </em>[ <a href="edit.php?ID=<?php echo $_GET['ID']; ?>">Edit ! </a>] [ <a href="upload.php?ID=<?php echo $_GET['ID']; ?>">Upload Photos</a> ! ] [ <a href="cleargallery.php?ID=<?php echo $_GET['ID']; ?>">Clear Gallery</a> ! ]</p> <p align="center">Current Files Allowd: <?php echo $imgtypes; ?></p> <p align="center"> --- 92,99 ---- ?> <h2>Upload to Gallery</h2> ! <p><a href="manage.php">Manager</a> <a href="newgallery.php">Add New Gallery</a><?php membersmenu($user->membertype); ?></p> ! <p><em><?php echo $gallery->GalleryName; ?> Options - </em><a href="edit.php?ID=<?php echo $_GET['ID']; ?>">Edit ! </a> <a href="upload.php?ID=<?php echo $_GET['ID']; ?>">Upload Photos</a> ! <a href="cleargallery.php?ID=<?php echo $_GET['ID']; ?>">Clear Gallery</a> </p> <p align="center">Current Files Allowd: <?php echo $imgtypes; ?></p> <p align="center"> *************** *** 112,114 **** <input name="upload" type="submit" value="Upload To Gallery"> </form> ! <?php include($footer); ?> --- 113,120 ---- <input name="upload" type="submit" value="Upload To Gallery"> </form> ! <?php ! }else{ ! showlogin(); ! } ! include($footer); ! ?> |
From: <dav...@us...> - 2003-06-07 02:52:52
|
Update of /cvsroot/openfirst/awards In directory sc8-pr-cvs1:/tmp/cvs-serv25497 Modified Files: manage.php Log Message: manage.php is now configured to work with the members module authentication system. Index: manage.php =================================================================== RCS file: /cvsroot/openfirst/awards/manage.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** manage.php 5 May 2003 00:17:40 -0000 1.6 --- manage.php 7 Jun 2003 02:52:49 -0000 1.7 *************** *** 30,33 **** --- 30,36 ---- mysql_select_db("openFIRST",$sqlconnection); + // Check if user is an admin then allow processes + if (isset($user->user)){ + // If user has posted delete then delete specified record in querystring DELETE if (ISSET($_GET['DELETE'])){ *************** *** 48,56 **** die("<br><br><center>Congratulations on your new award. Award submitted! [ <a href='manage.php'>Manage Award</a> ]"); } ?> <h1>Manage Award Information</h1> ! <p>[ <a href="manage.php">Manage Awards </a>] [ <a href="awards.php">View Awards</a> ]</p> <form name="form1" method="post" action="manage.php"> <table width="500" border="1" align="center" cellpadding="5" cellspacing="0" bordercolor="#999999"> --- 51,60 ---- die("<br><br><center>Congratulations on your new award. Award submitted! [ <a href='manage.php'>Manage Award</a> ]"); } + ?> <h1>Manage Award Information</h1> ! <p><a href="manage.php">Manage Awards </a> <a href="awards.php">View Awards</a> <?php membersmenu($user->membertype); ?></p> <form name="form1" method="post" action="manage.php"> <table width="500" border="1" align="center" cellpadding="5" cellspacing="0" bordercolor="#999999"> *************** *** 128,130 **** <? } ?> </table> ! <?php include($footer); ?> --- 132,140 ---- <? } ?> </table> ! <?php ! ! }else{ ! showlogin(); ! } ! include($footer); ! ?> |
From: <dav...@us...> - 2003-06-06 21:34:31
|
Update of /cvsroot/openfirst/config In directory sc8-pr-cvs1:/tmp/cvs-serv23479 Modified Files: globals.php Log Message: Changed includes for the messenger module. Index: globals.php =================================================================== RCS file: /cvsroot/openfirst/config/globals.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** globals.php 4 Jun 2003 18:48:16 -0000 1.9 --- globals.php 6 Jun 2003 21:34:27 -0000 1.10 *************** *** 70,77 **** // scripts will refer people to. ! $sqlconnection = mysql_connect("$sqlserver","$sqluser","$sqlpassword"); // Connect to the // SQL database ! session_start(); //MODULE ACTIVATION - To activate any --- 70,77 ---- // scripts will refer people to. ! $sqlconnection = mysql_connect("$sqlserver","$sqluser","$sqlpassword"); // Connect to the // SQL database ! session_start(); //MODULE ACTIVATION - To activate any *************** *** 84,102 **** if(file_exists("../logger/logger.php") == true) { ! include("../logger/logger.php"); } ! if(file_exists("../messanger/messanger.php") == true) { ! include("../messanger/messanger.php"); } if(file_exists("../emoticon/emoticonf.php") == true) { ! include("../emoticon/emoticonf.php"); } if(file_exists("../members/auth.php") == true) { ! // Set the type of encryption to use for members passwords. ! $encryption = "crypt"; // You should probably leave this // available values are: // md5, sha1, crypt, crc32 ! include("../members/auth.php"); } --- 84,105 ---- if(file_exists("../logger/logger.php") == true) { ! include("../logger/logger.php"); } ! ! if(file_exists("../messenger/messenger.php") == true) { ! include("../messenger/messenger.php"); } + if(file_exists("../emoticon/emoticonf.php") == true) { ! include("../emoticon/emoticonf.php"); } + if(file_exists("../members/auth.php") == true) { ! // Set the type of encryption to use for members passwords. ! $encryption = "crypt"; // You should probably leave this // available values are: // md5, sha1, crypt, crc32 ! include("../members/auth.php"); } |
From: <dav...@us...> - 2003-06-05 19:18:40
|
Update of /cvsroot/openfirst/photogallery In directory sc8-pr-cvs1:/tmp/cvs-serv29426 Modified Files: edit.php gallery.php galleryglobals.php preview.php Added Files: email.php makethumb.php Log Message: Commit includes changes from task 79086. Thumbnails are completely fixed and working properly. preview.php required a lof of editing and should reqiure a bit more of a clean up. The e-mail option is now up and active. You can now set the SMTP server to send from in galleryglobals.php. --- NEW FILE: email.php --- <?php /* * openFIRST.photogallery - email.php * * Copyright (C) 2003, * openFIRST Project * Original Author: David Di Biase <dav...@ea...> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ // Import globals and estbalish database connection include("../config/globals.php"); include($header); include("galleryglobals.php"); mysql_select_db($sqldatabase,$sqlconnection); 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."/photogallery/".$_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>"; mail($recipientemail,$title." Gallery Photo Sender",$message,$headers) or die("<br><br><br><center>E-Mail was <b>not</b> successfully sent!</center>"); die("<br><br><br><center>Photo was successfully sent recipient, thank you! [ <a href='index.php'>Galleries</a> ]</center>"); } ?> <h2>Send To A Friend</h2> <p>[ <a href="index.php">View Galleries</a> ] <p align="center"><br> <img src="<?php echo $_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"> <input type="hidden" name="photo" value="<?php echo $_GET['PHOTO']; ?>"> <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> <p> <?php include($footer); ?> --- NEW FILE: makethumb.php --- <?php /* * openFIRST.photogallery - makethumb.php * * Copyright (C) 2003, * openFIRST Project * Original Author: David Di Biase <dav...@ea...> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ // Import globals and estbalish database connection include("../config/globals.php"); include($header); include("galleryglobals.php"); include("preview.php"); mysql_select_db($sqldatabase,$sqlconnection); $query = mysql_query("SELECT * FROM ofirst_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); die("<br><br><center>Thumbnail created! [ <a href='edit.php?ID=".$_GET['ID']."'>Edit</a> ]"); } // 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); } } die("<br><br><center>Thumbnails created for gallery! [ <a href='edit.php?ID=".$_GET['ID']."'>Edit</a> ]"); } include($footer); ?> Index: edit.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/edit.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** edit.php 5 Jun 2003 01:56:56 -0000 1.1 --- edit.php 5 Jun 2003 18:36:16 -0000 1.2 *************** *** 116,118 **** ?> </table> ! <?php include($footer); ?> --- 116,119 ---- ?> </table> ! <center><br>[ <a href='makethumb.php?ID=<?php echo $_GET['ID']; ?>; ?>&OPTION=all'>Make Thumbnail's for Entire Gallery</a> ]<br><br></center> ! <?php include($footer); ?> \ No newline at end of file Index: gallery.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/gallery.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** gallery.php 5 Jun 2003 01:56:56 -0000 1.4 --- gallery.php 5 Jun 2003 18:36:17 -0000 1.5 *************** *** 83,88 **** } echo "<td width='34%'><a target='_blank' href='viewphoto.php?ID=".$_GET['ID']."&PHOTO=".$file."'> ! <center><img height=100 width=152 src='preview.php?img=$dirlocate/$file'><br><a href=email.php> ! <img src=email.PNG alt='Email to a friend'></a><a target='_blank' href='viewphoto.php?ID=".$_GET['ID']."&PHOTO=".$file."'><img alt='Enlarge' src='enlarge.PNG'></a></center></a></td>"; $num++; } --- 83,97 ---- } echo "<td width='34%'><a target='_blank' href='viewphoto.php?ID=".$_GET['ID']."&PHOTO=".$file."'> ! <center>"; ! ! if(file_exists($dirlocate."/thumbs/".$file)){ ! echo "<img height=100 width=152 src='".$dirlocate."/thumbs/".$file."'>"; ! }else{ ! echo "<img height=100 width=152 src='".$dirlocate."/".$file."'>"; ! } ! ! echo "<br><a href='email.php?PHOTO=".$dirlocate."/".$file."'><img src=email.PNG alt='Email to a friend'></a><a target='_blank' ! href='viewphoto.php?ID=".$_GET['ID']."&PHOTO=".$file."'><img alt='Enlarge' src='enlarge.PNG'> ! </a></center></a></td>"; $num++; } Index: galleryglobals.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/galleryglobals.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** galleryglobals.php 5 Jun 2003 14:20:55 -0000 1.4 --- galleryglobals.php 5 Jun 2003 18:36:18 -0000 1.5 *************** *** 38,40 **** --- 38,43 ---- $gallery_execution_time = "1200"; + // Declare SMTP to use when sending photo's by e-mail + $SMTP = "smtp.localhost.com"; + ?> Index: preview.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/preview.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** preview.php 2 Jun 2003 23:51:57 -0000 1.3 --- preview.php 5 Jun 2003 18:36:19 -0000 1.4 *************** *** 26,126 **** * */ - $img = $_GET["img"]; ! include("galleryglobals.php"); ! $imgt = explode(",", $imgtypes); ! for ($x = 0; $x < count($imgt); $x++) { ! $imgt[$x] = strtolower($imgt[$x]); ! if($imgt[$x] == strtolower(substr($img, strrpos($img, ".") + 1, strlen($img) - strrpos($img, ".")))) { ! if($imgt[$x] == "png") { ! if(function_exists(imagepng) == true) { ! header("Content-Type: image/png"); ! $src_img = imagecreatefrompng("$img"); ! $new_h = 100; ! $new_w = 100; ! if(strpos($a["GD Version"], "2.0") > 0) { ! $dst_img = imagecreatetruecolor($new_w,$new_h); ! imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); ! } else { ! $dst_img = imagecreate($new_w,$new_h); ! imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); ! } ! imagepng($dst_img); ! imagedestroy($dst_img); ! imagedestroy($src_img); ! } else { ! header("Location: thumbnailerror.png"); ! } ! $displayed = "true"; ! } elseif($imgt[$x] == "jpg" || $imgt[$x] == "jpeg") { ! if(function_exists(imagejpeg) == true) { ! header("Content-Type: image/jpeg"); ! $src_img = imagecreatefromjpeg("$img"); ! $new_h = 100; ! $new_w = 100; ! if(strpos($a["GD Version"], "2.0") > 0) { ! $dst_img = imagecreatetruecolor($new_w,$new_h); ! imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); ! } else { ! $dst_img = imagecreate($new_w,$new_h); ! imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); ! } ! imagejpeg($dst_img); ! imagedestroy($dst_img); ! imagedestroy($src_img); ! } else { ! header("Location: thumbnailerror.png"); ! } ! $displayed = "true"; ! } elseif($imgt[$x] == "gif") { ! if(function_exists(imagegif) == true) { ! header("Content-Type: image/gif"); ! $src_img = imagecreatefromgif("$img"); ! $new_h = 100; ! $new_w = 100; ! if(strpos($a["GD Version"], "2.0") > 0) { ! $dst_img = imagecreatetruecolor($new_w,$new_h); ! imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); ! } else { ! $dst_img = imagecreate($new_w,$new_h); ! imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); ! } ! imagegif($dst_img); ! imagedestroy($dst_img); ! imagedestroy($src_img); ! } else { ! header("Location: thumbnailerror.png"); ! } ! $displayed = "true"; ! } elseif($imgt[$x] == "bmp") { ! if(function_exists(imagebitmap) == true) { ! header("Content-Type: image/bmp"); ! $src_img = imagecreatefrombitmap("$img"); ! $new_h = 100; ! $new_w = 100; ! if(strpos($a["GD Version"], "2.0") > 0) { ! $dst_img = imagecreatetruecolor($new_w,$new_h); ! imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); ! } else { ! $dst_img = imagecreate($new_w,$new_h); ! imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); ! } ! imagebitmap($dst_img); ! imagedestroy($dst_img); ! imagedestroy($src_img); ! } else { ! header("Location: thumbnailerror.png"); ! } ! $displayed = "true"; ! } else { ! header("Location: thumbnailerror.png"); ! $displayed = "true"; ! } ! } ! } ! if($displayed != "true") { ! header("Location: thumbnailerror.png"); ! } ! ?> --- 26,137 ---- * */ ! function makethumb($imagesrc,$imagename,$imgtypes){ ! ! $img = $imagesrc."/".$imagename; ! $imgt = explode(",", $imgtypes); ! ! // Gather information about GD's current state and version ! $a = 'function gd_info() { ! $array = Array("GD Version" => ""); ! ob_start(); ! eval("phpinfo();"); ! $info = ob_get_contents(); ! ob_end_clean(); ! ! foreach(explode("\n", $info) as $line) { ! if(strpos($line, "GD Version")!==false) ! $array["GD Version"] = trim(str_replace("GD Version", "", strip_tags($line))); ! return $array; ! }'; ! // Run through the different file types and create images ! for ($x = 0; $x < count($imgt); $x++) { ! ! $imgt[$x] = strtolower($imgt[$x]); ! ! if($imgt[$x] == strtolower(substr($img, strrpos($img, ".") + 1, strlen($img) - strrpos($img, ".")))) { ! ! // Run options if file is png ! if($imgt[$x] == "png") { ! if(function_exists("imagepng") == true) { ! $src_img = imagecreatefrompng("$img"); ! $new_h = 100; ! $new_w = 100; ! if(strpos($a["GD Version"], "2.0") > 0) { ! $dst_img = imagecreatetruecolor($new_w,$new_h); ! imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); ! }else { ! $dst_img = imagecreate($new_w,$new_h); ! imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); ! } ! imagepng($dst_img,$imagesrc."/thumbs/".$imagename); ! imagedestroy($dst_img); ! imagedestroy($src_img); ! } ! } ! ! // Run options if file is for extension jpg or jpeg ! if($imgt[$x] == "jpg" || $imgt[$x] == "jpeg") { ! if(function_exists("imagejpeg") == true) { ! $src_img = imagecreatefromjpeg("$img"); ! $new_h = 100; ! $new_w = 100; ! if(strpos($a["GD Version"], "2.0") > 0) { ! $dst_img = imagecreatetruecolor($new_w,$new_h); ! imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); ! } else { ! $dst_img = imagecreate($new_w,$new_h); ! imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); ! } ! imagejpeg($dst_img,$imagesrc."/thumbs/".$imagename); ! imagedestroy($dst_img); ! imagedestroy($src_img); ! } ! } ! ! // Run options if file is gif (NOTE THAT GD2 DOES NOT SUPPORT THIS FUNCTION) ! if($imgt[$x] == "gif") { ! if(function_exists("imagegif") == true) { ! $src_img = imagecreatefromgif("$img"); ! $new_h = 100; ! $new_w = 100; ! if(strpos($a["GD Version"], "2.0") > 0) { ! $dst_img = imagecreatetruecolor($new_w,$new_h); ! imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); ! } else { ! $dst_img = imagecreate($new_w,$new_h); ! imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); ! } ! imagegif($dst_img,$imagesrc."/thumbs/".$imagename); ! imagedestroy($dst_img); ! imagedestroy($src_img); ! } ! } ! ! // Run options if file is bmp ! if($imgt[$x] == "bmp") { ! if(function_exists("imagebitmap") == true) { ! $src_img = imagecreatefrombitmap("$img"); ! $new_h = 100; ! $new_w = 100; ! if(strpos($a["GD Version"], "2.0") > 0) { ! $dst_img = imagecreatetruecolor($new_w,$new_h); ! imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); ! } else { ! $dst_img = imagecreate($new_w,$new_h); ! imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); ! } ! imagebmp($dst_img,$imagesrc."/thumbs/".$imagename); ! imagedestroy($dst_img); ! imagedestroy($src_img); ! } ! } ! } ! } ! ! ! } ! ! ?> \ No newline at end of file |
From: <dav...@us...> - 2003-06-05 14:20:58
|
Update of /cvsroot/openfirst/photogallery In directory sc8-pr-cvs1:/tmp/cvs-serv11623 Modified Files: galleryglobals.php Log Message: In regards to task 79060, where I implemented file checking, I decided to make a note of how to enter file extensions. Index: galleryglobals.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/galleryglobals.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** galleryglobals.php 5 Jun 2003 01:56:56 -0000 1.3 --- galleryglobals.php 5 Jun 2003 14:20:55 -0000 1.4 *************** *** 31,35 **** //Declare image types allowed for uploading/previewing ! $imgtypes = "gif,jpg,jpeg,png,bmp"; // Declare maximum execution time for the galleries --- 31,37 ---- //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 |
From: <dav...@us...> - 2003-06-05 14:16:30
|
Update of /cvsroot/openfirst/photogallery In directory sc8-pr-cvs1:/tmp/cvs-serv8297 Modified Files: upload.php Log Message: Changes made according to task 79060. Implemented file checking for all uploads. To remove errors I made the extensions all upper case so that people don't find errors when trying to upload. Index: upload.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/upload.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** upload.php 5 Jun 2003 01:56:56 -0000 1.1 --- upload.php 5 Jun 2003 14:16:27 -0000 1.2 *************** *** 43,57 **** $dirlocate = $gallerydir.$gallery->GalleryName; ! for ($num=1;$num<=$_POST['NUM_UPLOADS'];$num++){ ! if (! $_FILES['upload'.$num]['name'] == ""){ ! copy($_FILES['upload'.$num]['tmp_name'], $dirlocate."/".$_FILES['upload'.$num]['name']) or $error = true; ! echo "<center><br>".$_FILES['upload'.$num]['name']." - ".$_FILES['upload'.$num]['size']." - ".$_FILES['upload'.$num]['type']." - "; ! if(empty($error)){ ! echo "<font color='Green'>Successful</font><br></center>\n"; ! }else{ ! echo "<font color='Red'>Not Successful</font><br></center>\n"; ! } ! } } } --- 43,81 ---- $dirlocate = $gallerydir.$gallery->GalleryName; ! $imgtypes = explode(",",$imgtypes); ! ! for ($num=1;$num<=$_POST['NUM_UPLOADS'];$num++){ ! ! $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; + } + + if (! $_FILES['upload'.$num]['name'] == ""){ + copy($_FILES['upload'.$num]['tmp_name'], $dirlocate."/".$_FILES['upload'.$num]['name']) or $error = true; + echo "<center><br>".$_FILES['upload'.$num]['name']." - ".$_FILES['upload'.$num]['size']." - ".$_FILES['upload'.$num]['type']." - "; + + if(empty($error)){ + echo "<font color='Green'>Successful</font><br></center>\n"; + }else{ + echo "<font color='Red'>Not Successful</font><br></center>\n"; + } + + } + } } *************** *** 77,81 **** <input name="setuploads" type="submit" id="setuploads" value="Add Spaces"> <input type="hidden" name="MAX_FILE_SIZE" size="5200000"> ! <input type="hidden" name="NUM_UPLOADS" value="<?php echo $uploads; ?>"> <?php --- 101,105 ---- <input name="setuploads" type="submit" id="setuploads" value="Add Spaces"> <input type="hidden" name="MAX_FILE_SIZE" size="5200000"> ! <input type="hidden" name="NUM_UPLOADS" value="<?php echo $uploads; ?>"><br> <?php |
From: <dav...@us...> - 2003-06-05 01:57:00
|
Update of /cvsroot/openfirst/photogallery In directory sc8-pr-cvs1:/tmp/cvs-serv16841 Modified Files: gallery.php galleryglobals.php index.php openFIRST.photogallery.sql viewphoto.php Added Files: cleargallery.php edit.php email.PNG enlarge.PNG manage.php newgallery.php photo.PNG upload.php Log Message: Extreme changes made to photogallery. New scripts uploaded: newgallery.php, cleargallery.php, upload.php. Changes were mostly of manager options. I had to change a field in the sql setup. More images were uploaded also. --- NEW FILE: cleargallery.php --- <?php /* * openFIRST.photogallery - cleargallery.php * * Copyright (C) 2003, * openFIRST Project * Original Author: David Di Biase <dav...@ea...> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ // Import globals and estbalish database connection include("../config/globals.php"); include($header); include("galleryglobals.php"); mysql_select_db($sqldatabase,$sqlconnection); $query = mysql_query("SELECT * FROM ofirst_galleries WHERE ID = '".$_GET['ID']."'"); $gallery = mysql_fetch_object($query); // Check if user initiates the confirm of clearing the gallery if (ISSET($_GET['CONFIRM'])){ $dirlocate = $gallerydir.$gallery->GalleryName; $dir = opendir($dirlocate); while(! (($file = readdir($dir)) === false)){ if (is_file($dirlocate."/".$file)){ unlink($dirlocate."/".$file); if (file_exists($dirlocate."/thumbs/".$file)){ unlink($dirlocate."/thumbs/".$file); } } die("<br><br><center>The <b>".$gallery->GalleryName."</b> gallery has been reset. [ <a href='manage.php'>Manage</a> ]"); } } ?> <h2>Edit Gallery</h2><p>[ <a href="manage.php">Manager</a> ] [ <a href="newgallery.php">Add New Gallery</a> ]</p> <p><em><?php echo $gallery->GalleryName; ?> Options -</em> [ <a href="edit.php?ID=<?php echo $_GET['ID']; ?>">Edit</a> ] [ <a href="upload.php?ID=<?php echo $_GET['ID']; ?>">Upload Photos</a> ] [ <a href="cleargallery.php?ID=<?php echo $_GET['ID']; ?>">Clear Gallery</a> ]</p> <br><br><p align="center">You are trying to clear the entire <b><?php echo $gallery->GalleryName; ?></b> gallery! <a href="cleargallery.php?ID=<?php echo $_GET['ID']; ?>&CONFIRM=True">Confirm</a></p> <?php include($footer); ?> --- NEW FILE: edit.php --- <?php /* * openFIRST.photogallery - edit.php * * Copyright (C) 2003, * openFIRST Project * Original Author: David Di Biase <dav...@ea...> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ // Import globals and estbalish database connection include("../config/globals.php"); include($header); include("galleryglobals.php"); mysql_select_db($sqldatabase,$sqlconnection); // Check if user initiated delete and run delete process if(ISSET($_GET['DELETE'])){ $query = mysql_query("SELECT * FROM ofirst_galleries WHERE ID = '".$_GET['DELETE']."'") or die(mysql_error()); $gallery = mysql_fetch_object($query); rmdir($gallerydir.$gallery->GalleryName) or die("<br><br><center>Can't remove gallery! [ <a href='manage.php'>Manage</a> ]"); mysql_query("DELETE FROM ofirst_galleries WHERE ID = '".$_GET['DELETE']."'") or die(mysql_error()); die("<br><br><center>The gallery has been deleted! [ <a href='manage.php'>Manage</a> ]</center>"); } // Check if user initiated delete of particular photo and run photo and thumb delete if(ISSET($_GET['DELETEPHOTO'])){ $query = mysql_query("SELECT * FROM ofirst_galleries WHERE ID = '".$_GET['ID']."'") or die(mysql_error()); $gallery = mysql_fetch_object($query); unlink($gallerydir.$gallery->GalleryName."/".$_GET['PHOTO']) or die("<br><br><center>Can't remove gallery! [ <a href='manage.php'>Manage</a> ]"); if (file_exists($gallerydir.$gallery->GalleryName."/thumbs/".$_GET['PHOTO'])){ unlink($gallerydir.$gallery->GalleryName."/thumbs/".$_GET['PHOTO']) or die("<br><br><center>Can't remove gallery! [ <a href='manage.php'>Manage</a> ]"); die("<br><br><center>The photo and its thumbnail have been deleted! [ <a href='edit.php?ID=".$_GET['ID']."'>Manage</a> ]</center>"); }else{ die("<br><br><center>The photo has been deleted! [ <a href='edit.php?ID=".$_GET['ID']."'>Manage</a> ]</center>"); } } $query = mysql_query("SELECT * FROM ofirst_galleries WHERE ID = '".$_GET['ID']."'"); $gallery = mysql_fetch_object($query); ?> <h2>Edit Gallery</h2><p>[ <a href="manage.php">Manager</a> ] [ <a href="newgallery.php">Add New Gallery</a> ]</p> <p><em><?php echo $gallery->GalleryName; ?> Options - </em>[ <a href="edit.php?ID=<?php echo $_GET['ID']; ?>">Edit</a> ] [ <a href="upload.php?ID=<?php echo $_GET['ID']; ?>">Upload Photos</a> ] [ <a href="cleargallery.php?ID=<?php echo $_GET['ID']; ?>">Clear Gallery</a> ]</p> <table width="457" border="0" align="center" cellpadding="6" cellspacing="0"> <tr bgcolor="#999999"> <td valign="top"> <div align="center"> </div></td> <td><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Photo Name </font></strong></td> <td><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Thumbnail</font></strong></td> <td><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Option</font></strong></td> </tr> <?php // List photos in current gallery $dirlocate = $gallerydir.$gallery->GalleryName; $dir = opendir($dirlocate); $num = 0; while(! (($file = readdir($dir)) === false)){ if (is_file($dirlocate."/".$file)){ $num++; ?> <tr> <td valign="top"><div align="center"> <a href="viewphoto.php?ID=<?php echo $_GET['ID']; ?>&PHOTO=<?php echo $file; ?>" target="_blank"><img src="photo.PNG" width="27" height="31" border="0"></a></div></td> <td valign="top"><?php echo $file; ?></td> <td valign="top"> <?php if (file_exists($dirlocate."/thumbs/".$file)){ echo "Yes"; }else{ echo "No"; } ?> </td> <td valign="top">[ <a href='makethumb.php?ID=<?php echo $_GET['ID']; ?>&PHOTO=<?php echo $file; ?>'>Make Thumbnail</a> ]<br> [ <a href='edit.php?ID=<?php echo $_GET['ID']; ?>&DELETEPHOTO=True&PHOTO=<?php echo $file; ?>'>Delete</a> ]</td> </tr> <?php } } if($num == 0){ echo "<tr><td>--</td><td><br>No photos in gallery!<br><br></td><td>--</td><td>--</td></tr>"; } ?> </table> <?php include($footer); ?> --- NEW FILE: email.PNG --- (This appears to be a binary file; contents omitted.) --- NEW FILE: enlarge.PNG --- (This appears to be a binary file; contents omitted.) --- NEW FILE: manage.php --- <?php /* * openFIRST.photogallery - manage.php * * Copyright (C) 2003, * openFIRST Project * Original Author: David Di Biase <dav...@ea...> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ // Import globals and estbalish database connection include("../config/globals.php"); include($header); include("galleryglobals.php"); mysql_select_db($sqldatabase,$sqlconnection); ?> <h2>Gallery Manager</h2> <p>[ <a href="manage.php">Manager</a> ] [ <a href="newgallery.php">Add New Gallery</a> ]</p> <p align="center"> <table width="633" border="0" align="center" cellpadding="6" cellspacing="0"> <tr bgcolor="#999999"> <td valign="top"> <div align="center"> </div></td> <td><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Gallery Name</strong></font></td> <td><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Description</font></strong></td> <td> <div align="left"><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Option</font></strong></div></td> </tr> <?php // Retrieve galleries from database and list them accordingly $query = mysql_query("SELECT * FROM ofirst_galleries"); while($gallery = mysql_fetch_object($query)){ ?> <tr> <td width="58" valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><a href="gallery.php?ID=<?php echo $gallery->ID; ?>"><img src="gallery.PNG" width="58" height="51" border="0"></a></font></td> <td width="145" valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $gallery->GalleryName; ?></font></td> <td width="307" valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $gallery->Description; ?></font></td> <td width="75" valign="top">[ <a href="edit.php?ID=<?php echo $gallery->ID; ?>">Edit</a> ]<br> [ <a href="edit.php?DELETE=<?php echo $gallery->ID; ?>">Delete</a> ]</td> </tr> <?php } if (mysql_num_rows($query) == 0){ echo "<tr><td>--</td><td><br>There are no galleries uploaded<br><br></td>"; } ?> </table> <br> </p> <p align="center"> </p> <?php include($footer); ?> --- NEW FILE: newgallery.php --- <?php /* * openFIRST.photogallery - newgallery.php * * Copyright (C) 2003, * openFIRST Project * Original Author: David Di Biase <dav...@ea...> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ // Import globals and estbalish database connection include("../config/globals.php"); include($header); include("galleryglobals.php"); mysql_select_db($sqldatabase,$sqlconnection); // Check if user initiates create option and run create options if(ISSET($_POST['create'])){ mkdir($gallerydir.$_POST['galleryname'],0777) or die("<br><br><center>Can't create folder! [ <a href='manage.php'>Manage</a> ]"); mkdir($gallerydir.$_POST['galleryname']."/thumbs",0777) or die("<br><br><center>Can't create folder! [ <a href='manage.php'>Manage</a> ]"); mysql_query("INSERT INTO ofirst_galleries (GalleryName, Author, Date, Description) values( '".$_POST['galleryname']."' ,'".$_POST['author']."' ,'".time()."' ,'".$_POST['description']."')") or die(mysql_error()); die("<br><br><center>New gallery added! [ <a href='manage.php'>Manage</a> ]</center>"); } ?> <h2>New Gallery</h2> <p>[ <a href="manage.php">Manager</a> ] [ <a href="newgallery.php">Add New Gallery</a> ]</p> <form method="POST" action="newgallery.php"> <table width="499" border="0" align="center" cellpadding="6" cellspacing="0"> <tr bgcolor="#999999"> <td valign="top"> <div align="center"> </div></td> <td><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Gallery Name</strong></font></td> </tr> <tr> <td width="135" valign="top"><div align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Gallery Name:</font></div></td> <td width="275" valign="top"><input name="galleryname" type="text" id="galleryname"></td> </tr> <tr> <td valign="top"><div align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Author:</font></div></td> <td valign="top"><font size="2"> <input name="author" type="text" id="author"> (Temporarily an option until openfirst.members is released)</font></td> </tr> <tr> <td valign="top"><div align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Date:</font></div></td> <td valign="top"><?php echo date("F j, Y, g:i a",time()); ?></td> </tr> <tr> <td valign="top"><div align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Description:</font></div></td> <td valign="top"> <textarea name="description" cols="40" rows="10" id="description"></textarea></td> </tr> <tr> <td valign="top"> </td> <td valign="top"><input name="create" type="submit" id="create" value="Create Gallery"></td> </tr> </table> </form> <?php include($footer); ?> --- NEW FILE: photo.PNG --- (This appears to be a binary file; contents omitted.) --- NEW FILE: upload.php --- <?php /* * openFIRST.photogallery - upload.php * * Copyright (C) 2003, * openFIRST Project * Original Author: David Di Biase <dav...@ea...> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ // Import globals and estbalish database connection include("../config/globals.php"); include($header); include("galleryglobals.php"); mysql_select_db($sqldatabase,$sqlconnection); $query = mysql_query("SELECT * FROM ofirst_galleries WHERE ID = '".$_GET['ID']."'"); $gallery = mysql_fetch_object($query); // Check if user initiates upload process and run upload process if(ISSET($_POST['upload'])){ ini_set("max_execution_time",$gallery_execution_time); $dirlocate = $gallerydir.$gallery->GalleryName; for ($num=1;$num<=$_POST['NUM_UPLOADS'];$num++){ if (! $_FILES['upload'.$num]['name'] == ""){ copy($_FILES['upload'.$num]['tmp_name'], $dirlocate."/".$_FILES['upload'.$num]['name']) or $error = true; echo "<center><br>".$_FILES['upload'.$num]['name']." - ".$_FILES['upload'.$num]['size']." - ".$_FILES['upload'.$num]['type']." - "; if(empty($error)){ echo "<font color='Green'>Successful</font><br></center>\n"; }else{ echo "<font color='Red'>Not Successful</font><br></center>\n"; } } } } // Prepare fields for uploading next time if(ISSET($_POST['setuploads'])){ $uploads = $_POST['uploads']; }else{ $uploads = 5; } ?> <h2>Upload to Gallery</h2> <p>[ <a href="manage.php">Manager</a> ] [ <a href="newgallery.php">Add New Gallery</a> ]</p> <p><em><?php echo $gallery->GalleryName; ?> Options - </em>[ <a href="edit.php?ID=<?php echo $_GET['ID']; ?>">Edit </a>] [ <a href="upload.php?ID=<?php echo $_GET['ID']; ?>">Upload Photos</a> ] [ <a href="cleargallery.php?ID=<?php echo $_GET['ID']; ?>">Clear Gallery</a> ]</p> <p align="center">Current Files Allowd: <?php echo $imgtypes; ?></p> <p align="center"> <form action='upload.php?ID=<?php echo $_GET['ID']; ?>' enctype="multipart/form-data" method='POST'> <input name="uploads" type="text" id="uploads" size="2" maxlength="2"> <input name="setuploads" type="submit" id="setuploads" value="Add Spaces"> <input type="hidden" name="MAX_FILE_SIZE" size="5200000"> <input type="hidden" name="NUM_UPLOADS" value="<?php echo $uploads; ?>"> <?php // Output upload fields depending on the user request or not for($n = 1; $n <= $uploads ; $n++ ){ echo $n.". <input type='file' name='upload".$n."' size='29'><br>\n"; } ?> <br> <input name="upload" type="submit" value="Upload To Gallery"> </form> <?php include($footer); ?> Index: gallery.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/gallery.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** gallery.php 2 Jun 2003 11:42:03 -0000 1.3 --- gallery.php 5 Jun 2003 01:56:56 -0000 1.4 *************** *** 26,30 **** * */ ! include("../config/globals.php"); include($header); --- 26,31 ---- * */ ! ! // Import globals and estbalish database connection include("../config/globals.php"); include($header); *************** *** 33,44 **** mysql_select_db($sqldatabase,$sqlconnection); - if(! ISSET($_GET['MAX']) && ! ISSET($_GET['MIN'])){ - $min = 0; - $max = 9; - }else{ - $min = $_GET['MIN']; - $max = $_GET['MAX']; - } - ?> <h2>Gallery Viewer</h2> --- 34,37 ---- *************** *** 56,66 **** <?php $query = mysql_query("SELECT * FROM ofirst_galleries WHERE ID = '".$_GET['ID']."'"); $gallery = mysql_fetch_object($query); - if (! is_dir($gallerydir.$gallery->GalleryName)){ - die("<h2><br><br><center>Gallery not setup!</h2><br>"); - } - ?> <tr> --- 49,56 ---- <?php + // Retrieve gallery information $query = mysql_query("SELECT * FROM ofirst_galleries WHERE ID = '".$_GET['ID']."'"); $gallery = mysql_fetch_object($query); ?> <tr> *************** *** 68,72 **** <td width="127" valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $gallery->GalleryName; ?></font></td> <td width="150" valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $gallery->Author; ?></font></td> ! <td width="185" valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $gallery->Date; ?></font></td> </tr> </table> --- 58,62 ---- <td width="127" valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $gallery->GalleryName; ?></font></td> <td width="150" valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $gallery->Author; ?></font></td> ! <td width="185" valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><?php echo date("F j, Y, g:i a",$gallery->Date); ?></font></td> </tr> </table> *************** *** 80,83 **** --- 70,74 ---- <?php + // List photos in the gallery $dirlocate = $gallerydir.$gallery->GalleryName; $dir = opendir($dirlocate); *************** *** 91,95 **** $num = 1; } ! echo "<td width='34%'><a target='_blank' href='viewphoto.php?ID=".$_GET['ID']."&PHOTO=".$file."'><center><img height=100 width=152 src='preview.php?img=$dirlocate/$file'></center></a></td>"; $num++; } --- 82,88 ---- $num = 1; } ! echo "<td width='34%'><a target='_blank' href='viewphoto.php?ID=".$_GET['ID']."&PHOTO=".$file."'> ! <center><img height=100 width=152 src='preview.php?img=$dirlocate/$file'><br><a href=email.php> ! <img src=email.PNG alt='Email to a friend'></a><a target='_blank' href='viewphoto.php?ID=".$_GET['ID']."&PHOTO=".$file."'><img alt='Enlarge' src='enlarge.PNG'></a></center></a></td>"; $num++; } Index: galleryglobals.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/galleryglobals.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** galleryglobals.php 2 Jun 2003 23:26:49 -0000 1.2 --- galleryglobals.php 5 Jun 2003 01:56:56 -0000 1.3 *************** *** 33,35 **** --- 33,38 ---- $imgtypes = "gif,jpg,jpeg,png,bmp"; + // Declare maximum execution time for the galleries + $gallery_execution_time = "1200"; + ?> Index: index.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/index.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** index.php 1 Jun 2003 22:54:49 -0000 1.2 --- index.php 5 Jun 2003 01:56:56 -0000 1.3 *************** *** 27,30 **** --- 27,31 ---- */ + // Import globals and estbalish database connection include("../config/globals.php"); include($header); *************** *** 46,49 **** --- 47,51 ---- <?php + // List galleries from database $query = mysql_query("SELECT * FROM ofirst_galleries"); while($gallery = mysql_fetch_object($query)){ Index: openFIRST.photogallery.sql =================================================================== RCS file: /cvsroot/openfirst/photogallery/openFIRST.photogallery.sql,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** openFIRST.photogallery.sql 2 Jun 2003 11:22:42 -0000 1.1 --- openFIRST.photogallery.sql 5 Jun 2003 01:56:56 -0000 1.2 *************** *** 14,29 **** `GalleryName` tinytext, `Author` text, ! `Date` timestamp(6) NOT NULL, `Description` text, `NumPhotos` tinyint(6) unsigned default '0', PRIMARY KEY (`ID`) ! ) TYPE=MyISAM; ! ! ! ! # ! # Dumping data for table 'ofirst_galleries' ! # ! INSERT INTO `ofirst_galleries` VALUES("1","Testing","David Di Biase","000000","Doesnt doesnt doesnt doesnt","6"); ! INSERT INTO `ofirst_galleries` VALUES("2","Testing","David Di Biase","000000","Doesnt doesnt doesnt doesnt","6"); ! INSERT INTO `ofirst_galleries` VALUES("3","Testing","David Di Biase","000000","Doesnt doesnt doesnt doesnt","6"); --- 14,20 ---- `GalleryName` tinytext, `Author` text, ! `Date` time(10) NOT NULL, `Description` text, `NumPhotos` tinyint(6) unsigned default '0', PRIMARY KEY (`ID`) ! ) TYPE=MyISAM; \ No newline at end of file Index: viewphoto.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/viewphoto.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** viewphoto.php 1 Jun 2003 22:56:20 -0000 1.1.1.1 --- viewphoto.php 5 Jun 2003 01:56:56 -0000 1.2 *************** *** 27,30 **** --- 27,31 ---- */ + // Import globals and estbalish database connection $header_condense = true; include("../config/globals.php"); *************** *** 47,57 **** <?php $query = mysql_query("SELECT * FROM ofirst_galleries WHERE ID = '".$_GET['ID']."'"); $gallery = mysql_fetch_object($query); - if(! is_dir($gallerydir.$gallery->GalleryName)){ - die("<h2><br><br><center>Gallery not setup!</h2><br>"); - } - ?> <tr> --- 48,55 ---- <?php + // Retrieve information about the photos related gallery $query = mysql_query("SELECT * FROM ofirst_galleries WHERE ID = '".$_GET['ID']."'"); $gallery = mysql_fetch_object($query); ?> <tr> *************** *** 59,63 **** <td width="127" valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $gallery->GalleryName; ?></font></td> <td width="150" valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $gallery->Author; ?></font></td> ! <td width="185" valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $gallery->Date; ?></font></td> </tr> </table> --- 57,61 ---- <td width="127" valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $gallery->GalleryName; ?></font></td> <td width="150" valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $gallery->Author; ?></font></td> ! <td width="185" valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><?php echo date("F j, Y, g:i a",$gallery->Date); ?></font></td> </tr> </table> *************** *** 70,75 **** <table width="75" border="0" align="center" cellpadding="5" cellspacing="0"> <?php $dirlocate = $gallerydir.$gallery->GalleryName."/"; ! echo "<img src=".$dirlocate.$_GET['PHOTO'].">"; ?> </table> --- 68,76 ---- <table width="75" border="0" align="center" cellpadding="5" cellspacing="0"> <?php + + // Declare dir location $dirlocate = $gallerydir.$gallery->GalleryName."/"; ! echo "<img src='".$dirlocate.$_GET['PHOTO']."'>"; ! ?> </table> |
From: <dav...@us...> - 2003-06-05 01:15:46
|
Update of /cvsroot/openfirst/config In directory sc8-pr-cvs1:/tmp/cvs-serv5687 Modified Files: headers.php Log Message: Made change to info error. Index: headers.php =================================================================== RCS file: /cvsroot/openfirst/config/headers.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** headers.php 1 Jun 2003 17:30:14 -0000 1.10 --- headers.php 5 Jun 2003 01:15:43 -0000 1.11 *************** *** 89,93 **** <acronym title="For Inspiration and Recognition of Science and Technology">FIRST</acronym> is the largest North American robotics competition ! that has over 800 teams and 2 competitions yearly.<br> <a href="http://www.usfirst.org"><img src="http://openfirst.sourceforge.net/oflogo.php?img=firstlogo&type=1" alt="FIRST" title="FIRST" width="200" height="75" border="0"></a> </p> --- 89,93 ---- <acronym title="For Inspiration and Recognition of Science and Technology">FIRST</acronym> is the largest North American robotics competition ! that has over 800 teams and many competitions yearly.<br> <a href="http://www.usfirst.org"><img src="http://openfirst.sourceforge.net/oflogo.php?img=firstlogo&type=1" alt="FIRST" title="FIRST" width="200" height="75" border="0"></a> </p> |
From: <dav...@us...> - 2003-06-04 18:48:20
|
Update of /cvsroot/openfirst/config In directory sc8-pr-cvs1:/tmp/cvs-serv7699 Modified Files: globals.php Log Message: Added a little note to the $home variable and removed the bracket after the link. I noticed this problem when playing around with messanger. When the msg notifier pops up the Inbox link has two / therefor resulting in a broken link. Im fixing that by making the link without brackets the norm. Everyone should adjust the code to this norm. Index: globals.php =================================================================== RCS file: /cvsroot/openfirst/config/globals.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** globals.php 1 Jun 2003 17:30:13 -0000 1.8 --- globals.php 4 Jun 2003 18:48:16 -0000 1.9 *************** *** 53,58 **** $sqlpassword = "sqlpassword"; //Change this to the MySQL Server Password $sqldatabase = "sqldatabase"; //Change this to the MySQL Database ! $home = "http://openfirst.sourceforge.net/"; // The address scripts will use for ! // linking to your main page. $header = "headers.php"; // Change this to the location of a file // containing the headers for your pages. --- 53,59 ---- $sqlpassword = "sqlpassword"; //Change this to the MySQL Server Password $sqldatabase = "sqldatabase"; //Change this to the MySQL Database ! $home = "http://openfirst.sourceforge.net"; // The address scripts will use for ! // linking to your main page. PLEASE NOTE: do not place ! // a slash after the link. You will get broken links if you do. $header = "headers.php"; // Change this to the location of a file // containing the headers for your pages. |
From: <dav...@us...> - 2003-06-04 18:34:23
|
Update of /cvsroot/openfirst/messanger In directory sc8-pr-cvs1:/tmp/cvs-serv32757 Modified Files: inbox.php Log Message: Edited bug reported by Jon Gambrell on CD. The inbox would not allow the link when the subject was blank. Whenever the subject is empty it now previews < No Subject > Index: inbox.php =================================================================== RCS file: /cvsroot/openfirst/messanger/inbox.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** inbox.php 5 May 2003 00:20:55 -0000 1.5 --- inbox.php 4 Jun 2003 18:34:20 -0000 1.6 *************** *** 60,64 **** <tr> <td><img src="msg.png" alt="Message"></td> ! <td><a href='viewmsg.php?ID=<?php echo $messages->ID; ?>'><?php echo $messages->Subject; ?></a></td> <td><?php echo date("F j, Y, g:i a",$messages->Date); ?></td> <td>Visitor #<?php echo $senderinfo->ID; ?></td> --- 60,74 ---- <tr> <td><img src="msg.png" alt="Message"></td> ! <td><a href='viewmsg.php?ID=<?php echo $messages->ID; ?>'> ! <?php ! ! if (empty($messages->Subject)){ ! echo "< No Subject >"; ! }else{ ! echo $messages->Subject; ! } ! ! ?> ! </a></td> <td><?php echo date("F j, Y, g:i a",$messages->Date); ?></td> <td>Visitor #<?php echo $senderinfo->ID; ?></td> |
From: <xt...@us...> - 2003-06-02 23:52:01
|
Update of /cvsroot/openfirst/photogallery In directory sc8-pr-cvs1:/tmp/cvs-serv24955 Modified Files: preview.php Log Message: Add support for older GD versions Index: preview.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/preview.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** preview.php 2 Jun 2003 23:26:49 -0000 1.2 --- preview.php 2 Jun 2003 23:51:57 -0000 1.3 *************** *** 41,46 **** $new_h = 100; $new_w = 100; ! $dst_img = imagecreatetruecolor($new_w,$new_h); ! imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); imagepng($dst_img); imagedestroy($dst_img); --- 41,51 ---- $new_h = 100; $new_w = 100; ! if(strpos($a["GD Version"], "2.0") > 0) { ! $dst_img = imagecreatetruecolor($new_w,$new_h); ! imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); ! } else { ! $dst_img = imagecreate($new_w,$new_h); ! imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); ! } imagepng($dst_img); imagedestroy($dst_img); *************** *** 56,61 **** $new_h = 100; $new_w = 100; ! $dst_img = imagecreatetruecolor($new_w,$new_h); ! imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); imagejpeg($dst_img); imagedestroy($dst_img); --- 61,71 ---- $new_h = 100; $new_w = 100; ! if(strpos($a["GD Version"], "2.0") > 0) { ! $dst_img = imagecreatetruecolor($new_w,$new_h); ! imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); ! } else { ! $dst_img = imagecreate($new_w,$new_h); ! imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); ! } imagejpeg($dst_img); imagedestroy($dst_img); *************** *** 71,76 **** $new_h = 100; $new_w = 100; ! $dst_img = imagecreatetruecolor($new_w,$new_h); ! imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); imagegif($dst_img); imagedestroy($dst_img); --- 81,91 ---- $new_h = 100; $new_w = 100; ! if(strpos($a["GD Version"], "2.0") > 0) { ! $dst_img = imagecreatetruecolor($new_w,$new_h); ! imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); ! } else { ! $dst_img = imagecreate($new_w,$new_h); ! imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); ! } imagegif($dst_img); imagedestroy($dst_img); *************** *** 86,91 **** $new_h = 100; $new_w = 100; ! $dst_img = imagecreatetruecolor($new_w,$new_h); ! imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); imagebitmap($dst_img); imagedestroy($dst_img); --- 101,111 ---- $new_h = 100; $new_w = 100; ! if(strpos($a["GD Version"], "2.0") > 0) { ! $dst_img = imagecreatetruecolor($new_w,$new_h); ! imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); ! } else { ! $dst_img = imagecreate($new_w,$new_h); ! imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); ! } imagebitmap($dst_img); imagedestroy($dst_img); |
From: <xt...@us...> - 2003-06-02 23:26:52
|
Update of /cvsroot/openfirst/photogallery In directory sc8-pr-cvs1:/tmp/cvs-serv17595 Modified Files: galleryglobals.php preview.php Log Message: Change preview.php to allow more image formats to be available (assuming GD is compiled with support for them). Index: galleryglobals.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/galleryglobals.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** galleryglobals.php 1 Jun 2003 04:17:15 -0000 1.1.1.1 --- galleryglobals.php 2 Jun 2003 23:26:49 -0000 1.2 *************** *** 31,35 **** //Declare image types allowed for uploading/previewing ! $imgtypes = "gif,jpg,png,bmp"; ! ?> \ No newline at end of file --- 31,35 ---- //Declare image types allowed for uploading/previewing ! $imgtypes = "gif,jpg,jpeg,png,bmp"; ! ?> Index: preview.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/preview.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** preview.php 2 Jun 2003 11:42:04 -0000 1.1 --- preview.php 2 Jun 2003 23:26:49 -0000 1.2 *************** *** 28,43 **** $img = $_GET["img"]; ! header("Content-Type: image/png"); ! ! // Take the image passed to us, rescale it to preview-size. Then display it. ! $src_img = imagecreatefrompng("$img"); ! $new_h = 100; ! $new_w = 100; ! $dst_img = imagecreatetruecolor($new_w,$new_h); ! imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); ! imagepng($dst_img); ! imagedestroy($dst_img); ! imagedestroy($src_img); ?> --- 28,106 ---- $img = $_GET["img"]; ! include("galleryglobals.php"); ! $imgt = explode(",", $imgtypes); + for ($x = 0; $x < count($imgt); $x++) { + $imgt[$x] = strtolower($imgt[$x]); + if($imgt[$x] == strtolower(substr($img, strrpos($img, ".") + 1, strlen($img) - strrpos($img, ".")))) { + if($imgt[$x] == "png") { + if(function_exists(imagepng) == true) { + header("Content-Type: image/png"); + $src_img = imagecreatefrompng("$img"); + $new_h = 100; + $new_w = 100; + $dst_img = imagecreatetruecolor($new_w,$new_h); + imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); + imagepng($dst_img); + imagedestroy($dst_img); + imagedestroy($src_img); + } else { + header("Location: thumbnailerror.png"); + } + $displayed = "true"; + } elseif($imgt[$x] == "jpg" || $imgt[$x] == "jpeg") { + if(function_exists(imagejpeg) == true) { + header("Content-Type: image/jpeg"); + $src_img = imagecreatefromjpeg("$img"); + $new_h = 100; + $new_w = 100; + $dst_img = imagecreatetruecolor($new_w,$new_h); + imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); + imagejpeg($dst_img); + imagedestroy($dst_img); + imagedestroy($src_img); + } else { + header("Location: thumbnailerror.png"); + } + $displayed = "true"; + } elseif($imgt[$x] == "gif") { + if(function_exists(imagegif) == true) { + header("Content-Type: image/gif"); + $src_img = imagecreatefromgif("$img"); + $new_h = 100; + $new_w = 100; + $dst_img = imagecreatetruecolor($new_w,$new_h); + imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); + imagegif($dst_img); + imagedestroy($dst_img); + imagedestroy($src_img); + } else { + header("Location: thumbnailerror.png"); + } + $displayed = "true"; + } elseif($imgt[$x] == "bmp") { + if(function_exists(imagebitmap) == true) { + header("Content-Type: image/bmp"); + $src_img = imagecreatefrombitmap("$img"); + $new_h = 100; + $new_w = 100; + $dst_img = imagecreatetruecolor($new_w,$new_h); + imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); + imagebitmap($dst_img); + imagedestroy($dst_img); + imagedestroy($src_img); + } else { + header("Location: thumbnailerror.png"); + } + $displayed = "true"; + } else { + header("Location: thumbnailerror.png"); + $displayed = "true"; + } + } + } + if($displayed != "true") { + header("Location: thumbnailerror.png"); + } ?> |
From: <dav...@us...> - 2003-06-02 22:55:39
|
Update of /cvsroot/openfirst/photogallery In directory sc8-pr-cvs1:/tmp/cvs-serv6978 Added Files: thumbnailerror.png Log Message: Initial upload --- NEW FILE: thumbnailerror.png --- (This appears to be a binary file; contents omitted.) |
From: <xt...@us...> - 2003-06-02 20:01:39
|
Update of /cvsroot/openfirst/members In directory sc8-pr-cvs1:/tmp/cvs-serv28202 Modified Files: auth.php Added Files: logout.php Log Message: Add logout functionality to members area. --- NEW FILE: logout.php --- <?php /* * openFIRST.members - logout.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 * */ include("../config/globals.php"); include($header); if(isset($user->user)) { ?> <?php membersmenu($user->membertype); ?> <h1>Logged Out</h1> <?php $q = mysql_query("UPDATE ofirst_members SET authcode = NULL WHERE user='$user->user';"); echo(mysql_error()); session_start(); session_destroy(); ?> <p>You have been logged out of this web site.</p> <?php } else { echo("<h1>Cannot Logout</h1> <p>You must be logged in in order to log out.</p>"); showlogin(); } include($footer); ?> Index: auth.php =================================================================== RCS file: /cvsroot/openfirst/members/auth.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** auth.php 1 Jun 2003 17:33:35 -0000 1.11 --- auth.php 2 Jun 2003 20:01:36 -0000 1.12 *************** *** 53,57 **** } } ! echo("</p>"); return(0); } --- 53,57 ---- } } ! echo(" <a href='../members/logout.php'>Logout</a></p>"); return(0); } |
From: <xt...@us...> - 2003-06-02 11:42:07
|
Update of /cvsroot/openfirst/photogallery In directory sc8-pr-cvs1:/tmp/cvs-serv13783 Modified Files: gallery.php Added Files: preview.php Log Message: Add image previewing to gallery.php supported by preview.php --- NEW FILE: preview.php --- <?php /* * openFIRST.photogallery - preview.php * * Copyright (C) 2003, * openFIRST Project * Original Author: Tim Ginn <tim...@sy...> * * 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 * */ $img = $_GET["img"]; header("Content-Type: image/png"); // Take the image passed to us, rescale it to preview-size. Then display it. $src_img = imagecreatefrompng("$img"); $new_h = 100; $new_w = 100; $dst_img = imagecreatetruecolor($new_w,$new_h); imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); imagepng($dst_img); imagedestroy($dst_img); imagedestroy($src_img); ?> Index: gallery.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/gallery.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gallery.php 1 Jun 2003 22:54:49 -0000 1.2 --- gallery.php 2 Jun 2003 11:42:03 -0000 1.3 *************** *** 91,95 **** $num = 1; } ! echo "<td width='34%'><a target='_blank' href='viewphoto.php?ID=".$_GET['ID']."&PHOTO=".$file."'><center><img height=100 width=152 src=".$dirlocate."/".$file."></center></a></td>"; $num++; } --- 91,95 ---- $num = 1; } ! echo "<td width='34%'><a target='_blank' href='viewphoto.php?ID=".$_GET['ID']."&PHOTO=".$file."'><center><img height=100 width=152 src='preview.php?img=$dirlocate/$file'></center></a></td>"; $num++; } *************** *** 104,106 **** In order to use or copy its content please contact the teams webmaster.</font></p> <p align="center"> </p> ! <?php include($footer); ?> \ No newline at end of file --- 104,106 ---- In order to use or copy its content please contact the teams webmaster.</font></p> <p align="center"> </p> ! <?php include($footer); ?> |
From: <dav...@us...> - 2003-06-02 11:22:46
|
Update of /cvsroot/openfirst/photogallery In directory sc8-pr-cvs1:/tmp/cvs-serv7557 Added Files: openFIRST.photogallery.sql Log Message: Initial upload of sql setup --- NEW FILE: openFIRST.photogallery.sql --- # MySQL-Front Dump 2.0 # # Host: localhost Database: openFIRST #-------------------------------------------------------- # Server version 3.23.47-nt # # Table structure for table 'ofirst_galleries' # CREATE TABLE `ofirst_galleries` ( `ID` tinyint(3) unsigned NOT NULL auto_increment, `GalleryName` tinytext, `Author` text, `Date` timestamp(6) NOT NULL, `Description` text, `NumPhotos` tinyint(6) unsigned default '0', PRIMARY KEY (`ID`) ) TYPE=MyISAM; # # Dumping data for table 'ofirst_galleries' # INSERT INTO `ofirst_galleries` VALUES("1","Testing","David Di Biase","000000","Doesnt doesnt doesnt doesnt","6"); INSERT INTO `ofirst_galleries` VALUES("2","Testing","David Di Biase","000000","Doesnt doesnt doesnt doesnt","6"); INSERT INTO `ofirst_galleries` VALUES("3","Testing","David Di Biase","000000","Doesnt doesnt doesnt doesnt","6"); |
From: <dav...@us...> - 2003-06-01 22:54:54
|
Update of /cvsroot/openfirst/photogallery In directory sc8-pr-cvs1:/tmp/cvs-serv29542 Modified Files: gallery.php index.php Log Message: gallery.php and index.php are now completely written to allow for gallery viewing. Index: gallery.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/gallery.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** gallery.php 1 Jun 2003 04:17:15 -0000 1.1.1.1 --- gallery.php 1 Jun 2003 22:54:49 -0000 1.2 *************** *** 1,5 **** <?php /* ! * openFIRST.photogallery - index.php * * Copyright (C) 2003, --- 1,5 ---- <?php /* ! * openFIRST.photogallery - gallery.php * * Copyright (C) 2003, *************** *** 26,42 **** * */ - include("../config/globals.php"); - include($header); - include("galleryglobals.php"); ! mysql_select_db($sqldatabase,$sqlconnection); ! if(! ISSET($_GET['MAX']) && ! ISSET($_GET['MIN'])){ ! $min = 0; ! $max = 9; ! }else{ ! $min = $_GET['MIN']; ! $max = $_GET['MAX']; ! } ?> --- 26,43 ---- * */ ! include("../config/globals.php"); ! include($header); ! include("galleryglobals.php"); ! mysql_select_db($sqldatabase,$sqlconnection); ! ! if(! ISSET($_GET['MAX']) && ! ISSET($_GET['MIN'])){ ! $min = 0; ! $max = 9; ! }else{ ! $min = $_GET['MIN']; ! $max = $_GET['MAX']; ! } ?> *************** *** 54,63 **** </tr> <?php - $query = mysql_query("SELECT * FROM ofirst_galleries WHERE ID = '".$_GET['ID']."'"); - $gallery = mysql_fetch_object($query); ! if (! is_dir($gallerydir.$gallery->GalleryName)){ ! die("<h2><br><br><center>Gallery not setup!</h2><br>"); ! } ?> --- 55,65 ---- </tr> <?php ! $query = mysql_query("SELECT * FROM ofirst_galleries WHERE ID = '".$_GET['ID']."'"); ! $gallery = mysql_fetch_object($query); ! ! if (! is_dir($gallerydir.$gallery->GalleryName)){ ! die("<h2><br><br><center>Gallery not setup!</h2><br>"); ! } ?> *************** *** 68,86 **** <td width="185" valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $gallery->Date; ?></font></td> </tr> - <?php - - $dirlocate = $gallerydir.$gallery->GalleryName; - $dir = opendir($dirlocate); - - while(! (($file = readdir($dir)) === false)){ - if (! is_dir($dirlocate."/".$file)){ - echo "<img height=40 width=30 src=".$dirlocate."/".$file.">"; - } - } - ?> </table> <div align="center"> ! <p><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><b>Current ! Pictures <?php echo $min."-".$max; ?> / <?php echo $gallery->NumPhotos; ?> Total</b></font><br> <br> </p> --- 70,76 ---- <td width="185" valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $gallery->Date; ?></font></td> </tr> </table> <div align="center"> ! <p><font size="2" face="Verdana, Arial, Helvetica, sans-serif"></font><br> <br> </p> *************** *** 88,120 **** <div align="center"></div> <table width="75" border="0" align="center" cellpadding="5" cellspacing="0"> - <tr> - <td width="34%"><div align="center"><img src="gallery/funnies/A000010.jpg" width="162" height="112"></div></td> - <td width="34%"><div align="center"><img src="gallery/funnies/A000010.jpg" width="162" height="112"></div></td> - <td width="32%"><div align="center"><img src="gallery/funnies/A000010.jpg" width="162" height="112"></div></td> - </tr> - <tr> - <td><div align="center"><img src="gallery/funnies/A000010.jpg" width="162" height="112"></div></td> - <td><div align="center"><img src="gallery/funnies/A000010.jpg" width="162" height="112"></div></td> - <td><div align="center"><img src="gallery/funnies/A000010.jpg" width="162" height="112"></div></td> - </tr> - <tr> - <td><div align="center"><img src="gallery/funnies/A000010.jpg" width="162" height="112"></div></td> - <td><div align="center"><img src="gallery/funnies/A000010.jpg" width="162" height="112"></div></td> - <td><div align="center"><img src="gallery/funnies/A000010.jpg" width="162" height="112"></div></td> - </tr> - </table> - <p align="center"> - <form action="gallery.php" method="GET"> - <input type="hidden" value="<?php echo $_GET['ID']; ?>" name="ID"> <?php ! if ($min < 0){ ! echo "<a href=gallery.php?ID=".$_GET['ID']."&MIN=".($min-9)."&MAX=".$min."><- Previous</a>"; ! } ! ! if ($max < $gallery->NumPhotos){ ! echo "<a href=gallery.php?ID=".$_GET['ID']."&MIN=".$max."&MAX=".($max+9).">Next -></a>"; ! } ?> ! </form> </p> <p align="center"><font size="2">The content within the galleries are copyright --- 78,102 ---- <div align="center"></div> <table width="75" border="0" align="center" cellpadding="5" cellspacing="0"> <?php ! ! $dirlocate = $gallerydir.$gallery->GalleryName; ! $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%'><a target='_blank' href='viewphoto.php?ID=".$_GET['ID']."&PHOTO=".$file."'><center><img height=100 width=152 src=".$dirlocate."/".$file."></center></a></td>"; ! $num++; ! } ! } ! ?> ! </table> ! <p align="center"> </p> <p align="center"><font size="2">The content within the galleries are copyright Index: index.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/index.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** index.php 1 Jun 2003 04:17:15 -0000 1.1.1.1 --- index.php 1 Jun 2003 22:54:49 -0000 1.2 *************** *** 26,34 **** * */ - include("../config/globals.php"); - include($header); - include("galleryglobals.php"); ! mysql_select_db($sqldatabase,$sqlconnection); ?> --- 26,35 ---- * */ ! include("../config/globals.php"); ! include($header); ! include("galleryglobals.php"); ! ! mysql_select_db($sqldatabase,$sqlconnection); ?> *************** *** 43,52 **** <td> <div align="center"><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Description</font></strong></div></td> </tr> - - - <?php ! $query = mysql_query("SELECT * FROM ofirst_galleries"); ! while($gallery = mysql_fetch_object($query)){ ?> <tr> --- 44,52 ---- <td> <div align="center"><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Description</font></strong></div></td> </tr> <?php ! ! $query = mysql_query("SELECT * FROM ofirst_galleries"); ! while($gallery = mysql_fetch_object($query)){ ! ?> <tr> *************** *** 56,63 **** </tr> <?php ! } ! if (mysql_num_rows($query) == 0){ ! echo "<tr><td>--</td><td><br>There are no galleries uploaded<br><br></td>"; ! } ?> </table> --- 56,65 ---- </tr> <?php ! } ! ! if (mysql_num_rows($query) == 0){ ! echo "<tr><td>--</td><td><br>There are no galleries uploaded<br><br></td>"; ! } ! ?> </table> |
From: <xt...@us...> - 2003-06-01 20:00:36
|
Update of /cvsroot/openfirst/members In directory sc8-pr-cvs1:/tmp/cvs-serv32317 Modified Files: profile.php Log Message: Make profile show *their* skills, instead of *your* skills. Index: profile.php =================================================================== RCS file: /cvsroot/openfirst/members/profile.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** profile.php 1 Jun 2003 18:59:39 -0000 1.4 --- profile.php 1 Jun 2003 20:00:32 -0000 1.5 *************** *** 135,139 **** } } ! $skill = explode(",", $user->skills); for($y = 0; $y < count($skill); $y++) { $det = explode("|",$skill[$y]); --- 135,139 ---- } } ! $skill = explode(",", $q->skills); for($y = 0; $y < count($skill); $y++) { $det = explode("|",$skill[$y]); |
From: <xt...@us...> - 2003-06-01 18:59:43
|
Update of /cvsroot/openfirst/members In directory sc8-pr-cvs1:/tmp/cvs-serv8048 Modified Files: profile.php Log Message: Fix very minor typo. Index: profile.php =================================================================== RCS file: /cvsroot/openfirst/members/profile.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** profile.php 1 Jun 2003 05:59:14 -0000 1.3 --- profile.php 1 Jun 2003 18:59:39 -0000 1.4 *************** *** 151,153 **** <?php include($footer); ?> - ?> --- 151,152 ---- |
From: <xt...@us...> - 2003-06-01 18:59:07
|
Update of /cvsroot/openfirst/config In directory sc8-pr-cvs1:/tmp/cvs-serv7810 Modified Files: footers.php Log Message: Fix minor bug discovered Mozilla on mouseover, of turning text white on mouseover. Index: footers.php =================================================================== RCS file: /cvsroot/openfirst/config/footers.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** footers.php 14 May 2003 11:32:44 -0000 1.8 --- footers.php 1 Jun 2003 18:59:03 -0000 1.9 *************** *** 7,11 **** </tr> </table> ! <p class="menu" align="center">Copyright © 2002 All rights reserved by the openFIRST Development Team. <a href="/source.php?url=/index.php">Show Source</a></p> --- 7,11 ---- </tr> </table> ! <p align="center">Copyright © 2002 All rights reserved by the openFIRST Development Team. <a href="/source.php?url=/index.php">Show Source</a></p> *************** *** 15,19 **** <a href="http://sourceforge.net"> <img src="http://sourceforge.net/sflogo.php?group_id=78233&type=4" width="125" height="37" border="0" alt="SourceForge.net" title="SourceForge.net" /></a> ! <a class="menu"href="http://validator.w3.org/check/referer"><img border="0" src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" height="31" width="88"></a></p> </body> </html> --- 15,19 ---- <a href="http://sourceforge.net"> <img src="http://sourceforge.net/sflogo.php?group_id=78233&type=4" width="125" height="37" border="0" alt="SourceForge.net" title="SourceForge.net" /></a> ! <a class="menu" href="http://validator.w3.org/check/referer"><img border="0" src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" height="31" width="88"></a></p> </body> </html> |
From: <xt...@us...> - 2003-06-01 17:53:30
|
Update of /cvsroot/openfirst/logger In directory sc8-pr-cvs1:/tmp/cvs-serv17523 Modified Files: track.php Log Message: Fix minor problem causing headers to fail Index: track.php =================================================================== RCS file: /cvsroot/openfirst/logger/track.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** track.php 5 May 2003 11:19:24 -0000 1.3 --- track.php 1 Jun 2003 17:53:25 -0000 1.4 *************** *** 1,3 **** ! <?php include("../config/globals.php"); include("$header"); --- 1,3 ---- ! <?php include("../config/globals.php"); include("$header"); |