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,119 @@
1
+<?php
2
+// ----------------------------------------------------------------------
3
+// Copyright (c) 2007 by Tammy Keefer
4
+// Based on eFiction 1.1
5
+// Copyright (C) 2003 by Rebecca Smallwood.
6
+// http://efiction.sourceforge.net/
7
+// ----------------------------------------------------------------------
8
+// LICENSE
9
+//
10
+// This program is free software; you can redistribute it and/or
11
+// modify it under the terms of the GNU General Public License (GPL)
12
+// as published by the Free Software Foundation; either version 2
13
+// of the License, or (at your option) any later version.
14
+//
15
+// This program is distributed in the hope that it will be useful,
16
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+// GNU General Public License for more details.
19
+//
20
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
21
+// ----------------------------------------------------------------------
22
+if(!defined("_CHARSET")) exit( );
23
+
24
+		$output = "<div id=\"pagetitle\">".$panel['panel_title']."</div>";
25
+		$where = false;
26
+	switch($list) {
27
+		case "popskins":
28
+			$result = dbquery("SELECT userskin, COUNT(userskin) as count FROM ".TABLEPREFIX."fanfiction_authorprefs GROUP BY userskin ORDER BY count DESC");
29
+			$count = 1;
30
+			while($popskin = dbassoc($result)) {
31
+				$output .= "$count. ".$popskin['userskin']."<br />";
32
+				$count++;
33
+			}
34
+			break;
35
+		case "favauthors":
36
+			$result = dbquery("SELECT count( fav.item ) AS count, "._UIDFIELD." as uid, "._PENNAMEFIELD." as penname FROM ".TABLEPREFIX."fanfiction_favorites AS fav, "._AUTHORTABLE." WHERE fav.item = "._UIDFIELD." AND fav.type = 'AU' GROUP  BY fav.item ORDER  BY count DESC LIMIT 10");
37
+			if(dbnumrows($result) == 0) $output .= write_message(_NORESULTS);
38
+			$count = 1;
39
+			while($author = dbassoc($result)) {
40
+				$output .= "$count. <a href=\"viewuser.php?uid=".$author['uid']."\">".$author['penname']."</a> [".$author['count']."]<br /> ";
41
+				$count++;
42
+			}
43
+			break;
44
+		case "favstories":
45
+			$result = dbquery("SELECT count( fav.item ) AS count, stories.*, "._PENNAMEFIELD." as penname, stories.date as date, stories.updated as updated FROM ".TABLEPREFIX."fanfiction_favorites AS fav, "._AUTHORTABLE.", ".TABLEPREFIX."fanfiction_stories as stories WHERE stories.uid = "._UIDFIELD." AND stories.validated > 0 AND fav.item = stories.sid AND fav.type = 'ST' GROUP  BY stories.sid ORDER  BY count DESC LIMIT 10");
46
+			if(dbnumrows($result) == 0) $output .= write_message(_NORESULTS);
47
+			$tpl->newBlock("listings");
48
+			while($stories = dbassoc($result)) { 
49
+				$tpl->newblock("storyblock");
50
+				include("includes/storyblock.php"); 
51
+			}
52
+			break;
53
+		case "favseries" :
54
+			$result = dbquery("SELECT count(fav.item) AS count, series.*,  "._PENNAMEFIELD." as penname FROM (".TABLEPREFIX."fanfiction_series AS series, ".TABLEPREFIX."fanfiction_favorites as fav, "._AUTHORTABLE.") WHERE series.uid = "._UIDFIELD." AND fav.item = series.seriesid AND fav.type = 'SE' GROUP BY series.seriesid ORDER BY count DESC LIMIT 10");
55
+			if(dbnumrows($result) == 0) $output .= write_message(_NORESULTS);
56
+			$tpl->newBlock("listings");
57
+			while($stories = dbassoc($result)) { include("includes/seriesblock.php"); }
58
+			break;
59
+		case "largeseries":
60
+			$result = dbquery("SELECT count(inorder.seriesid) AS count, sub.*,  "._PENNAMEFIELD." as penname FROM ".TABLEPREFIX."fanfiction_series AS sub, ".TABLEPREFIX."fanfiction_inseries as inorder, "._AUTHORTABLE." WHERE sub.uid = "._UIDFIELD." AND inorder.seriesid = sub.seriesid GROUP BY sub.seriesid ORDER BY count DESC LIMIT 10");
61
+			if(dbnumrows($result) == 0) $output .= write_message(_NORESULTS);
62
+			$tpl->newBlock("listings");
63
+			while($stories = dbassoc($result)) { include("includes/seriesblock.php"); }
64
+			break;
65
+		case "smallseries":
66
+			$result = dbquery("SELECT count(inorder.seriesid) AS count, sub.*,  "._PENNAMEFIELD." as penname FROM ".TABLEPREFIX."fanfiction_series AS sub, ".TABLEPREFIX."fanfiction_inseries as inorder, "._AUTHORTABLE." WHERE sub.uid = "._UIDFIELD." AND inorder.seriesid = sub.seriesid GROUP BY sub.seriesid ORDER BY count LIMIT 10");
67
+			if(dbnumrows($result) == 0) $output .= write_message(_NORESULTS);
68
+			$tpl->newBlock("listings");
69
+			while($stories = dbassoc($result)) { include("includes/seriesblock.php"); }
70
+			break;
71
+		case "reviewedseries":
72
+			$result = dbquery("SELECT series.*,  "._PENNAMEFIELD." as penname FROM ".TABLEPREFIX."fanfiction_series AS series, "._AUTHORTABLE." WHERE series.uid = "._UIDFIELD." ORDER BY series.reviews DESC LIMIT 10");
73
+			if(dbnumrows($result) == 0) $output .= write_message(_NORESULTS);
74
+			$tpl->newBlock("listings");
75
+			while($stories = dbassoc($result)) { include("includes/seriesblock.php"); }
76
+			break;
77
+		case "prolificauthors":
78
+			$result = dbquery("SELECT ap.stories AS count, "._PENNAMEFIELD." as penname , "._UIDFIELD." as uid FROM ".TABLEPREFIX."fanfiction_authorprefs as ap LEFT JOIN "._AUTHORTABLE." ON ap.uid = "._UIDFIELD." ORDER BY count DESC LIMIT 10");
79
+			if(dbnumrows($result) == 0) $output .= write_message(_NORESULTS);
80
+			$count = 1;
81
+			while($author = dbassoc($result)) {
82
+				$output .= "$count. <a href=\"viewuser.php?uid=".$author['uid']."\">".$author['penname']."</a> [".$author['count']."]<br /> ";
83
+				$count++;
84
+			}
85
+			break;	
86
+		case "prolificreviewers":
87
+			$result = dbquery("SELECT count(reviews.uid) AS count, "._PENNAMEFIELD." as penname , "._UIDFIELD." as uid FROM ".TABLEPREFIX."fanfiction_reviews as reviews, "._AUTHORTABLE." WHERE reviews.uid = "._UIDFIELD." AND reviews.review != 'No Review' GROUP BY reviews.uid ORDER BY count DESC LIMIT 10");
88
+			if(dbnumrows($result) == 0) $output .= write_message(_NORESULTS);
89
+			$count = 1;
90
+			while($author = dbassoc($result)) {
91
+				$output .= "$count. <a href=\"viewuser.php?uid=".$author['uid']."\">".$author['penname']."</a> [".$author['count']."]<br /> ";
92
+				$count++;
93
+			}
94
+			break;
95
+		case "shortstories":
96
+			$where = "ORDER BY stories.wordcount ASC";
97
+			break;
98
+		case "longstories":
99
+			$where = "ORDER BY stories.wordcount DESC";
100
+			break;
101
+		case "reviewedstories":
102
+			$where = "AND stories.reviews > 0 ORDER BY stories.reviews DESC";
103
+			break;
104
+		case "readstories":
105
+			$where = "ORDER BY stories.count DESC";
106
+			break;
107
+	}
108
+	if($where) {
109
+		$result2 = dbquery(_STORYQUERY." $where LIMIT 10");
110
+		if(dbnumrows($result2) == 0) $output .= "</div>".write_message(_NORESULTS);
111
+		$tpl->newBlock("listings");
112
+
113
+		while($stories = dbassoc($result2)) { 
114
+			$tpl->newBlock("storyblock");
115
+			include("includes/storyblock.php"); 
116
+		}
117
+	}
118
+	$tpl->gotoBlock( "_ROOT" );
119
+?>
0 120
\ No newline at end of file