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:55
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, $lang) = dbrow(dbquery("SELECT tableprefix, language FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '$sitekey'"));
6 5
 define("TABLEPREFIX", $tableprefix);
7 6
 include(_BASEDIR."languages/$lang.php");
Browse code

version 3.5.7

Jimako authored on 2024/04/08 12:21:57
Showing 1 changed files
... ...
@@ -21,7 +21,7 @@ $x = 0;
21 21
 $find = array ('"', chr(150), chr(147), chr(148), chr(146));
22 22
 $replace = array ('\"', "-", "\"", "\"", "'");
23 23
 while($char = dbassoc($characters)) {
24
-	echo "characters[$x] = new Array(".$char['charid'].", \"".urlencode(str_replace($find, $replace, stripslashes($char['charname'])))."\");\r\n";
24
+	echo "characters[$x] = new Array(".$char['charid'].", \"". str_replace($find, $replace, stripslashes($char['charname'])) ."\");\r\n";
25 25
 	$x++;
26 26
 }
27
-?>
28 27
\ No newline at end of file
28
+?>
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,27 @@
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/html; charset=".CHARSET,true);
9
+include("../includes/queries.php");
10
+// Checks that the given $num is actually a number.  Used to help prevent XSS attacks.
11
+function isNumber($num) {
12
+	if(empty($num)) return false;
13
+	return (preg_match("/^[0-9]+$/", $num) || $num == "-1" ? true : false);
14
+}
15
+
16
+$catid = isset($_GET['catid']) ? explode(",", $_GET['catid']) : array(-1);
17
+$catid = array_filter($catid, "isNumber");
18
+$characters = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_characters WHERE ".(count($catid) > 1 ? "FIND_IN_SET(catid, '".implode(",", $catid)."') > 0" : "catid = '".$catid[0]."'")." ORDER BY charname");
19
+echo "var element = '".$_GET['element']."';\n";
20
+$x = 0;
21
+$find = array ('"', chr(150), chr(147), chr(148), chr(146));
22
+$replace = array ('\"', "-", "\"", "\"", "'");
23
+while($char = dbassoc($characters)) {
24
+	echo "characters[$x] = new Array(".$char['charid'].", \"".urlencode(str_replace($find, $replace, stripslashes($char['charname'])))."\");\r\n";
25
+	$x++;
26
+}
27
+?>
0 28
\ No newline at end of file