Browse code

reductant files

Jimako authored on 2024/04/14 11:39:13
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,87 +0,0 @@
1
-<?php
2
-// ----------------------------------------------------------------------
3
-// Copyright (c) 2007 by Tammy Keefer
4
-// Also Like Module developed for eFiction 3.0
5
-// // http://efiction.hugosnebula.com/
6
-// ----------------------------------------------------------------------
7
-// LICENSE
8
-//
9
-// This program is free software; you can redistribute it and/or
10
-// modify it under the terms of the GNU General Public License (GPL)
11
-// as published by the Free Software Foundation; either version 2
12
-// of the License, or (at your option) any later version.
13
-//
14
-// This program is distributed in the hope that it will be useful,
15
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
16
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
-// GNU General Public License for more details.
18
-//
19
-// To read the license please visit http://www.gnu.org/copyleft/gpl.html
20
-// ----------------------------------------------------------------------
21
-
22
-if(!defined("_CHARSET")) exit( );
23
-if(file_exists(_BASEDIR."modules/storyend/languages/{$language}.php")) include_once(_BASEDIR."modules/storyend/languages/{$language}.php");
24
-else include_once(_BASEDIR."modules/storyend/languages/en.php");
25
-
26
-if(file_exists("./$skindir/storyend.tpl")) $storyend = new TemplatePower("./$skindir/storyend.tpl");
27
-else $storyend = new TemplatePower("./modules/storyend/default_tpls/storyend.tpl");
28
-$storyend->prepare( );
29
-$storyend->assign("theend", !empty($storyinfo['completed']) ? _THEEND : _THEENDMAYBE);
30
-
31
-$authors[] = $storyinfo['uid'];
32
-if(!empty($storyinfo['coauthors'])) {
33
-	$coauth = dbquery("SELECT uid FROM ".TABLEPREFIX."fanfiction_coauthors WHERE sid = '".$storyinfo['sid']."'");
34
-	while($c = dbassoc($coauth)) {
35
-		$authors[] = $c['uid'];
36
-	}
37
-}
38
-if(count($authors) > 1) $cond = "FIND_IN_SET(ap.uid, '".implode(",", $authors)."') > 0";
39
-else $cond = "ap.uid = '".$authors[0]."'";
40
-$aquery = dbquery("SELECT "._PENNAMEFIELD." as penname, ap.uid, ap.stories FROM "._AUTHORTABLE." LEFT JOIN ".TABLEPREFIX."fanfiction_authorprefs AS ap on "._UIDFIELD." = ap.uid WHERE $cond");
41
-while($a2 = dbassoc($aquery)) {
42
-	$alist[] = sprintf(_AUTHORCOUNT, "<a href='viewuser.php?uid=".$a2['uid']."'>".$a2['penname']."</a>", ($a2['stories'] - 1));
43
-}
44
-$storyend->assign("authorcount", implode("<br />", $alist));
45
-$favquery = dbquery("SELECT uid FROM ".TABLEPREFIX."fanfiction_favorites WHERE item = '".$storyinfo['sid']."' AND type = 'ST'");
46
-$favcount = dbnumrows($favquery);
47
-$authlist = array( );
48
-if($favcount > 0) {
49
-	while($favau = dbassoc($favquery)) {
50
-		$authlist[] = $favau['uid'];
51
-	}
52
-	$authlist = implode(",", $authlist);
53
-	$storyend->assign("favof", sprintf(_SE_FAVOF, $favcount));
54
-	$other = dbquery("SELECT item FROM ".TABLEPREFIX."fanfiction_favorites WHERE type = 'ST' AND FIND_IN_SET(uid, '$authlist') > 0 AND item != '".$storyinfo['sid']."' GROUP BY item");
55
-	$othercount = dbnumrows($other);
56
-	$storyend->assign("alsolike", sprintf(_SE_ALSOLIKE, title_link($storyinfo), $storyinfo['sid'], $othercount));
57
-}
58
-/*
59
-// If we've got series links for this story, let's give them links to the previous and next stories in the series.
60
-$seriesquery = "SELECT series.title, series.seriesid, list.inorder FROM ".TABLEPREFIX."fanfiction_inseries as list, ".TABLEPREFIX."fanfiction_series as series WHERE list.sid = '".$storyinfo['sid']."' AND series.seriesid = list.seriesid";
61
-$seriesresults = dbquery($seriesquery);
62
-$seSeries = array( );
63
- while($series = dbassoc($seriesresults)) {
64
-	$thisSeries = sprintf(_SE_INSERIES, "<a href='"._BASEDIR."viewseries.php?seriesid=".$series['seriesid']."'>".stripslashes($series['title'])."</a>");
65
-	$others = dbquery("SELECT subseriesid, sid, inorder FROM ".TABLEPREFIX."fanfiction_inseries WHERE seriesid = '".$series['seriesid']."' AND confirmed = 1 AND (inorder = ".($series['inorder'] - 1)." OR inorder = ".($series['inorder'] + 1).")"); 
66
- 	while($o = dbassoc($others)) {
67
-		unset($story, $sub);
68
-		if(!empty($o['sid'])) $story = dbassoc(dbquery(_STORYQUERY." AND sid = ".$o['sid']." LIMIT 1"));
69
-		elseif(!empty($o['subseriesid'])) $sub = dbassoc(dbquery(_SERIESQUERY." AND seriesid = ".$o['seriesid']));
70
-		
71
-		if($o['inorder'] < $series['inorder']) {
72
-			if($story) $thisSeries .= " ".sprintf(_SE_SERIES_PREVST, title_link($story));
73
-			elseif($sub) $thisSeries .= " ".sprintf(_SE_SERIES_PREVSE, "<a href='"._BASEDIR."viewseries.php?seriesid=".$sub['seriesid']."'>".stripslashes($sub['title'])."</a>");
74
-		}
75
-		elseif ($o['inorder'] > $series['inorder']) {
76
-			if($story) $thisSeries .= " ".sprintf(_SE_SERIES_NEXTST, title_link($story));
77
-			elseif($sub) $thisSeries .= " ".sprintf(_SE_SERIES_NEXTSE, "<a href='"._BASEDIR."viewseries.php?seriesid=".$sub['seriesid']."'>".stripslashes($sub['title'])."</a>");
78
-		}
79
-		
80
-	}  
81
-	$seSeries[] = $thisSeries;
82
-}
83
-if(count($seSeries) > 0) $storyend->assign("seriesinfo", implode("<br />", $seSeries));
84
-*/
85
-$tpl->assign("storyend", $storyend->getOutputContent( ));
86
-
87
-?>
88 0
\ No newline at end of file
Browse code

backup

Jimako authored on 2024/04/13 04:14:24
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,87 @@
1
+<?php
2
+// ----------------------------------------------------------------------
3
+// Copyright (c) 2007 by Tammy Keefer
4
+// Also Like Module developed for eFiction 3.0
5
+// // http://efiction.hugosnebula.com/
6
+// ----------------------------------------------------------------------
7
+// LICENSE
8
+//
9
+// This program is free software; you can redistribute it and/or
10
+// modify it under the terms of the GNU General Public License (GPL)
11
+// as published by the Free Software Foundation; either version 2
12
+// of the License, or (at your option) any later version.
13
+//
14
+// This program is distributed in the hope that it will be useful,
15
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
+// GNU General Public License for more details.
18
+//
19
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
20
+// ----------------------------------------------------------------------
21
+
22
+if(!defined("_CHARSET")) exit( );
23
+if(file_exists(_BASEDIR."modules/storyend/languages/{$language}.php")) include_once(_BASEDIR."modules/storyend/languages/{$language}.php");
24
+else include_once(_BASEDIR."modules/storyend/languages/en.php");
25
+
26
+if(file_exists("./$skindir/storyend.tpl")) $storyend = new TemplatePower("./$skindir/storyend.tpl");
27
+else $storyend = new TemplatePower("./modules/storyend/default_tpls/storyend.tpl");
28
+$storyend->prepare( );
29
+$storyend->assign("theend", !empty($storyinfo['completed']) ? _THEEND : _THEENDMAYBE);
30
+
31
+$authors[] = $storyinfo['uid'];
32
+if(!empty($storyinfo['coauthors'])) {
33
+	$coauth = dbquery("SELECT uid FROM ".TABLEPREFIX."fanfiction_coauthors WHERE sid = '".$storyinfo['sid']."'");
34
+	while($c = dbassoc($coauth)) {
35
+		$authors[] = $c['uid'];
36
+	}
37
+}
38
+if(count($authors) > 1) $cond = "FIND_IN_SET(ap.uid, '".implode(",", $authors)."') > 0";
39
+else $cond = "ap.uid = '".$authors[0]."'";
40
+$aquery = dbquery("SELECT "._PENNAMEFIELD." as penname, ap.uid, ap.stories FROM "._AUTHORTABLE." LEFT JOIN ".TABLEPREFIX."fanfiction_authorprefs AS ap on "._UIDFIELD." = ap.uid WHERE $cond");
41
+while($a2 = dbassoc($aquery)) {
42
+	$alist[] = sprintf(_AUTHORCOUNT, "<a href='viewuser.php?uid=".$a2['uid']."'>".$a2['penname']."</a>", ($a2['stories'] - 1));
43
+}
44
+$storyend->assign("authorcount", implode("<br />", $alist));
45
+$favquery = dbquery("SELECT uid FROM ".TABLEPREFIX."fanfiction_favorites WHERE item = '".$storyinfo['sid']."' AND type = 'ST'");
46
+$favcount = dbnumrows($favquery);
47
+$authlist = array( );
48
+if($favcount > 0) {
49
+	while($favau = dbassoc($favquery)) {
50
+		$authlist[] = $favau['uid'];
51
+	}
52
+	$authlist = implode(",", $authlist);
53
+	$storyend->assign("favof", sprintf(_SE_FAVOF, $favcount));
54
+	$other = dbquery("SELECT item FROM ".TABLEPREFIX."fanfiction_favorites WHERE type = 'ST' AND FIND_IN_SET(uid, '$authlist') > 0 AND item != '".$storyinfo['sid']."' GROUP BY item");
55
+	$othercount = dbnumrows($other);
56
+	$storyend->assign("alsolike", sprintf(_SE_ALSOLIKE, title_link($storyinfo), $storyinfo['sid'], $othercount));
57
+}
58
+/*
59
+// If we've got series links for this story, let's give them links to the previous and next stories in the series.
60
+$seriesquery = "SELECT series.title, series.seriesid, list.inorder FROM ".TABLEPREFIX."fanfiction_inseries as list, ".TABLEPREFIX."fanfiction_series as series WHERE list.sid = '".$storyinfo['sid']."' AND series.seriesid = list.seriesid";
61
+$seriesresults = dbquery($seriesquery);
62
+$seSeries = array( );
63
+ while($series = dbassoc($seriesresults)) {
64
+	$thisSeries = sprintf(_SE_INSERIES, "<a href='"._BASEDIR."viewseries.php?seriesid=".$series['seriesid']."'>".stripslashes($series['title'])."</a>");
65
+	$others = dbquery("SELECT subseriesid, sid, inorder FROM ".TABLEPREFIX."fanfiction_inseries WHERE seriesid = '".$series['seriesid']."' AND confirmed = 1 AND (inorder = ".($series['inorder'] - 1)." OR inorder = ".($series['inorder'] + 1).")"); 
66
+ 	while($o = dbassoc($others)) {
67
+		unset($story, $sub);
68
+		if(!empty($o['sid'])) $story = dbassoc(dbquery(_STORYQUERY." AND sid = ".$o['sid']." LIMIT 1"));
69
+		elseif(!empty($o['subseriesid'])) $sub = dbassoc(dbquery(_SERIESQUERY." AND seriesid = ".$o['seriesid']));
70
+		
71
+		if($o['inorder'] < $series['inorder']) {
72
+			if($story) $thisSeries .= " ".sprintf(_SE_SERIES_PREVST, title_link($story));
73
+			elseif($sub) $thisSeries .= " ".sprintf(_SE_SERIES_PREVSE, "<a href='"._BASEDIR."viewseries.php?seriesid=".$sub['seriesid']."'>".stripslashes($sub['title'])."</a>");
74
+		}
75
+		elseif ($o['inorder'] > $series['inorder']) {
76
+			if($story) $thisSeries .= " ".sprintf(_SE_SERIES_NEXTST, title_link($story));
77
+			elseif($sub) $thisSeries .= " ".sprintf(_SE_SERIES_NEXTSE, "<a href='"._BASEDIR."viewseries.php?seriesid=".$sub['seriesid']."'>".stripslashes($sub['title'])."</a>");
78
+		}
79
+		
80
+	}  
81
+	$seSeries[] = $thisSeries;
82
+}
83
+if(count($seSeries) > 0) $storyend->assign("seriesinfo", implode("<br />", $seSeries));
84
+*/
85
+$tpl->assign("storyend", $storyend->getOutputContent( ));
86
+
87
+?>
0 88
\ No newline at end of file