Thread: [Openfirst-cvscommit] news/admin index.php,1.11,1.12
Brought to you by:
xtimg
From: <xt...@us...> - 2003-10-06 22:24:45
|
Update of /cvsroot/openfirst/news/admin In directory sc8-pr-cvs1:/tmp/cvs-serv1983 Modified Files: index.php Log Message: Revert index file back to proper news admin index file Index: index.php =================================================================== RCS file: /cvsroot/openfirst/news/admin/index.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** index.php 6 Oct 2003 22:11:33 -0000 1.11 --- index.php 6 Oct 2003 22:24:39 -0000 1.12 *************** *** 1,9 **** <?php /* ! * openFIRST.downloads - admin/index.php * * Copyright (C) 2003, * openFIRST Project ! * Original Author: Greg Inozemtsev <gr...@si...> * * This program is free software; you can redistribute it and/or modify --- 1,9 ---- <?php /* ! * openFIRST.news - admin/index.php * * Copyright (C) 2003, * openFIRST Project ! * Original Author: Tim Ginn <tim...@sy...> * * This program is free software; you can redistribute it and/or modify *************** *** 29,153 **** include($header); ! echo("<h1>Category Editor</h1>"); if(isset($user->membertype)){ if($user->membertype == "administrator") { ! if(!(isset($_POST["cat"])||isset($_POST["newcat"]))) { ! $query = ofirst_dbquery("SELECT * FROM ofirst_downloadcat ORDER BY Category"); ! if(ofirst_dbnum_rows($query)!=0){ ! echo("<table width=300><tr><th>Delete Category</th></tr>"); ! echo('<tr><td align=center><form method="post" action="index.php"><select style="width:250px" name=cat size=4>'); ! while($cat = ofirst_dbfetch_object($query)){ ! echo("<option>".$cat->Category.'</option>'); ! } ! echo("</select><br><input type=submit value=Delete></form></td></tr></table><br><br>"); ! } ?> ! <form method=post action=index.php><table width=300> ! <tr><th colspan=2>New Category</th></tr> ! <tr><td><div align=right>Title:</div></td> ! <td><input name=newcat></tr> ! <tr><td><div align=right>Icon:</div></td> ! <td><select name=newicon> ! <option value=members/icons/filesystems/folder.png>Standard Sub Directory</option> ! <option value=members/icons/filesystems/folder_green.png>Green Sub Directory</option> ! <option value=members/icons/filesystems/folder_red.png>Red Sub Directory</option> ! <option value=members/icons/filesystems/folder_orange.png>Orange Sub Directory</option> ! <option value=members/icons/filesystems/folder_yellow.png>Yellow Sub Directory</option> ! <option value=members/icons/filesystems/folder_grey.png>Grey Sub Directory</option> ! <option value=members/icons/filesystems/folder_violet.png>Violet Sub Directory</option> ! <option value=members/icons/filesystems/trashcan_full.png>Junk Sub Directory</option> ! <option value=members/icons/filesystems/favorites.png>Favorites Sub Directory</option> ! <option value=members/icons/filesystems/folder_cool.png>Smiley Sub Directory</option> ! <option value=members/icons/filesystems/folder_penguin.png>Penguin-ified Sub Directory</option> ! <option value=members/icons/filesystems/folder_cd.png>CD-ROM Sub Directory</option> ! <option value=members/icons/filesystems/folder_home.png>Home Sub Directory</option> ! <option value=members/icons/filesystems/folder_html.png>Web Sub Directory</option> ! <option value=members/icons/filesystems/folder_image.png>Image Sub Directory</option> ! <option value=members/icons/filesystems/folder_important.png>Important Sub Directory</option> ! <option value=members/icons/filesystems/folder_man.png>Documentation Sub Directory</option> ! <option value=members/icons/filesystems/folder_midi.png>Midi Sub Directory</option> ! <option value=members/icons/filesystems/folder_sound.png>Audio Sub Directory</option> ! <option value=members/icons/filesystems/folder_tar.png>Archive Sub Directory</option> ! <option value=members/icons/filesystems/folder_video.png>Video Sub Directory</option> ! <option value=members/icons/filesystems/network_local.png>Network Sub Directory</option> ! <option value=members/icons/filesystems/folder_txt.png>Text Documents Directory</option> ! <option value=members/icons/filesystems/folder_wordprocessing.png>Word Processing Directory</option> ! </select><br>(or) <input name=customicon></td></tr> ! <tr><td><div align=right>Description:</div></td> ! <td><input name=newdesc></tr> ! <tr><td colspan=2 align=center><input type=submit value=Create></td></tr> ! </td></tr></table></form> <?php ! } ! else { ! // Action ! $nodelete=false; ! if(isset($_POST["cat"])){ ! if(!isset($_POST["conflictaction"])){ ! $query=ofirst_dbquery("SELECT ID FROM ofirst_downloads WHERE Category='".$_POST["cat"]."';"); ! if(ofirst_dbnum_rows($query)!=0){ ! //there are still files ! $nodelete=true; ?> ! ! <table width=500><tr><th>Conflict</th></tr><tr><td align=left><form method=post action=index.php><input name=cat type=hidden value="<?php echo($_POST["cat"]); ?>"> ! <div>There are still files left in the category you are deleting. What would you like to do?</div><br> ! <input type=radio checked value=delete name=conflictaction>Delete Files</input><br> ! <input type=radio value=move name=conflictaction>Move Files to</input> <select name=movecat> ! <option value="">(none)</option> <?php ! $q = ofirst_dbquery("SELECT * FROM ofirst_downloadcat ORDER BY Category"); ! if(ofirst_dbnum_rows($q)!=0){ ! while($cat = ofirst_dbfetch_object($q)){ ! if($_POST["cat"]!=$cat->Category){ ! echo("<option>".$cat->Category.'</option>'); ! } ! } } ! ?></select><br> ! <input type=radio value=leave name=conflictaction>Leave as is (not recommended)<br>Note: If this option is selected, the files will not be accessible unless a category with the same name is created.</input><br><input type=submit value=OK> ! </form></td></tr></table> ! <?php ! } ! } ! else { ! switch($_POST["conflictaction"]){ ! case "delete": { ! ofirst_dbquery("DELETE FROM ofirst_downloads WHERE Category='".$_POST["cat"]."';"); ! break; ! } ! case "move": { ! ofirst_dbquery("UPDATE ofirst_downloads SET Category='".$_POST["movecat"]."' WHERE Category='".$_POST["cat"]."';"); ! break; ! } ! default: { ! break; ! } ! } ! } ! if(!$nodelete){ ! ofirst_dbquery("DELETE FROM ofirst_downloadcat WHERE Category='".$_POST["cat"]."';"); ! echo("Category " . $_POST["cat"] . " has been deleted. [ <a href='../index.php'>Main</a> ]"); ! } ! } ! else { ! if(isset($_POST["newcat"])){ ! if($_POST["customicon"]!=""){ ! $icon=$_POST["customicon"]; ! } ! else { ! $icon=$_POST["newicon"]; ! } ! ofirst_dbquery("INSERT INTO ofirst_downloadcat (Category, Description, Icon) VALUES ('" . $_POST["newcat"] . "', '" . $_POST["newdesc"] . "', '" .$icon. "');"); ! echo("Category " . $_POST["newcat"] . " has been created. [ <a href='../index.php'>Main</a> ]"); ! } ! } ! } } } ! else { ! echo("You must be logged on as an administrative user to edit categories."); } include($footer); --- 29,100 ---- include($header); ! echo("<h1>Add News</h1>"); if(isset($user->membertype)){ if($user->membertype == "administrator") { ! if(! isset($_POST["news"])) { ! // Display a form for news. ?> ! <form name="NewsForm" id="NewsForm" method="post" action="index.php"> ! <p><br /> ! <br /> ! </p> ! <table width="618" align="center"> ! <tr> ! <th> </th> ! <th>Add News</th> ! </tr> ! <tr> ! <td><div align="right">Headline:</div></td> ! <td><input name="title" type="text" value="openFIRST News" style="width: 250px;"></td> ! </tr> ! <tr> ! <td width="156"><div align="right">Image:</div></td> ! <td width="332"> <input type="text" name="image" value="<?php echo $basepath . "/images/openfirst.png"; ?>" ! style="width: 250px;"> </td> ! </tr> ! <tr> ! <td valign="top"> ! <div align="right">Descriptions</div></td> ! <td> <?php ! $dhtml=function_exists("make_wysiwyg"); ! if($dhtml){ ! make_wysiwyg("news", 500, 300, "Insert your news here."); ! } ! else{ ! echo('<textarea name="news" cols="60" rows="20">Insert your news here.</textarea>'); ! } ?> ! </td> ! </tr> ! <tr> ! <td> </td> ! <td> <?php ! if($dhtml){ ! echo('<input name="news2" type="button" id="news" value="Add News Item" onclick="dhtmlEditorPrepareSubmit(); document.NewsForm.submit();" />'); } ! else { ! echo('<input name="news2" type="submit" id="news" value="Add News Item" />'); ! } ! ?> ! <input name="reset" type="reset" value="Clear News Item" /> </td> ! </tr> ! </table> ! <p> </p> ! </form> <?php ! } else { ! // Add the news. ! $now = date("D M j G:i:s T Y"); ! ! $query = ofirst_dbquery("INSERT INTO ofirst_news (date, poster, title, news, image) VALUES ('$now', '$user->user', '" . $_POST["title"] . "', '" . $_POST["news"] . "', '" . $_POST["image"] . "');"); ! ! echo("The news item " . $_POST["title"] . " has been added. [ <a href='../index.php'>Main</a> ]"); } } ! } else { ! echo("You must be logged on as an administrative user to add news."); } include($footer); |