| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,73 @@ |
| 1 |
+<?php |
|
| 2 |
+// ---------------------------------------------------------------------- |
|
| 3 |
+// Copyright (c) 2007 by Tammy Keefer |
|
| 4 |
+// Valid HTML 4.01 Transitional |
|
| 5 |
+// Based on eFiction 1.1 |
|
| 6 |
+// Copyright (C) 2003 by Rebecca Smallwood. |
|
| 7 |
+// http://efiction.sourceforge.net/ |
|
| 8 |
+// ---------------------------------------------------------------------- |
|
| 9 |
+// LICENSE |
|
| 10 |
+// |
|
| 11 |
+// This program is free software; you can redistribute it and/or |
|
| 12 |
+// modify it under the terms of the GNU General Public License (GPL) |
|
| 13 |
+// as published by the Free Software Foundation; either version 2 |
|
| 14 |
+// of the License, or (at your option) any later version. |
|
| 15 |
+// |
|
| 16 |
+// This program is distributed in the hope that it will be useful, |
|
| 17 |
+// but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 18 |
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 19 |
+// GNU General Public License for more details. |
|
| 20 |
+// |
|
| 21 |
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html |
|
| 22 |
+// ---------------------------------------------------------------------- |
|
| 23 |
+if(!defined("_CHARSET")) exit( );
|
|
| 24 |
+ |
|
| 25 |
+$current = "characters"; |
|
| 26 |
+$charid = isset($_GET['charid']) && isNumber($_GET['charid']) ? $_GET['charid'] : 0; |
|
| 27 |
+ |
|
| 28 |
+if($charid > 0) {
|
|
| 29 |
+ $charquery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_characters WHERE charid = '$charid' LIMIT 1");
|
|
| 30 |
+ $char = dbassoc($charquery); |
|
| 31 |
+ $output = "<div id='pagetitle'>".stripslashes($char['charname'])."</div>\n<div id='story'>".format_story($char['bio'])."</div>"; |
|
| 32 |
+ $numrows = search(_STORYQUERY.$storyquery._ORDERBY, _STORYCOUNT.$countquery, "browse.php?"); |
|
| 33 |
+} |
|
| 34 |
+else {
|
|
| 35 |
+ $output .= "<div id=\"pagetitle\">"._CHARACTERS.($let ? " - $let" : "")."</div>".build_alphalinks("browse.php?$terms&", $let);
|
|
| 36 |
+ |
|
| 37 |
+ if($let == _OTHER) $query = " charname REGEXP '^[^a-z]'"; |
|
| 38 |
+ else if($let) $query = " charname LIKE '$let%'"; |
|
| 39 |
+ else $query = ""; |
|
| 40 |
+ |
|
| 41 |
+ $charquery = "SELECT * FROM ".TABLEPREFIX."fanfiction_characters".($query ? " WHERE $query" : ""); |
|
| 42 |
+ $countquery = "SELECT count(charid) FROM ".TABLEPREFIX."fanfiction_characters".($query ? " WHERE $query" : ""); |
|
| 43 |
+ $charid = 0; |
|
| 44 |
+ $count = dbquery($countquery); |
|
| 45 |
+ list($numrows)= dbrow($count); |
|
| 46 |
+ $limit = $itemsperpage * $displaycolumns; |
|
| 47 |
+ $total = ($numrows > $limit ? $limit : $numrows); |
|
| 48 |
+ $list = floor($total / $displaycolumns); |
|
| 49 |
+ if($total % $displaycolumns != 0) $list++; |
|
| 50 |
+ $colwidth = (100/ $displaycolumns) -1; |
|
| 51 |
+ $count = 0; |
|
| 52 |
+ $column = 1; |
|
| 53 |
+ $result2 = dbquery($charquery." ORDER BY charname LIMIT $offset,$limit"); |
|
| 54 |
+ $output .= "<div id=\"columncontainer\"><div id=\"browseblock\">".($displaycolumns ? "<div class=\"column\">" : ""); |
|
| 55 |
+ while($char = dbassoc($result2)) {
|
|
| 56 |
+ $count++; |
|
| 57 |
+ $output .= "<a href=\"browse.php?type=characters&charid=$char[charid]\">".stripslashes($char['charname'])."</a><br />"; |
|
| 58 |
+ if( $count >= $list && $column != $displaycolumns) {
|
|
| 59 |
+ $output .= "</div><div class=\"column\">"; |
|
| 60 |
+ if($total % $displaycolumns == $column) $list--; |
|
| 61 |
+ $column++; |
|
| 62 |
+ $count = 0; |
|
| 63 |
+ } |
|
| 64 |
+ } |
|
| 65 |
+ $output .= "</div>".($displaycolumns ? "</div>" : "")."<div class='cleaner'> </div></div>"; |
|
| 66 |
+ if ($numrows > $limit) {
|
|
| 67 |
+ $output .= build_pagelinks("browse.php?type=characters".($let ? "&let=$let" : "")."&", $numrows, $offset, $displaycolumns);
|
|
| 68 |
+ } |
|
| 69 |
+ else if(!$numrows) $output .= write_message(_NORESULTS); |
|
| 70 |
+ $numrows = 0; |
|
| 71 |
+} |
|
| 72 |
+ if($charid > 0) $charlist1 = $charid; |
|
| 73 |
+?> |
|
| 0 | 74 |
\ No newline at end of file |