Browse code

Initial uplad w/ php7 fixes

Rainer Volkrodt authored on 2016/03/12 15:54:02
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,25 @@
1
+<?php
2
+define("_BASEDIR", "../");
3
+include("../config.php");
4
+include("../includes/dbfunctions.php");
5
+list($tableprefix) = dbrow(dbquery("SELECT tableprefix FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '$sitekey'"));
6
+define("TABLEPREFIX", $tableprefix);
7
+include("../includes/queries.php");
8
+
9
+$catid = isset($_GET['catid']) && preg_match("/^[0-9]+$/", $_GET['catid']) ? $_GET['catid'] : -1;
10
+$cats = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_categories WHERE parentcatid = '$catid' OR catid = '$catid' ORDER BY leveldown, displayorder");
11
+echo "var el = '".$_GET['element']."';\n";
12
+$x = 0;
13
+$find = array ('"', chr(150), chr(147), chr(148), chr(146));
14
+$replace = array ('\"', "-", "\"", "\"", "'");
15
+while($category = dbassoc($cats)) {
16
+	echo "categories[$x] = new category(".$category['parentcatid'].", ".$category['catid'].", \"".htmlentities(str_replace($find, $replace, stripslashes($category['category'])))."\", ".$category['locked'].", ".$category['displayorder'].");\r\n";
17
+	$x++;
18
+}
19
+$characters = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_characters WHERE catid = '$catid' OR catid = '-1' ORDER BY charname");
20
+$x = 0;
21
+while($char = dbassoc($characters)) {
22
+	echo "characters[$x] = new Array(".$char['charid'].", \"".str_replace($find, $replace, stripslashes($char['charname']))."\");\r\n";
23
+	$x++;
24
+}
25
+?>
0 26
\ No newline at end of file