openfirst-cvscommit Mailing List for openFIRST (Page 21)
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: Astronouth7303 <ast...@us...> - 2005-06-30 02:00:58
|
Update of /cvsroot/openfirst/awards In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29797/awards Added Files: awards.php Log Message: handles the Module class --- NEW FILE: awards.php --- <?php /* * openFIRST.awards - awards.php * * Copyright (C) 2005, * openFIRST Project * Original Author: Jamie Bliss <ja...@op...> * * 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. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ // Purpose: Defines the AwardModule class, a child of the Module class. class AwardModule extends Module { function getSlugURI($slug) { /* supported forms: %Date% (some parsable date) %Title% (The title exists) %ID% (just an integer) */ } } ?> |
From: Astronouth7303 <ast...@us...> - 2005-06-30 01:59:05
|
Update of /cvsroot/openfirst/awards In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28713/awards Modified Files: index.php openfirst.info.xml Added Files: awardsfirst.gif Log Message: lots o' updates Index: openfirst.info.xml =================================================================== RCS file: /cvsroot/openfirst/awards/openfirst.info.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** openfirst.info.xml 31 May 2005 22:17:45 -0000 1.5 --- openfirst.info.xml 30 Jun 2005 01:58:53 -0000 1.6 *************** *** 7,10 **** --- 7,14 ---- <maintainer>Jamie Bliss</maintainer> + <includes> + <include>awards.php</include> + </includes> + <!-- Configuration --> <!-- Either entities or CDATA can be used. Just make sure it's parsed into the literal HTML. --> Index: index.php =================================================================== RCS file: /cvsroot/openfirst/awards/index.php,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** index.php 26 May 2005 23:27:05 -0000 1.17 --- index.php 30 Jun 2005 01:58:53 -0000 1.18 *************** *** 1,106 **** ! <?php ! /* ! * openFIRST.awards - index.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. ! * ! * 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_once("../includes/globals.php"); ! include_once($Header); ! ! // Query database for award information ! $query = ofirst_dbquery('SELECT * FROM '. ! ofirst_dbquote_table('awards'). ! ' WHERE '. ! ofirst_dbquote_name('FIRSTAward'). ! '='. ! ofirst_dbquote_data(1). ! ' ORDER BY '. ! ofirst_dbquote_name('Date'). ! ' DESC'); ! $amount = ofirst_dbnum_rows($query); ! ?> ! <h1>Team Awards</h1> ! <p>This team has won <b><?php echo $amount; ?></b> <a href='http://www.usfirst.org/'>FIRST</a> award(s).</p> ! <?php ! // If more then one award is present then show the values ! if($amount > 0) { ! ?> ! <table> ! <tr> ! <th colspan="2">Award Name</th> ! <th>Event</th> ! <th>Date</th> ! <th>Recipient</th> ! </tr> ! <?php ! // Loop through awards ordered by date ! while($awards = ofirst_dbfetch_object($query)){ ! ?> ! <tr valign="top"> ! <td><img src="awards<?php echo $awards->Image; ?>.png" alt="<?php echo $awards->Image; ?>"></td> ! <td> ! <h3><?php echo $awards->AwardName; ?></h3> ! <p><?php echo $awards->Description; ?></p> ! </td> ! <td><?php echo $awards->Event; ?></td> ! <td><?php echo $awards->Date; ?></td> ! <td><?php echo $awards->Recipient; ?></td> ! </tr> ! <?php } ?> ! </table> ! ! <?php ! } ! // Query database for award information ! $query = ofirst_dbquery("SELECT * FROM ofirst_awards WHERE FIRSTAward='0' ORDER BY Date DESC"); ! $amount = ofirst_dbnum_rows($query); ! ?> ! <h1>Team Awards</h1> ! <p>This team has won <strong><?php echo $amount; ?></strong> award(s) from sources other than FIRST.</p> ! <?php ! // If more then one award is present then show the values ! if($amount > 0) { ! ?> ! <table> ! <tr> ! <th colspan="2">Award Name</th> ! <th>Event</th> ! <th>Date</th> ! <th>Recipient</th> ! </tr> ! <?php ! // Loop through awards ordered by date ! while($awards = ofirst_dbfetch_object($query)){ ! ?> ! <tr valign="top"> ! <td><img src="awards<?php echo $awards->Image; ?>.png" alt="<?php echo $awards->Image; ?>"></td> ! <td> ! <h3><?php echo $awards->AwardName; ?></h3> ! <p><?php echo $awards->Description; ?></p> ! </td> ! <td><?php echo $awards->Event; ?></td> ! <td><?php echo $awards->Date; ?></td> ! <td><?php echo $awards->Recipient; ?></td> ! </tr> ! <?php } ?> ! </table> ! <?php ! } ! include_once($Footer); ?> --- 1,71 ---- ! <?php ! /* ! * openFIRST.awards - index.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. ! * ! * 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_once("../includes/globals.php"); ! include_once($Header); ! ! // Query database for award information ! $query = $ofDB->query('SELECT * FROM '.$ofDB->quoteTable('awards'). ! ' ORDER BY '.$ofDB->quoteField('Date').' DESC' ! ); ! $amount = $ofDB->numberOfRows($query); ! ?> ! <h1>Team Awards</h1> ! <p>This team has won <b><?php echo $amount; ?></b> award(s).</p> ! <?php ! // If more then one award is present then show the values ! if($amount > 0) { ! ?> ! <table> ! <tr> ! <th colspan="2">Award Name</th> ! <th>Event</th> ! <th>Date</th> ! <th>Recipient</th> ! </tr> ! <?php ! // Loop through awards ordered by date ! while($awards = $ofDB->fetchObject($query)){ ! ?> ! <tr valign="top"> ! <td> ! <img src="awards<?php echo $awards->Image; ?>.png" alt="<?php echo $awards->Image; ?>" /> ! <?php if ($awards->FIRSTAward) { ?><img src="awardsfirst.gif" /><?php } ?> ! </td> ! <td> ! <h3><?php echo $awards->AwardName; ?></h3> ! <p><?php echo $awards->Description; ?></p> ! </td> ! <td><?php echo $awards->Event; ?></td> ! <td><?php echo $awards->Date; ?></td> ! <td><?php echo $awards->Recipient; ?></td> ! </tr> ! <?php } ?> ! </table> ! ! <?php ! } ! $ofDB->freeResult($query); ! ! include_once($Footer); ! ?> --- NEW FILE: awardsfirst.gif --- (This appears to be a binary file; contents omitted.) |
From: Astronouth7303 <ast...@us...> - 2005-06-30 01:59:04
|
Update of /cvsroot/openfirst/awards/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28713/awards/admin Modified Files: index.php Log Message: lots o' updates Index: index.php =================================================================== RCS file: /cvsroot/openfirst/awards/admin/index.php,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** index.php 26 May 2005 23:27:05 -0000 1.23 --- index.php 30 Jun 2005 01:58:52 -0000 1.24 *************** *** 1,308 **** ! <?php ! /* ! * openFIRST.awards - admin/index.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. ! * ! * 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_once("../../includes/globals.php"); ! include_once($Header); ! ! // Check if user is an admin then allow processes ! if(isset($user->user)){ ! ! if($user->membertype=="administrator"){ ! // If user has posted delete then delete specified record in querystring DELETE ! if (isset($_GET['DELETE'])){ ! ofirst_dbquery('DELETE FROM '. ! ofirst_dbquote_table('awards'). ! ' WHERE '. ! ofirst_dbquote_name('ID'). ! ' = '. ! ofirst_dbquote_data($_GET['DELETE']) ! ) or die("DELETE: ". ofirst_dberror()); ! ! echo("<p>Award information has been deleted.</p><p>[ <a href='./'>Manage Awards</a> ]</p>"); ! die(include_once($footer)); ! } ! $DisplayForm = true; ! $CreateNew = true; ! if (array_key_exists('AwardID', $_POST)) { ! $CreateNew = false; ! $DisplayForm = false; ! } ! if (array_key_exists('create', $_POST)) { ! $CreateNew = true; ! $DisplayForm = false; ! } ! if (array_key_exists('modify', $_POST)) { ! $CreateNew = false; ! $DisplayForm = false; ! } ! ! $firstaward = false; ! if (isset($_POST['firstaward'])) $firstaward = $_POST['firstaward'] == '1' ? true : false; ! $award = ''; ! if (isset($_POST['award'])) $award = $_POST['award']; ! $event = ''; ! if (isset($_POST['event'])) $event = $_POST['event']; ! $date = date('Y-n-j'); ! if (isset($_POST['date'])) $date = $_POST['date']; ! $recipient = ''; ! if (isset($_POST['recipient'])) $recipient = $_POST['recipient']; ! $description = ''; ! if (isset($_POST['description'])) $description = $_POST['description']; ! $type = 'gold'; ! if (isset($_POST['type'])) $type = $_POST['type']; ! ! // If user has posted create then insert new award record ! if ($CreateNew && !$DisplayForm){ ! if ($award != "" || $firstaward){ ! if($firstaward) { ! $faq = ofirst_dbquery('SELECT * FROM '. ! ofirst_dbquote_table('firstawards'). ! ' WHERE '. ! ofirst_dbquote_name('AwardName'). ! '='. ! ofirst_dbquote_data($firstaward)); ! $fa = ofirst_dbfetch_object($faq); ! $award = $fa->AwardName; ! $description = $fa->Description; ! } ! ! ofirst_dbquery('INSERT INTO '. ! ofirst_dbquote_table('awards').' ('. ! ofirst_dbquote_name(array('AwardName', 'FIRSTAward', 'Event', 'Date', 'Image', 'Description', 'Recipient')). ! ') values('. ! ofirst_dbquote_data(array($award, $firstaward, $event, $date, $type, $description, $recipient)). ! ')') ! #or die("INSERT: ".ofirst_dberror()) ! or die(trigger_error('an openFIRST DB error')) ! ; ! ! echo("<p>Congratulations on your new award. Award submitted!</p><p>[ <a href='./'>Manage Awards</a> ]</p>"); ! } else { ! echo("<p>Please enter a name for the award.</p><p>[ <a href='./'>Manage Awards</a> ]</p>"); ! } ! die(include_once($Footer)); ! } ! ! // If the user has submitted modifications to an award, then make them. ! ! if (!$CreateNew && !$DisplayForm){ ! if ($award != "" || $firstaward){ ! if ($firstaward) { ! $faq = ofirst_dbquery('SELECT * FROM '.ofirst_dbquote_table('awards').' WHERE '. ! ofirst_dbquote_name('AwardName').'='. ! ofirst_dbquote_data($firstawardname)); ! $fa = ofirst_dbfetch_object($faq); ! $award = $fa->AwardName; ! $description = $fa->Description; ! } ! ! ofirst_dbquery('UPDATE '.ofirst_dbquote_table('awards').' SET '. ! ofirst_dbquote_fd_pairs(array( ! 'AwardName' => $award, ! 'FIRSTAward' => $firstaward, ! 'Event' => $event, ! 'Date' => $date, ! 'Image' => $type, ! 'Description' => $description, ! 'Recipient' => $recipient)). ! ' WHERE '.ofirst_dbquote_name('ID').'='.ofirst_dbquote_data(AwardID)) ! or die("UPDATE: ".ofirst_dberror()); ! ! echo("<p>Award modifications submitted!</p><p>[ <a href='./'>Manage Awards</a> ]</p>"); ! } else { ! echo("<p>Please enter a name for the award.</p><p>[ <a href='./'>Manage Awards</a> ]</p>"); ! } ! die(include_once($footer)); ! } ! ! ! // If the user has elected to modify an award, fill the form with those details. ! if(!$CreateNew) { ! $award = ofirst_dbfetch_object(ofirst_dbquery('SELECT * FROM '.ofirst_dbquote_table('awards').' WHERE '.ofirst_dbquote_name('ID').'='.ofirst_dbquote_data('AwardID'))); ! $award->template = false; ! ! } else { ! $award = (object)''; ! $award->template = true; ! $award->AwardName = 'Autodesk Visualization Award'; ! $award->Description = ''; ! $award->Event = ''; ! $award->Date = date('Y-n-j'); ! $award->Recipient = 'Team Award'; ! $award->Image = 'gold'; ! $award->FIRSTAward = '1'; ! } ! ?> ! ! <h1>Manage Award Information</h1> ! <form method="post" action="index.php"> ! <table> ! <colgroup> ! <col /> ! </colgroup> ! <colgroup> ! <col /> ! </colgroup> ! <tr> ! <th colspan="2"><?php ! if (!$award->template) { ! echo("Modify an Existing Award ! <input type='hidden' id='AwardID' name='AwardID' value='$award->ID'>"); ! } else { ! echo("Add A New Award"); ! } ! ?></th> ! </tr> ! <tr> ! <th>Award Name</th> ! <td class="left"> ! <table class="no-space left"> ! <tr> ! <td> ! <input type='radio' name='firstaward' value='1' <?php if ($award->FIRSTAward) echo 'checked="checked"'; ?>> ! </td> ! <td> FIRST Award</td> ! </td> ! <td> ! <select name='firstawardname'> ! <?php ! $faq = ofirst_dbquery('SELECT * FROM '.ofirst_dbquote_table('awards').' ORDER BY '.ofirst_dbquote_name('AwardName')); ! while($fa = ofirst_dbfetch_object($faq)) { ! echo "<option value='$fa->AwardName'"; ! if ($award->AwardName == $fa->AwardName) echo 'selected'; ! echo ">$fa->AwardName</option>"; ! } ! ?> ! </select> ! </td> ! </tr> ! <tr> ! <td> ! <input type='radio' name='firstaward' value='0' <?php if (!$award->FIRSTAward) echo 'checked="checked"'; ?>> ! </td> ! <td> Custom Award</td> ! </td> ! <td> ! <input name="award" type="text" id="award" value="<?php if (!$award->FIRSTAward) echo $award->AwardName; ?>"> ! </td> ! </tr> ! </table> ! </td> ! </tr> ! <tr> ! <th>Regional/Event</th> ! <td class="left"><input name="event" type="text" id="event" value="<?php echo $award->Event; ?>"></td> ! </tr> ! <tr> ! <th>Date</th> ! <td class="left"><input name="date" type="text" id="date" value="<?php ! echo $award->Date; ! ?>" size="10"> ! <sub>(Use this syntax: Year-Month-Day)</sub></td> ! </tr> ! <tr> ! <th>Recipient</th> ! <td class="left"><input name="recipient" type="text" id="recipient" value="<?php ! echo $award->Recipient; ! ?>"></td> ! </tr> ! <tr> ! <th>Description<br />(leave blank for FIRST Awards)</th> ! <td><textarea name="description" cols="30" rows="5"><?php echo $award->Description; ?></textarea></td> ! </tr> ! <tr> ! <th>Award Type</th> ! <td class="left"><table> ! <tr> ! <td><img src="<?php echo($BasePath); ?>/awards/awardsgold.png" alt="Gold"></td> ! <td><img src="<?php echo($BasePath); ?>/awards/awardssilver.png" alt="Silver"></td> ! <td><img src="<?php echo($BasePath); ?>/awards/awardsbronze.png" alt="Bronze"></td> ! </tr> ! <tr> ! <td><div align="center"> ! <input name="type" type="radio" value="gold" <?php ! if (strcasecmp($award->Image, 'gold') == 0) echo 'checked="checked"'; ! ?>> ! </div></td> ! <td><div align="center"> ! <input type="radio" name="type" value="silver" <?php ! if (strcasecmp($award->Image, 'silver') == 0) echo 'checked="checked"'; ! ?>> ! </div></td> ! <td><div align="center"> ! <input type="radio" name="type" value="bronze" <?php ! if (strcasecmp($award->Image, 'bronze') == 0) echo 'checked="checked"'; ! ?>> ! </div></td> ! </tr> ! </table></td> ! </tr> ! <tr> ! <td colspan="2" class="center"> ! <?php if($award->template) { ?> ! <input name="create" type="submit" id="create" value="Create Award"> ! <?php } else { ?> ! <input name="modify" type="submit" id="modify" value="Modify Award"></td> ! <?php } ?> ! </td> ! </tr> ! </table> ! </form> ! <table> ! <tr> ! <th colspan="2">Award Name</th> ! <th>Event</th> ! <th>Date</th> ! <th>Recipient</th> ! <th>Option</th> ! </tr> ! <?php ! // Loop through awards ordered by date ! $query = ofirst_dbquery('SELECT * FROM '.ofirst_dbquote_table('awards').' ORDER BY '.ofirst_dbquote_name('Date')); ! while($awards = ofirst_dbfetch_object($query)){ ! ?> ! <tr> ! <td><img src="<?php echo($BasePath); ?>/awards/awards<?php echo $awards->Image; ?>.png" alt="<?php echo $awards->Image; ?>"></td> ! <td><?php echo $awards->AwardName; ?></td> ! <td><?php echo $awards->Event; ?></td> ! <td><?php echo $awards->Date; ?></td> ! <td><?php echo $awards->Recipient; ?></td> ! <td><div align="center">[ <a href='./?DELETE=<?php echo $awards->ID; ?>'>Delete</a> | <a href='./?MODIFY=<?php echo $awards->ID; ?>'>Modify</a> ]</div></td> ! </tr> ! <?php ! } ! if(ofirst_dbnum_rows($query) == 0){ ! echo '<tr><td colspan="6">No awards entered!</td></tr>'; ! } ! ?> ! </table> ! <br /> ! <?php ! } else { ! echo("<h1>Manage Award Information</h1><p>Only administrators can use this feature</p>"); ! } ! } else { ! showlogin(); ! } ! include_once($Footer); ! ?> --- 1,312 ---- ! <?php ! /* ! * openFIRST.awards - admin/index.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. ! * ! * 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_once("../../includes/globals.php"); ! include_once($Header); ! ! // Check if user is an admin then allow processes ! if(isset($user->user)){ ! ! if($user->membertype=="administrator"){ ! // If user has posted delete then delete specified record in querystring DELETE ! if (isset($_GET['DELETE'])){ ! ofirst_dbquery('DELETE FROM '. ! ofirst_dbquote_table('awards'). ! ' WHERE '. ! ofirst_dbquote_name('ID'). ! ' = '. ! ofirst_dbquote_data($_GET['DELETE']) ! ) or die("DELETE: ". ofirst_dberror()); ! ! echo("<p>Award information has been deleted.</p><p>[ <a href='./'>Manage Awards</a> ]</p>"); ! die(include_once($footer)); ! } ! $DisplayForm = true; ! $CreateNew = true; ! if (array_key_exists('AwardID', $_POST)) { ! $CreateNew = false; ! $DisplayForm = false; ! } ! if (array_key_exists('create', $_POST)) { ! $CreateNew = true; ! $DisplayForm = false; ! } ! if (array_key_exists('modify', $_POST)) { ! $CreateNew = false; ! $DisplayForm = false; ! } ! ! $firstaward = false; ! if (isset($_POST['firstaward'])) $firstaward = $_POST['firstaward'] == '1' ? true : false; ! $firstawardname = ''; ! if (isset($_POST['firstawardname'])) $firstawardname = $_POST['firstawardname']; ! $award = ''; ! if (isset($_POST['award'])) $award = $_POST['award']; ! $event = ''; ! if (isset($_POST['event'])) $event = $_POST['event']; ! $date = date('Y-n-j'); ! if (isset($_POST['date'])) $date = $_POST['date']; ! $recipient = ''; ! if (isset($_POST['recipient'])) $recipient = $_POST['recipient']; ! $description = ''; ! if (isset($_POST['description'])) $description = $_POST['description']; ! $type = 'gold'; ! if (isset($_POST['type'])) $type = $_POST['type']; ! ! ! // If user has posted create then insert new award record ! if ($CreateNew && !$DisplayForm){ ! if ($award != '' || $firstaward){ ! if($firstaward) { ! $sql = 'SELECT * FROM '.$ofDB->quoteTable('firstawards'). ! ' WHERE '.$ofDB->quoteField('AwardName').'='.$ofDB->quoteData($firstawardname). ! ' LIMIT 0,1'; ! $faq = $ofDB->query($sql); ! $fa = $ofDB->fetchObject($faq); ! $award = $fa->AwardName; ! $description = $fa->Description; ! } ! $sql = 'INSERT INTO '. ! $ofDB->quoteTable('awards').' SET '. ! $ofDB->quoteFDPairs(array('AwardName' => $award, ! 'FIRSTAward' => $firstaward, ! 'Event' => $event, ! 'Date' => $date, ! 'Image' => $type, ! 'Description' => $description, ! 'Recipient' => $recipient ! )); ! $ofDB->query($sql) or die(trigger_error('an openFIRST DB error')); ! ! echo("<p>Congratulations on your new award. Award submitted!</p><p>[ <a href='./'>Manage Awards</a> ]</p>"); ! } else { ! echo("<p>Please enter a name for the award.</p><p>[ <a href='./'>Manage Awards</a> ]</p>"); ! } ! die(include_once($Footer)); ! } ! ! // If the user has submitted modifications to an award, then make them. ! ! if (!$CreateNew && !$DisplayForm){ ! if ($award != "" || $firstaward){ ! if ($firstaward) { ! $faq = ofirst_dbquery('SELECT * FROM '.ofirst_dbquote_table('awards').' WHERE '. ! ofirst_dbquote_name('AwardName').'='. ! ofirst_dbquote_data($firstawardname)); ! $fa = ofirst_dbfetch_object($faq); ! $award = $fa->AwardName; ! $description = $fa->Description; ! } ! ! ofirst_dbquery('UPDATE '.ofirst_dbquote_table('awards').' SET '. ! ofirst_dbquote_fd_pairs(array( ! 'AwardName' => $award, ! 'FIRSTAward' => $firstaward, ! 'Event' => $event, ! 'Date' => $date, ! 'Image' => $type, ! 'Description' => $description, ! 'Recipient' => $recipient)). ! ' WHERE '.ofirst_dbquote_name('ID').'='.ofirst_dbquote_data(AwardID)) ! or die("UPDATE: ".ofirst_dberror()); ! ! echo("<p>Award modifications submitted!</p><p>[ <a href='./'>Manage Awards</a> ]</p>"); ! } else { ! echo("<p>Please enter a name for the award.</p><p>[ <a href='./'>Manage Awards</a> ]</p>"); ! } ! die(include_once($footer)); ! } ! ! ! // If the user has elected to modify an award, fill the form with those details. ! if(!$CreateNew) { ! $sql = 'SELECT * FROM '.$ofDB->quoteTable('awards'). ! ' WHERE '.$ofDB->quoteField('ID').'='.$ofDB->quoteData('AwardID'); ! $award = $ofDB->fetchObject($ofDB->query($sql)); ! $award->template = false; ! ! } else { ! $award = (object)''; ! $award->template = true; ! $award->AwardName = 'Autodesk Visualization Award'; ! $award->Description = ''; ! $award->Event = ''; ! $award->Date = date('Y-n-j'); ! $award->Recipient = 'Team Award'; ! $award->Image = 'gold'; ! $award->FIRSTAward = '1'; ! } ! ?> ! ! <h1>Manage Award Information</h1> ! <form method="post" action="index.php"> ! <table> ! <colgroup> ! <col /> ! </colgroup> ! <colgroup> ! <col /> ! </colgroup> ! <tr> ! <th colspan="2"><?php ! if (!$award->template) { ! echo("Modify an Existing Award ! <input type='hidden' id='AwardID' name='AwardID' value='$award->ID'>"); ! } else { ! echo("Add A New Award"); ! } ! ?></th> ! </tr> ! <tr> ! <th>Award Name</th> ! <td class="left"> ! <table class="no-space left"> ! <tr> ! <td> ! <input type='radio' name='firstaward' value='1' <?php if ($award->FIRSTAward) echo 'checked="checked"'; ?>> ! </td> ! <td> FIRST Award</td> ! </td> ! <td> ! <select name='firstawardname'> ! <?php ! $faq = $ofDB->query('SELECT * FROM '.$ofDB->quoteTable('firstawards').' ORDER BY '.$ofDB->quoteField('AwardName')); ! while($fa = $ofDB->fetchObject($faq)) { ! echo "<option value='$fa->AwardName'"; ! if ($award->AwardName == $fa->AwardName) echo 'selected'; ! echo ">$fa->AwardName</option>"; ! } ! ?> ! </select> ! </td> ! </tr> ! <tr> ! <td> ! <input type='radio' name='firstaward' value='0' <?php if (!$award->FIRSTAward) echo 'checked="checked"'; ?>> ! </td> ! <td> Custom Award</td> ! </td> ! <td> ! <input name="award" type="text" id="award" value="<?php if (!$award->FIRSTAward) echo $award->AwardName; ?>"> ! </td> ! </tr> ! </table> ! </td> ! </tr> ! <tr> ! <th>Regional/Event</th> ! <td class="left"><input name="event" type="text" id="event" value="<?php echo $award->Event; ?>"></td> ! </tr> ! <tr> ! <th>Date</th> ! <td class="left"><input name="date" type="text" id="date" value="<?php ! echo $award->Date; ! ?>" size="10"> ! <sub>(Use this syntax: Year-Month-Day)</sub></td> ! </tr> ! <tr> ! <th>Recipient</th> ! <td class="left"><input name="recipient" type="text" id="recipient" value="<?php ! echo $award->Recipient; ! ?>"></td> ! </tr> ! <tr> ! <th>Description<br />(leave blank for FIRST Awards)</th> ! <td><textarea name="description" cols="30" rows="5"><?php echo $award->Description; ?></textarea></td> ! </tr> ! <tr> ! <th>Award Type</th> ! <td class="left"><table> ! <tr> ! <td><img src="<?php echo($BasePath); ?>/awards/awardsgold.png" alt="Gold"></td> ! <td><img src="<?php echo($BasePath); ?>/awards/awardssilver.png" alt="Silver"></td> ! <td><img src="<?php echo($BasePath); ?>/awards/awardsbronze.png" alt="Bronze"></td> ! </tr> ! <tr> ! <td><div align="center"> ! <input name="type" type="radio" value="gold" <?php ! if (strcasecmp($award->Image, 'gold') == 0) echo 'checked="checked"'; ! ?>> ! </div></td> ! <td><div align="center"> ! <input type="radio" name="type" value="silver" <?php ! if (strcasecmp($award->Image, 'silver') == 0) echo 'checked="checked"'; ! ?>> ! </div></td> ! <td><div align="center"> ! <input type="radio" name="type" value="bronze" <?php ! if (strcasecmp($award->Image, 'bronze') == 0) echo 'checked="checked"'; ! ?>> ! </div></td> ! </tr> ! </table></td> ! </tr> ! <tr> ! <td colspan="2" class="center"> ! <?php if($award->template) { ?> ! <input name="create" type="submit" id="create" value="Create Award"> ! <?php } else { ?> ! <input name="modify" type="submit" id="modify" value="Modify Award"></td> ! <?php } ?> ! </td> ! </tr> ! </table> ! </form> ! <table> ! <tr> ! <th colspan="2">Award Name</th> ! <th>Event</th> ! <th>Date</th> ! <th>Recipient</th> ! <th>Option</th> ! </tr> ! <?php ! // Loop through awards ordered by date ! $query = $ofDB->query('SELECT * FROM '.$ofDB->quoteTable('awards').' ORDER BY '.$ofDB->quoteName('Date')); ! while($awards = $ofDB->fetchObject($query)){ ! ?> ! <tr> ! <td><img src="<?php echo($BasePath); ?>/awards/awards<?php echo $awards->Image; ?>.png" alt="<?php echo $awards->Image; ?>"></td> ! <td><?php echo $awards->AwardName; ?></td> ! <td><?php echo $awards->Event; ?></td> ! <td><?php echo $awards->Date; ?></td> ! <td><?php echo $awards->Recipient; ?></td> ! <td><div align="center">[ <a href='./?DELETE=<?php echo $awards->ID; ?>'>Delete</a> | <a href='./?MODIFY=<?php echo $awards->ID; ?>'>Modify</a> ]</div></td> ! </tr> ! <?php ! } ! if($ofDB->numberOfRows($query) == 0){ ! echo '<tr><td colspan="6">No awards entered!</td></tr>'; ! } ! ?> ! </table> ! <br /> ! <?php ! } else { ! echo("<h1>Manage Award Information</h1><p>Only administrators can use this feature</p>"); ! } ! } else { ! showlogin(); ! } ! include_once($Footer); ! ?> |
From: Astronouth7303 <ast...@us...> - 2005-06-30 01:09:33
|
Update of /cvsroot/openfirst/base/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1356/includes Modified Files: functions.php Log Message: fixed ofFormatSize() Index: functions.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/functions.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** functions.php 29 Jun 2005 23:41:19 -0000 1.3 --- functions.php 30 Jun 2005 01:09:23 -0000 1.4 *************** *** 83,91 **** ); reset($units); while (list($pow, $unit) = each($units)) { if ($unit === false) continue; if ($size >= pow($base, $pow)) { ! return sprintf('%01.2f', $size/pow($base, $pow)).' '.$unit; } } --- 83,95 ---- ); + $units = array_reverse($units, true); reset($units); while (list($pow, $unit) = each($units)) { if ($unit === false) continue; if ($size >= pow($base, $pow)) { ! $unitsize = $size/pow($base, $pow); ! $unitsize = rtrim($unitsize, '0'); ! if (substr($unitsize, -1) == '.') $unitsize = substr($unitsize, 0, -1); ! return number_format($unitsize, 2, '.', '').' '.$unit; } } |
From: Astronouth7303 <ast...@us...> - 2005-06-29 23:48:04
|
Update of /cvsroot/openfirst/base/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25459/includes Modified Files: dbase.php Log Message: OOP! Index: dbase.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/dbase.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** dbase.php 29 Jun 2005 21:20:41 -0000 1.4 --- dbase.php 29 Jun 2005 23:47:52 -0000 1.5 *************** *** 26,220 **** // without having to be completely rewritten or released as two // different versions. ! $lastquery = ''; ! if(isset($DBaseType) == false) { $DBaseType = "mysql"; } ! $connectdsn = ""; ! if(isset($peardb) && $peardb) { ! // Include the PEAR Database Abstraction Layer ! include_once("DB.php"); ! } elseif(! isset($peardb)) { ! $peardb = false; ! } ! // Wrapper for database selection. ! function ofirst_dbconnect($server = "", $username = "", $password = "", ! $newlink = "", $intclientflags = "") { ! global $DBaseType, $connectdsn; ! if($DBaseType == "mysql") { ! if(function_exists("mysql_connect") == false) { ! die("MySQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable MySQL support, or choose another database type."); ! } ! if($intclientflags != "") { ! return(mysql_connect($server, $username, $password, $newlink, $intclientflags)); ! } elseif($newlink != "") { ! return(mysql_connect($server, $username, $password, $newlink)); } else { ! return(mysql_connect($server, $username, $password)); ! } ! } elseif ($DBaseType == "mssql") { ! if(function_exists("mssql_connect") == false) { ! die("Microsoft SQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable Microsoft SQL support, or choose another database type."); ! } ! return(mssql_connect($server, $username, $password)); ! } elseif ($DBaseType == "odbc") { ! if(function_exists("odbc_connect") == false) { ! die("ODBC support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable ODBC support, or choose another database type."); } ! if($newlink != "") { ! return(odbc_connect($server, $username, $password, $newlink)); } else { ! return(odbc_connect($server, $username, $password)); } } - exit(0); } ! ! function ofirst_select_db($databasename, $linkidentifier = "") { ! global $DBaseType, $connectdsn; ! if($DBaseType == "mysql") { ! if(function_exists("mysql_select_db") == false) { ! die("MySQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable MySQL support, or choose another database type."); ! } ! if($linkidentifier != "") { ! return(mysql_select_db($databasename, $linkidentifier)); ! } else { ! return(mysql_select_db($databasename)); ! } ! } elseif ($DBaseType == "mssql") { ! if(function_exists("mssql_select_db") == false) { ! die("Microsoft SQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable Microsoft SQL support, or choose another database type."); ! } ! if($linkidentifier != "") { ! return(mssql_select_db($databasename, $linkidentifier)); ! } else { ! return(mssql_select_db($databasename)); ! } //ODBC does not require slecting a DB } - exit(0); } ! function ofirst_dberrno($linkidentifier = "") { ! global $DBaseType; ! if($DBaseType == "mysql") { ! if(function_exists("mysql_errno") == false) { ! die("MySQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable MySQL support, or choose another database type."); ! } ! if($linkidentifier != "") { ! return(mysql_errno($linkidentifier)); ! } else { ! return(mysql_errno()); ! } ! } elseif ($DBaseType == "mssql") { ! if(function_exists("mssql_connect") == false) { ! die("Microsoft SQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable Microsoft SQL support, or choose another database type."); ! } ! return(0); ! } elseif ($DBaseType == "odbc") { ! if(function_exists("odbc_error") == false) { ! die("ODBC support is not enabled in your version of PHP. To use the openFIRST Web Portal Software, please either enable ODBC support, or choose another database type."); ! } ! if($linkidentifier != "") { ! return(odbc_error($linkidentifier)); ! } else { ! return(odbc_error()); ! } } - exit(0); } ! function ofirst_dberror($linkidentifier = "") { ! global $DBaseType; ! if($DBaseType == "mysql") { ! if(function_exists("mysql_error") == false) { ! die("MySQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable MySQL support, or choose another database type."); ! } ! if($linkidentifier != "") { ! return(mysql_error($linkidentifier)); ! } else { ! return(mysql_error()); ! } ! } elseif ($DBaseType == "mssql") { ! if(function_exists("mssql_connect") == false) { ! die("Microsoft SQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable Microsoft SQL support, or choose another database type."); ! } ! return(0); ! } elseif ($DBaseType == "odbc") { ! if(function_exists("odbc_errormsg") == false) { ! die("ODBC support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable ODBC support, or choose another database type."); ! } ! if($linkidentifier != "") { ! return(odbc_errormsg($linkidentifer)); ! } else { ! return(odbc_errormsg()); ! } } - exit(0); } ! function ofirst_dbquery($string, $linkidentifier = "", $batchsize = "") { ! global $DBaseType, $sqlconnection, $lastquery; ! $lastquery = "\$string = \"$string\", \$linkidentifier = \"$linkidentifier\", \$batchsize = \"$batchsize\""; ! if($DBaseType == "mysql") { ! if(function_exists("mysql_query") == false) { ! die("MySQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable MySQL support, or choose another database type."); ! } ! if($linkidentifier != "") { ! return(mysql_query($string, $linkidentifier)); ! } else { ! return(mysql_query($string)); ! } ! } elseif($DBaseType == "mssql") { ! if(function_exists("mssql_query") == false) { ! die("Microsoft SQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable Microsoft SQL support, or choose another database type."); ! } ! if($batchsize != "") { ! return(mssql_query($string, $linkidentifier, $batchsize)); ! } elseif($linkidentifier != "") { ! return(mssql_query($string, $linkidentifier)); } else { ! return(mssql_query($string)); ! } ! } elseif ($DBaseType == "odbc") { ! if(function_exists("odbc_exec") == false) { ! die("ODBC support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable ODBC support, or choose another database type."); } // Note: this may be misleading, the variable names are not reflective of their content in this particular line, as the odbc function uses an order different from the other databases. ! return(odbc_exec($string, $linkidentifer)); } - exit(0); } ! function ofirst_dbfetch_object($resource, $rownumber = "") { ! global $DBaseType; ! if($DBaseType == "mysql") { ! if(function_exists("mysql_fetch_object") == false) { ! die("MySQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable MySQL support, or choose another database type."); ! } ! return(mysql_fetch_object($resource)); ! } elseif($DBaseType == "mssql") { ! if(function_exists("mssql_fetch_object") == false) { ! die("Microsoft SQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable Microsoft SQL support, or choose another database type."); ! } ! return(mssql_fetch_object($resource)); ! } elseif($DBaseType == "odbc") { ! if(function_exists("odbc_fetch_object") == false) { ! die("ODBC support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable ODBC support, or choose another database type."); ! ! } ! if($rownumber != "") { ! return(odbc_fetch_object($resource, $rownumber)); } else { ! return(odbc_fetch_object($resource)); } } - - exit(0); } ! function ofirst_dbnum_rows($resource) { ! global $DBaseType; if($DBaseType == "mysql") { if(function_exists("mysql_num_rows") == false) { --- 26,223 ---- // without having to be completely rewritten or released as two // different versions. ! define('dbMYSQL', 'mysql'); ! define('dbMSSQL', 'mssql'); ! define('dbODBC', 'odbc'); + $ogLastQuery = ''; + if (!isset($DBaseType)) { $DBaseType = dbMYSQL; } ! class DataBase { ! /*private*/ var $type, $connection, $lastquery; // Wrapper for database selection. ! function DataBase($type = 'mysql', $server = '', $username = '', $password = '', $newlink = '', $intclientflags = '') { ! $this->type = $type; ! switch ($this->type) { ! case dbMYSQL: ! $this->checkForFunction('mysql_connect'); ! if($intclientflags != '') { ! $this->connection = mysql_connect($server, $username, $password, $newlink, $intclientflags); ! } elseif($newlink != '') { ! $this->connection = mysql_connect($server, $username, $password, $newlink); } else { ! $this->connection = mysql_connect($server, $username, $password); } ! break; ! ! case dbMSSQL: ! $this->checkForFunction('mssql_connect'); ! $this->connection = mssql_connect($server, $username, $password); ! break; ! ! case dbODBC: ! $this->checkForFunction('odbc_connect'); ! if($newlink != '') { ! $this->connection = odbc_connect($server, $username, $password, $newlink); } else { ! $this->connection = odbc_connect($server, $username, $password); } + break; + + default: + $this->badDBType(); } } ! ! /*private*/ function getTypeName() { ! $typetext = $this->type; ! switch ($this->type) { ! case dbMYSQL: ! $typetext = 'MySQL'; ! break; ! ! case dbMSSQL: ! $typetext = 'Microsoft SQL'; ! break; ! ! case dbODBC: ! $typetext = 'ODBC'; ! break; ! } ! return $typetext; ! } ! ! /*private*/ function checkForFunction($name) { ! if (!function_exists($name)) { ! $typetext = $this->getTypeName(); ! trigger_error("$typetext support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable Microsoft SQL support, or choose another database type.", ! E_USER_ERROR); ! } ! } ! ! /*private*/ function badDBType() { ! trigger_error('Invalid Database type: '.$this->type, E_USER_ERROR); ! } ! ! function selectDB($databasename) { ! switch ($this->type) { ! case dbMYSQL: ! $this->checkForFunction('mysql_select_db'); ! return mysql_select_db($databasename, $this->connection); ! break; ! ! case dbMSSQL: ! $this->checkForFunction('mssql_select_db'); ! return mssql_select_db($databasename, $this->connection); ! break; ! ! case dbODBC: //ODBC does not require slecting a DB + break; + + default: + $this->badDBType(); } } ! function errorNumber() { ! switch ($this->type) { ! case dbMYSQL: ! $this->checkForFunction('mysql_errno'); ! return mysql_errno($this->connection); ! break; ! ! case dbMSSQL: ! // MSSQL doesn't have an equivelent function ! return 0; ! break; ! ! case dbODBC: ! $this->checkForFunction('odbc_error'); ! return odbc_error($this->connection); ! break; ! ! default: ! $this->badDBType(); } } ! function errorString() { ! switch ($this->type) { ! case dbMYSQL: ! $this->checkForFunction('mysql_error'); ! return mysql_error($this->connection); ! break; ! ! case dbMSSQL: ! return ''; ! break; ! ! case dbODBC: ! $this->checkForFunction('odbc_errormsg'); ! return odbc_errormsg($this->connection); ! ! default: ! $this->badDBType(); } } ! function query($string, $batchsize = false) { ! global $ogLastQuery; ! $ogLastQuery = $this->lastquery = "\$string = \"$string\", \$linkidentifier = \"{$this->connection}\", \$batchsize = \"$batchsize\""; ! ! switch ($this->type) { ! case dbMYSQL: ! $this->checkForFunction('mysql_query'); ! return mysql_query($string, $this->connection); ! break; ! ! case dbMSSQL: ! $this->checkForFunction('mssql_query'); ! if($batchsize !== false) { ! return mssql_query($string, $this->connection, $batchsize); } else { ! return mssql_query($string, $this->connection); } + break; + + case dbODBC: + $this->checkForFunction('odbc_exec'); // Note: this may be misleading, the variable names are not reflective of their content in this particular line, as the odbc function uses an order different from the other databases. ! return odbc_exec($string, $this->connection); ! ! default: ! $this->badDBType(); } } ! function getObject($resource, $rownumber = false) { ! switch ($this->type) { ! case dbMYSQL: ! $this->checkForFunction('mysql_fetch_object'); ! return mysql_fetch_object($resource); ! break; ! ! case dbMSSQL: ! $this->checkForFunction('mssql_fetch_object'); ! return mssql_fetch_object($resource); ! break; ! ! case dbODBC: ! $this->checkForFunction('odbc_fetch_object'); ! // Note that odbc_fetch_object() is not documented ! if($rownumber !== false) { ! return odbc_fetch_object($resource, $rownumber); } else { ! return odbc_fetch_object($resource); } + break; + + default: + $this->badDBType(); } } ! function numberOfRows($resource) { if($DBaseType == "mysql") { if(function_exists("mysql_num_rows") == false) { *************** *** 243,386 **** } ! function ofirst_dbfree_result($resource) { ! global $DBaseType; ! if($DBaseType == "mysql") { ! if(function_exists("mysql_free_result") == false) { ! die("MySQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable MySQL support, or choose another database type."); ! } if (!is_resource($resource)) return false; return mysql_free_result($resource); ! } elseif($DBaseType == "mssql") { ! if(function_exists("mssql_free_result") == false) { ! die("Microsoft SQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable Microsoft SQL support, or choose another database type."); ! } if (!is_resource($resource)) return false; return mssql_free_result($resource); ! } elseif($DBaseType == "odbc") { ! if(function_exists("odbc_free_result") == false) { ! die("ODBC support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable ODBC support, or choose another database type."); ! } if (!is_resource($resource)) return false; return odbc_free_result($resource); } - exit(0); } ! function ofirst_dbname_version() { ! global $DBaseType; ! if($DBaseType == "mysql") { ! $v = ofirst_dbfetch_object(ofirst_dbquery("SELECT VERSION() AS mysql_version")); ! return "MySQL $v->mysql_version"; ! } elseif($DBaseType == "mssql") { ! $v = ofirst_dbquery("SELECT @@VERSION"); ! return "Microsoft SQL Server $v <br><strong>Warning:</strong> unconfirmed"; ! } elseif($DBaseType == "odbc") { ! return "ODBC"; ! } else { ! return "Unknown DB type"; } } ! function ofirst_dbsize() { ! global $DBaseType, $sqlDatabase; ! if($DBaseType == "mysql") { $dbsize = 0; ! $dq = ofirst_dbquery("SHOW TABLE STATUS FROM $sqlDatabase"); ! while($d = ofirst_dbfetch_object($dq)) { ! $dbsize += $d->Data_length + $d->Index_length; } ! return (int) (($dbsize + 0.5) / 1024 * 10) / 10 . " KB"; ! } elseif($DBaseType == "mssql") { $s = ofirst_dbfetch_object(ofirst_dbquery("SELECT ((SUM(size) * 8.0) * 1024.0) as dbsize FROM sysfiles")); ! return (int) (( $s->dbsize + 0.5) / 1024 * 10) / 10 . " KB"; ! } else { ! return "Size not supported"; } } # Check if there the connection is valid ! function ofirst_dbcheck($linkidentifier = "") { #TODO: Write me! ! global $DBaseType; ! if($DBaseType == "mysql") { ! } elseif($DBaseType == "mssql") { ! } elseif($DBaseType == "odbc") { } - exit(0); } ! function ofirst_dbcreate($sqlserver, $sqluser, $sqlpassword, $sqldatabase) { ! trigger_error('Depreciated function called: ofirst_dbcreate()', E_USER_NOTICE); ! /* Create database if it does not already exist */ ! ofirst_dbconnect("$sqlserver","$sqluser","$sqlpassword"); ! ! ofirst_dbquery("CREATE DATABASE IF NOT EXISTS $sqldatabase;"); ! if (ofirst_dberror() != 0) return false; ! ! ofirst_select_db($sqldatabase); ! ! $query = ofirst_dbquery("CREATE TABLE `ofirst_config` ( ! `modulename` varchar(25) NOT NULL default '', ! `label` VARCHAR(25), ! `version` VARCHAR(10) NOT NULL default 'CVS', ! `showonmenu` TINYINT( 1 ) NOT NULL DEFAULT '0', ! `active` TINYINT( 1 ) NOT NULL DEFAULT '0', ! `adminnavigation` text, ! `modulenavigation` text, ! `includes` text, ! PRIMARY KEY (`modulename`), ! UNIQUE (`modulename`) ! )"); ! if (ofirst_dberror() != 0) return false; ! ! /* copied from auth.php */ ! $query = ofirst_dbquery("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 (ofirst_dberror() != 0) return false; ! ! if (ofirst_dberrno() == 0) { ! // Insert a default user 'administrator' and set them to have ! // administrative access and some password. ! ! $query = ofirst_dbquery("INSERT INTO ofirst_members (user, ! membertype, password) VALUES('admin', 'administrator', '" . ! cryptpassword("openfirst") ."');"); ! if (ofirst_dberror() != 0) return false; ! } ! /* End copy */ ! return true; ! } ! ! function ofirst_dbexec_file($filename, $linkidentifier = "") { if (file_exists($filename) && is_readable($filename)) { ! $sf = fopen($filename, "r"); ! $query = ""; while($line = fgets($sf)) { ! if(substr($line, 0, 2) != "--" && substr($line, 0, 1) != "#" && strlen($line) > 0) { ! $q = ofirst_dbquery(trim($line)); } } ! fclose($sf); return true; } else { --- 246,360 ---- } ! function freeResult($resource) { ! switch ($this->type) { ! case dbMYSQL: ! $this->checkForFunction('mysql_free_result'); if (!is_resource($resource)) return false; return mysql_free_result($resource); ! break; ! ! case dbMSSQL: ! $this->checkForFunction('mssql_free_result'); if (!is_resource($resource)) return false; return mssql_free_result($resource); ! ! case dbODBC: ! $this->checkForFunction('odbc_free_result'); if (!is_resource($resource)) return false; return odbc_free_result($resource); + + default: + $this->badDBType(); } } ! ! function getVersion() { ! switch ($this->type) { ! case dbMYSQL: ! $res = $this->query('SELECT VERSION() AS mysql_version'); ! $v = $this->fetchObject($res); ! $this->freeResult($res); ! return $this->getTypeName().' '.$v->mysql_version; ! break; ! ! case dbMSSQL: ! $res = $this->query('SELECT @@VERSION'); ! $v = $this->fetchObject($res); ! $this->freeResult($res); ! ob_start(); ! print_r($v); ! $ver = ob_get_contents(); ! ob_end_clean(); ! return $this->getTypeName().' '.$ver.' <br /><strong>Warning:</strong> unconfirmed.'; ! break; ! ! case dbODBC: ! return $this->getTypeName(); ! break; ! ! default: ! return 'Unknown DB type: '.$this->getTypeName(); } } ! function getSize() { ! global $sqlDatabase; ! switch ($this->type) { ! case dbMYSQL: $dbsize = 0; ! $dq = $this->query("SHOW TABLE STATUS FROM $sqlDatabase"); ! while($d = $this->fetchObject($dq)) { ! $dbsize += $d->Data_length; ! $dbsize += $d->Index_length; ! $dbsize += $d->Data_free; //Overhead } ! $this->freeResult($dq); ! return ofFormatSize($dbsize); ! break; ! ! case dbMSSQL: $s = ofirst_dbfetch_object(ofirst_dbquery("SELECT ((SUM(size) * 8.0) * 1024.0) as dbsize FROM sysfiles")); ! return ofFormatSize($s->dbsize); ! ! default: ! return 'Size not supported'; } } # Check if there the connection is valid ! function check() { #TODO: Write me! ! switch ($this->type) { ! case dbMYSQL: ! break; ! ! case dbMSSQL: ! break; ! ! case dbODBC: ! break; ! ! default: ! $this->badDBType(); } } ! function execFile($filename) { if (file_exists($filename) && is_readable($filename)) { ! /*$sf = fopen($filename, 'r'.(($osType == osWINDOWS) ? 'b' : '' )); ! $query = ''; while($line = fgets($sf)) { ! $line = ofStripLineComment(array('--', '#')); ! if(substr($line, 0, 2) != '--' && substr($line, 0, 1) != "#" && strlen($line) > 0) { ! $q = $this->query(trim($line)); ! if ($this->errorNumber() != 0) return false; ! $this->free_result($q); } } ! fclose($sf);*/ ! $text = file_get_contents($filename); ! $q = $this->query($text); ! if ($this->errorNumber() != 0) return false; ! $this->free_result($q); return true; } else { *************** *** 389,402 **** } ! function ofirst_dbescape($text) { ! global $DBaseType; ! if($DBaseType == "mysql") { return mysql_real_escape_string($text); ! # MS SQL and ODBC don't have specific escaping functions. ! } else { ! # Lets just assume there isn't an escaping function return addslashes($text); } - exit(0); } --- 363,376 ---- } ! function escape($text) { ! switch ($this->type) { ! case dbMYSQL: return mysql_real_escape_string($text); ! break; ! ! # MSSQL and ODBC don't have specific escaping functions. ! default: return addslashes($text); } } *************** *** 408,450 **** #Used for quoting field and DB names ! function ofirst_dbquote_name($name, $delimiter = ',') { if (is_array($name)) { $value = ''; foreach ($name as $text) { ! $value .= ofirst_dbquote_name($text).$delimiter; } $value = substr($value, 0, -strlen($delimiter)); return $value; } else { ! return '`'.ofirst_dbescape($name).'`'; } } #Used for quoting table names. Includes table prefix. ! function ofirst_dbquote_table($name, $delimiter = ',') { global $sqlTablePrefix; if (is_array($name)) { $value = ''; foreach ($name as $text) { ! $value .= ofirst_dbquote_table($text).$delimiter; } $value = substr($value, 0, -strlen($delimiter)); return $value; } else { ! return ofirst_dbquote_name("$sqlTablePrefix$name"); } } #Used for quoting data ! function ofirst_dbquote_data($data, $delimiter = ',') { if (is_array($data)) { $value = ''; foreach ($data as $text) { ! $value .= ofirst_dbquote_data($text).$delimiter; } $value = substr($value, 0, -strlen($delimiter)); return $value; } else { ! return "'".ofirst_dbescape($data)."'"; } } --- 382,432 ---- #Used for quoting field and DB names ! function quoteName($name, $delimiter = ',') { if (is_array($name)) { $value = ''; foreach ($name as $text) { ! $value .= $this->quoteName($text).$delimiter; } $value = substr($value, 0, -strlen($delimiter)); return $value; } else { ! return '`'.$this->escape($name).'`'; } } #Used for quoting table names. Includes table prefix. ! function quoteTable($name, $delimiter = ',') { global $sqlTablePrefix; if (is_array($name)) { $value = ''; foreach ($name as $text) { ! $value .= $this->quoteTable($text).$delimiter; } $value = substr($value, 0, -strlen($delimiter)); return $value; } else { ! return $this->quoteName("$sqlTablePrefix$name"); } } + function quoteDatabase($name, $delimiter = ',') { + return $this->quoteName($name, $delimiter); + } + + function quoteField($name, $delimiter = ',') { + return $this->quoteName($name, $delimiter); + } + #Used for quoting data ! function quoteData($data, $delimiter = ',') { if (is_array($data)) { $value = ''; foreach ($data as $text) { ! $value .= $this->quoteData($text).$delimiter; } $value = substr($value, 0, -strlen($delimiter)); return $value; } else { ! return "'".$this->escape($data)."'"; } } *************** *** 453,462 **** #passed like: # array( 'field' => 'data' ) ! function ofirst_dbquote_fd_pairs($pairs, $delimiter = ',') { $value = ''; foreach ($pairs as $field => $data) { ! $value .= ofirst_dbquote_name($field); $value .= '='; ! $value .= ofirst_dbquote_data($data); $value .= $delimiter; } --- 435,444 ---- #passed like: # array( 'field' => 'data' ) ! function quoteFDPairs($pairs, $delimiter = ',') { $value = ''; foreach ($pairs as $field => $data) { ! $value .= $this->quoteField($field); $value .= '='; ! $value .= $this->quoteData($data); $value .= $delimiter; } *************** *** 464,466 **** --- 446,449 ---- return $value; } + } ?> |
From: Astronouth7303 <ast...@us...> - 2005-06-29 23:41:31
|
Update of /cvsroot/openfirst/base/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21801/includes Modified Files: functions.php Log Message: Added ofStripLineComment() Index: functions.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/functions.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** functions.php 29 Jun 2005 23:21:20 -0000 1.2 --- functions.php 29 Jun 2005 23:41:19 -0000 1.3 *************** *** 91,93 **** --- 91,103 ---- } } + + /** Strip line comment. + * Given a string and an array of commentors (in PHP, it would be array('#', '//')), + * remove all end-of-line comments. + * Note that this only works if you feed it one line at a time. + */ + function ofStripLineComment($commentors, $text) { + $parts = explode($commentors, $text, 2); + return $parts[0]; + } ?> |
From: Astronouth7303 <ast...@us...> - 2005-06-29 23:21:28
|
Update of /cvsroot/openfirst/base/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11155/includes Modified Files: functions.php Log Message: Added ofFormatSize() Index: functions.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/functions.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** functions.php 27 May 2005 16:33:03 -0000 1.1 --- functions.php 29 Jun 2005 23:21:20 -0000 1.2 *************** *** 1,63 **** ! <?php ! /* ! * openFIRST.base - includes/functions.php ! * ! * Copyright (C) 2003, ! * openFIRST Project ! * Original Author: Jamie Bliss <ja...@op...> ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! */ ! ! // Purpose: Provide global functions to openFIRST ! ! /** Replaces standard vars in config text. ! * Currently includes $BasePath, $fBasePath, ! * $StylePath, $fStylePath, $ModPath, and $fModPath. ! */ ! function replaceVariables($text, $ModuleDir = false) { ! if ($ModuleDir === false) { ! global $CurrentModule; ! if (is_object($CurrentModule)) $ModuleDir == $CurrentModule->getDir(); ! } ! ! global $BasePath, $fBasePath, $StylePath, $fStylePath; ! ! $find = array('$BasePath', ! '$fBasePath', ! '$StylePath', ! '$fStylePath', ! '$ModPath', ! '$fModPath' ! ); ! ! $replace = array($BasePath, ! $fBasePath, ! $StylePath, ! $fStylePath, ! "$BasePath/$ModuleDir", ! "$fBasePath/$ModuleDir" ! ); ! ! return str_ireplace($find, $replace, $text); ! ! } ! ! ?> --- 1,93 ---- ! <?php ! /* ! * openFIRST.base - includes/functions.php ! * ! * Copyright (C) 2003, ! * openFIRST Project ! * Original Author: Jamie Bliss <ja...@op...> ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! */ ! ! // Purpose: Provide global functions to openFIRST ! ! /** Replaces standard vars in config text. ! * Currently includes $BasePath, $fBasePath, ! * $StylePath, $fStylePath, $ModPath, and $fModPath. ! */ ! function replaceVariables($text, $ModuleDir = false) { ! if ($ModuleDir === false) { ! global $CurrentModule; ! if (is_object($CurrentModule)) $ModuleDir == $CurrentModule->getDir(); ! } ! ! global $BasePath, $fBasePath, $StylePath, $fStylePath; ! ! $find = array('$BasePath', ! '$fBasePath', ! '$StylePath', ! '$fStylePath', ! '$ModPath', ! '$fModPath' ! ); ! ! $replace = array($BasePath, ! $fBasePath, ! $StylePath, ! $fStylePath, ! "$BasePath/$ModuleDir", ! "$fBasePath/$ModuleDir" ! ); ! ! return str_ireplace($find, $replace, $text); ! ! } ! ! ! /** Formats the size of computer data. ! * Uses the units: KB, MB, GB, etc. ! * Uses 1024 definition (1 KB = 1024 B) ! */ ! function ofFormatSize($size) { ! $base = 1024; ! $units = array( ! 'B', ! 'KB', ! 'MB', ! 'GB', ! 'TB', ! 'PB', ! 'EB', ! 'ZB', ! 'YB', ! 'XB', ! false, ! 'VB' ! ); ! ! reset($units); ! while (list($pow, $unit) = each($units)) { ! if ($unit === false) continue; ! if ($size >= pow($base, $pow)) { ! return sprintf('%01.2f', $size/pow($base, $pow)).' '.$unit; ! } ! } ! } ! ?> |
From: Astronouth7303 <ast...@us...> - 2005-06-29 21:33:56
|
Update of /cvsroot/openfirst/base/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15307/includes Modified Files: globals.php Added Files: slug.php Log Message: added slug file Index: globals.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/globals.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** globals.php 29 Jun 2005 21:20:41 -0000 1.8 --- globals.php 29 Jun 2005 21:33:47 -0000 1.9 *************** *** 65,68 **** --- 65,69 ---- require_once('auth.php'); require_once('Module.php'); + require_once('slug.php'); $sqlTablePrefix = 'ofirst_'; *************** *** 111,130 **** } } - /* if ($module->getShowOnMenu()) { - if ($curmodule == $dir){ - $CurrentModule =& $thisModule; - $headers .= ' » <a class="menu selected" href="'.htmlentities("$BasePath/$dir").'">'.htmlentities($module->getName()).'</a> | - '; - - $adminnav = $module->getAdminBar(); - $subnav = $module->getNavBar(); - - } else { - $headers .= ' » <a class="menu" href="'.htmlentities("$BasePath/$dir").'">'.htmlentities($module->getName()).'</a> | - '; - } - }*/ } } if (!preg_match('/\A[a-zA-Z0-9]+\z/',session_id())) { --- 112,118 ---- } } } } + ofirst_dbfree_result($res); if (!preg_match('/\A[a-zA-Z0-9]+\z/',session_id())) { --- NEW FILE: slug.php --- <?php /* * openFIRST.base - includes/slug.php * * Copyright (C) 2003, * openFIRST Project * Original Author: Jamie Bliss <ja...@op...> * * 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. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ // Purpose: Defines the functions to handle slugs. /** Returns the URI of a slug. * Note that it is relative to $BasePath, so you still need to * prepend $BasePath to it. * It also removes an initial slug: in it. */ function ofGetSlugURI($slug) { global $ogModuleManager; if (strcasecmp(substr($slug, 1, strlen('slug:')), 'slug:') == 0) { $slug = substr($slug, strlen('slug:')); } $parts = explode('/', $slug); if (!isset($parts[1])) { return '/'.$parts[0]; } else if ($parts[1] == '') { return '/'.$parts[0].'/'; } else { $dir = $parts[0]; $modslug = $parts[1]; $module =& $ogModuleManager->getModuleFromDir($dir); if (method_exists($module, 'getSlugURI')) { return $module->getSlugURI($modslug); } else { return false; } } } ?> |
From: Astronouth7303 <ast...@us...> - 2005-06-29 21:20:56
|
Update of /cvsroot/openfirst/base In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7818 Modified Files: index.php Log Message: Mostly improved module support, also some outstanding commits. Index: index.php =================================================================== RCS file: /cvsroot/openfirst/base/index.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** index.php 27 May 2005 16:07:51 -0000 1.15 --- index.php 29 Jun 2005 21:20:41 -0000 1.16 *************** *** 1,122 **** ! <?php ! /* ! * openFIRST.base - index.php ! * ! * Copyright (C) 2003, ! * openFIRST Project ! * Original Author: Tim Ginn <tim...@po...> ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! */ ! ! // Purpose: provide a basic starting point for the OpenFIRST web portal. ! ! require_once("includes/globals.php"); ! include($Header); ! ! $count = 0; ! global $Modules; ! ?> ! <h1>openFIRST Web Portal</h1> ! <table> ! <tr> ! <?php ! if(isset($Headers) == false) { ! echo("You may: <a href='config/'>login to configure openFIRST options</a>."); ! } ! ! echo("<tr valign=top>"); ! echo("<th>Welcome to $Title Web Site!</th>"); ! echo("<td rowspan=3 valign=top>"); ! ! if(isset($user->user)){ ! echo("<table width=200><tr><th>Welcome</th><td class=sub>Welcome, ".ucfirst($user->user)."!</td></tr></table><br />"); ! } ! ! if(function_exists("latest_posts")) { ! echo("<table width=200><tr><th>Latest Posts in Forum</th></tr><tr><td>"); ! latest_posts(5); ! echo("</td></tr></table><br />"); ! } ! ! if (is_readable("guestbook/") && ofirst_dbnum_rows(ofirst_dbquery("SELECT * FROM ofirst_config WHERE modulename='guestbook' AND active='1';")) > 0) { ! $qu = ofirst_dbquery("SELECT guest, date FROM ofirst_guestbook ORDER BY guest LIMIT 5;"); ! if(ofirst_dbnum_rows($qu)!=0){ ! echo("<table width=200><tr><th>Guestbook</th></tr><tr><td><div>Last records in our <a href=\"$BasePath/guestbook\">guestbook</a>: </div>"); ! while($q = ofirst_dbfetch_object($qu)) { ! echo("<sub><strong><a href='/guestbook/' target='_content'>$q->guest</a></strong><br />$q->date</sub><br />"); ! } ! echo("</td></tr></table><br />"); ! } ! } ! if (is_readable("awards/") && ofirst_dbnum_rows(ofirst_dbquery("SELECT * FROM ofirst_config WHERE modulename='awards' AND active='1';")) > 0) { ! $qu = ofirst_dbquery("SELECT AwardName FROM ofirst_awards;"); ! if(ofirst_dbnum_rows($qu)!=0){ ! echo("<table width=200><tr><th>Awards</th></tr><tr><td><div>Our team has received the following <a href=\"$BasePath/awards\">awards</a>: </div>"); ! while($q = ofirst_dbfetch_object($qu)) { ! echo("<sub><a href='$BasePath/awards' target='_content'>$q->AwardName</a></sub><br />"); ! } ! echo("</td></tr></table><br />"); ! } ! } ! ! # Features ! echo ' ! <table width=200> ! <tr><th>Features</th></tr> ! <tr><td><div>This portal has the following features: </div> ! '; ! echo '<ul> ! '; ! foreach($Modules as $code=>$mod) { ! if ($mod->getActive() ! #&& $mod->getShowOnMenu() ! ) { ! echo '<li><a href="'.htmlentities("$BasePath/$code").'">'.htmlentities($mod->getName()).'</a></li> ! '; ! } ! } ! echo '</ul>'; ! ! echo '</td></tr></table><br />'; ! if(function_exists("get_visitors")) { ! echo("<table width=200><tr><th>Stats</th></tr><tr><td><div>Website <a href=\"$BasePath/logger/stats.php\">usage statistics</a>: </div>"); ! echo("<sub><strong>".get_totalpages()." pages served to ".get_visitors()." visitors</strong></sub>"); ! echo("</td></tr></table><br />"); ! } ! echo("</td></tr>"); ! echo("<tr><td class=sub>Welcome to the $Title portal.</td></tr>"); ! echo("<tr><td valign=top>"); ! if(function_exists("shownews")) { ! echo("<h2 style=\"margin-bottom:0px;margin-top:15px\">Latest News</h2>"); ! $admin=false; ! if (isset($user->membertype)){ ! $admin=($user->membertype == "administrator"); ! } ! shownews(5,$admin); ! //are there more news? ! if(ofirst_dbnum_rows(ofirst_dbquery("SELECT * FROM ofirst_news"))>5){ ! echo("<div class=\"right\">[ <b><a href=\"$BasePath/news/index.php?show=all\">More News</a></b> ]</div>"); ! } ! } ! echo(" </td></tr></table>"); ! ! include($Footer); ! ?> --- 1,124 ---- ! <?php ! /* ! * openFIRST.base - index.php ! * ! * Copyright (C) 2003, ! * openFIRST Project ! * Original Author: Tim Ginn <tim...@po...> ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! */ ! ! // Purpose: provide a basic starting point for the OpenFIRST web portal. ! ! require_once("includes/globals.php"); ! include($Header); ! ! $count = 0; ! global $Modules; ! ?> ! <h1>openFIRST Web Portal</h1> ! <table> ! <tr> ! <?php ! if(isset($Headers) == false) { ! echo("You may: <a href='config/'>login to configure openFIRST options</a>."); ! } ! ! echo("<tr valign=top>"); ! echo("<th>Welcome to $Title Web Site!</th>"); ! echo("<td rowspan=3 valign=top>"); ! ! if(isset($user->user)){ ! echo("<table width=200><tr><th>Welcome</th><td class=sub>Welcome, ".ucfirst($user->user)."!</td></tr></table><br />"); ! } ! ! if(function_exists("latest_posts")) { ! echo("<table width=200><tr><th>Latest Posts in Forum</th></tr><tr><td>"); ! latest_posts(5); ! echo("</td></tr></table><br />"); ! } ! ! if (is_readable("guestbook/") && ofirst_dbnum_rows(ofirst_dbquery("SELECT * FROM ofirst_config WHERE modulename='guestbook' AND active='1';")) > 0) { ! $qu = ofirst_dbquery("SELECT guest, date FROM ofirst_guestbook ORDER BY guest LIMIT 5;"); ! if(ofirst_dbnum_rows($qu)!=0){ ! echo("<table width=200><tr><th>Guestbook</th></tr><tr><td><div>Last records in our <a href=\"$BasePath/guestbook\">guestbook</a>: </div>"); ! while($q = ofirst_dbfetch_object($qu)) { ! echo("<sub><strong><a href='/guestbook/' target='_content'>$q->guest</a></strong><br />$q->date</sub><br />"); ! } ! echo("</td></tr></table><br />"); ! } ! } ! ! if (is_readable("awards/") && ofirst_dbnum_rows(ofirst_dbquery("SELECT * FROM ofirst_config WHERE modulename='awards' AND active='1';")) > 0) { ! $qu = ofirst_dbquery("SELECT AwardName FROM ofirst_awards;"); ! if(ofirst_dbnum_rows($qu)!=0){ ! echo("<table width=200><tr><th>Awards</th></tr><tr><td><div>Our team has received the following <a href=\"$BasePath/awards\">awards</a>: </div>"); ! while($q = ofirst_dbfetch_object($qu)) { ! echo("<sub><a href='$BasePath/awards' target='_content'>$q->AwardName</a></sub><br />"); ! } ! echo("</td></tr></table><br />"); ! } ! } ! ! # Features ! echo ' ! <table width=200> ! <tr><th>Features</th></tr> ! <tr><td><div>This portal has the following features: </div> ! '; ! echo '<ul> ! '; ! foreach($ogModuleManager->getDirs() as $dir) { ! $mod =& $ogModuleManager->getModuleFromDir($dir); ! if ($mod->getActive() ! #&& $mod->getShowOnMenu() ! ) { ! echo '<li><a href="'.htmlentities("$BasePath/$dir").'">'.htmlentities($mod->getName()).'</a></li> ! '; ! } ! } ! echo '</ul>'; ! ! echo '</td></tr></table><br />'; ! if(function_exists("get_visitors")) { ! echo("<table width=200><tr><th>Stats</th></tr><tr><td><div>Website <a href=\"$BasePath/logger/stats.php\">usage statistics</a>: </div>"); ! echo("<sub><strong>".get_totalpages()." pages served to ".get_visitors()." visitors</strong></sub>"); ! echo("</td></tr></table><br />"); ! } ! echo("</td></tr>"); ! echo("<tr><td class=sub>Welcome to the $Title portal.</td></tr>"); ! echo("<tr><td valign=top>"); ! if(function_exists("shownews")) { ! echo("<h2 style=\"margin-bottom:0px;margin-top:15px\">Latest News</h2>"); ! $admin=false; ! if (isset($user->membertype)){ ! $admin=($user->membertype == "administrator"); ! } ! shownews(5,$admin); ! //are there more news? ! if(ofirst_dbnum_rows(ofirst_dbquery("SELECT * FROM ofirst_news"))>5){ ! echo("<div class=\"right\">[ <b><a href=\"$BasePath/news/index.php?show=all\">More News</a></b> ]</div>"); ! } ! } ! echo(" </td></tr></table>"); ! ! include($Footer); ! ?> |
From: Astronouth7303 <ast...@us...> - 2005-06-29 21:20:55
|
Update of /cvsroot/openfirst/base/style In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7818/style Modified Files: headers.php style.css Log Message: Mostly improved module support, also some outstanding commits. Index: style.css =================================================================== RCS file: /cvsroot/openfirst/base/style/style.css,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** style.css 26 May 2005 23:26:31 -0000 1.3 --- style.css 29 Jun 2005 21:20:42 -0000 1.4 *************** *** 1,299 **** ! /* Basic elements */ ! bold { ! font-weight: bold; ! } ! ! big { ! font-size: large; ! } ! ! input[type=text], select { ! text-align: left; ! } ! ! input[type=checkbox], input[type=radio] { ! margin-right: .3em; ! vertical-align: middle; ! } ! ! caption { ! text-align: center; ! font-size: medium; ! padding: .25em; ! font-weight: bold; ! } ! ! /* classes and IDs */ ! #content { ! padding: 1em; ! text-align: center; ! margin-left: auto; ! margin-right: auto; ! } ! #content table { ! margin-left: auto; ! margin-right: auto; ! text-align: center; ! } ! ! #adminmenu { ! color: white; ! background-image: url(images/back-admin.png); ! text-align: left; ! } ! #adminmenu a:link { ! color: white; ! } ! #adminmenu a:visited { ! color: white; ! } ! #adminmenu a:active { ! color: white; ! } ! #adminmenu a:hover { ! color: white; ! } ! ! a:link { ! color: black; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: underline; ! } ! a:visited { ! color: black; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: underline; ! } ! a:active { ! color: black; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: underline; ! } ! a:hover { ! color: black; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: underline; ! } ! ! #topmenu, caption { ! text-align: left; ! background-image: url(images/back.gif); ! color: #cecece; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: none; ! } ! #topmenu a:link { ! color: #cecece; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: none; ! } ! #topmenu a:visited { ! color: #bebebe; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: none; ! } ! #topmenu a:active { ! color: #cecece; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: none; ! } ! #topmenu a:hover { ! color: #bed8ff; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: none; ! } ! ! #toplogo { ! text-align: left; ! } ! ! .nav1 { ! width:100%; ! border: none 0px; ! margin-left: -2px; ! margin-right: -2px; ! margin-bottom: 0; ! } ! .nav1 td, .nav1 th { ! margin: 0; ! padding: 6px; ! border: none 0px; ! } ! .nav1 tr { ! margin: 0px; ! padding: 2px; ! } ! ! .nav2 table { ! border-left:solid #999999 1px; ! border-right:solid #999999 1px; ! border-bottom:solid #999999 1px; ! margin-left:auto; ! margin-right:auto; ! } ! ! .center, .center > * { ! margin-left: auto; ! margin-right: auto; ! text-align: center; ! } ! ! .right, .right > * { ! margin-left: auto; ! margin-right: 0; ! text-align: right; ! } ! ! .left, .left > * { ! margin-left: 0; ! margin-right: auto; ! text-align: left; ! } ! ! td { ! padding: 5px; ! } ! th { ! padding: 5px; ! } ! table.menu { ! border-left:0px; ! border-right:0px; ! border-bottom:0px; ! } ! td.menu { ! border-left:0px; ! border-right:0px; ! border-bottom:0px; ! } ! body { ! color: black; ! font-weight: bolder; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration:none; ! margin: 0px; ! padding: 2px; ! text-align: center; ! } ! td { ! color: black; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: none; ! } ! td.navigation { ! color: black; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: none; ! } ! th { ! background-color: #999999; ! color: #333333; ! background-image: url(images/back-light.gif); ! } ! ! td.sub { ! background-color: #999999; ! color: #333333; ! background-image: url(images/back-lighter.gif); ! } ! ! .menu.selected { ! color: red; ! text-decoration: underline; ! } ! ! .small { ! font-size:small; ! } ! ! fieldset { ! margin: 1em 1.5em; ! } ! ! LEGEND { ! font-size: 1.5em; ! font-weight: bold; ! } ! ! dl.setup { ! text-align: left; ! } ! dl.setup dd { ! margin-left: 0; ! } ! dl.setup dd label { ! clear: left; ! font-weight: bold; ! width: 12em; ! float: left; ! text-align: right; ! padding-right: 1em; ! } ! dl.setup dt { ! clear: left; ! font-size: 0.8em; ! margin-left: 10em; ! /* margin-right: 200px; */ ! margin-bottom: 2em; ! } ! .error, .warning { ! color: red; ! } ! ul.plain { ! list-style: none; ! clear: both; ! margin-left: 12em; ! } ! dl.setup input:not([type=checkbox]) { ! width: 25em; ! } ! ! table.center caption { ! margin-left:auto; ! margin-right:auto; ! } ! ! hr { ! width: 80%; ! border: 1px; ! height: 1px; ! } ! ! #copyright { ! background=image: url(images/back-light.gif); ! } ! ! #footer p { ! margin: 0; ! } ! ! .logo, .logo img, ! .valid, .valid img { ! border: 0; ! } ! ! #moduleInstall * { ! text-align: left; ! } ! ! .no-space, ! table.no-space tr, table.no-space td, table.no-space th { ! margin: 0; ! padding: 0; ! } ! ! margin: 0; ! padding: 0; ! } --- 1,309 ---- ! /* Basic elements */ ! bold { ! font-weight: bold; ! } ! ! big { ! font-size: large; ! } ! ! input[type=text], select { ! text-align: left; ! } ! ! input[type=checkbox], input[type=radio] { ! margin-right: .3em; ! vertical-align: middle; ! } ! ! caption { ! text-align: center; ! font-size: medium; ! padding: .25em; ! font-weight: bold; ! } ! ! /* classes and IDs */ ! #content { ! padding: 1em; ! text-align: center; ! margin-left: auto; ! margin-right: auto; ! } ! #content table { ! margin-left: auto; ! margin-right: auto; ! text-align: center; ! } ! ! #adminmenu { ! color: white; ! background-image: url(images/back-admin.png); ! text-align: left; ! } ! #adminmenu a:link { ! color: white; ! } ! #adminmenu a:visited { ! color: white; ! } ! #adminmenu a:active { ! color: white; ! } ! #adminmenu a:hover { ! color: white; ! } ! ! a:link { ! color: black; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: underline; ! } ! a:visited { ! color: black; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: underline; ! } ! a:active { ! color: black; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: underline; ! } ! a:hover { ! color: black; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: underline; ! } ! ! #topmenu, caption { ! text-align: left; ! background-image: url(images/back.gif); ! color: #cecece; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: none; ! } ! #topmenu a:link { ! color: #cecece; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: none; ! } ! #topmenu a:visited { ! color: #bebebe; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: none; ! } ! #topmenu a:active { ! color: #cecece; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: none; ! } ! #topmenu a:hover { ! color: #bed8ff; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: none; ! } ! ! #toplogo { ! text-align: left; ! } ! ! .nav1 { ! width:100%; ! border: none 0px; ! margin-left: -2px; ! margin-right: -2px; ! margin-bottom: 0; ! } ! .nav1 td, .nav1 th { ! margin: 0; ! padding: 6px; ! border: none 0px; ! } ! .nav1 tr { ! margin: 0px; ! padding: 2px; ! } ! ! .nav2 table { ! border-left:solid #999999 1px; ! border-right:solid #999999 1px; ! border-bottom:solid #999999 1px; ! margin-left:auto; ! margin-right:auto; ! } ! ! .center, .center > * { ! margin-left: auto; ! margin-right: auto; ! text-align: center; ! } ! ! .right, .right > * { ! margin-left: auto; ! margin-right: 0; ! text-align: right; ! } ! ! .left, .left > * { ! margin-left: 0; ! margin-right: auto; ! text-align: left; ! } ! ! .contentleft, .contentleft > * { ! margin-left: auto; ! margin-right: auto; ! text-align: left; ! } ! ! .file { ! font-family: monospace; ! } ! ! td { ! padding: 5px; ! } ! th { ! padding: 5px; ! } ! table.menu { ! border-left:0px; ! border-right:0px; ! border-bottom:0px; ! } ! td.menu { ! border-left:0px; ! border-right:0px; ! border-bottom:0px; ! } ! body { ! color: black; ! font-weight: bolder; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration:none; ! margin: 0px; ! padding: 2px; ! text-align: center; ! } ! td { ! color: black; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: none; ! } ! td.navigation { ! color: black; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: none; ! } ! th { ! background-color: #999999; ! color: #333333; ! background-image: url(images/back-light.gif); ! } ! ! td.sub { ! background-color: #999999; ! color: #333333; ! background-image: url(images/back-lighter.gif); ! } ! ! .menu.selected { ! color: red; ! text-decoration: underline; ! } ! ! .small { ! font-size:small; ! } ! ! fieldset { ! margin: 1em 1.5em; ! } ! ! LEGEND { ! font-size: 1.5em; ! font-weight: bold; ! } ! ! dl.setup { ! text-align: left; ! } ! dl.setup dd { ! margin-left: 0; ! } ! dl.setup dd label { ! clear: left; ! font-weight: bold; ! width: 12em; ! float: left; ! text-align: right; ! padding-right: 1em; ! } ! dl.setup dt { ! clear: left; ! font-size: 0.8em; ! margin-left: 10em; ! /* margin-right: 200px; */ ! margin-bottom: 2em; ! } ! .error, .warning { ! color: red; ! } ! ul.plain { ! list-style: none; ! clear: both; ! margin-left: 12em; ! } ! dl.setup input:not([type=checkbox]) { ! width: 25em; ! } ! ! table.center caption { ! margin-left:auto; ! margin-right:auto; ! } ! ! hr { ! width: 80%; ! border: 1px; ! height: 1px; ! } ! ! #copyright { ! background=image: url(images/back-light.gif); ! } ! ! #footer p { ! margin: 0; ! } ! ! .logo, .logo img, ! .valid, .valid img { ! border: 0; ! } ! ! #moduleInstall * { ! text-align: left; ! } ! ! .no-space, ! table.no-space tr, table.no-space td, table.no-space th { ! margin: 0; ! padding: 0; ! } ! ! margin: 0; ! padding: 0; ! } Index: headers.php =================================================================== RCS file: /cvsroot/openfirst/base/style/headers.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** headers.php 27 May 2005 16:07:51 -0000 1.4 --- headers.php 29 Jun 2005 21:20:42 -0000 1.5 *************** *** 1,106 **** ! <?php ! if(! isset($BasePath)){ ! $BasePath = 'http://openfirst.sourceforge.net'; ! $title = "openFIRST Team"; ! } ! ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> ! <html> ! <head> ! <title><?php echo htmlentities($Title); ?></title> ! <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> ! <meta http-equiv="Content-Language" content="en-CA" /> ! <meta name="copyright" content="© 2003 openFIRST http://openfirst.sf.net." /> ! <meta name="author" content="OpenFIRST - http://openfirst.sf.net" /> ! <meta name="generator" content="OpenFIRST - http://openfirst.sf.net" /> ! <link rel="stylesheet" type="text/css" href="<?php echo htmlentities($StylePath); ?>/style.css"> ! </head> ! <body> ! ! <table class="nav1"> ! <tr id="toplogo"> ! <td> ! <img src="<?php echo htmlentities($BasePath); ?>/style/images/openfirst.png" alt="openFIRST Portal System" /> ! </td> ! </tr> ! <tr> ! <th id="topmenu"> ! <?php ! if(ISSET($headers)){ ! echo("» <a accesskey='h' href='$Home'><u>H</u>ome</a> | " . $headers); ! }else{ ! ?> ! » <a accesskey="h" href="http://openfirst.sourceforge.net"><u>H</u>ome</a> ! | » <a accesskey="d" href="http://openfirst.sourceforge.net/downloads.php"><u>D</u>ownloads</a> ! | » <a accesskey="r" href="http://openfirst.sourceforge.net/release.php"><u>R</u>elease Notes</a> ! | » <a accesskey="m" href="http://openfirst.sourceforge.net/modules.php"><u>M</u>odules</a> ! | » <a accesskey="l" href="http://openfirst.sourceforge.net/license.php"><u>L</u>icense</a> ! | » <a accesskey="b" href="http://openfirst.sourceforge.net/bugreports.php"><u>B</u>ug Reports</a> ! | » <a accesskey="c" href="http://openfirst.sourceforge.net/contact.php"><u>C</u>ontact Us</a> ! | » <a accesskey="a" href="http://openfirst.sourceforge.net/about.php"><u>A</u>bout openFIRST</a> ! | » <a accesskey="e" href="http://openfirst.sourceforge.net/developers.php">D<u>e</u>velopers</a> ! <?php } ?> ! </th> ! </tr> ! <tr> ! <td class="nav2" style="background-image: url('<?php echo htmlentities($StylePath); ?>/images/back-light.gif'); "> ! <table width="100%" border="0" cellspacing="0" ! cellpadding="0"> ! <tr> ! <td class="left"> ! <?php ! ! // Check if module name has been set then echo ! if(isset($CurrentModule)){ ! echo '<b>'.htmlentities($CurrentModule->getName()).'</b> – '; ! } ! ! // Check if navigation bar option is set then echo options ! if(isset($subnav)){ ! ! // Output module navigation bar ! echo $subnav; ! } ! ?> ! </td> ! <td class="right" style="color: #333333;"> ! <?php ! ! // Check if messenger module has activated usersonline option then echo value ! if(isset($usersonline)){ ! echo $usersonline; ! } else { ! echo "Welcome to the <b>$Title</b> website!"; ! } ! ! ?> ! </td> ! </tr> ! </table></td> ! </tr> ! <?php ! ! if (isset($user) && isset($user->user)){ ! if(isset($adminnav) && (strcasecmp($user->membertype, 'administrator') == 0)) { ! ! ?> ! <tr> ! <td id="adminmenu"><b>Admin Options</b> – ! <?php ! // Print admin navigation bar ! echo $adminnav; ! ?></td> ! </tr> ! <?php ! ! } ! } ! ! ?> ! </table><div id="content"> ! <?php ! ! if ($BasePath == 'http://openfirst.sourceforge.net') { ! unset($BasePath); ! } ! ! ?> --- 1,129 ---- ! <?php ! if(! isset($BasePath)){ ! $BasePath = 'http://openfirst.sourceforge.net'; ! $title = "openFIRST Team"; ! } else { ! foreach($ogModuleManager->getDirs() as $dir) { ! $module =& $ogModuleManager->getModuleFromDir($dir); ! if ($module->getActive()) { ! if ($module->getShowOnMenu()) { ! if ($curmodule == $dir){ ! $CurrentModule =& $thisModule; ! $headers .= ' » <a class="menu selected" href="'.htmlentities("$BasePath/$dir").'">'.htmlentities($module->getName()).'</a> | ! '; ! ! $adminnav = $module->getAdminBar(); ! $subnav = $module->getNavBar(); ! ! } else { ! $headers .= ' » <a class="menu" href="'.htmlentities("$BasePath/$dir").'">'.htmlentities($module->getName()).'</a> | ! '; ! } ! } ! } ! } ! ! $headers = substr($headers, 0, -strlen('| ! ')); ! } ! ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> ! <html> ! <head> ! <title><?php echo htmlentities($Title); ?></title> ! <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> ! <meta http-equiv="Content-Language" content="en" /> ! <meta name="copyright" content="© 2003 openFIRST http://openfirst.sf.net." /> ! <meta name="author" content="openFIRST - http://openfirst.sf.net" /> ! <meta name="generator" content="openFIRST - http://openfirst.sf.net" /> ! <link rel="stylesheet" type="text/css" href="<?php echo htmlentities($StylePath); ?>/style.css" /> ! </head> ! <body> ! ! <table class="nav1"> ! <tr id="toplogo"> ! <td> ! <img src="<?php echo htmlentities($BasePath); ?>/style/images/openfirst.png" alt="openFIRST Portal System" /> ! </td> ! </tr> ! <tr> ! <th id="topmenu"> ! <?php ! if(ISSET($headers)){ ! echo("» <a accesskey='h' href='$Home'><u>H</u>ome</a> | " . $headers); ! }else{ ! ?> ! » <a accesskey="h" href="http://openfirst.sourceforge.net"><u>H</u>ome</a> ! | » <a accesskey="d" href="http://openfirst.sourceforge.net/downloads.php"><u>D</u>ownloads</a> ! | » <a accesskey="r" href="http://openfirst.sourceforge.net/release.php"><u>R</u>elease Notes</a> ! | » <a accesskey="m" href="http://openfirst.sourceforge.net/modules.php"><u>M</u>odules</a> ! | » <a accesskey="l" href="http://openfirst.sourceforge.net/license.php"><u>L</u>icense</a> ! | » <a accesskey="b" href="http://openfirst.sourceforge.net/bugreports.php"><u>B</u>ug Reports</a> ! | » <a accesskey="c" href="http://openfirst.sourceforge.net/contact.php"><u>C</u>ontact Us</a> ! | » <a accesskey="a" href="http://openfirst.sourceforge.net/about.php"><u>A</u>bout openFIRST</a> ! | » <a accesskey="e" href="http://openfirst.sourceforge.net/developers.php">D<u>e</u>velopers</a> ! <?php } ?> ! </th> ! </tr> ! <tr> ! <td class="nav2" style="background-image: url('<?php echo htmlentities($StylePath); ?>/images/back-light.gif'); "> ! <table width="100%" border="0" cellspacing="0" ! cellpadding="0"> ! <tr> ! <td class="left"> ! <?php ! ! // Check if module name has been set then echo ! if(isset($CurrentModule)){ ! echo '<b>'.htmlentities($CurrentModule->getName()).'</b> – '; ! } ! ! // Check if navigation bar option is set then echo options ! if(isset($subnav)){ ! ! // Output module navigation bar ! echo $subnav; ! } ! ?> ! </td> ! <td class="right" style="color: #333333;"> ! <?php ! ! // Check if messenger module has activated usersonline option then echo value ! if(isset($usersonline)){ ! echo $usersonline; ! } else { ! echo "Welcome to the <b>$Title</b> website!"; ! } ! ! ?> ! </td> ! </tr> ! </table></td> ! </tr> ! <?php ! ! if (isset($user) && isset($user->user)){ ! if(isset($adminnav) && (strcasecmp($user->membertype, 'administrator') == 0)) { ! ! ?> ! <tr> ! <td id="adminmenu"><b>Admin Options</b> – ! <?php ! // Print admin navigation bar ! echo $adminnav; ! ?></td> ! </tr> ! <?php ! ! } ! } ! ! ?> ! </table><div id="content"> ! <?php ! ! if ($BasePath == 'http://openfirst.sourceforge.net') { ! unset($BasePath); ! } ! ! ?> |
From: Astronouth7303 <ast...@us...> - 2005-06-29 21:20:55
|
Update of /cvsroot/openfirst/base/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7818/includes Modified Files: Module.php dbase.php edit.php globals.php xmlModule.php Log Message: Mostly improved module support, also some outstanding commits. Index: xmlModule.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/xmlModule.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** xmlModule.php 12 Jun 2005 17:43:54 -0000 1.1 --- xmlModule.php 29 Jun 2005 21:20:41 -0000 1.2 *************** *** 145,148 **** --- 145,150 ---- /*** PUBLIC FUNCTIONS ***/ + /** Parse the <db> tag + */ /*public*/ function prepareTables() { $mTables =& $this->mTables; *************** *** 158,161 **** --- 160,165 ---- } + /* + /*** PRIVATE FUNCTIONS ***/ /*private*/ function getModuleDTD() { *************** *** 178,181 **** --- 182,187 ---- <!ENTITY BasePath "$BasePath"> <!ENTITY StylePath "$StylePath"> + <!ENTITY fBasePath "$fBasePath"> + <!ENTITY fStylePath "$fStylePath"> ]>'; } Index: Module.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/Module.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Module.php 26 Jun 2005 00:51:33 -0000 1.2 --- Module.php 29 Jun 2005 21:20:41 -0000 1.3 *************** *** 27,58 **** require_once('dbase.php'); ! function getIDFromDir($dir) { ! $sql = 'SELECT '.ofirst_dbquote_name('modulename').' FROM '.ofirst_dbquote_table('config').' WHERE '.ofirst_dbquote_fd_pairs(array('dir'=>$dir), ' AND '); ! $res = ofirst_dbquery($sql); ! $row = ofirst_dbfetch_object($res); ! return $row->modulename; } class Module { ! /*private*/ var $mName, $mID, $mVersion, $mDate, $mAuthor, $mMaintainer; /*private*/ var $mIncludes, $mNavBar, $mAdminBar, $mShow, $mActive; ! function Module($ID) { ! $sql = 'SELECT * FROM '.ofirst_dbquote_table('config').' WHERE '.ofirst_dbquote_fd_pairs(array('modulename'=>$ID), ' AND '); $res = ofirst_dbquery($sql); $mod = ofirst_dbfetch_object($res); $this->mName = $mod->label; ! $this->mID = $ID; $this->mVersion = $mod->version; ! $this->mDate = $mod->UpdateDate; $this->mAuthor = $mod->Author; $this->mMaintainer = $mod->Maintainer; ! $this->mIncludes = explode(',', $mod->includes); ! $this->mNavBar = $mod->modulenavigation; ! $this->mAdminBar = $mod->adminnavigation; $this->mShow = $mod->showonmenu; $this->mActive = $mod->active; } --- 27,127 ---- require_once('dbase.php'); ! ! /** Provides static functions for managing modules. ! */ ! class ModuleManager { ! /*private*/ var $ids, $dirs, $modules; ! ! /** Returns the ID of the module in the dir ! */ ! /*public*/ function getIDFromDir($dir) { ! #$dir = strtolower($dir); //Should I do this? ! if (!isset($this->dirs[$dir])) { ! $sql = 'SELECT '.ofirst_dbquote_name('modulename'). ! ' FROM '.ofirst_dbquote_table('config'). ! ' WHERE '.ofirst_dbquote_fd_pairs(array('dir'=>$dir), ' AND '). ! ' LIMIT 0,1'; ! $res = ofirst_dbquery($sql); ! $row = ofirst_dbfetch_object($res); ! ofirst_dbfree_result($res); ! $this->dirs[$dir] = $row->modulename; ! } ! return $this->dirs[$dir]; ! } ! ! /*public*/ function getDirsFromID($ID) { ! if (!isset($this->ids[$ID])) { ! $sql = 'SELECT '.ofirst_dbquote_name('dir'). ! ' FROM '.ofirst_dbquote_table('config'). ! ' WHERE '.ofirst_dbquote_fd_pairs(array('modulename'=>$ID), ' AND '); ! $res = ofirst_dbquery($sql); ! while ($row = ofirst_dbfetch_object($res)) { ! $this->ids[$ID][] = $row->dir; ! } ! ofirst_dbfree_result($res); ! } ! return $this->ids[$ID]; ! } ! ! /*public*/ function &getModuleFromDir($dir) { ! if (isset($this->modules[$dir])) { ! return $this->modules[$dir]; ! } else { ! return false; ! } ! } ! ! function addModuleFromObject(&$mod) { ! $dir = $mod->getDir(); ! $id = $mod->getID(); ! $this->ids[$id][] = $dir; ! $this->dirs[$dir] = $id; ! $this->modules[$dir] =& $mod; ! } ! ! function &addModuleFromDir($dir) { ! $mod =& Module::createFromDir($dir); ! $dir = $mod->getDir(); ! $id = $mod->getID(); ! $this->ids[$id][] = $dir; ! $this->dirs[$dir] = $id; ! $this->modules[$dir] =& $mod; ! return $mod; ! } ! ! function getDirs() { ! return array_keys($this->modules); ! } } class Module { ! /*private*/ var $mName, $mID, $mDir, $mVersion, $mDate, $mAuthor, $mMaintainer; /*private*/ var $mIncludes, $mNavBar, $mAdminBar, $mShow, $mActive; ! function Module($dir) { ! $sql = 'SELECT * FROM '.ofirst_dbquote_table('config').' WHERE '.ofirst_dbquote_fd_pairs(array('dir'=>$dir), ' AND ').' LIMIT 0,1'; $res = ofirst_dbquery($sql); $mod = ofirst_dbfetch_object($res); + ofirst_dbfree_result($res); $this->mName = $mod->label; ! $this->mID = $mod->modulename; //Internal consistancy. If it goes wrong, at least the ID matches everything else. ! $this->mDir = $mod->dir; $this->mVersion = $mod->version; ! $this->mDate = strtotime($mod->UpdateDate); $this->mAuthor = $mod->Author; $this->mMaintainer = $mod->Maintainer; ! if ($mod->includes == '') { ! $this->mIncludes = array(); ! } else { ! $this->mIncludes = explode(',', $mod->includes); ! } ! $this->mNavBar = replaceVariables($mod->modulenavigation, $this->getDir()); ! $this->mAdminBar = replaceVariables($mod->adminnavigation.' <a href="http://bugzilla.openfirst.org/">Report Bug</a>', $this->getDir()); $this->mShow = $mod->showonmenu; $this->mActive = $mod->active; + + ofirst_dbfree_result($res); } *************** *** 60,70 **** /** Creates a Module object from a directory in the oF directory. */ ! /*static*/ function createFromID($ID) { return new Module($ID); ! } /*static*/ function createFromDir($Dir) { ! return new Module(getIDFromDir($Dir)); } --- 129,140 ---- /** Creates a Module object from a directory in the oF directory. + * This isn't actually possible, since the same module can have multiple dirs */ ! /*static*/ /*function createFromID($ID) { return new Module($ID); ! }*/ /*static*/ function createFromDir($Dir) { ! return new Module($Dir); } *************** *** 78,81 **** --- 148,155 ---- } + /*public*/ function getDir() { + return $this->mDir; + } + /*public*/ function getVersion() { return $this->mVersion; *************** *** 134,137 **** */ } - ?> --- 208,210 ---- Index: dbase.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/dbase.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** dbase.php 26 May 2005 23:26:31 -0000 1.3 --- dbase.php 29 Jun 2005 21:20:41 -0000 1.4 *************** *** 243,246 **** --- 243,269 ---- } + function ofirst_dbfree_result($resource) { + global $DBaseType; + if($DBaseType == "mysql") { + if(function_exists("mysql_free_result") == false) { + die("MySQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable MySQL support, or choose another database type."); + } + if (!is_resource($resource)) return false; + return mysql_free_result($resource); + } elseif($DBaseType == "mssql") { + if(function_exists("mssql_free_result") == false) { + die("Microsoft SQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable Microsoft SQL support, or choose another database type."); + } + if (!is_resource($resource)) return false; + return mssql_free_result($resource); + } elseif($DBaseType == "odbc") { + if(function_exists("odbc_free_result") == false) { + die("ODBC support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable ODBC support, or choose another database type."); + } + if (!is_resource($resource)) return false; + return odbc_free_result($resource); + } + exit(0); + } function ofirst_dbname_version() { global $DBaseType; *************** *** 287,290 **** --- 310,314 ---- function ofirst_dbcreate($sqlserver, $sqluser, $sqlpassword, $sqldatabase) { + trigger_error('Depreciated function called: ofirst_dbcreate()', E_USER_NOTICE); /* Create database if it does not already exist */ ofirst_dbconnect("$sqlserver","$sqluser","$sqlpassword"); *************** *** 384,394 **** #Used for quoting field and DB names ! function ofirst_dbquote_name($name) { if (is_array($name)) { $value = ''; foreach ($name as $text) { ! $value .= ofirst_dbquote_name($text).','; } ! $value = substr($value, 0, -1); return $value; } else { --- 408,418 ---- #Used for quoting field and DB names ! function ofirst_dbquote_name($name, $delimiter = ',') { if (is_array($name)) { $value = ''; foreach ($name as $text) { ! $value .= ofirst_dbquote_name($text).$delimiter; } ! $value = substr($value, 0, -strlen($delimiter)); return $value; } else { *************** *** 398,409 **** #Used for quoting table names. Includes table prefix. ! function ofirst_dbquote_table($name) { global $sqlTablePrefix; if (is_array($name)) { $value = ''; foreach ($name as $text) { ! $value .= ofirst_dbquote_table($text).','; } ! $value = substr($value, 0, -1); return $value; } else { --- 422,433 ---- #Used for quoting table names. Includes table prefix. ! function ofirst_dbquote_table($name, $delimiter = ',') { global $sqlTablePrefix; if (is_array($name)) { $value = ''; foreach ($name as $text) { ! $value .= ofirst_dbquote_table($text).$delimiter; } ! $value = substr($value, 0, -strlen($delimiter)); return $value; } else { *************** *** 413,423 **** #Used for quoting data ! function ofirst_dbquote_data($data) { if (is_array($data)) { $value = ''; foreach ($data as $text) { ! $value .= ofirst_dbquote_data($text).','; } ! $value = substr($value, 0, -1); return $value; } else { --- 437,447 ---- #Used for quoting data ! function ofirst_dbquote_data($data, $delimiter = ',') { if (is_array($data)) { $value = ''; foreach ($data as $text) { ! $value .= ofirst_dbquote_data($text).$delimiter; } ! $value = substr($value, 0, -strlen($delimiter)); return $value; } else { *************** *** 429,433 **** #passed like: # array( 'field' => 'data' ) ! function ofirst_dbquote_fd_pairs($pairs) { $value = ''; foreach ($pairs as $field => $data) { --- 453,457 ---- #passed like: # array( 'field' => 'data' ) ! function ofirst_dbquote_fd_pairs($pairs, $delimiter = ',') { $value = ''; foreach ($pairs as $field => $data) { *************** *** 435,441 **** $value .= '='; $value .= ofirst_dbquote_data($data); ! $value .= ','; } ! $value = substr($value, 0, -1); return $value; } --- 459,465 ---- $value .= '='; $value .= ofirst_dbquote_data($data); ! $value .= $delimiter; } ! $value = substr($value, 0, -strlen($delimiter)); return $value; } Index: globals.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/globals.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** globals.php 31 May 2005 22:16:58 -0000 1.7 --- globals.php 29 Jun 2005 21:20:41 -0000 1.8 *************** *** 64,68 **** require_once('dbase.php'); require_once('auth.php'); ! require_once('liteModule.php'); $sqlTablePrefix = 'ofirst_'; --- 64,68 ---- require_once('dbase.php'); require_once('auth.php'); ! require_once('Module.php'); $sqlTablePrefix = 'ofirst_'; *************** *** 86,136 **** $headers = ''; ! $incl = ofirst_dbquery('SELECT * FROM '.ofirst_dbquote_table('config')); ! ! $Modules = array(); ! $CurrentModule = null; ! ! // If there is no error then run the module add feature ! if(ofirst_dberrno() == 0) { ! // Begin to loop through modules from the databaes ! while($module = ofirst_dbfetch_object($incl)) { ! $thisModule =& liteModule::createFromRecord($module); ! $Modules[] =& $thisModule; ! ! // Check if the value is try, if it is then run an include ! if($thisModule->getActive()) { ! $inclist = $thisModule->getIncludes(); ! $dir = $thisModule->getDir(); ! $modulename = $thisModule->getID(); ! $showonmenu = $thisModule->getShowOnMenu(); ! $name = $thisModule->getName(); ! $modulenavigation = $thisModule->getNavBar(); ! $adminnavigation = $thisModule->getAdminBar(); ! ! // Loop through the inclist and add them according to their paths ! foreach($inclist As $inc){ ! include_once("$fBasePath/$modulename/$inc"); ! } ! ! // If the module has requested to be shown on the menu then add it ! if ($showonmenu) { ! // If it is the current module then color the item ! if ($curmodule == $dir){ ! $CurrentModule =& $thisModule; ! $headers .= " » <a class='menu selected' href='$BasePath/$dir'>".htmlentities($name)."</a> | ! "; ! ! // Declare important variables so that headers can pick them up and preview them ! ! $adminnav = replaceVariables($adminnavigation.' <a href="http://bugzilla.openfirst.org/">Report Bug</a>', $dir); ! $subnav = replaceVariables($modulenavigation, $dir); ! ! } else { ! $headers .= " » <a class='menu' href='$BasePath/$dir'>".htmlentities($name)."</a> | ! "; } } } } } --- 86,128 ---- $headers = ''; + $ogCurrentModule = null; ! /* This is not going into a function becuase: ! 1. the files should be included in the global scope ! 2. I'd rather iterate through the array once ! */ ! $ogModuleManager = new ModuleManager; ! $res = ofirst_dbquery('SELECT '.ofirst_dbquote_name('dir'). ! ' FROM '.ofirst_dbquote_table('config')); ! if(ofirst_dberrno() != 0) { ! trigger_error('Error while listing modules!', E_USER_ERROR); ! } ! while($mod =& ofirst_dbfetch_object($res)) { ! $dir = $mod->dir; ! $module =& $ogModuleManager->addModuleFromDir($dir); ! if ($module->getActive()) { ! $dir = $module->getDir(); ! $includes = $module->getIncludes(); ! if (is_array($includes) && count($includes) > 0) { ! foreach ($includes as $include) { ! if ($include != '') { ! include_once("$fBasePath/$dir/$include"); } } } + /* if ($module->getShowOnMenu()) { + if ($curmodule == $dir){ + $CurrentModule =& $thisModule; + $headers .= ' » <a class="menu selected" href="'.htmlentities("$BasePath/$dir").'">'.htmlentities($module->getName()).'</a> | + '; + + $adminnav = $module->getAdminBar(); + $subnav = $module->getNavBar(); + + } else { + $headers .= ' » <a class="menu" href="'.htmlentities("$BasePath/$dir").'">'.htmlentities($module->getName()).'</a> | + '; + } + }*/ } } Index: edit.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/edit.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** edit.php 2 Jun 2005 21:13:23 -0000 1.2 --- edit.php 29 Jun 2005 21:20:41 -0000 1.3 *************** *** 1,93 **** ! <?php ! /* ! * openFIRST.base - includes/mdoules.php ! * ! * Copyright (C) 2003, ! * openFIRST Project ! * Original Author: Jamie Bliss <ja...@op...> ! * ! * 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. ! * ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! */ ! // Purpose: Defines the Editor class, which allows a module to create a new ! // markup language and the editor for it, as well as global functions ! // to handle it. ! ! $registeredEditors = array(); ! ! /** Registers an editor. ! * Should be handled by a module include. ! * Allows for multiple editors to co-exist. ! * Pass the module ID and the display name. ! */ ! function registerEditor($ID, $Name) { ! global $registeredEditors; ! $registeredEditors[$ID] = $Name; ! } ! ! /** Selects an editor for use. ! * Should only be called by system, not by ! * modules. ! * @todo Write module code to support this. ! */ ! function selectEditor($ID) { ! global $registeredEditors, $EditorPlugin; ! $Name = $registeredEditors[$ID]; ! $module =& getModuleObject($ID); ! if (method_exists($module, 'getEditor')) { ! $EditorPlugin =& $module->getEditor(); ! return true; ! } else { ! // This indicates a serious coding error on the part of the plugin. ! // _Some_ kind of alert is probably needed. ! return false; ! } ! } ! ! /** Handles editors and parsers. ! */ ! class Editor { ! /** Returns the HTML to paste on a page. ! * The return should not be modified in any way, ! * else you may break the software. ! */ ! function getEditField($fieldname,$height,$width,$init) { ! return '<textarea name="'.htmlentities($fieldname).'" cols="'.htmlentities($width).'" rows="'.htmlentities($height).'">'. ! htmlentities($init). ! '</textarea>'; ! } ! ! /** Returns the text posted. ! */ ! function getFieldValue($fieldname) { ! return $_REQUEST[$fieldname]; ! } ! ! /** Returns the plain text version, eg for search indeces. ! */ ! function getPlainText($text) { ! return $text; ! } ! ! /** Returns the HTML version for display. ! */ ! function parseText($text) { ! return htmlentities($text); ! } ! } ! ! #Default ! $EditorPlugin = new Editor; ! ?> --- 1,93 ---- ! <?php ! /* ! * openFIRST.base - includes/mdoules.php ! * ! * Copyright (C) 2003, ! * openFIRST Project ! * Original Author: Jamie Bliss <ja...@op...> ! * ! * 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. ! * ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! */ ! // Purpose: Defines the Editor class, which allows a module to create a new ! // markup language and the editor for it, as well as global functions ! // to handle it. ! ! #$ofRegisteredEditors = array(); ! ! /** Registers an editor. ! * Should be handled by a module include. ! * Allows for multiple editors to co-exist. ! * Pass the module dir and the display name. ! */ ! /*function registerEditor($dir, $Name) { ! global $ofRegisteredEditors; ! $ofRegisteredEditors[$dir] = $Name; ! }*/ ! ! /** Selects an editor for use. ! * Should only be called by system, not by ! * modules. ! * @todo Write module code to support this. ! */ ! function selectEditor($dir) { ! global $ogModuleManager; ! $module =& $ogModuleManager->getModuleFromDir($dir); ! if (method_exists($module, 'getEditorObject')) { ! $GLOBALS['ofEditorPlugin'] =& $module->getEditorObject(); ! return true; ! } else { ! // This indicates a serious coding error on the part of the plugin. ! // _Some_ kind of alert is probably needed. ! return false; ! } ! } ! ! /** Handles editors and parsers. ! */ ! class Editor { ! /** Returns the HTML to paste on a page. ! * The return should not be modified in any way, ! * else you may break the software. ! */ ! function getEditField($fieldname,$height,$width,$init) { ! return '<textarea name="'.htmlentities($fieldname).'" cols="'.htmlentities($width).'" rows="'.htmlentities($height).'">'. ! htmlentities($init). ! '</textarea>'; ! } ! ! /** Returns the text posted. ! */ ! function getFieldValue($fieldname) { ! return $_REQUEST[$fieldname]; ! } ! ! /** Returns the plain text version, eg for search indeces. ! * The suggested function of this is to strip markup. ! */ ! function getPlainText($text) { ! return $text; ! } ! ! /** Returns the HTML version for display. ! */ ! function parseText($text) { ! return htmlentities($text); ! } ! } ! ! #Default ! $ofEditorPlugin = new Editor; ! ?> |
From: Astronouth7303 <ast...@us...> - 2005-06-29 21:20:55
|
Update of /cvsroot/openfirst/base/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7818/config Modified Files: first.php openfirst.info.xml Log Message: Mostly improved module support, also some outstanding commits. Index: first.php =================================================================== RCS file: /cvsroot/openfirst/base/config/first.php,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** first.php 26 May 2005 21:00:02 -0000 1.61 --- first.php 29 Jun 2005 21:20:40 -0000 1.62 *************** *** 1,334 **** ! <?php ! /* ! * openFIRST.base - config/first.php ! * ! * Copyright (C) 2003, ! * openFIRST Project ! * Original Author: Tim Ginn <tim...@po...> ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! */ ! ! // Purpose: Deal with the initial set up that must occur once the openFIRST ! // base system has been extracted. This file should be removed once ! // this task is complete, or the permissions on globals.php should be ! // changed to prevent unwanted modification of configuration options. ! ! if(isset($_POST["login"])) { ! require_once('auth.php'); ! InitUser(); ! // User is attempting to login for the first time. ! if (isset($user)) { ! die("<br /><br /><br />You have successfully logged in. <a href='index.php'>Access Administrative Configuration Options</a> (you will be prompted for your password again)</center>"); ! } ! } ! ! ! if(isset($_POST["sqlserver"])) { ! $sqlserver = $_POST["sqlserver"]; ! $sqluser = $_POST["sqluser"]; ! $sqlpassword = $_POST["sqlpassword"]; ! $sqldatabase = $_POST["sqldatabase"]; ! include_once("./dbase.php"); ! include_once("./auth.php"); ! if(function_exists("ofirst_dbconnect") == false) { ! die("Your version of PHP has not been compiled with MySQL support, therefore the openFIRST web portal system cannot run on this system. Please contact your system administrator to request MySQL support for your version of PHP."); ! } ! if (!ofirst_dbcreate("$sqlserver","$sqluser","$sqlpassword", $sqldatabase)) ! echo 'DB/tables creation error: '.ofirst_dberror(); ! ! function GetVarValue($var) { ! ob_Start(); ! var_export($var); ! $Value = ob_Get_Contents(); ! ob_End_Clean(); ! return $Value; ! } ! ! // They have submitted the form, write a new globals.php file and test ! // options. ! $fbasepath = realpath($_POST['fbasepath']); ! $ConfigFile = "$fbasepath/includes/sitesettings.php"; ! if ( (file_exists($ConfigFile) && is_writable($ConfigFile)) || is_writable(dirname($ConfigFile) ) { ! $file = file_get_contents('../includes/sitesettings.tpl'); ! $cookielogins = ((isset($_POST["cookielogins"]) && $_POST["cookielogins"]=="yes") ? true : false); ! $allowreg = ((isset($_POST["allowreg"]) && $_POST["allowreg"]=="yes") ? true : false); ! ! $find = array('%DBTYPE%', ! '%ENCRYPT%', ! '%TITLE%', ! '%VER%', ! '%DBSERVER%', ! '%DBUSER%', ! '%DBPASS%', ! '%DBNAME%', ! '%COOKIE%', ! '%REG%', ! '%HOME%', ! '%HEADER%', ! '%FOOTER%', ! '%MASTERMAIL%', ! '%BOTMAIL%', ! '%SERVER%', ! '%BASEPATH%', ! '%FBASEPATH%'); ! ! $replace = array(GetVarValue($_POST['dbasetype']), ! GetVarValue($_POST['encryption']), ! GetVarValue($_POST['title']), ! GetVarValue($_POST['version']), ! GetVarValue($_POST['sqlserver']), ! GetVarValue($_POST['sqluser']), ! GetVarValue($_POST['sqlpassword']), ! GetVarValue($_POST['sqldatabase']), ! GetVarValue($cookielogins), ! GetVarValue($allowreg), ! GetVarValue($_POST['home']), ! GetVarValue($_POST['header']), ! GetVarValue($_POST['footer']), ! GetVarValue($_POST['mailnotify']), ! GetVarValue($_POST['mailfrom']), ! GetVarValue($_POST['server']), ! GetVarValue($_POST['basepath']), ! GetVarValue($fbasepath)); ! ! $file = str_replace($find, $replace, $file); ! $hfile = fopen("$ConfigFile",'w'); fwrite($hfile, $file); fclose($hfile); ! ! include_once("../includes/globals.php"); ! include_once($header); ! echo("<div class=\"success\"><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 <span class=\"file\">globals.php</span> to prevent unwanted changes ! to the configuration options. You should be able to login below using the username ! <b class=\"user\">admin</b> and the password <b class=\"password\">openfirst</b>, if not, then either ! the password for that account has been changed, or the MySQL settings are incorrect.</p>"); ! showlogin(); ! die(include_once($footer)); ! } else { ! echo '<p class="error"><span class="file">'.htmlentities($ConfigFile).'</span> is not writable</p> ! '; ! if(is_readable("style/headers.php")) { ! include_once("style/headers.php"); ! } else { ! include_once("../style/headers.php"); ! } ! echo("<h1 class=\"error\">System 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 /> ! <pre class=\"shell\">cd config ! <br />chmod 666 globals.php</pre></p>"); ! } ! } else { ! ! // Do form ! if(is_readable("style/headers.php")) { ! include_once("style/headers.php"); ! } else { ! include_once("../style/headers.php"); ! } ! ! // Detect default options ! $basepath = substr($_SERVER["SCRIPT_NAME"], 0, -17); ! $server = $_SERVER["SERVER_NAME"]; ! $fbasepath = realpath(dirname(__FILE__).'/..'); ! ! $sqlhost = 'localhost'; ! if(ini_get('mysql.default_host') != '') { ! $sqlhost = ini_get('mysql.default_host'); ! } ! ! $sqluser = 'sqluser'; ! if(ini_get('mysql.default_user') != '') { ! $sqluser = ini_get('mysql.default_user'); ! } ! ! $sqlpass = ''; ! if(ini_get('mysql.default_password') != '') { ! $sqlpass = ini_get('mysql.default_password'); ! } ! ! $mailto = $_SERVER['SERVER_ADMIN']; ! $mailfrom = "openfirst@$server"; ! ! // User is visiting the configuration page, present them with a form ! // of options to fill out. ! ?> ! <div class="center"> ! <h1>Base Configuration</h1> ! <p class="center" style="max-width: 50em;">Congratulations for choosing openFIRST! Please proceed through ! this setup wizard to get your new openFIRST portal software set up and working ! quickly and painlessly. Also please make sure that before installing this script ! that you have the appropriate permissions set on config/globals.php (if not ! then you may receive a collection of errors after submitting this form).</p> ! </div> ! <form action="<?php echo htmlentities("http://$server$basepath/config/first.php"); ?>" method="post"> ! <fieldset> ! <legend>Database Setup</legend> ! <dl class="setup"> ! <dd> ! <label for="dbasetype">Database Type</label> ! <input type='hidden' name='peardb' value='false'> ! <select name="dbasetype"> ! <option value="mysql" selected="selected">MySQL</option> ! <option value="mssql">Microsoft SQL</option> ! <option value="odbc">ODBC</option> ! </select> ! </dd> ! <dt></dt> ! <dd> ! <label for="title">Title of Website</label> ! <input type="text" name="title" value="openFIRST" /> ! </dd> ! <dt></dt> ! <dd> ! <label for="version">Version of Website</label> ! <input type="text" name="version" value="1.0" /> ! </dd> ! <dt></dt> ! <dd> ! <label for="sqlserver">Database Server Address</label> ! <input type="text" name="sqlserver" value="<?php echo htmlentities($sqlhost); ?>" /> ! </dd> ! <dt></dt> ! <dd> ! <label for="sqluser">Database User Name</label> ! <input type="text" name="sqluser" value="<?php echo htmlentities($sqluser); ?>" /> ! </dd> ! <dt></dt> ! <dd> ! <label for="sqlpassword">Database User Password</label> ! <input type="password" name="sqlpassword" value="<?php echo htmlentities($sqlpass); ?>" /> ! </dd> ! <dt></dt> ! <dd> ! <label for="sqldatabase">Database Name</label> ! <input type="text" name="sqldatabase" value="openfirst" /> ! </dd> ! <dt>(I this database does not already exist, the user entered above must have access to create it.</dt> ! </dl> ! </fieldset> ! ! <fieldset> ! <legend>Linking Options</legend> ! <dl class="setup"> ! <dd> ! <label for="home">Home Site</label> ! <input type="text" name="home" value="http://<?php echo htmlentities("$server$basepath"); ?>" /> ! </dd> ! <dt>This address will used for linking to your main page.</dt> ! <dd> ! <label for="header">Header file</label> ! <input type="text" name="header" value="<?php echo htmlentities(realpath("$fbasepath/style/headers.php")); ?>" /> ! </dd> ! <dt>This should be a full system path, eg, ! <code class="file">c:\inetpub\wwwroot\openfirst\style\header.php</code> or ! <code class="file">/home/site/public_html/openfirst/style/headers.php</code> ! </dt> ! <dd> ! <label for="footer">Footer file</label> ! <input type="text" name="footer" value="<?php echo htmlentities(realpath("$fbasepath/style/footers.php")); ?>" /> ! </dd> ! <dt>This should be a full system path, eg, ! <code class="file">c:\inetpub\wwwroot\openfirst\style\footers.php</code> or ! <code class="file">/home/site/public_html/openfirst/style/footers.php</code> ! </dt> ! <dd> ! <label for="">The server name</label> ! <input type="text" name="server" value="http://<?php echo htmlentities($server); ?>" /> ! <span class="warning">Must not have a trailing slash and must include a protocol.</span> ! </dd> ! <dt>eg, <code class="url"><b>http://openfirst.sourceforge.net</b>/openfirst</code></dt> ! <dd> ! <label for="basepath">URL base path</label> ! <input type="text" name="basepath" value="<?php echo htmlentities($basepath); ?>" /> ! <span class="warning">Must not have a trailing slash.</span> ! </dd> ! <dt>ie. example: <code class="url">http://openfirst.sourceforge.net<b>/openfirst</b></code>) this should ! always have a beginning slash but no ending slash. (If openFIRST is in the root directory, then leave blank.) ! </dt> ! <dd> ! <label for="fbasepath">File system path</label> ! <input type="text" name="fbasepath" value="<?php echo htmlentities($fbasepath); ?>" /> ! <span class="warning">Must not have a trailing slash.</span> ! </dd> ! <dt>eg, <code class="file">/home/openfirst/htdocs/openfirst</code> ! or <code class="file">c:\inetpub\wwwroot\openfirst</code>) this should not have a ending slash.</dt> ! </dl> ! </fieldset> ! ! <fieldset> ! <legend>Security Options</legend> ! <dl class="setup"> ! <dd> ! <label for="">Hashing method</label> ! <select name="encryption"> ! <option value='md5' selected='selected'>MD5 Message-Digest Algorithm</option> ! <option value='crypt'>Standard Unix DES-based encryption algorthm</option> ! <option value='crc32'>crc32 Polynomial</option> ! <option value='sha1'>US Secure Hash Algorithm 1 (sha1)</option> ! </select> ! </dd> ! <dt>If you are migrating from an existing system, this should be the same encryption ! style that system uses, otherwise all users will have to reset their password; otherwise, in ! most cases the default option is fine.</dt> ! <dd> ! <label for="cookielogins">Allow users to save their passwords?</label> ! <input type="checkbox" name="cookielogins" id="cookielogins" value="yes" checked />Allowed ! </dd> ! <dt>This feature uses cookies to automatically log in users into the openFIRST portal.</dt> ! <dd> ! <label for="allowreg">Allow users to register on the portal?</label> ! <input type="checkbox" name="allowreg" id="allowreg" value="yes" />Allowed ! </dd> ! <dt>Enabling this option will allow users to register on the website and log in to access the ! members area. Be careful when using this option.</dt> ! </dl> ! </fieldset> ! ! <fieldset> ! <legend>Mailing Options</legend> ! <dl class="setup"> ! <dd> ! <label for="mailnotify">Mail Notification</label> ! <input type="text" name="mailnotify" value="<?php echo htmlentities($mailto); ?>" /> ! </dd> ! <dt>The e-mail address used to notify you when significant events occur.</dt> ! <dd> ! <label for="mailfrom">Mail From</label> ! <input type="text" name="mailfrom" value="<?php echo htmlentities($mailfrom); ?>" /> ! </dd> ! <dt>The e-mail address that mail from the openFIRST site should appear to be from.</dt> ! </dl> ! </fieldset> ! <div class="center big"><button class="center big" type="submit">Set up openFIRST!</button></div> ! </form> ! <?php ! } ! if(is_readable("style/footers.php")) { ! include_once("style/footers.php"); ! } else { ! include_once("../style/footers.php"); ! } ! ?> --- 1,339 ---- ! <?php ! /* ! * openFIRST.base - config/first.php ! * ! * Copyright (C) 2003, ! * openFIRST Project ! * Original Author: Tim Ginn <tim...@po...> ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! */ ! ! // Purpose: Deal with the initial set up that must occur once the openFIRST ! // base system has been extracted. This file should be removed once ! // this task is complete, or the permissions on globals.php should be ! // changed to prevent unwanted modification of configuration options. ! ! // Initialize header/footer vars ! $Title = 'openFIRST Installation'; ! $StylePath = 'http://openfirst.sourceforge.net/'; ! ! if(isset($_POST["login"])) { ! require_once('auth.php'); ! InitUser(); ! // User is attempting to login for the first time. ! if (isset($user)) { ! die("<br /><br /><br />You have successfully logged in. <a href='index.php'>Access Administrative Configuration Options</a> (you will be prompted for your password again)</center>"); ! } ! } ! ! ! if(isset($_POST["sqlserver"])) { ! $sqlserver = $_POST["sqlserver"]; ! $sqluser = $_POST["sqluser"]; ! $sqlpassword = $_POST["sqlpassword"]; ! $sqldatabase = $_POST["sqldatabase"]; ! $fbasepath = realpath($_POST['fbasepath']); ! include_once("$fbasepath/includes/dbase.php"); ! include_once("$fbasepath/includes/auth.php"); ! if(function_exists("ofirst_dbconnect") == false) { ! die("Your version of PHP has not been compiled with MySQL support, therefore the openFIRST web portal system cannot run on this system. Please contact your system administrator to request MySQL support for your version of PHP."); ! } ! if (!ofirst_dbcreate("$sqlserver","$sqluser","$sqlpassword", $sqldatabase)) ! echo 'DB/tables creation error: '.ofirst_dberror(); ! ! function GetVarValue($var) { ! ob_Start(); ! var_export($var); ! $Value = ob_Get_Contents(); ! ob_End_Clean(); ! return $Value; ! } ! ! // They have submitted the form, write a new globals.php file and test ! // options. ! $ConfigFile = "$fbasepath/includes/sitesettings.php"; ! if ( (file_exists($ConfigFile) && is_writable($ConfigFile)) || is_writable(dirname($ConfigFile)) ) { ! $file = file_get_contents('../includes/sitesettings.tpl'); ! $cookielogins = ((isset($_POST["cookielogins"]) && $_POST["cookielogins"]=="yes") ? true : false); ! $allowreg = ((isset($_POST["allowreg"]) && $_POST["allowreg"]=="yes") ? true : false); ! ! $find = array('%DBTYPE%', ! '%ENCRYPT%', ! '%TITLE%', ! '%VER%', ! '%DBSERVER%', ! '%DBUSER%', ! '%DBPASS%', ! '%DBNAME%', ! '%COOKIE%', ! '%REG%', ! '%HOME%', ! '%HEADER%', ! '%FOOTER%', ! '%MASTERMAIL%', ! '%BOTMAIL%', ! '%SERVER%', ! '%BASEPATH%', ! '%FBASEPATH%'); ! ! $replace = array(GetVarValue($_POST['dbasetype']), ! GetVarValue($_POST['encryption']), ! GetVarValue($_POST['title']), ! GetVarValue($_POST['version']), ! GetVarValue($_POST['sqlserver']), ! GetVarValue($_POST['sqluser']), ! GetVarValue($_POST['sqlpassword']), ! GetVarValue($_POST['sqldatabase']), ! GetVarValue($cookielogins), ! GetVarValue($allowreg), ! GetVarValue($_POST['home']), ! GetVarValue($_POST['header']), ! GetVarValue($_POST['footer']), ! GetVarValue($_POST['mailnotify']), ! GetVarValue($_POST['mailfrom']), ! GetVarValue($_POST['server']), ! GetVarValue($_POST['basepath']), ! GetVarValue($fbasepath)); ! ! $file = str_replace($find, $replace, $file); ! $hfile = fopen("$ConfigFile",'w'); fwrite($hfile, $file); fclose($hfile); ! ! include_once("../includes/globals.php"); ! include_once($header); ! echo("<div class=\"success\"><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 <span class=\"file\">".htmlentities(basename($ConfigFile))."</span> to prevent unwanted changes ! to the configuration options. You should be able to login below using the username ! <b class=\"user\">admin</b> and the password <b class=\"password\">openfirst</b>, if not, then either ! the password for that account has been changed, or the MySQL settings are incorrect.</p>"); ! showlogin(); ! die(include_once($footer)); ! } else { ! echo '<p class="error"><span class="file">'.htmlentities($ConfigFile).'</span> is not writable</p> ! '; ! if(is_readable("style/headers.php")) { ! include_once("style/headers.php"); ! } else { ! include_once("../style/headers.php"); ! } ! echo("<h1 class=\"error\">System 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 /> ! <pre class=\"shell\">cd config ! <br />chmod 666 globals.php</pre></p>"); ! } ! } else { ! ! // Do form ! if(is_readable("style/headers.php")) { ! include_once("style/headers.php"); ! } else { ! include_once("../style/headers.php"); ! } ! ! // Detect default options ! $basepath = substr($_SERVER["SCRIPT_NAME"], 0, -17); ! $server = $_SERVER["SERVER_NAME"]; ! $fbasepath = realpath(dirname(__FILE__).'/..'); ! $ConfigFile = "$fbasepath/includes/sitesettings.php"; ! ! $sqlhost = 'localhost'; ! if(ini_get('mysql.default_host') != '') { ! $sqlhost = ini_get('mysql.default_host'); ! } ! ! $sqluser = 'sqluser'; ! if(ini_get('mysql.default_user') != '') { ! $sqluser = ini_get('mysql.default_user'); ! } ! ! $sqlpass = ''; ! if(ini_get('mysql.default_password') != '') { ! $sqlpass = ini_get('mysql.default_password'); ! } ! ! $mailto = $_SERVER['SERVER_ADMIN']; ! $mailfrom = "openfirst@$server"; ! ! // User is visiting the configuration page, present them with a form ! // of options to fill out. ! ?> ! <div class="center"> ! <h1>Base Configuration</h1> ! <p class="center" style="max-width: 50em;">Congratulations for choosing openFIRST! Please proceed through ! this setup wizard to get your new openFIRST portal software set up and working ! quickly and painlessly. Also please make sure that before installing this script ! that you have the appropriate permissions set on <span class="file"><?php echo htmlentities($ConfigFile) ?></span> (if not ! then you may receive a collection of errors after submitting this form).</p> ! </div> ! <form action="<?php echo htmlentities("http://$server$basepath/config/first.php"); ?>" method="post"> ! <fieldset> ! <legend>Database Setup</legend> ! <dl class="setup"> ! <dd> ! <label for="dbasetype">Database Type</label> ! <input type='hidden' name='peardb' value='false'> ! <select name="dbasetype"> ! <option value="mysql" selected="selected">MySQL</option> ! <option value="mssql">Microsoft SQL</option> ! <option value="odbc">ODBC</option> ! </select> ! </dd> ! <dt></dt> ! <dd> ! <label for="title">Title of Website</label> ! <input type="text" name="title" value="openFIRST" /> ! </dd> ! <dt></dt> ! <dd> ! <label for="version">Version of Website</label> ! <input type="text" name="version" value="1.0" /> ! </dd> ! <dt></dt> ! <dd> ! <label for="sqlserver">Database Server Address</label> ! <input type="text" name="sqlserver" value="<?php echo htmlentities($sqlhost); ?>" /> ! </dd> ! <dt></dt> ! <dd> ! <label for="sqluser">Database User Name</label> ! <input type="text" name="sqluser" value="<?php echo htmlentities($sqluser); ?>" /> ! </dd> ! <dt></dt> ! <dd> ! <label for="sqlpassword">Database User Password</label> ! <input type="password" name="sqlpassword" value="<?php echo htmlentities($sqlpass); ?>" /> ! </dd> ! <dt></dt> ! <dd> ! <label for="sqldatabase">Database Name</label> ! <input type="text" name="sqldatabase" value="openfirst" /> ! </dd> ! <dt>(I this database does not already exist, the user entered above must have access to create it.</dt> ! </dl> ! </fieldset> ! ! <fieldset> ! <legend>Linking Options</legend> ! <dl class="setup"> ! <dd> ! <label for="home">Home Site</label> ! <input type="text" name="home" value="http://<?php echo htmlentities("$server$basepath"); ?>" /> ! </dd> ! <dt>This address will used for linking to your main page.</dt> ! <dd> ! <label for="header">Header file</label> ! <input type="text" name="header" value="<?php echo htmlentities(realpath("$fbasepath/style/headers.php")); ?>" /> ! </dd> ! <dt>This should be a full system path, eg, ! <code class="file">c:\inetpub\wwwroot\openfirst\style\header.php</code> or ! <code class="file">/home/site/public_html/openfirst/style/headers.php</code> ! </dt> ! <dd> ! <label for="footer">Footer file</label> ! <input type="text" name="footer" value="<?php echo htmlentities(realpath("$fbasepath/style/footers.php")); ?>" /> ! </dd> ! <dt>This should be a full system path, eg, ! <code class="file">c:\inetpub\wwwroot\openfirst\style\footers.php</code> or ! <code class="file">/home/site/public_html/openfirst/style/footers.php</code> ! </dt> ! <dd> ! <label for="">The server name</label> ! <input type="text" name="server" value="http://<?php echo htmlentities($server); ?>" /> ! <span class="warning">Must not have a trailing slash and must include a protocol.</span> ! </dd> ! <dt>eg, <code class="url"><b>http://openfirst.sourceforge.net</b>/openfirst</code></dt> ! <dd> ! <label for="basepath">URL base path</label> ! <input type="text" name="basepath" value="<?php echo htmlentities($basepath); ?>" /> ! <span class="warning">Must not have a trailing slash.</span> ! </dd> ! <dt>ie. example: <code class="url">http://openfirst.sourceforge.net<b>/openfirst</b></code>) this should ! always have a beginning slash but no ending slash. (If openFIRST is in the root directory, then leave blank.) ! </dt> ! <dd> ! <label for="fbasepath">File system path</label> ! <input type="text" name="fbasepath" value="<?php echo htmlentities($fbasepath); ?>" /> ! <span class="warning">Must not have a trailing slash.</span> ! </dd> ! <dt>eg, <code class="file">/home/openfirst/htdocs/openfirst</code> ! or <code class="file">c:\inetpub\wwwroot\openfirst</code>) this should not have a ending slash.</dt> ! </dl> ! </fieldset> ! ! <fieldset> ! <legend>Security Options</legend> ! <dl class="setup"> ! <dd> ! <label for="">Hashing method</label> ! <select name="encryption"> ! <option value='md5' selected='selected'>MD5 Message-Digest Algorithm</option> ! <option value='crypt'>Standard Unix DES-based encryption algorthm</option> ! <option value='crc32'>crc32 Polynomial</option> ! <option value='sha1'>US Secure Hash Algorithm 1 (sha1)</option> ! </select> ! </dd> ! <dt>If you are migrating from an existing system, this should be the same encryption ! style that system uses, otherwise all users will have to reset their password; otherwise, in ! most cases the default option is fine.</dt> ! <dd> ! <label for="cookielogins">Allow users to save their passwords?</label> ! <input type="checkbox" name="cookielogins" id="cookielogins" value="yes" checked />Allowed ! </dd> ! <dt>This feature uses cookies to automatically log in users into the openFIRST portal.</dt> ! <dd> ! <label for="allowreg">Allow users to register on the portal?</label> ! <input type="checkbox" name="allowreg" id="allowreg" value="yes" />Allowed ! </dd> ! <dt>Enabling this option will allow users to register on the website and log in to access the ! members area. Be careful when using this option.</dt> ! </dl> ! </fieldset> ! ! <fieldset> ! <legend>Mailing Options</legend> ! <dl class="setup"> ! <dd> ! <label for="mailnotify">Mail Notification</label> ! <input type="text" name="mailnotify" value="<?php echo htmlentities($mailto); ?>" /> ! </dd> ! <dt>The e-mail address used to notify you when significant events occur.</dt> ! <dd> ! <label for="mailfrom">Mail From</label> ! <input type="text" name="mailfrom" value="<?php echo htmlentities($mailfrom); ?>" /> ! </dd> ! <dt>The e-mail address that mail from the openFIRST site should appear to be from.</dt> ! </dl> ! </fieldset> ! <div class="center big"><button class="center big" type="submit">Set up openFIRST!</button></div> ! </form> ! <?php ! } ! if(is_readable("style/footers.php")) { ! include_once("style/footers.php"); ! } else { ! include_once("../style/footers.php"); ! } ! ?> Index: openfirst.info.xml =================================================================== RCS file: /cvsroot/openfirst/base/config/openfirst.info.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** openfirst.info.xml 27 May 2005 16:03:48 -0000 1.2 --- openfirst.info.xml 29 Jun 2005 21:20:41 -0000 1.3 *************** *** 1,84 **** ! <module id="openfirst.base"> ! <!-- NOTE: This file defines the basic DB layout when installing or upgrading. ! openfirst.base is a psuedomodule. --> ! <name>Base</name> ! <version>CVS</version> ! <author>The openFIRST Team</author> ! ! <!-- Database setup --> ! <db> ! <table id="config"> ! <fields> ! <!-- Empty tags with no attributes serve as flags. Should be self explainatory --> ! <field name="modulename"><type>varchar<length>25</length></type> <not_null /> <default></default></field> ! <field name="dir"><type>varchar<length>25</length></type> <not_null /></field> ! <field name="UpdateDate"><type>datetime</type> <not_null /></field> ! <field name="label"><type>varchar<length>25</length></type></field> ! <field name="Author"><type>tinytext</type></field> ! <field name="Maintainer"><type>tinytext</type><default>null</default></field> ! <field name="version"><type>varchar<length>10</length></type> <not_null /> <default>CVS</default></field> ! <field name="showonmenu"><type>BOOL</type> <not_null /> <default>0</default></field> ! <field name="active"><type>BOOL</type> <not_null /> <default>0</default></field> ! <field name="adminnavigation"><type>text</type></field> ! <field name="modulenavigation"><type>text</type></field> ! <field name="includes"><type>text</type></field> ! </fields> ! <keys> ! <key> ! <cols> ! <col>modulename</col> ! </cols> ! <primary /> ! </key> ! <key name="modulename"> ! <cols> ! <col>modulename</col> ! </cols> ! <unique /> ! </key> ! <key name="dir"> ! <cols> ! <col>dir</col> ! </cols> ! <unique /> ! </key> ! </keys> ! </table> ! ! <table id="firstawards"> ! <fields> ! <field name="user"><type>varchar<length>128</length></type><not_null /></field> ! <field name="firstname"><type>tinytext</type></field> ! <field name="lastname"><type>tinytext</type></field> ! <field name="lastseen"><type>datetime</type></field> ! <field name="ip"><type>tinytext</type></field> ! <field name="password"><type>text</type></field> ! <field name="authcode"><type>text</type></field> ! <field name="membertype"><type>tinytext</type></field> ! <field name="division"><type>tinytext</type></field> ! <field name="year"><type>year</type></field> ! <field name="email"><type>text</type></field> ! <field name="icq"><type>int<length>11</length></type></field> ! <field name="aim"><type>tinytext</type></field> ! <field name="msn"><type>tinytext</type></field> ! <field name="yim"><type>tinytext</type></field> ! <field name="jabber"><type>tinytext</type></field> ! <field name="description"><type>text</type></field> ! <field name="signature"><type>tinytext</type></field> ! <field name="dateregistered"><type>datetime</type></field> ! <field name="picturelocation"><type>tinytext</type></field> ! <field name="team"><type>int<length>11</length></type></field> ! <field name="skills"><type>text</type></field> ! </fields> ! <keys> ! <key name="user"> ! <cols> ! <col>user</col> ! </cols> ! <unique /> ! </key> ! </keys> ! </table> ! ! </db> ! </module> --- 1,72 ---- ! <module id="openfirst.base"> ! <!-- NOTE: This file defines the basic DB layout when installing or upgrading. ! openfirst.base is a psuedo-module for the oF core. --> ! <name>openFIRST</name> ! <version>CVS</version> ! <author>The openFIRST Team</author> ! ! <!-- Database setup --> ! <db> ! <table id="config"> ! <fields> ! <!-- Empty tags with no attributes serve as flags. Should be self explainatory --> ! <field name="modulename"><type>varchar<length>25</length></type> <not_null /> <default></default></field> ! <field name="dir"><type>varchar<length>25</length></type> <not_null /></field> ! <field name="UpdateDate"><type>datetime</type> <not_null /></field> ! <field name="label"><type>varchar<length>25</length></type></field> ! <field name="Author"><type>tinytext</type></field> ! <field name="Maintainer"><type>tinytext</type><default>null</default></field> ! <field name="version"><type>varchar<length>10</length></type> <not_null /> <default>CVS</default></field> ! <field name="showonmenu"><type>BOOL</type> <not_null /> <default>0</default></field> ! <field name="active"><type>BOOL</type> <not_null /> <default>0</default></field> ! <field name="adminnavigation"><type>text</type></field> ! <field name="modulenavigation"><type>text</type></field> ! <field name="includes"><type>text</type></field> ! </fields> ! <keys> ! <key name="dir"> ! <cols> ! <col>dir</col> ! </cols> ! <unique /> ! </key> ! </keys> ! </table> ! ! <table id="firstawards"> ! <fields> ! <field name="user"><type>varchar<length>128</length></type><not_null /></field> ! <field name="firstname"><type>tinytext</type></field> ! <field name="lastname"><type>tinytext</type></field> ! <field name="lastseen"><type>datetime</type></field> ! <field name="ip"><type>tinytext</type></field> ! <field name="password"><type>text</type></field> ! <field name="authcode"><type>text</type></field> ! <field name="membertype"><type>tinytext</type></field> ! <field name="division"><type>tinytext</type></field> ! <field name="year"><type>year</type></field> ! <field name="email"><type>text</type></field> ! <field name="icq"><type>int<length>11</length></type></field> ! <field name="aim"><type>tinytext</type></field> ! <field name="msn"><type>tinytext</type></field> ! <field name="yim"><type>tinytext</type></field> ! <field name="jabber"><type>tinytext</type></field> ! <field name="description"><type>text</type></field> ! <field name="signature"><type>tinytext</type></field> ! <field name="dateregistered"><type>datetime</type></field> ! <field name="picturelocation"><type>tinytext</type></field> ! <field name="team"><type>int<length>11</length></type></field> ! <field name="skills"><type>text</type></field> ! </fields> ! <keys> ! <key name="user"> ! <cols> ! <col>user</col> ! </cols> ! <unique /> ! </key> ! </keys> ! </table> ! ! </db> ! </module> |
From: Tim G. <xt...@us...> - 2005-06-29 12:01:12
|
Update of /cvsroot/openfirst/www/htdocs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29318 Modified Files: index.php Log Message: Make Hackergotchi images work now that Dotster is holding openfirst.org hostage. Index: index.php =================================================================== RCS file: /cvsroot/openfirst/www/htdocs/index.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** index.php 24 May 2005 22:09:45 -0000 1.4 --- index.php 29 Jun 2005 12:00:33 -0000 1.5 *************** *** 22,32 **** // Hackergotchi images can be of a few different formats; and if we don't find one, we'll display a default. if(file_exists("image/hackergotchi/" . $h[0] . ".png")) { ! $hackergotchi = "http://www.openfirst.org/image/hackergotchi/" . $h[0] . ".png"; } else if(file_exists("image/hackergotchi/" . $h[0] . ".jpg")) { $hackergotchi = "http://www.openfirst.org/image/hackergotchi/" . $h[0] . ".jpg"; } else if(file_exists("image/hackergotchi/" . $h[0] . ".gif")) { ! $hackergotchi = "http://www.openfirst.org/image/hackergotchi/" . $h[0] . ".gif"; } else { ! $hackergotchi = "http://www.openfirst.org/image/hackergotchi/unknown.png"; } echo "<td valign='top'><img src='$hackergotchi' alt='[Hackergotchi]'><br><small>Posted: $n->pubDate by $h[0]</small></td><td valign='top'>" . str_replace("<", "<", str_replace(">", ">", str_replace(""", "\"", $n->description))) . "</td>"; --- 22,32 ---- // Hackergotchi images can be of a few different formats; and if we don't find one, we'll display a default. if(file_exists("image/hackergotchi/" . $h[0] . ".png")) { ! $hackergotchi = "/image/hackergotchi/" . $h[0] . ".png"; } else if(file_exists("image/hackergotchi/" . $h[0] . ".jpg")) { $hackergotchi = "http://www.openfirst.org/image/hackergotchi/" . $h[0] . ".jpg"; } else if(file_exists("image/hackergotchi/" . $h[0] . ".gif")) { ! $hackergotchi = "/image/hackergotchi/" . $h[0] . ".gif"; } else { ! $hackergotchi = "/image/hackergotchi/unknown.png"; } echo "<td valign='top'><img src='$hackergotchi' alt='[Hackergotchi]'><br><small>Posted: $n->pubDate by $h[0]</small></td><td valign='top'>" . str_replace("<", "<", str_replace(">", ">", str_replace(""", "\"", $n->description))) . "</td>"; |
From: Tim G. <xt...@us...> - 2005-06-29 11:37:35
|
Update of /cvsroot/openfirst/www/inc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17178 Modified Files: headers.php footers.php Log Message: Change addresses not to require openfirst.org, since it's being held hostage by Dotster at the moment. Index: footers.php =================================================================== RCS file: /cvsroot/openfirst/www/inc/footers.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** footers.php 31 Dec 2004 06:25:19 -0000 1.4 --- footers.php 29 Jun 2005 11:37:19 -0000 1.5 *************** *** 24,28 **** */ ?>. <a ! href="http://www.openfirst.org/source.php?url=<?php echo($_SERVER["SCRIPT_NAME"]);?> ">Show --- 24,28 ---- */ ?>. <a ! href="/source.php?url=<?php echo($_SERVER["SCRIPT_NAME"]);?> ">Show Index: headers.php =================================================================== RCS file: /cvsroot/openfirst/www/inc/headers.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** headers.php 25 May 2005 15:28:38 -0000 1.13 --- headers.php 29 Jun 2005 11:37:19 -0000 1.14 *************** *** 59,64 **** td { color: black; font-size: 12px; font-family: sans-serif; text-decoration: none; } td.navigation { color: black; font-size: 12px; font-family: sans-serif; text-decoration: none; } ! th { background-color: #999999; color: #333333;background-image: url('http://www.openfirst.org/image/back-light.gif'); } ! td.sub { background-color: #999999; color: #333333;background-image: url('http://www.openfirst.org/image/back-lighter.gif'); } </style> </head> --- 59,64 ---- td { color: black; font-size: 12px; font-family: sans-serif; text-decoration: none; } td.navigation { color: black; font-size: 12px; font-family: sans-serif; text-decoration: none; } ! th { background-color: #999999; color: #333333;background-image: url('/image/back-light.gif'); } ! td.sub { background-color: #999999; color: #333333;background-image: url('/image/back-lighter.gif'); } </style> </head> *************** *** 67,87 **** <table width="100%" border="0" cellspacing="0" cellpadding="6"> <tr> ! <td> <img src="http://www.openfirst.org/image/openfirst.png" alt="openFIRST Portal System"> </td> </tr> <tr> ! <th id="topmenu" style="background-image: url('http://www.openfirst.org/image/back.gif');"> » <a accesskey="h" href="http://openfirst.sourceforge.net"><u>H</u>ome</a> ! | » <a accesskey="a" href="http://www.openfirst.org/about.php"><u>A</u>bout openFIRST</a> ! | » <a accesskey="o" href="http://www.openfirst.org/doc/">D<u>o</u>cumentation</a> ! | » <a accesskey="d" href="http://www.openfirst.org/downloads.php"><u>D</u>ownloads</a> ! | » <a accesskey="m" href="http://www.openfirst.org/modules.php"><u>M</u>odules</a> ! | » <a accesskey="e" href="http://www.openfirst.org/developers.php">Volunt<u>e</u>ers</a> ! | » <a accesskey="b" href="http://www.openfirst.org/bugreports.php"><u>B</u>ug Reports</a> ! | » <a accesskey="c" href="http://www.openfirst.org/contact.php"><u>C</u>ontact Us</a> </th> </tr> <tr> ! <td style="background-image: url('http://www.openfirst.org/image/back-light.gif'); "> <table width="100%" border="0" cellspacing="0" cellpadding="0"> --- 67,87 ---- <table width="100%" border="0" cellspacing="0" cellpadding="6"> <tr> ! <td> <img src="/image/openfirst.png" alt="openFIRST Portal System"> </td> </tr> <tr> ! <th id="topmenu" style="background-image: url('/image/back.gif');"> » <a accesskey="h" href="http://openfirst.sourceforge.net"><u>H</u>ome</a> ! | » <a accesskey="a" href="/about.php"><u>A</u>bout openFIRST</a> ! | » <a accesskey="o" href="/doc/">D<u>o</u>cumentation</a> ! | » <a accesskey="d" href="/downloads.php"><u>D</u>ownloads</a> ! | » <a accesskey="m" href="/modules.php"><u>M</u>odules</a> ! | » <a accesskey="e" href="/developers.php">Volunt<u>e</u>ers</a> ! | » <a accesskey="b" href="/bugreports.php"><u>B</u>ug Reports</a> ! | » <a accesskey="c" href="/contact.php"><u>C</u>ontact Us</a> </th> </tr> <tr> ! <td style="background-image: url('/image/back-light.gif'); "> <table width="100%" border="0" cellspacing="0" cellpadding="0"> *************** *** 95,101 **** <table width="100%"> <tr> ! <td width="20%" valign="top" style="background-image: url('http://www.openfirst.org/image/back-lighter.gif'); "><table width="100%" border="0"> <tr> ! <td><strong><img alt="" src="http://www.openfirst.org/image/help.png"> What is openFIRST?</strong></td> </tr> --- 95,101 ---- <table width="100%"> <tr> ! <td width="20%" valign="top" style="background-image: url('/image/back-lighter.gif'); "><table width="100%" border="0"> <tr> ! <td><strong><img alt="" src="/image/help.png"> What is openFIRST?</strong></td> </tr> *************** *** 106,110 **** </tr> <tr> ! <td><strong><img alt="" src="http://www.openfirst.org/image/misc.png"> Developers?</strong> </td> </tr> --- 106,110 ---- </tr> <tr> ! <td><strong><img alt="" src="/image/misc.png"> Developers?</strong> </td> </tr> *************** *** 117,125 **** <a href="http://www.teamthrust.us/">#1501</a>, #1227, and #1257. You may ! <a href="http://www.openfirst.org/developers/">read more about the ! developers</a>. To learn how to contribute to the project, and for a technical reference about writing modifications / patches / enhancements for the openFIRST system, read the <a href="http://www.openfirst.org/doc/tut/howto/">openFIRST Contributor's HOWTO</a>. New contributors are always welcome.</td> </tr> <tr> ! <td> <strong><img alt="" src="http://www.openfirst.org/image/gear.png"> USFIRST Robotics</strong></td> </tr> --- 117,125 ---- <a href="http://www.teamthrust.us/">#1501</a>, #1227, and #1257. You may ! <a href="/developers/">read more about the ! developers</a>. To learn how to contribute to the project, and for a technical reference about writing modifications / patches / enhancements for the openFIRST system, read the <a href="/doc/tut/howto/">openFIRST Contributor's HOWTO</a>. New contributors are always welcome.</td> </tr> <tr> ! <td> <strong><img alt="" src="/image/gear.png"> USFIRST Robotics</strong></td> </tr> *************** *** 130,145 **** </tr> </table> ! <p align="center"><a href="http://www.usfirst.org"><img alt="" src="http://www.openfirst.org/oflogo.php?img=firstlogo&type=1" border="0"></a> <br> <br> <strong>openFIRST was developed with:</strong><br> <br><center> ! <img alt="" src="http://www.openfirst.org/image/tested/apache.png"> <br> <br> ! <img alt="" src="http://www.openfirst.org/image/tested/iis.png"><br> <br> ! <img alt="" src="http://www.openfirst.org/image/tested/sambar.png"> <img alt="" src="http://www.openfirst.org/image/tested/php.png"><br> ! <img alt="" src="http://www.openfirst.org/image/tested/mysql.png"><br>(Other databases are supported)<br> ! <!--img src="http://www.openfirst.org/image/powered_pear.png" alt="PEAR"><br>(Pear components are optional)--></center> <p><b>Bugzilla Stats</b> <!-- --- 130,146 ---- </tr> </table> ! <p align="center"><a href="http://www.usfirst.org"><img alt="" src="/oflogo.php?img=firstlogo&type=1" border="0"></a> <br> <br> <strong>openFIRST was developed with:</strong><br> <br><center> ! <img alt="" src="/image/tested/apache.png"> <br> <br> ! <img alt="" src="/image/tested/iis.png"><br> <br> ! <img alt="" src="/image/tested/sambar.png"> <img alt="" src="/image/tested/php.png"><br> ! / <br><a href="http://www.firsttopsite.com/index.php?id=92" target="_blank"><img src="http://www.firsttopsite.com/img.php?id=92" border="0"></a> ! <img alt="" src="/image/tested/mysql.png"><br>(Other databases are supported)<br> ! <!--img src="/image/powered_pear.png" alt="PEAR"><br>(Pear components are optional)--></center> <p><b>Bugzilla Stats</b> <!-- |
From: Astronouth7303 <ast...@us...> - 2005-06-26 00:51:44
|
Update of /cvsroot/openfirst/base/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7817/includes Modified Files: Module.php Log Message: Basic Module class written Index: Module.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/Module.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Module.php 12 Jun 2005 17:43:54 -0000 1.1 --- Module.php 26 Jun 2005 00:51:33 -0000 1.2 *************** *** 25,39 **** // and code for the module itself. class Module { ! /*private*/ var $mName, $mID, $mVersion, $mAuthor, $mMaintainer; ! /*private*/ var $mIncludes, $mNavBar, $mAdminBar, $mTables; ! /*private*/ var $mSetupScript, $mRemoveScript, $mUpgradeScript; ! ! // XML ! /*private*/ var $mxmlCurTag, $mRootElement; ! // Specific tags for later. ! /*private*/ var $mIncludesTag, $mDBTag; function Module($ID) { } --- 25,58 ---- // and code for the module itself. + require_once('dbase.php'); + + function getIDFromDir($dir) { + $sql = 'SELECT '.ofirst_dbquote_name('modulename').' FROM '.ofirst_dbquote_table('config').' WHERE '.ofirst_dbquote_fd_pairs(array('dir'=>$dir), ' AND '); + $res = ofirst_dbquery($sql); + $row = ofirst_dbfetch_object($res); + return $row->modulename; + } + class Module { ! /*private*/ var $mName, $mID, $mVersion, $mDate, $mAuthor, $mMaintainer; ! /*private*/ var $mIncludes, $mNavBar, $mAdminBar, $mShow, $mActive; function Module($ID) { + $sql = 'SELECT * FROM '.ofirst_dbquote_table('config').' WHERE '.ofirst_dbquote_fd_pairs(array('modulename'=>$ID), ' AND '); + $res = ofirst_dbquery($sql); + $mod = ofirst_dbfetch_object($res); + + $this->mName = $mod->label; + $this->mID = $ID; + $this->mVersion = $mod->version; + $this->mDate = $mod->UpdateDate; + $this->mAuthor = $mod->Author; + $this->mMaintainer = $mod->Maintainer; + + $this->mIncludes = explode(',', $mod->includes); + $this->mNavBar = $mod->modulenavigation; + $this->mAdminBar = $mod->adminnavigation; + $this->mShow = $mod->showonmenu; + $this->mActive = $mod->active; } *************** *** 43,47 **** */ /*static*/ function createFromID($ID) { ! return new Module("$fBasePath/$Dir/openfirst.info.xml"); } --- 62,70 ---- */ /*static*/ function createFromID($ID) { ! return new Module($ID); ! } ! ! /*static*/ function createFromDir($Dir) { ! return new Module(getIDFromDir($Dir)); } *************** *** 59,62 **** --- 82,89 ---- } + /*public*/ function getDate() { + return $this->mDate; + } + /*public*/ function getAuthor() { return $this->mAuthor; *************** *** 79,97 **** } ! /*public*/ function getTables() { ! return $this->mTables; } ! /*public*/ function getSetupScript() { ! return $this->mSetupScript; } ! /*public*/ function getRemoveScript() { ! return $this->mRemoveScript; } ! /*public*/ function getUpgradeScript() { ! return $this->mUpgradeScript; } } --- 106,136 ---- } ! /*public*/ function getShowOnMenu() { ! return $this->mShow; } ! /*public*/ function getActive() { ! return $this->mActive; } ! /* ! There are several functions that may optionally be implemented by a child of the Module class. ! ! The first handles slugs. If you present content, you must implement this. ! You can do any manipulation you want to it, however, it is suggested that you use a directory-style ! setup, and that it is kept sane and logical. ! function getSlugURI($slug) { ! return $BasePath.'/'.$this->dir.'/'.$slug; } + It is recomended that you present the slug, in some form, to the user. At a later date, there may be + functions available from the skin to do this. ! If the module has an editor, you must create a child of the Editor class (you may implement the same ! functions in the Module class as well) and return an instance of it. ! function &getEditorObject() { ! return new Editor; } + A module containing an Editor is recomended to limit content to pages about the editor itself. + */ } |
From: Astronouth7303 <ast...@us...> - 2005-06-12 17:44:02
|
Update of /cvsroot/openfirst/base/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3951/includes Modified Files: modules.php Added Files: Module.php xmlModule.php Log Message: intermitent commit --- NEW FILE: xmlModule.php --- <?php /* * openFIRST.base - includes/xmlModule.php * * Copyright (C) 2003, * openFIRST Project * Original Author: Jamie Bliss <ja...@op...> * * 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. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ // Purpose: Defines the xmlModule class, which loads metadata about a module // and handles installation/removal/upgrading require_once('db_setup.php'); class xmlModule { /*private*/ var $mName, $mID, $mVersion, $mAuthor, $mMaintainer; /*private*/ var $mIncludes, $mNavBar, $mAdminBar, $mTables; /*private*/ var $mSetupScript, $mRemoveScript, $mUpgradeScript; // XML /*private*/ var $mxmlCurTag, $mRootElement; // Specific tags for later. /*private*/ var $mIncludesTag, $mDBTag; function xmlModule($File) { $hXML = false; if (!($fp = @fopen($File, 'r'))) { return; } $hXML = xml_parser_create(); xml_set_object($hXML, $this); xml_set_element_handler($hXML, 'startElement', 'endElement'); xml_set_character_data_handler($hXML, 'characterData'); xml_parse($hXML, $this->getModuleDTD(), false); #Add predefined entities while ($data = fread($fp, 1024)) { if (!xml_parse($hXML, $data, feof($fp))) { xml_parser_free($hXML); unset($hXML); return; } } xml_parser_free($hXML); unset($hXML); $this->mIncludes = array(); // Handle includes if (is_object($this->mIncludesTag)) { $IncludeTags = $this->mIncludesTag->Contents; foreach($IncludeTags as $tag) { if (is_object($tag) && is_a($tag, 'xmlElement')) { $this->mIncludes[] = $tag->Contents[0]; } } } if (is_null($this->mMaintainer)) $this->mMaintainer = $this->mAuthor; } /*** STATIC FUNCTIONS ***/ /** Creates a xmlModule object from a directory in the oF directory. */ /*static*/ function createFromDir($Dir) { global $fBasePath; return new xmlModule("$fBasePath/$Dir/openfirst.info.xml"); } /** Creates a xmlModule object from an absolute directory. */ /*static*/ function createFromAbsDir($Dir) { return new xmlModule("$Dir/openfirst.info.xml"); } /** Creates a xmlModule object from a specifc file. */ /*static*/ function createFromFile($File) { return new xmlModule($File); } /*** PUBLIC PROPERTIES ***/ /*public*/ function getName() { return $this->mName; } /*public*/ function getID() { return $this->mID; } /*public*/ function getVersion() { return $this->mVersion; } /*public*/ function getAuthor() { return $this->mAuthor; } /*public*/ function getMaintainer() { return $this->mMaintainer; } /*public*/ function getIncludes() { return $this->mIncludes; } /*public*/ function getNavBar() { return $this->mNavBar; } /*public*/ function getAdminBar() { return $this->mAdminBar; } /*public*/ function getTables() { return $this->mTables; } /*public*/ function getSetupScript() { return $this->mSetupScript; } /*public*/ function getRemoveScript() { return $this->mRemoveScript; } /*public*/ function getUpgradeScript() { return $this->mUpgradeScript; } /*** PUBLIC FUNCTIONS ***/ /*public*/ function prepareTables() { $mTables =& $this->mTables; $mDBTag =& $this->mDBTag; $mTables = array(); foreach($mDBTag->Contents as $tag) { if (!(is_object($tag) && is_a($tag, 'xmlElement'))) continue; if ($tag->Name != 'TABLE') continue; } } /*** PRIVATE FUNCTIONS ***/ /*private*/ function getModuleDTD() { /* global $BasePath, $StylePath; $xmlBasePath = str_replace(array('&', '<', '>', '"', '\'' ), array('&', '<', '>', '"e;', '''), $BasePath ); $xmlStylePath = str_replace(array('&', '<', '>', '"', '\'' ), array('&', '<', '>', '"e;', '''), $StylePath ); return "<!DOCTYPE module [ <!ENTITY BasePath \"$xmlBasePath\"> <!ENTITY StylePath \"$xmlStylePath\"> ]>";*/ return '<!DOCTYPE module [ <!ENTITY BasePath "$BasePath"> <!ENTITY StylePath "$StylePath"> ]>'; } /*** XML PARSER HOOKS ***/ function startElement($parser, $name, $attrs) { if (isset($this->mxmlCurTag)) { $this->mxmlCurTag =& $this->mxmlCurTag->addElement($name, $attrs); } else { $this->mxmlCurTag =& new xmlElement($name, $attrs, $this); $this->mRootElement =& $this->mxmlCurTag; } if ($name == 'MODULE') { if (isset($attrs['ID'])) $this->mID = $attrs['ID']; } else if ($name == 'SCRIPT') { if (!isset($attrs['rel']) || !isset($attrs['src'])) break; $type = $attrs['rel']; $file = $attrs['src']; if ($type == 'setup') { $this->mSetupScript = $file; } else if ($type == 'remove') { $this->mRemoveScript = $file; } else if ($type == 'upgrade') { $this->mUpgradeScript = $file; } } } function endElement($parser, $name) { if ($name == 'NAME') { $this->mName = $this->mxmlCurTag->Contents[0]; } else if ($name == 'VERSION') { $this->mVersion = $this->mxmlCurTag->Contents[0]; } else if ($name == 'AUTHOR') { $this->mAuthor = $this->mxmlCurTag->Contents[0]; } else if ($name == 'MAINTAINER') { $this->mMaintainer = $this->mxmlCurTag->Contents[0]; } else if ($name == 'NAVBAR') { $this->mNavBar = $this->mxmlCurTag->Contents[0]; } else if ($name == 'ADMINBAR') { $this->mAdminBar = $this->mxmlCurTag->Contents[0]; } else if ($name == 'INCLUDES') { $this->mIncludesTag =& $this->mxmlCurTag; } else if ($name == 'DB') { $this->mDBTag =& $this->mxmlCurTag; } $this->mxmlCurTag =& $this->mxmlCurTag->getParent(); } function characterData($parser, $data) { $this->mxmlCurTag->addCData($data); } } class xmlElement { var $Name, $Attributes, $Contents, $parent; /*public*/ function xmlElement($Name, $Attributes, &$ParentElement=null) { $this->Name = $Name; $this->Attributes = $Attributes; $this->Contents = array(); $this->parent =& $ParentElement; } /*public*/ function addCData($Text) { if (count($this->Contents) == 0) { $this->Contents[] = $Text; return; } end($this->Contents); if (is_object(current($this->Contents))) { $this->Contents[] = $Text; } else { $this->Contents[key($this->Contents)] .= $Text; } } /*public*/ function &addElement($Name, $Attrs) { global $xmlClassNames; $ClassName = $xmlClassNames['Element']; return $this->Contents[] =& new xmlElement($Name, $Attrs, &$this); } /*public*/ function &getParent() { return $this->parent; } } ?> --- NEW FILE: Module.php --- <?php /* * openFIRST.base - includes/Module.php * * Copyright (C) 2003, * openFIRST Project * Original Author: Jamie Bliss <ja...@op...> * * 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. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ // Purpose: Defines the Module class, which handles data about a module, // and code for the module itself. class Module { /*private*/ var $mName, $mID, $mVersion, $mAuthor, $mMaintainer; /*private*/ var $mIncludes, $mNavBar, $mAdminBar, $mTables; /*private*/ var $mSetupScript, $mRemoveScript, $mUpgradeScript; // XML /*private*/ var $mxmlCurTag, $mRootElement; // Specific tags for later. /*private*/ var $mIncludesTag, $mDBTag; function Module($ID) { } /*** STATIC FUNCTIONS ***/ /** Creates a Module object from a directory in the oF directory. */ /*static*/ function createFromID($ID) { return new Module("$fBasePath/$Dir/openfirst.info.xml"); } /*** PUBLIC PROPERTIES ***/ /*public*/ function getName() { return $this->mName; } /*public*/ function getID() { return $this->mID; } /*public*/ function getVersion() { return $this->mVersion; } /*public*/ function getAuthor() { return $this->mAuthor; } /*public*/ function getMaintainer() { return $this->mMaintainer; } /*public*/ function getIncludes() { return $this->mIncludes; } /*public*/ function getNavBar() { return $this->mNavBar; } /*public*/ function getAdminBar() { return $this->mAdminBar; } /*public*/ function getTables() { return $this->mTables; } /*public*/ function getSetupScript() { return $this->mSetupScript; } /*public*/ function getRemoveScript() { return $this->mRemoveScript; } /*public*/ function getUpgradeScript() { return $this->mUpgradeScript; } } ?> Index: modules.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/modules.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** modules.php 31 May 2005 22:16:58 -0000 1.8 --- modules.php 12 Jun 2005 17:43:54 -0000 1.9 *************** *** 27,31 **** require_once('db_setup.php'); ! class Module { /*private*/ var $mName, $mID, $mVersion, $mAuthor, $mMaintainer; /*private*/ var $mIncludes, $mNavBar, $mAdminBar, $mTables; --- 27,31 ---- require_once('db_setup.php'); ! class xmlModule { /*private*/ var $mName, $mID, $mVersion, $mAuthor, $mMaintainer; /*private*/ var $mIncludes, $mNavBar, $mAdminBar, $mTables; |
From: Astronouth7303 <ast...@us...> - 2005-06-02 21:13:34
|
Update of /cvsroot/openfirst/base/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22600/includes Modified Files: edit.php Log Message: Added registerEditor() and selectEditor() functions for managing it. Index: edit.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/edit.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** edit.php 1 Jun 2005 00:51:27 -0000 1.1 --- edit.php 2 Jun 2005 21:13:23 -0000 1.2 *************** *** 26,29 **** --- 26,62 ---- // to handle it. + $registeredEditors = array(); + + /** Registers an editor. + * Should be handled by a module include. + * Allows for multiple editors to co-exist. + * Pass the module ID and the display name. + */ + function registerEditor($ID, $Name) { + global $registeredEditors; + $registeredEditors[$ID] = $Name; + } + + /** Selects an editor for use. + * Should only be called by system, not by + * modules. + * @todo Write module code to support this. + */ + function selectEditor($ID) { + global $registeredEditors, $EditorPlugin; + $Name = $registeredEditors[$ID]; + $module =& getModuleObject($ID); + if (method_exists($module, 'getEditor')) { + $EditorPlugin =& $module->getEditor(); + return true; + } else { + // This indicates a serious coding error on the part of the plugin. + // _Some_ kind of alert is probably needed. + return false; + } + } + + /** Handles editors and parsers. + */ class Editor { /** Returns the HTML to paste on a page. *************** *** 57,60 **** #Default ! $EditPlugin = new Editor; ?> --- 90,93 ---- #Default ! $EditorPlugin = new Editor; ?> |
From: Astronouth7303 <ast...@us...> - 2005-06-01 00:51:37
|
Update of /cvsroot/openfirst/base/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30624/includes Added Files: edit.php Log Message: initial Editor. Defines a basic plain-text form. All editors and parses should extend it. --- NEW FILE: edit.php --- <?php /* * openFIRST.base - includes/mdoules.php * * Copyright (C) 2003, * openFIRST Project * Original Author: Jamie Bliss <ja...@op...> * * 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. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ // Purpose: Defines the Editor class, which allows a module to create a new // markup language and the editor for it, as well as global functions // to handle it. class Editor { /** Returns the HTML to paste on a page. * The return should not be modified in any way, * else you may break the software. */ function getEditField($fieldname,$height,$width,$init) { return '<textarea name="'.htmlentities($fieldname).'" cols="'.htmlentities($width).'" rows="'.htmlentities($height).'">'. htmlentities($init). '</textarea>'; } /** Returns the text posted. */ function getFieldValue($fieldname) { return $_REQUEST[$fieldname]; } /** Returns the plain text version, eg for search indeces. */ function getPlainText($text) { return $text; } /** Returns the HTML version for display. */ function parseText($text) { return htmlentities($text); } } #Default $EditPlugin = new Editor; ?> |
From: Astronouth7303 <ast...@us...> - 2005-05-31 22:19:08
|
Update of /cvsroot/openfirst/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12768/modules Modified Files: export.php Log Message: trying to update with XML. This maybe a dead-end... Index: export.php =================================================================== RCS file: /cvsroot/openfirst/modules/export.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** export.php 26 May 2005 23:27:30 -0000 1.3 --- export.php 31 May 2005 22:18:44 -0000 1.4 *************** *** 24,35 **** require_once("../includes/globals.php"); - function GetVarValue($var) { - ob_Start(); - var_export($var); - $Value = ob_Get_Contents(); - ob_End_Clean(); - return $Value; - } - $incl = ofirst_dbquery('SELECT * FROM '.ofirst_dbquote_table('config')); --- 24,27 ---- *************** *** 39,87 **** <dl> <?php ! foreach($Modules as $key => $data) { ! $version = $data['ver']; ! $includes = $data['inc']; ! $admin = $data['admin']; ! $nav = $data['nav']; ! ! if (strlen($version) <= 0) $version = 'CVS'; ! $code = GetVarValue($key); ! $name = GetVarValue(ucwords($key)); ! $version = GetVarValue($version); ! $includes = GetVarValue($includes); ! $admin = GetVarValue($admin); ! $nav = GetVarValue($nav); ! $PHPCode = '<'."?php ! global \$Modules; ! \$Modules[$code]['name'] = $name; ! \$Modules[$code]['ver'] = $version; ! \$Modules[$code]['inc'] = $includes; ! \$Modules[$code]['admin'] = $admin; ! \$Modules[$code]['nav'] = $nav; ! ! if (!isset(\$Modules['awards']['active']) { ! \$Modules['awards']['active'] = false; ! } ! ! if (!isset(\$Modules['awards']['show']) { ! \$Modules['awards']['show'] = false; ! } ! ?".'>'; ! if (isset($_REQUEST['save'])) { ! $save_len = file_put_contents("$fbasepath/$key/openfirst.info.php", $PHPCode); ! } ! ?><dt style="font-weight:bold;"><h2><?php echo htmlentities($key); ?></h2><?php ! if (isset($_REQUEST['save'])) { ! echo htmlentities("$save_len / ".strlen($PHPCode)); } ?></dt><dd> ! <textarea readonly="readonly" rows="18" cols="75"><?php ! if (false) { ! highlight_string($PHPCode); ! } else { ! echo htmlentities($PHPCode); } ?></textarea></dd><?php } --- 31,86 ---- <dl> <?php ! foreach($Modules as $key => $mod) { ! $id = $mod->getID(); ! $name = $mod->getName(); ! $version = $mod->getVersion(); ! $includes = $mod->getIncludes(); ! $adminbar = $mod->getAdminBar(); ! $navbar = $mod->getNavBar(); ! $author = $mod->getAuthor(); ! $maintainer = $mod->getMaintainer(); ! $dir = $mod->getDir(); ! $XMLCode = '<module id="'.htmlspecialchars($id).'"> ! <name>'.htmlspecialchars($name).'</name> ! <version>'.htmlspecialchars($version).'</version> ! <author>'.htmlspecialchars($author).'</author> ! '; ! if ($maintainer != '') ! $XMLCode .= ' <maintainer>'.htmlspecialchars($maintainer).'</maintainer> ! '; ! if (count($includes) > 0) { ! $XMLCode .= ' <includes> ! '; ! foreach($includes as $inc) { ! $XMLCode .= ' <include>'; ! $XMLCode .= htmlspecialchars($inc); ! $XMLCode .= '</include> ! '; ! } ! } ! ! if ($adminbar != '') ! $XMLCode .= ' <adminbar><![CDATA['.$adminbar.']]></adminbar> ! '; ! if ($navbar != '') ! $XMLCode .= ' <navbar><![CDATA['.$navbar.']]></navbar> ! '; ! '</module>'; ! ! if (isset($_REQUEST['save'])) { ! $save_len = file_put_contents("$fBasePath/$dir/openfirst.info.xml", $XMLCode); ! } ! ?><dt style="font-weight:bold;"><h2><?php echo htmlentities($name); ?></h2><?php ! if (isset($_REQUEST['save'])) { ! echo htmlentities("$save_len / ".strlen($PHPCode)); } + ?></dt><dd> + <textarea class="code xml" readonly="readonly" rows="18" cols="75"><?php + + echo htmlentities($XMLCode); ?></textarea></dd><?php } |
From: Astronouth7303 <ast...@us...> - 2005-05-31 22:17:54
|
Update of /cvsroot/openfirst/awards In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11965/awards Modified Files: openfirst.info.xml Log Message: Seperating dirs from IDs. Index: openfirst.info.xml =================================================================== RCS file: /cvsroot/openfirst/awards/openfirst.info.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** openfirst.info.xml 27 May 2005 16:36:46 -0000 1.4 --- openfirst.info.xml 31 May 2005 22:17:45 -0000 1.5 *************** *** 8,16 **** <!-- Configuration --> - <includes> - <!-- Each one of these is a file --> - <include>foo.php</include> - <include>bar.php</include> - </includes> <!-- Either entities or CDATA can be used. Just make sure it's parsed into the literal HTML. --> <!-- Note the two ways of including BasePath. --> --- 8,11 ---- |
From: Astronouth7303 <ast...@us...> - 2005-05-31 22:17:07
|
Update of /cvsroot/openfirst/base/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11512/includes Modified Files: db_setup.php globals.php modules.php Log Message: Seperating dirs from IDs. Index: db_setup.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/db_setup.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** db_setup.php 26 May 2005 21:00:03 -0000 1.2 --- db_setup.php 31 May 2005 22:16:58 -0000 1.3 *************** *** 25,28 **** --- 25,29 ---- // includes both setup and modification of said tables. require_once('dbase.php'); + require_once('modules.php'); /** Gets an array of tables. *************** *** 39,47 **** */ class Table { ! var $mName; /** Constructor */ ! function Table($Name) { # } --- 40,60 ---- */ class Table { ! var $mName, $mFields, $mRecords; /** Constructor */ ! function Table() { ! $this->mName = ''; ! $this->mFields = array(); ! $this->mRecords = array(); ! } ! ! /*static*/ function createFromXML($tag) { ! if (!(is_object($tag) && is_a($tag, 'xmlElement'))) return false; ! if ($tag->Name != 'TABLE') return false; ! ! } ! ! /*static*/ function createFromDB($Name) { # } Index: globals.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/globals.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** globals.php 27 May 2005 16:33:03 -0000 1.6 --- globals.php 31 May 2005 22:16:58 -0000 1.7 *************** *** 115,121 **** // If the module has requested to be shown on the menu then add it ! if ( (bool) $module->showonmenu == true) { // If it is the current module then color the item ! if ($curmodule == $modulename){ $CurrentModule =& $thisModule; $headers .= " » <a class='menu selected' href='$BasePath/$dir'>".htmlentities($name)."</a> | --- 115,121 ---- // If the module has requested to be shown on the menu then add it ! if ($showonmenu) { // If it is the current module then color the item ! if ($curmodule == $dir){ $CurrentModule =& $thisModule; $headers .= " » <a class='menu selected' href='$BasePath/$dir'>".htmlentities($name)."</a> | Index: modules.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/modules.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** modules.php 27 May 2005 14:36:31 -0000 1.7 --- modules.php 31 May 2005 22:16:58 -0000 1.8 *************** *** 144,147 **** --- 144,161 ---- } + /*** PUBLIC FUNCTIONS ***/ + /*public*/ function prepareTables() { + $mTables =& $this->mTables; + $mDBTag =& $this->mDBTag; + + $mTables = array(); + + foreach($mDBTag->Contents as $tag) { + if (!(is_object($tag) && is_a($tag, 'xmlElement'))) continue; + if ($tag->Name != 'TABLE') continue; + + } + } + /*** PRIVATE FUNCTIONS ***/ /*private*/ function getModuleDTD() { |
From: Astronouth7303 <ast...@us...> - 2005-05-27 16:38:48
|
Update of /cvsroot/openfirst/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30753/modules Modified Files: openfirst.info.xml Log Message: Added $ModPath Index: openfirst.info.xml =================================================================== RCS file: /cvsroot/openfirst/modules/openfirst.info.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** openfirst.info.xml 27 May 2005 14:37:40 -0000 1.2 --- openfirst.info.xml 27 May 2005 16:38:39 -0000 1.3 *************** *** 5,11 **** <navbar><![CDATA[ ! <a href="$basepath/modules/index.php">Show available modules</a> | ! <a href="$basepath/modules/export.php">Export module info</a> | ! <a href="$basepath/modules/info.php">Generate info file</a> ]]></navbar> </module> --- 5,11 ---- <navbar><![CDATA[ ! <a href="$ModPath/index.php">Show available modules</a> | ! <a href="$ModPath/export.php">Export module info</a> | ! <a href="$ModPath/info.php">Generate info file</a> ]]></navbar> </module> |
From: Astronouth7303 <ast...@us...> - 2005-05-27 16:36:56
|
Update of /cvsroot/openfirst/awards In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30356/awards Modified Files: openfirst.info.xml Log Message: Added $ModPath Index: openfirst.info.xml =================================================================== RCS file: /cvsroot/openfirst/awards/openfirst.info.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** openfirst.info.xml 27 May 2005 00:26:14 -0000 1.3 --- openfirst.info.xml 27 May 2005 16:36:46 -0000 1.4 *************** *** 16,23 **** <!-- Note the two ways of including BasePath. --> <navbar><![CDATA[ ! <a href="$BasePath/awards/">View Awards</a> ]]></navbar> <adminbar><![CDATA[ ! <a href="$BasePath/awards/admin/">Manage Awards</a> ]]></adminbar> --- 16,23 ---- <!-- Note the two ways of including BasePath. --> <navbar><![CDATA[ ! <a href="$ModPath/">View Awards</a> ]]></navbar> <adminbar><![CDATA[ ! <a href="$ModPath/admin/">Manage Awards</a> ]]></adminbar> |
From: Astronouth7303 <ast...@us...> - 2005-05-27 16:33:14
|
Update of /cvsroot/openfirst/base/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29550/includes Modified Files: globals.php Added Files: functions.php Log Message: Better Directory support --- NEW FILE: functions.php --- <?php /* * openFIRST.base - includes/functions.php * * Copyright (C) 2003, * openFIRST Project * Original Author: Jamie Bliss <ja...@op...> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ // Purpose: Provide global functions to openFIRST /** Replaces standard vars in config text. * Currently includes $BasePath, $fBasePath, * $StylePath, $fStylePath, $ModPath, and $fModPath. */ function replaceVariables($text, $ModuleDir = false) { if ($ModuleDir === false) { global $CurrentModule; if (is_object($CurrentModule)) $ModuleDir == $CurrentModule->getDir(); } global $BasePath, $fBasePath, $StylePath, $fStylePath; $find = array('$BasePath', '$fBasePath', '$StylePath', '$fStylePath', '$ModPath', '$fModPath' ); $replace = array($BasePath, $fBasePath, $StylePath, $fStylePath, "$BasePath/$ModuleDir", "$fBasePath/$ModuleDir" ); return str_ireplace($find, $replace, $text); } ?> Index: globals.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/globals.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** globals.php 27 May 2005 16:07:51 -0000 1.5 --- globals.php 27 May 2005 16:33:03 -0000 1.6 *************** *** 61,64 **** --- 61,65 ---- unset($configdir); + require_once('functions.php'); require_once('dbase.php'); require_once('auth.php'); *************** *** 123,133 **** // Declare important variables so that headers can pick them up and preview them ! $adminnav = str_ireplace(array('$BasePath', '$StylePath'), ! array($BasePath, $StylePath), ! $adminnavigation)." <a href='http://bugzilla.openfirst.org'>Report Bug</a>"; ! ! $subnav = str_ireplace(array('$BasePath', '$StylePath'), ! array($BasePath, $StylePath), ! $modulenavigation); } else { --- 124,129 ---- // Declare important variables so that headers can pick them up and preview them ! $adminnav = replaceVariables($adminnavigation.' <a href="http://bugzilla.openfirst.org/">Report Bug</a>', $dir); ! $subnav = replaceVariables($modulenavigation, $dir); } else { |
From: Astronouth7303 <ast...@us...> - 2005-05-27 16:08:12
|
Update of /cvsroot/openfirst/base/style In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23844/style Modified Files: headers.php Log Message: Added class liteModule Index: headers.php =================================================================== RCS file: /cvsroot/openfirst/base/style/headers.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** headers.php 26 May 2005 23:26:31 -0000 1.3 --- headers.php 27 May 2005 16:07:51 -0000 1.4 *************** *** 51,56 **** // Check if module name has been set then echo ! if(isset($modulename)){ ! echo "<b>$currentmodulen</b> -"; } --- 51,56 ---- // Check if module name has been set then echo ! if(isset($CurrentModule)){ ! echo '<b>'.htmlentities($CurrentModule->getName()).'</b> – '; } *************** *** 85,89 **** ?> <tr> ! <td id="adminmenu"><b>Admin Options -</b> <?php // Print admin navigation bar --- 85,89 ---- ?> <tr> ! <td id="adminmenu"><b>Admin Options</b> – <?php // Print admin navigation bar |