| ... | ... |
@@ -20,19 +20,6 @@ |
| 20 | 20 |
// To read the license please visit http://www.gnu.org/copyleft/gpl.html |
| 21 | 21 |
// ---------------------------------------------------------------------- |
| 22 | 22 |
|
| 23 |
-/* PHP 8 fix */ |
|
| 24 |
-$allowed_tags = ''; |
|
| 25 |
-$recentdays = ''; |
|
| 26 |
-$sitename = ''; |
|
| 27 |
-$url = ''; |
|
| 28 |
-$multiplecats = ''; |
|
| 29 |
-$minwords = ''; |
|
| 30 |
-$maxwords = ''; |
|
| 31 |
-$action = ''; |
|
| 32 |
-$pwdsetting = ''; |
|
| 33 |
-$imagewidth = ''; |
|
| 34 |
-$imageheight = ''; |
|
| 35 |
- |
|
| 36 | 23 |
define("_BASEDIR", "");
|
| 37 | 24 |
require_once("config.php");
|
| 38 | 25 |
|
| ... | ... |
@@ -20,9 +20,18 @@ |
| 20 | 20 |
// To read the license please visit http://www.gnu.org/copyleft/gpl.html |
| 21 | 21 |
// ---------------------------------------------------------------------- |
| 22 | 22 |
|
| 23 |
-ini_set('display_errors', 0);
|
|
| 24 |
-ini_set('display_startup_errors', 0);
|
|
| 25 |
-error_reporting(-1); |
|
| 23 |
+/* PHP 8 fix */ |
|
| 24 |
+$allowed_tags = ''; |
|
| 25 |
+$recentdays = ''; |
|
| 26 |
+$sitename = ''; |
|
| 27 |
+$url = ''; |
|
| 28 |
+$multiplecats = ''; |
|
| 29 |
+$minwords = ''; |
|
| 30 |
+$maxwords = ''; |
|
| 31 |
+$action = ''; |
|
| 32 |
+$pwdsetting = ''; |
|
| 33 |
+$imagewidth = ''; |
|
| 34 |
+$imageheight = ''; |
|
| 26 | 35 |
|
| 27 | 36 |
define("_BASEDIR", "");
|
| 28 | 37 |
require_once("config.php");
|
| ... | ... |
@@ -61,7 +70,7 @@ while($rate = dbassoc($ratlist)) {
|
| 61 | 70 |
$rss.="<title>".xmlentities( $sitename)."</title>\n"; |
| 62 | 71 |
$rss.="<managingEditor>$siteemail</managingEditor>\n"; |
| 63 | 72 |
$rss.="<webMaster>$siteemail</webMaster>\n"; |
| 64 |
- $rss.="<language>$language</language>\n"; |
|
| 73 |
+ $rss.="<language>$language</language>\n"; |
|
| 65 | 74 |
|
| 66 | 75 |
$query = _STORYQUERY." ORDER BY updated DESC LIMIT 20"; |
| 67 | 76 |
$results = dbquery($query); |
| ... | ... |
@@ -34,7 +34,7 @@ foreach($settings as $var => $val) {
|
| 34 | 34 |
} |
| 35 | 35 |
define("TABLEPREFIX", $tableprefix);
|
| 36 | 36 |
define("SITEKEY", $sitekey);
|
| 37 |
-define("_CHARSET", "utf-8");
|
|
| 37 |
+define("_RSSCHARSET", "utf-8");
|
|
| 38 | 38 |
|
| 39 | 39 |
include_once("includes/queries.php");
|
| 40 | 40 |
if(file_exists("languages/{$language}.php")) include("languages/{$language}.php");
|
| ... | ... |
@@ -51,7 +51,7 @@ while($rate = dbassoc($ratlist)) {
|
| 51 | 51 |
$ratings[$rate['rid']] = $rate['rating']; |
| 52 | 52 |
} |
| 53 | 53 |
|
| 54 |
- $rss="<?xml version=\"1.0\" encoding=\""._CHARSET."\"?>\n"; |
|
| 54 |
+ $rss="<?xml version=\"1.0\" encoding=\""._RSSCHARSET."\"?>\n"; |
|
| 55 | 55 |
$rss.="<rss version=\"2.0\">\n"; |
| 56 | 56 |
$rss.="<channel>\n"; |
| 57 | 57 |
$rss.="<copyright>Copyright ".date("Y")."</copyright>\n";
|
| ... | ... |
@@ -26,7 +26,6 @@ error_reporting(-1); |
| 26 | 26 |
|
| 27 | 27 |
define("_BASEDIR", "");
|
| 28 | 28 |
require_once("config.php");
|
| 29 |
-require_once("includes/dbfunctions.php");
|
|
| 30 | 29 |
|
| 31 | 30 |
$settingsresults = dbquery("SELECT sitename, url, siteemail, slogan, language, tableprefix, dateformat FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '$sitekey'");
|
| 32 | 31 |
$settings = dbassoc($settingsresults); |
| ... | ... |
@@ -24,9 +24,10 @@ ini_set('display_errors', 0);
|
| 24 | 24 |
ini_set('display_startup_errors', 0);
|
| 25 | 25 |
error_reporting(-1); |
| 26 | 26 |
|
| 27 |
-define("_BASEDIR", "");
|
|
| 28 |
- require_once("includes/dbfunctions.php");
|
|
| 29 |
- require_once("config.php");
|
|
| 27 |
+define("_BASEDIR", "");
|
|
| 28 |
+require_once("config.php");
|
|
| 29 |
+require_once("includes/dbfunctions.php");
|
|
| 30 |
+ |
|
| 30 | 31 |
$settingsresults = dbquery("SELECT sitename, url, siteemail, slogan, language, tableprefix, dateformat FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '$sitekey'");
|
| 31 | 32 |
$settings = dbassoc($settingsresults); |
| 32 | 33 |
foreach($settings as $var => $val) {
|
| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,96 @@ |
| 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 |
+ |
|
| 23 |
+ini_set('display_errors', 0);
|
|
| 24 |
+ini_set('display_startup_errors', 0);
|
|
| 25 |
+error_reporting(-1); |
|
| 26 |
+ |
|
| 27 |
+define("_BASEDIR", "");
|
|
| 28 |
+ require_once("includes/dbfunctions.php");
|
|
| 29 |
+ require_once("config.php");
|
|
| 30 |
+$settingsresults = dbquery("SELECT sitename, url, siteemail, slogan, language, tableprefix, dateformat FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '$sitekey'");
|
|
| 31 |
+$settings = dbassoc($settingsresults); |
|
| 32 |
+foreach($settings as $var => $val) {
|
|
| 33 |
+ $$var = $val; |
|
| 34 |
+} |
|
| 35 |
+define("TABLEPREFIX", $tableprefix);
|
|
| 36 |
+define("SITEKEY", $sitekey);
|
|
| 37 |
+define("_CHARSET", "utf-8");
|
|
| 38 |
+ |
|
| 39 |
+ include_once("includes/queries.php");
|
|
| 40 |
+ if(file_exists("languages/{$language}.php")) include("languages/{$language}.php");
|
|
| 41 |
+ else include("languages/en.php");
|
|
| 42 |
+ ob_start ("ob_gzhandler");
|
|
| 43 |
+ |
|
| 44 |
+function xmlentities ( $string ) |
|
| 45 |
+{
|
|
| 46 |
+ return str_replace ( array ( '&', '"', "'", '<', '>' ), array ( '&' , '"', ''' , '<' , '>' ), $string ); |
|
| 47 |
+} |
|
| 48 |
+ |
|
| 49 |
+$ratlist = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_ratings");
|
|
| 50 |
+while($rate = dbassoc($ratlist)) {
|
|
| 51 |
+ $ratings[$rate['rid']] = $rate['rating']; |
|
| 52 |
+} |
|
| 53 |
+ |
|
| 54 |
+ $rss="<?xml version=\"1.0\" encoding=\""._CHARSET."\"?>\n"; |
|
| 55 |
+ $rss.="<rss version=\"2.0\">\n"; |
|
| 56 |
+ $rss.="<channel>\n"; |
|
| 57 |
+ $rss.="<copyright>Copyright ".date("Y")."</copyright>\n";
|
|
| 58 |
+ $rss.="<lastBuildDate>".date("r")."</lastBuildDate>\n";
|
|
| 59 |
+ $rss.="<description>".xmlentities($slogan)."</description>\n"; |
|
| 60 |
+ $rss.="<link>$url</link>\n"; |
|
| 61 |
+ $rss.="<title>".xmlentities( $sitename)."</title>\n"; |
|
| 62 |
+ $rss.="<managingEditor>$siteemail</managingEditor>\n"; |
|
| 63 |
+ $rss.="<webMaster>$siteemail</webMaster>\n"; |
|
| 64 |
+ $rss.="<language>$language</language>\n"; |
|
| 65 |
+ |
|
| 66 |
+ $query = _STORYQUERY." ORDER BY updated DESC LIMIT 20"; |
|
| 67 |
+ $results = dbquery($query); |
|
| 68 |
+ while($story = dbassoc($results)) {
|
|
| 69 |
+ $story['authors'][] = $story['penname']; |
|
| 70 |
+ if($story['coauthors']) {
|
|
| 71 |
+ $coauth = dbquery("SELECT "._PENNAMEFIELD." as penname, co.uid FROM ".TABLEPREFIX."fanfiction_coauthors AS co LEFT JOIN "._AUTHORTABLE." ON co.uid = "._UIDFIELD." WHERE co.sid = '".$story['sid']."'");
|
|
| 72 |
+ while($c = dbassoc($coauth)) {
|
|
| 73 |
+ $story['authors'][] = $c['penname']; |
|
| 74 |
+ } |
|
| 75 |
+ } |
|
| 76 |
+ foreach($story['authors'] AS $k => $v) {
|
|
| 77 |
+ $story['authors'][$k] = strip_tags(xmlentities( $v)); |
|
| 78 |
+ } |
|
| 79 |
+ $rss.= "<item> |
|
| 80 |
+ <title>".strip_tags(xmlentities($story['title']))." "._BY." ".implode(", ", $story['authors'])." [".$ratings[$story['rid']]."]</title>
|
|
| 81 |
+ <link>$url/viewstory.php?sid=".$story['sid']."</link> |
|
| 82 |
+ <description>".strip_tags(xmlentities($story['summary']))."</description> |
|
| 83 |
+ <pubDate>".date("r",$story['updated'])."</pubDate>
|
|
| 84 |
+ </item>\n"; |
|
| 85 |
+ } |
|
| 86 |
+ |
|
| 87 |
+ $rss.="</channel> |
|
| 88 |
+ </rss>"; |
|
| 89 |
+ |
|
| 90 |
+ header('Content-type: application/xml');
|
|
| 91 |
+ header("Cache-Control: must-revalidate");
|
|
| 92 |
+ header("Expires: ".gmdate("D, d M Y H:i:s", time() + 3600) . " GMT");
|
|
| 93 |
+ |
|
| 94 |
+ echo $rss; |
|
| 95 |
+ |
|
| 96 |
+?> |