Browse code

Add includes/dbfunctions.php include back to config.php, but leave the actual dbconnect in the includes/dbfunctions.php file where it belongs - this makes legacy modules work without adding another include

Clarissa Walker authored on 2026/09/05 13:38:28
Showing 1 changed files
... ...
@@ -1,7 +1,6 @@
1 1
 <?php
2 2
 define("_BASEDIR", "../");
3 3
 include("../config.php");
4
-include("../includes/dbfunctions.php");
5 4
 list($tableprefix) = dbrow(dbquery("SELECT tableprefix FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '$sitekey'"));
6 5
 define("TABLEPREFIX", $tableprefix);
7 6
 include("../includes/queries.php");
... ...
@@ -22,4 +21,4 @@ while($char = dbassoc($characters)) {
22 21
 	echo "characters[$x] = new Array(".$char['charid'].", \"".str_replace($find, $replace, stripslashes($char['charname']))."\");\r\n";
23 22
 	$x++;
24 23
 }
25
-?>
26 24
\ No newline at end of file
25
+?>
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,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