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
... ...
@@ -23,8 +23,8 @@
23 23
 //
24 24
 // To read the license please visit http://www.gnu.org/copyleft/gpl.html
25 25
 // ----------------------------------------------------------------------
26
+
26 27
 define("_BASEDIR", "../");
27
-define("_CHARSET", "utf-8");
28 28
 include("../config.php");
29 29
  
30 30
 $settingsresults = dbquery("SELECT * FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '$sitekey'");
Browse code

working backup

Jimako authored on 2024/05/16 16:43:03
Showing 1 changed files
... ...
@@ -23,11 +23,10 @@
23 23
 //
24 24
 // To read the license please visit http://www.gnu.org/copyleft/gpl.html
25 25
 // ----------------------------------------------------------------------
26
-
27 26
 define("_BASEDIR", "../");
28
-$action = "backup";
27
+define("_CHARSET", "utf-8");
29 28
 include("../config.php");
30
-
29
+ 
31 30
 $settingsresults = dbquery("SELECT * FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '$sitekey'");
32 31
 $settings = dbassoc($settingsresults);
33 32
 foreach($settings as $var => $val) {
... ...
@@ -63,8 +62,10 @@ function datadump ($table) {
63 62
 	while($t = dbassoc($tabledata)) {
64 63
 		echo "INSERT INTO ".$table." ";
65 64
 		$row = array( );
66
-		foreach($t AS $field => $value) {			
67
-			$value = utf8_encode (escapestring($value) );
65
+		foreach($t AS $field => $value) {
66
+			//$value = utf8_encode (escapestring($value) );
67
+			$value = escapestring($value);
68
+			$value = mb_convert_encoding($value, 'UTF-8', 'ISO-8859-1');
68 69
 			$value = str_replace("\n","\\n",$value);
69 70
 			if (isset($value)) $row[$field] = "\"$value\"";
70 71
 			else $row[$field] = "\"\"";
Browse code

version 3.5.7

Jimako authored on 2024/04/08 12:21:57
Showing 1 changed files
... ...
@@ -80,7 +80,7 @@ function datadump ($table) {
80 80
 			datadump(current($table));
81 81
 	}
82 82
 
83
- 	if($logging) dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_log (`log_action`, `log_uid`, `log_ip`, `log_type`, `log_timestamp`) VALUES('".escapestring(sprintf(_LOG_BACKUP, USERPENNAME, USERUID))."', '".USERUID."', INET_ATON('".$_SERVER['REMOTE_ADDR']."'), 'AM', " . time() . ")");
83
+ 	if($logging) dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_log (`log_action`, `log_uid`, `log_ip`, `log_type`, `log_timestamp`) VALUES('".escapestring(sprintf(_LOG_BACKUP, USERPENNAME, USERUID))."', '".USERUID. "', INET6_ATON('".$_SERVER['REMOTE_ADDR']."'), 'AM', " . time() . ")");
84 84
 	exit( );
85 85
 
86
-?>
87 86
\ No newline at end of file
87
+?>
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,86 @@
1
+<?php
2
+// ----------------------------------------------------------------------
3
+// eFiction 3.0
4
+// Copyright (c) 2007 by Tammy Keefer
5
+// Valid HTML 4.01 Transitional
6
+// Based on eFiction 1.1
7
+// Copyright (C) 2003 by Rebecca Smallwood.
8
+// http://efiction.sourceforge.net/
9
+//
10
+// Size fix / UTF-8 feature 2016-05-18
11
+// ----------------------------------------------------------------------
12
+// LICENSE
13
+//
14
+// This program is free software; you can redistribute it and/or
15
+// modify it under the terms of the GNU General Public License (GPL)
16
+// as published by the Free Software Foundation; either version 2
17
+// of the License, or (at your option) any later version.
18
+//
19
+// This program is distributed in the hope that it will be useful,
20
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
21
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22
+// GNU General Public License for more details.
23
+//
24
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
25
+// ----------------------------------------------------------------------
26
+
27
+define("_BASEDIR", "../");
28
+$action = "backup";
29
+include("../config.php");
30
+
31
+$settingsresults = dbquery("SELECT * FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '$sitekey'");
32
+$settings = dbassoc($settingsresults);
33
+foreach($settings as $var => $val) {
34
+	$$var = stripslashes($val);
35
+	$settings[$var] = htmlspecialchars($val);
36
+}
37
+if(!defined("SITEKEY")) define("SITEKEY", $settings['sitekey']);
38
+unset($settings['sitekey']);
39
+if(!defined("TABLEPREFIX")) define("TABLEPREFIX", $settings['tableprefix']);
40
+unset($settings['tableprefix']);
41
+$debug = 0;
42
+include("../languages/".$language.".php");
43
+include("../languages/".$language."_admin.php");
44
+$file_name = str_replace(" ", "_", $sitename).date("m-d-Y").".sql";
45
+header("Content-Type: text/html; charset=utf-8");
46
+Header("Content-type: application/octet-stream");
47
+Header("Content-Disposition: attachment; filename=".$file_name."");
48
+
49
+session_start( );
50
+require_once("../includes/queries.php");
51
+require_once("../includes/get_session_vars.php");
52
+$debug = false;  // Because we don't want debug info mucking up our backup.
53
+
54
+if(!isADMIN) die( );
55
+
56
+// Database backup
57
+function datadump ($table) {
58
+    echo "# Dump of $table \r\n";
59
+    echo "# Dump DATE : " . date("d-M-Y") ."\r\n\r\n";
60
+
61
+    $tabledata = dbquery("SELECT * FROM $table");
62
+
63
+	while($t = dbassoc($tabledata)) {
64
+		echo "INSERT INTO ".$table." ";
65
+		$row = array( );
66
+		foreach($t AS $field => $value) {			
67
+			$value = utf8_encode (escapestring($value) );
68
+			$value = str_replace("\n","\\n",$value);
69
+			if (isset($value)) $row[$field] = "\"$value\"";
70
+			else $row[$field] = "\"\"";
71
+		}   
72
+		echo "VALUES(".implode(", ", $row).");\r\n";
73
+	}
74
+	echo "\r\n\r\n\r\n";
75
+}
76
+
77
+	$alltables = dbquery("SHOW TABLES");
78
+
79
+	while ($table = dbassoc($alltables)) {
80
+			datadump(current($table));
81
+	}
82
+
83
+ 	if($logging) dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_log (`log_action`, `log_uid`, `log_ip`, `log_type`, `log_timestamp`) VALUES('".escapestring(sprintf(_LOG_BACKUP, USERPENNAME, USERUID))."', '".USERUID."', INET_ATON('".$_SERVER['REMOTE_ADDR']."'), 'AM', " . time() . ")");
84
+	exit( );
85
+
86
+?>
0 87
\ No newline at end of file