Browse code

3.5.6 efiction version

Jimako authored on 2024/03/09 16:09:42
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,88 @@
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
+
24
+if(!defined("_CHARSET")) exit( );
25
+	if(!isset($count)) $count = 0;
26
+	$adminlinks = "";
27
+	$tpl->newBlock("seriesblock");
28
+	$tpl->assign("seriesid", $stories['seriesid']);
29
+	$tpl->assign("author", "<a href=\""._BASEDIR."viewuser.php?uid=".$stories['uid']."\">".stripslashes($stories['penname'])."</a>");
30
+	$tpl->assign("title", "<a href=\""._BASEDIR."viewseries.php?seriesid=".$stories['seriesid']."\">".stripslashes($stories['title'])."</a>");
31
+	$tpl->assign("summary", stripslashes($stories['summary']));
32
+	$tpl->assign("score", ratingpics($stories['rating']));
33
+	$tpl->assign("numstories", $stories['numstories']);
34
+	if($reviewsallowed == "1") {
35
+		$tpl->assign("reviews", "<a href=\""._BASEDIR."reviews.php?type=SE&amp;item=".$stories['seriesid']."\">"._REVIEWS."</a>");
36
+		$tpl->assign("numreviews", "<a href=\""._BASEDIR."reviews.php?type=SE&amp;item=".$stories['seriesid']."\">$stories[reviews]</a>");
37
+	}
38
+	$tpl->assign("category", ($stories['catid'] ? catlist($stories['catid']) : _NONE));
39
+	$tpl->assign("characters", $stories['characters'] ? charlist($stories['characters']) : _NONE);
40
+	$allclasslist = "";
41
+	if($stories['classes']) {
42
+		unset($storyclasses);
43
+		foreach(explode(",", $stories['classes']) as $c) {
44
+			$storyclasses[$classlist["$c"]['type']][] = "<a href='browse.php?type=class&amp;type_id=".$classlist["$c"]['type']."&amp;classid=$c'>".$classlist[$c]['name']."</a>";
45
+		}
46
+	}
47
+	foreach($classtypelist as $num => $c) {
48
+		if(isset($storyclasses[$num])) {
49
+			$tpl->assign($c['name'], implode(", ", $storyclasses[$num]));
50
+			$allclasslist .= "<span class='label'>".$c['title'].": </span> ".implode(", ", $storyclasses[$num])."<br />";
51
+		}
52
+		else {
53
+			$tpl->assign($c['name'], _NONE);
54
+			$allclasslist .= "<span class='label'>".$c['title'].": </span> "._NONE."<br />";
55
+		}
56
+	}
57
+	if(!isset($seriesType)) $seriesType = array(_CLOSED, _MODERATED, _OPEN);			
58
+	$tpl->assign("open", $seriesType[$stories['isopen']]);
59
+	$tpl->assign("oddeven", ($count % 2 ? "odd" : "even"));
60
+	$parents = dbquery("SELECT s.title, s.seriesid FROM ".TABLEPREFIX."fanfiction_inseries as i, ".TABLEPREFIX."fanfiction_series as s WHERE s.seriesid = i.seriesid AND i.subseriesid = '".$stories['seriesid']."'");
61
+	$plinks = array( );
62
+	while($p = dbassoc($parents)) {
63
+		$plinks[] = "<a href='"._BASEDIR."viewseries.php?seriesid=".$p['seriesid']."'>".$p['title']."</a>";
64
+	}
65
+	$tpl->assign("parentseries", count($plinks) ? implode(", ", $plinks) : _NONE);
66
+	if(!isset($seriescode)) {
67
+		$seriescode = array( );
68
+		$codequery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_codeblocks WHERE code_type = 'seriesblock'");
69
+		while($code = dbassoc($codequery)) {
70
+			$seriescode[] = $code['code_text'];
71
+		}
72
+	}
73
+	if(count($seriescode)) foreach($seriescode as $c) { eval($c); } 
74
+	$tpl->assign("classifications", $allclasslist);
75
+	if(isMEMBER && $favorites) {
76
+		$addtofaves = "[<a href=\"user.php?action=favse&amp;uid=".USERUID."&amp;add=".$stories['seriesid']."\">"._ADDSERIES2FAVES."</a>]";
77
+		if($stories['isopen'] < 2) {
78
+			$addtofaves .= " [<a href=\"viewuser.php?action=favau&amp;uid=".USERUID."&amp;author=".$stories['uid']."\">"._ADDAUTHOR2FAVES."</a>]";
79
+		}
80
+		$tpl->assign("addtofaves", $addtofaves);
81
+	}
82
+	if((isADMIN && uLEVEL < 4) || (USERUID != 0 && USERUID == $stories['uid'])) {
83
+		$tpl->assign("adminoptions", "<div class=\"adminoptions\"><span class='label'>"._ADMINOPTIONS.":</span> [<a href=\""._BASEDIR."series.php?action=add&amp;add=stories&amp;seriesid=".$stories['seriesid']."\">"._ADD2SERIES."</a>] [<a href=\""._BASEDIR."series.php?action=edit&amp;seriesid=".$stories['seriesid']."\">"._EDIT."</a>] [<a href=\""._BASEDIR."series.php?action=delete&amp;seriesid=".$stories['seriesid']."\">"._DELETE."</a>]".(!empty($adminlinks) ? " ".$adminlinks : "")."</div>");
84
+	}
85
+	else if($stories['isopen'] == 2 && USERUID) $tpl->assign("adminoptions", "[<a href=\""._BASEDIR."series.php?action=add&amp;add=stories&amp;seriesid=".$stories['seriesid']."\">"._ADD2SERIES."</a>] ".(!empty($adminlinks) ? " ".$adminlinks : ""));
86
+	$tpl->assign("reportthis", "[<a href=\""._BASEDIR."contact.php?action=report&amp;url=series.php?seriesid=".$stories['seriesid']."\">"._REPORTTHIS."</a>]");
87
+	$count++;
88
+?>
0 89
\ No newline at end of file