| ... | ... |
@@ -6,8 +6,6 @@ |
| 6 | 6 |
// Based on eFiction 1.1 |
| 7 | 7 |
// Copyright (C) 2003 by Rebecca Smallwood. |
| 8 | 8 |
// http://efiction.sourceforge.net/ |
| 9 |
-// |
|
| 10 |
-// Size fix / UTF-8 feature 2016-05-18 |
|
| 11 | 9 |
// ---------------------------------------------------------------------- |
| 12 | 10 |
// LICENSE |
| 13 | 11 |
// |
| ... | ... |
@@ -23,7 +21,7 @@ |
| 23 | 21 |
// |
| 24 | 22 |
// To read the license please visit http://www.gnu.org/copyleft/gpl.html |
| 25 | 23 |
// ---------------------------------------------------------------------- |
| 26 |
-define("_CHARSET", "utf-8");
|
|
| 24 |
+ |
|
| 27 | 25 |
define("_BASEDIR", "../");
|
| 28 | 26 |
include("../config.php");
|
| 29 | 27 |
|
| ... | ... |
@@ -23,7 +23,7 @@ |
| 23 | 23 |
// |
| 24 | 24 |
// To read the license please visit http://www.gnu.org/copyleft/gpl.html |
| 25 | 25 |
// ---------------------------------------------------------------------- |
| 26 |
- |
|
| 26 |
+define("_CHARSET", "utf-8");
|
|
| 27 | 27 |
define("_BASEDIR", "../");
|
| 28 | 28 |
include("../config.php");
|
| 29 | 29 |
|
| ... | ... |
@@ -78,7 +78,7 @@ function datadump ($table) {
|
| 78 | 78 |
datadump(current($table)); |
| 79 | 79 |
} |
| 80 | 80 |
|
| 81 |
- 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() . ")");
|
|
| 81 |
+ 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() . ")");
|
|
| 82 | 82 |
exit( ); |
| 83 | 83 |
|
| 84 |
-?> |
|
| 85 | 84 |
\ No newline at end of file |
| 85 |
+?> |
| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,84 @@ |
| 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 |
+include("../config.php");
|
|
| 29 |
+ |
|
| 30 |
+$settingsresults = dbquery("SELECT * FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '$sitekey'");
|
|
| 31 |
+$settings = dbassoc($settingsresults); |
|
| 32 |
+foreach($settings as $var => $val) {
|
|
| 33 |
+ $$var = stripslashes($val); |
|
| 34 |
+ $settings[$var] = htmlspecialchars($val); |
|
| 35 |
+} |
|
| 36 |
+if(!defined("SITEKEY")) define("SITEKEY", $settings['sitekey']);
|
|
| 37 |
+unset($settings['sitekey']); |
|
| 38 |
+if(!defined("TABLEPREFIX")) define("TABLEPREFIX", $settings['tableprefix']);
|
|
| 39 |
+unset($settings['tableprefix']); |
|
| 40 |
+$debug = 0; |
|
| 41 |
+include("../languages/".$language.".php");
|
|
| 42 |
+include("../languages/".$language."_admin.php");
|
|
| 43 |
+$file_name = str_replace(" ", "_", $sitename).date("m-d-Y").".sql";
|
|
| 44 |
+Header("Content-type: application/octet-stream");
|
|
| 45 |
+Header("Content-Disposition: attachment; filename=" . $file_name . "");
|
|
| 46 |
+ |
|
| 47 |
+session_start( ); |
|
| 48 |
+require_once("../includes/queries.php");
|
|
| 49 |
+require_once("../includes/get_session_vars.php");
|
|
| 50 |
+$debug = false; // Because we don't want debug info mucking up our backup. |
|
| 51 |
+ |
|
| 52 |
+if(!isADMIN) die( ); |
|
| 53 |
+ |
|
| 54 |
+// Database backup |
|
| 55 |
+function datadump ($table) {
|
|
| 56 |
+ echo "# Dump of $table \r\n"; |
|
| 57 |
+ echo "# Dump DATE : " . date("d-M-Y") ."\r\n\r\n";
|
|
| 58 |
+ |
|
| 59 |
+ $tabledata = dbquery("SELECT * FROM $table");
|
|
| 60 |
+ |
|
| 61 |
+ while($t = dbassoc($tabledata)) {
|
|
| 62 |
+ echo "INSERT INTO ".$table." "; |
|
| 63 |
+ $row = array( ); |
|
| 64 |
+ foreach($t AS $field => $value) {
|
|
| 65 |
+ $value = escapestring($value); |
|
| 66 |
+ $value = str_replace("\n","\\n",$value);
|
|
| 67 |
+ if (isset($value)) $row[$field] = "\"$value\""; |
|
| 68 |
+ else $row[$field] = "\"\""; |
|
| 69 |
+ } |
|
| 70 |
+ echo "VALUES(".implode(", ", $row).");\r\n";
|
|
| 71 |
+ } |
|
| 72 |
+ echo "\r\n\r\n\r\n"; |
|
| 73 |
+} |
|
| 74 |
+ |
|
| 75 |
+ $alltables = dbquery("SHOW TABLES");
|
|
| 76 |
+ |
|
| 77 |
+ while ($table = dbassoc($alltables)) {
|
|
| 78 |
+ datadump(current($table)); |
|
| 79 |
+ } |
|
| 80 |
+ |
|
| 81 |
+ 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() . ")");
|
|
| 82 |
+ exit( ); |
|
| 83 |
+ |
|
| 84 |
+?> |
|
| 0 | 85 |
\ No newline at end of file |