| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,45 @@ |
| 1 |
+<?php |
|
| 2 |
+ |
|
| 3 |
+// ---------------------------------------------------------------------- |
|
| 4 |
+// eFiction 3.2 |
|
| 5 |
+// Copyright (c) 2007 by Tammy Keefer |
|
| 6 |
+// Valid HTML 4.01 Transitional |
|
| 7 |
+// Based on eFiction 1.1 |
|
| 8 |
+// Copyright (C) 2003 by Rebecca Smallwood. |
|
| 9 |
+// http://efiction.sourceforge.net/ |
|
| 10 |
+// ---------------------------------------------------------------------- |
|
| 11 |
+// LICENSE |
|
| 12 |
+// |
|
| 13 |
+// This program is free software; you can redistribute it and/or |
|
| 14 |
+// modify it under the terms of the GNU General Public License (GPL) |
|
| 15 |
+// as published by the Free Software Foundation; either version 2 |
|
| 16 |
+// of the License, or (at your option) any later version. |
|
| 17 |
+// |
|
| 18 |
+// This program is distributed in the hope that it will be useful, |
|
| 19 |
+// but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 20 |
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 21 |
+// GNU General Public License for more details. |
|
| 22 |
+// |
|
| 23 |
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html |
|
| 24 |
+// ---------------------------------------------------------------------- |
|
| 25 |
+ |
|
| 26 |
+if(!defined("_CHARSET")) exit( );
|
|
| 27 |
+ |
|
| 28 |
+ if(isset($_GET['retire']) && preg_match("/^[0-9]+$/", $_GET['retire']))
|
|
| 29 |
+ dbquery("UPDATE ".TABLEPREFIX."fanfiction_stories SET featured = 2 WHERE sid = ".$_GET['retire']);
|
|
| 30 |
+ if(isset($_GET['remove']) && preg_match("/^[0-9]+$/", $_GET['remove']))
|
|
| 31 |
+ dbquery("UPDATE ".TABLEPREFIX."fanfiction_stories SET featured = 0 WHERE sid = ".$_GET['remove']);
|
|
| 32 |
+ if(isset($_GET['feature'])) |
|
| 33 |
+ dbquery("UPDATE ".TABLEPREFIX."fanfiction_stories SET featured = 1 WHERE sid = ".$_GET['feature']);
|
|
| 34 |
+ $fresult = dbquery("SELECT stories.*, stories.title as title, "._PENNAMEFIELD." as penname, stories.updated as updated, stories.date as date FROM "._AUTHORTABLE.", ".TABLEPREFIX."fanfiction_stories as stories WHERE stories.featured > 0 AND stories.uid = "._UIDFIELD." ORDER BY stories.featured");
|
|
| 35 |
+ $output .= "<div id='pagetitle'>"._FEATUREDSTORIES."</div>"; |
|
| 36 |
+ if(!dbnumrows($fresult)) $output .= write_message(_NORESULTS); |
|
| 37 |
+ else {
|
|
| 38 |
+ $output .= "<table class=\"tblborder\" cellpadding=\"5\" style=\"margin: 1em auto;\"><tr><th class=\"tblborder\">"._STORIES."</th><th class=\"tblborder\">"._STATUS."</th><th class=\"tblborder\">"._OPTIONS."</th></tr>"; |
|
| 39 |
+ while($story = dbassoc($fresult)) {
|
|
| 40 |
+ $output .= "<tr><td class=\"tblborder\"><a href=\"viewstory.php?sid=$story[sid]\">$story[title]</a> "._BY." <a href=\"viewuser.php?uid=$story[uid]\">$story[penname]</a></td><td class=\"tblborder\" align=\"center\">".($story['featured'] == 1 ? _ACTIVE : _RETIRED)."</td><td class=\"tblborder\" align=\"center\">".($story['featured'] == 1 ? "<a href=\"admin.php?action=featured&retire=$story[sid]\">"._RETIRE."</a>" : "<a href=\"admin.php?action=featured&feature=$story[sid]\">"._CURRENT."</a>")." | <a href=\"admin.php?action=featured&remove=$story[sid]\">"._REMOVE."</a></td></tr>"; |
|
| 41 |
+ } |
|
| 42 |
+ $output .= "</table>"; |
|
| 43 |
+ $output .= write_message(_FEATUREDNOTE); |
|
| 44 |
+ } |
|
| 45 |
+?> |
|
| 0 | 46 |
\ No newline at end of file |