| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,83 @@ |
| 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 |
+// Page Setup |
|
| 26 |
+$current = "series"; |
|
| 27 |
+ |
|
| 28 |
+$output .= "<div id=\"pagetitle\">"._SERIES.($let ? " - $let" : "")."</div>".build_alphalinks("browse.php?$terms&", $let);
|
|
| 29 |
+ |
|
| 30 |
+if($let) {
|
|
| 31 |
+ $seriesquery .= (empty($seriesquery) ? "" : " AND ").($let == _OTHER ? " series.title REGEXP '^[^a-z]'" : "series.title LIKE '$let%'"); |
|
| 32 |
+} |
|
| 33 |
+ if($searchterm) {
|
|
| 34 |
+ if($searchtype == "title") $scountquery[] = "series.title LIKE '%$searchterm%'"; |
|
| 35 |
+ if($searchtype == "summary") $scountquery[] = "series.summary LIKE '%$searchterm%'"; |
|
| 36 |
+ if(!empty($authorlist)) $scountquery[] = "FIND_IN_SET(series.uid, '".implode(",",$authorlist)."') > 0";
|
|
| 37 |
+ if($searchtype == "advanced" || !$searchtype) $scountquery[] = "(summary LIKE '%$searchterm%' OR title LIKE '%$searchterm%') "; |
|
| 38 |
+ } |
|
| 39 |
+ if(isset($_REQUEST['authors'])) $scountquery[] = "FIND_IN_SET(series.uid, '".implode(",",$searchVars['authors'])."') > 0";
|
|
| 40 |
+ foreach($categories as $cat) {
|
|
| 41 |
+ $catseries[] = "FIND_IN_SET($cat, series.catid) > 0 "; |
|
| 42 |
+ } |
|
| 43 |
+ // Now implode the SQL list |
|
| 44 |
+ if(!empty($catstories)) {
|
|
| 45 |
+ $scountquery[] = "(".implode(" OR ", $catseries).")";
|
|
| 46 |
+ } |
|
| 47 |
+ if($charid) {
|
|
| 48 |
+ foreach($charid as $c) {
|
|
| 49 |
+ if(empty($c)) continue; |
|
| 50 |
+ $charseries[] = "FIND_IN_SET($c, series.characters) > 0 "; |
|
| 51 |
+ } |
|
| 52 |
+ if(!empty($charseries)) {
|
|
| 53 |
+ $scountquery[] = "(".implode(" OR ", $charseries).")";
|
|
| 54 |
+ } |
|
| 55 |
+ } |
|
| 56 |
+ if($classin) {
|
|
| 57 |
+ foreach($classin as $class) {
|
|
| 58 |
+ if(empty($class)) continue; |
|
| 59 |
+ $scountquery[] = "FIND_IN_SET($class, series.classes) > 0"; |
|
| 60 |
+ } |
|
| 61 |
+ } |
|
| 62 |
+ if($classex) {
|
|
| 63 |
+ foreach($classex as $class) {
|
|
| 64 |
+ $scountquery[] = "FIND_IN_SET($class, series.classes) = 0"; |
|
| 65 |
+ } |
|
| 66 |
+ } |
|
| 67 |
+ |
|
| 68 |
+$count = dbquery(_SERIESCOUNT.(!empty($seriesquery) ? " WHERE ".$seriesquery : "")); |
|
| 69 |
+$query = _SERIESQUERY.(!empty($seriesquery) ? " AND ".$seriesquery : "")." ORDER BY series.title LIMIT $offset, $itemsperpage"; |
|
| 70 |
+list($numrows)= dbrow($count); |
|
| 71 |
+$sresult = dbquery($query); |
|
| 72 |
+$count = 0; |
|
| 73 |
+$tpl->newBlock("listings");
|
|
| 74 |
+while($stories = dbassoc($sresult)) { include("includes/seriesblock.php"); }
|
|
| 75 |
+$tpl->gotoBlock("listings");
|
|
| 76 |
+if($numrows > $itemsperpage) $tpl->assign("pagelinks", build_pagelinks("browse.php?$terms&", $numrows, $offset));
|
|
| 77 |
+$tpl->gotoBlock("_ROOT");
|
|
| 78 |
+if(!$numrows) {
|
|
| 79 |
+ $tpl->gotoBlock("_ROOT");
|
|
| 80 |
+ $output .= write_message(_NORESULTS); |
|
| 81 |
+} |
|
| 82 |
+$disablesorts = array("ratings", "sorts", "complete");
|
|
| 83 |
+?> |
|
| 0 | 84 |
\ No newline at end of file |