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,21 @@
1
+<?php
2
+define("_BASEDIR", "../");
3
+include("../config.php");
4
+include("../includes/dbfunctions.php");
5
+list($tableprefix, $lang) = dbrow(dbquery("SELECT tableprefix, language FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '$sitekey'"));
6
+define("TABLEPREFIX", $tableprefix);
7
+include(_BASEDIR."languages/$lang.php");
8
+header("Content-Type: text/javascript; charset="._CHARSET,true);
9
+include("../includes/queries.php");
10
+
11
+$catid = isset($_GET['catid']) && preg_match("/^[0-9]+$/", $_GET['catid']) ? $_GET['catid'] : -1;
12
+$cats = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_categories WHERE parentcatid = '$catid' OR catid = '$catid' ORDER BY leveldown, displayorder");
13
+echo "var el = '".$_GET['element']."';\n";
14
+$x = 0;
15
+$find = array ('"', chr(150), chr(147), chr(148), chr(146));
16
+$replace = array ('\"', "-", "\"", "\"", "'");
17
+while($category = dbassoc($cats)) {
18
+	echo "categories[$x] = new category(".$category['parentcatid'].", ".$category['catid'].", \"".urlencode(str_replace($find, $replace, stripslashes($category['category'])))."\", ".$category['locked'].", ".$category['displayorder'].");\r\n";
19
+	$x++;
20
+}
21
+?>
0 22
\ No newline at end of file