Browse code

Relocate CHARSET definition back to the languages/en.php file - this makes some legacy modules work without adding a charset definition

Clarissa Walker authored on 2026/09/05 15:43:38
Showing 1 changed files
... ...
@@ -1,6 +1,6 @@
1 1
 <?php
2 2
 define("_BASEDIR", "../");
3
-define("_CHARSET", "utf-8");
3
+define("_CATCHARSET", "utf-8");
4 4
 
5 5
 include("../config.php");
6 6
  
... ...
@@ -8,7 +8,7 @@ include("../config.php");
8 8
 list($tableprefix, $lang) = dbrow(dbquery("SELECT tableprefix, language FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '$sitekey'"));
9 9
 define("TABLEPREFIX", $tableprefix);
10 10
  
11
-header("Content-Type: text/javascript; charset="._CHARSET,true);
11
+header("Content-Type: text/javascript; charset="._CATCHARSET,true);
12 12
 include("../includes/queries.php");
13 13
 
14 14
 $catid = isset($_GET['catid']) && preg_match("/^[0-9]+$/", $_GET['catid']) ? $_GET['catid'] : -1;
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
... ...
@@ -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'"));
Browse code

version 3.5.7

Jimako authored on 2024/04/08 12:21:57
Showing 1 changed files
... ...
@@ -1,10 +1,14 @@
1 1
 <?php
2 2
 define("_BASEDIR", "../");
3
+define("_CHARSET", "utf-8");
4
+
3 5
 include("../config.php");
4 6
 include("../includes/dbfunctions.php");
7
+ 
8
+
5 9
 list($tableprefix, $lang) = dbrow(dbquery("SELECT tableprefix, language FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '$sitekey'"));
6 10
 define("TABLEPREFIX", $tableprefix);
7
-include(_BASEDIR."languages/$lang.php");
11
+ 
8 12
 header("Content-Type: text/javascript; charset="._CHARSET,true);
9 13
 include("../includes/queries.php");
10 14
 
... ...
@@ -15,7 +19,7 @@ $x = 0;
15 19
 $find = array ('"', chr(150), chr(147), chr(148), chr(146));
16 20
 $replace = array ('\"', "-", "\"", "\"", "'");
17 21
 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";
22
+	echo "categories[$x] = new category(".$category['parentcatid'].", ".$category['catid'].", \"". str_replace($find, $replace, stripslashes($category['category']))."\", ".$category['locked'].", ".$category['displayorder'].");\r\n";
19 23
 	$x++;
20 24
 }
21
-?>
22 25
\ No newline at end of file
26
+?>
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,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