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 7 changed files
... ...
@@ -6,4 +6,5 @@ $dbpass = "dbpass";
6 6
 $sitekey = "";
7 7
 $settingsprefix = "settings";
8 8
 
9
+include("includes/dbfunctions.php");
9 10
 ?>
... ...
@@ -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
+?>
... ...
@@ -3,7 +3,6 @@ define("_BASEDIR", "../");
3 3
 define("_CHARSET", "utf-8");
4 4
 
5 5
 include("../config.php");
6
-include("../includes/dbfunctions.php");
7 6
  
8 7
 
9 8
 list($tableprefix, $lang) = dbrow(dbquery("SELECT tableprefix, language FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '$sitekey'"));
... ...
@@ -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");
... ...
@@ -7,7 +7,6 @@ define("_BASEDIR", "../");
7 7
 define("_CHARSET", "utf-8");
8 8
 
9 9
 include("../config.php");
10
-include("../includes/dbfunctions.php");
11 10
 list($tableprefix, $language) = dbrow(dbquery("SELECT tableprefix, language FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '$sitekey'"));
12 11
 define("TABLEPREFIX", $tableprefix);
13 12
 if(file_exists(_BASEDIR."languages/{$language}.php")) include (_BASEDIR."languages/{$language}.php");
... ...
@@ -29,4 +28,4 @@ if(count($userlist) > 0) {
29 28
 		$x++;
30 29
 	}
31 30
 }
32
-?>
33 31
\ No newline at end of file
32
+?>
... ...
@@ -112,7 +112,7 @@ else if (isset($_REQUEST['language']))
112 112
 else
113 113
 {
114 114
 	include("../config.php");
115
-	include("../includes/dbfunctions.php");
115
+	//include("../includes/dbfunctions.php");
116 116
 
117 117
 	$dbconnect = dbconnect($dbhost, $dbuser, $dbpass, $dbname);
118 118
 	$settings = dbquery("SELECT tableprefix, language FROM " . $settingsprefix . "fanfiction_settings WHERE sitekey = '" . $sitekey . "'");
... ...
@@ -850,7 +850,7 @@ CREATE TABLE IF NOT EXISTS `" . $tableprefix . "fanfiction_modules` (
850 850
 
851 851
 	case "2";
852 852
 		include("../config.php");
853
-		include("../includes/dbfunctions.php");
853
+		//include("../includes/dbfunctions.php");
854 854
 		if (dbnumrows(dbquery("SHOW TABLES LIKE '" . $settingsprefix . "fanfiction_settings'")))
855 855
 		{
856 856
 			//include("../config.php");
... ...
@@ -1039,6 +1039,7 @@ CREATE TABLE IF NOT EXISTS `" . $tableprefix . "fanfiction_modules` (
1039 1039
 \$sitekey = \"$sitekey\";
1040 1040
 \$settingsprefix = \"$settingsprefix\";
1041 1041
 
1042
+include(\"includes/dbfunctions.php\");
1042 1043
 ?>";
1043 1044
 
1044 1045
 /* removed in 3.5.8 and moved to file: 
... ...
@@ -1057,7 +1058,7 @@ if(!empty(\$sitekey)) \$dbconnect = dbconnect(\$dbhost, \$dbuser,\$dbpass, \$dbn
1057 1058
 		{
1058 1059
 			if (file_exists("../config.php") && !isset($mysqli_access)) {
1059 1060
 				include("../config.php");
1060
-				include("../includes/dbfunctions.php");
1061
+				//include("../includes/dbfunctions.php");
1061 1062
 			}
1062 1063
 			if (isset($tinyMCE)) $output .= write_message(_CONFIG2DETECTED);
1063 1064
 			else if (isset($sitename) && $sitename) $output .= write_message(_CONFIG1DETECTED);
... ...
@@ -26,7 +26,6 @@
26 26
 		if(!defined("_LOGINCHECK")) exit( );
27 27
 		define("_BASEDIR", "");
28 28
 		include_once("config.php");
29
-		include(_BASEDIR . "includes/dbfunctions.php");
30 29
 		$settings = dbquery("SELECT tableprefix, maintenance, sitekey, debug FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '".$sitekey."'");
31 30
 		list($tableprefix, $maintenance, $sitekey, $debug) = dbrow($settings);
32 31
 		$tempdebug = $debug;