Browse code

Add support for Unicode conversion to eFiction 3 Mod - this is to be done in the Archive Conversion page of the Admin Panel

Clarissa Walker authored on 2026/09/17 03:40:39
Showing 8 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,49 @@
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
+// LICENSE
11
+//
12
+// This program is free software; you can redistribute it and/or
13
+// modify it under the terms of the GNU General Public License (GPL)
14
+// as published by the Free Software Foundation; either version 2
15
+// of the License, or (at your option) any later version.
16
+//
17
+// This program is distributed in the hope that it will be useful,
18
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
19
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
+// GNU General Public License for more details.
21
+//
22
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
23
+// ----------------------------------------------------------------------
24
+
25
+if(!defined("_CHARSET")) exit( );
26
+
27
+// converted maintenance page
28
+
29
+$convert = isset($_GET['conv']) ? $_GET['conv'] : false;
30
+$output .= "<div id='pagetitle'>"._ARCHIVECONV."</div>";
31
+if($convert == "convert_mod") {
32
+	if(file_exists("admin/convert_mod.php")) include_once("admin/convert_mod.php");
33
+}
34
+if($convert == "convert_utf") {
35
+	if(file_exists("admin/convert_utf.php")) include_once("admin/convert_utf.php");
36
+}
37
+if($convert == "convert_0900") {
38
+	if(file_exists("admin/convert_0900.php")) include_once("admin/convert_0900.php");
39
+}
40
+if($convert == "convert_1400") {
41
+	if(file_exists("admin/convert_1400.php")) include_once("admin/convert_1400.php");
42
+}
43
+$output .= "
44
+<ul>
45
+	<li><a href='admin.php?action=convert&amp;conv=convert_mod'>"._CONVERT_MOD."</a>  <A HREF=\"#\" class=\"pophelp\">[?]<span>"._HELP_CONVERTMOD."</span></A></li>
46
+	<li><a href='admin.php?action=convert&amp;conv=convert_utf'>"._CONVERT_UTF."</a>  <A HREF=\"#\" class=\"pophelp\">[?]<span>"._HELP_CONVERTUTF."</span></A></li>
47
+	<li><a href='admin.php?action=convert&amp;conv=convert_0900'>"._CONVERT_0900."</a>  <A HREF=\"#\" class=\"pophelp\">[?]<span>"._HELP_CONVERT0900."</span></A></li>
48
+	<li><a href='admin.php?action=convert&amp;conv=convert_1400'>"._CONVERT_1400."</a>  <A HREF=\"#\" class=\"pophelp\">[?]<span>"._HELP_CONVERT1400."</span></A></li>
49
+</ul>";
0 50
new file mode 100644
... ...
@@ -0,0 +1,64 @@
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
+// LICENSE
11
+//
12
+// This program is free software; you can redistribute it and/or
13
+// modify it under the terms of the GNU General Public License (GPL)
14
+// as published by the Free Software Foundation; either version 2
15
+// of the License, or (at your option) any later version.
16
+//
17
+// This program is distributed in the hope that it will be useful,
18
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
19
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
+// GNU General Public License for more details.
21
+//
22
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
23
+// ----------------------------------------------------------------------
24
+
25
+if(!defined("_CHARSET")) exit( );
26
+$expVer = explode(".", $version);
27
+$confirm = isset($_GET['confirm']) ? $_GET['confirm'] : false;
28
+
29
+// silly converted update script... just to further convert collation in some tables
30
+
31
+// messy version check, starting with version 3.5.9
32
+if($expVer[0] == 3 && ($expVer[1] == 5 || $expVer[1] >=6 && (!isset($expVer[2]) || $expVer[2] == 9 || $expVer[2] > 0))) {
33
+if($confirm == "yes") {
34
+	// For converting certain fields to a chosen collation, starting with versions 3.5.9
35
+    if($expVer[0] == 3 && ($expVer[1] == 5 || $expVer[1] >=6 && (!isset($expVer[2]) || $expVer[2] == 9 || $expVer[2] > 0))) {
36
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_authors CHANGE `penname` `penname` VARCHAR(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '', CHANGE `realname` `realname` VARCHAR(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '';");
37
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_categories CHANGE `category` `category` VARCHAR(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '';");
38
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_characters CHANGE `charname` `charname` VARCHAR(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '';");
39
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_favorites CHANGE `type` `type` CHAR(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL;");
40
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_ratings CHANGE `rating` `rating` VARCHAR(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '';");
41
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_series CHANGE `title` `title` VARCHAR(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '', CHANGE `summary` `summary` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL;");
42
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_stories CHANGE `title` `title` VARCHAR(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT 'Untitled', CHANGE `summary` `summary` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL;");
43
+		$alltables = dbquery("SHOW TABLES");
44
+	}
45
+	$update = dbquery("UPDATE ".$settingsprefix."fanfiction_settings SET version = '$version' WHERE sitekey ='".SITEKEY."'");
46
+	$alltables = dbquery("SHOW TABLES");
47
+	while ($table = dbassoc($alltables)) {
48
+		foreach ($table as $db => $tablename) {
49
+			dbquery("OPTIMIZE TABLE `".$tablename."`");
50
+		}
51
+	}
52
+	if($update) $output .= write_message(_ACTIONSUCCESSFUL);
53
+	else $output .= write_error(_ERROR);
54
+}
55
+else if($confirm == "no") {
56
+	$output .= write_message(_ACTIONCANCELLED);
57
+}
58
+else {
59
+  	$output .= write_message("Some fields in this setup will be converted to Unicode 9.0.  You should run the eFiction 3 Mod conversion first.  You are advised to back up your database before starting! <br />
60
+Are you ready to convert to Unicode 9.0? <a href='admin.php?action=convert&conv=convert_0900&amp;confirm=yes'>"._YES."</a> "._OR." <a href='admin.php?action=convert&conv=convert_0900&amp;confirm=no'>"._NO."</a>");
61
+}
62
+}
63
+else $output .= write_message(_ALREADYUPDATED);
64
+?>
0 65
new file mode 100644
... ...
@@ -0,0 +1,64 @@
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
+// LICENSE
11
+//
12
+// This program is free software; you can redistribute it and/or
13
+// modify it under the terms of the GNU General Public License (GPL)
14
+// as published by the Free Software Foundation; either version 2
15
+// of the License, or (at your option) any later version.
16
+//
17
+// This program is distributed in the hope that it will be useful,
18
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
19
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
+// GNU General Public License for more details.
21
+//
22
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
23
+// ----------------------------------------------------------------------
24
+
25
+if(!defined("_CHARSET")) exit( );
26
+$expVer = explode(".", $version);
27
+$confirm = isset($_GET['confirm']) ? $_GET['confirm'] : false;
28
+
29
+// silly converted update script... just to further convert collation in some tables
30
+
31
+// messy version check, starting with version 3.5.9
32
+if($expVer[0] == 3 && ($expVer[1] == 5 || $expVer[1] >=6 && (!isset($expVer[2]) || $expVer[2] == 9 || $expVer[2] > 0))) {
33
+if($confirm == "yes") {
34
+	// For converting certain fields to a chosen collation, starting with versions 3.5.9
35
+    if($expVer[0] == 3 && ($expVer[1] == 5 || $expVer[1] >=6 && (!isset($expVer[2]) || $expVer[2] == 9 || $expVer[2] > 0))) {
36
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_authors CHANGE `penname` `penname` VARCHAR(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci NOT NULL DEFAULT '', CHANGE `realname` `realname` VARCHAR(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci NOT NULL DEFAULT '';");
37
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_categories CHANGE `category` `category` VARCHAR(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci NOT NULL DEFAULT '';");
38
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_characters CHANGE `charname` `charname` VARCHAR(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci NOT NULL DEFAULT '';");
39
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_favorites CHANGE `type` `type` CHAR(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci NOT NULL;");
40
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_ratings CHANGE `rating` `rating` VARCHAR(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci NOT NULL DEFAULT '';");
41
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_series CHANGE `title` `title` VARCHAR(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci NOT NULL DEFAULT '', CHANGE `summary` `summary` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci NOT NULL;");
42
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_stories CHANGE `title` `title` VARCHAR(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci NOT NULL DEFAULT 'Untitled', CHANGE `summary` `summary` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci NULL DEFAULT NULL;");
43
+		$alltables = dbquery("SHOW TABLES");
44
+	}
45
+	$update = dbquery("UPDATE ".$settingsprefix."fanfiction_settings SET version = '$version' WHERE sitekey ='".SITEKEY."'");
46
+	$alltables = dbquery("SHOW TABLES");
47
+	while ($table = dbassoc($alltables)) {
48
+		foreach ($table as $db => $tablename) {
49
+			dbquery("OPTIMIZE TABLE `".$tablename."`");
50
+		}
51
+	}
52
+	if($update) $output .= write_message(_ACTIONSUCCESSFUL);
53
+	else $output .= write_error(_ERROR);
54
+}
55
+else if($confirm == "no") {
56
+	$output .= write_message(_ACTIONCANCELLED);
57
+}
58
+else {
59
+  	$output .= write_message("Some fields in this setup will be converted to Unicode 14.0.  You should run the eFiction 3 Mod conversion first.  You are advised to back up your database before starting! <br />
60
+Are you ready to convert to Unicode 14.0? <a href='admin.php?action=convert&conv=convert_1400&amp;confirm=yes'>"._YES."</a> "._OR." <a href='admin.php?action=convert&conv=convert_1400&amp;confirm=no'>"._NO."</a>");
61
+}
62
+}
63
+else $output .= write_message(_ALREADYUPDATED);
64
+?>
0 65
new file mode 100644
... ...
@@ -0,0 +1,91 @@
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
+// LICENSE
11
+//
12
+// This program is free software; you can redistribute it and/or
13
+// modify it under the terms of the GNU General Public License (GPL)
14
+// as published by the Free Software Foundation; either version 2
15
+// of the License, or (at your option) any later version.
16
+//
17
+// This program is distributed in the hope that it will be useful,
18
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
19
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
+// GNU General Public License for more details.
21
+//
22
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
23
+// ----------------------------------------------------------------------
24
+
25
+if(!defined("_CHARSET")) exit( );
26
+$expVer = explode(".", $version);
27
+$confirm = isset($_GET['confirm']) ? $_GET['confirm'] : false;
28
+
29
+// silly converted update script... just to convert collation and engine type in some tables
30
+
31
+// messy version check, starting with version 3.5.9
32
+if($expVer[0] == 3 && ($expVer[1] == 5 || $expVer[1] >=6 && (!isset($expVer[2]) || $expVer[2] == 9 || $expVer[2] > 0))) {
33
+if($confirm == "yes") {
34
+	// For converting to eFiction 3 Mod, starting with versions 3.5.9
35
+	if($expVer[0] == 3 && ($expVer[1] == 5 || $expVer[1] >=6 && (!isset($expVer[2]) || $expVer[2] == 9 || $expVer[2] > 0))) {
36
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_authorfields ENGINE=INNODB, DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_bin;");
37
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_authorinfo ENGINE=INNODB, DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_bin;");
38
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_authorprefs ENGINE=INNODB, DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_bin;");
39
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_authors ENGINE=INNODB, DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_bin;");
40
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_blocks ENGINE=INNODB, DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_bin;");
41
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_categories ENGINE=INNODB, DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_bin;");
42
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_chapters ENGINE=INNODB, DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_bin;");
43
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_characters ENGINE=INNODB, DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_bin;");
44
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_classes ENGINE=INNODB, DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_bin;");
45
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_classtypes ENGINE=INNODB, DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_bin;");
46
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_coauthors ENGINE=INNODB, DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_bin;");
47
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_codeblocks ENGINE=INNODB, DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_bin;");
48
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_comments ENGINE=INNODB, DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_bin;");
49
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_favorites ENGINE=INNODB, DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_bin;");
50
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_inseries ENGINE=INNODB, DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_bin;");
51
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_log ENGINE=INNODB, DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_bin;");
52
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_messages ENGINE=INNODB, DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_bin;");
53
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_modules ENGINE=INNODB, DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_bin;");
54
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_news ENGINE=INNODB, DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_bin;");
55
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_pagelinks ENGINE=INNODB, DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_bin;");
56
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_panels ENGINE=INNODB, DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_bin;");
57
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_ratings ENGINE=INNODB, DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_bin;");
58
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_reviews ENGINE=INNODB, DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_bin;");
59
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_series ENGINE=INNODB, DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_bin;");
60
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_settings ENGINE=INNODB, DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_bin;");
61
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_stats ENGINE=INNODB, DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_bin;");
62
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_stories ENGINE=INNODB, DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_bin;");
63
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_authors CHANGE `penname` `penname` VARCHAR(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', CHANGE `realname` `realname` VARCHAR(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '';");
64
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_categories CHANGE `category` `category` VARCHAR(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '';");
65
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_characters CHANGE `charname` `charname` VARCHAR(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '';");
66
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_favorites CHANGE `type` `type` CHAR(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL;");
67
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_ratings CHANGE `rating` `rating` VARCHAR(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '';");
68
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_series CHANGE `title` `title` VARCHAR(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', CHANGE `summary` `summary` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL;");
69
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_stories CHANGE `title` `title` VARCHAR(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Untitled', CHANGE `summary` `summary` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL;");
70
+		$alltables = dbquery("SHOW TABLES");
71
+	}
72
+	$update = dbquery("UPDATE ".$settingsprefix."fanfiction_settings SET version = '$version' WHERE sitekey ='".SITEKEY."'");
73
+	$alltables = dbquery("SHOW TABLES");
74
+	while ($table = dbassoc($alltables)) {
75
+		foreach ($table as $db => $tablename) {
76
+			dbquery("OPTIMIZE TABLE `".$tablename."`");
77
+		}
78
+	}
79
+	if($update) $output .= write_message(_ACTIONSUCCESSFUL);
80
+	else $output .= write_error(_ERROR);
81
+}
82
+else if($confirm == "no") {
83
+	$output .= write_message(_ACTIONCANCELLED);
84
+}
85
+else {
86
+  	$output .= write_message("This setup will be converted to eFiction 3 Mod.  There is no turning back, so you are advised to back up your database before starting! <br />
87
+Are you ready to convert to eFiction 3 Mod? <a href='admin.php?action=convert&conv=convert_mod&amp;confirm=yes'>"._YES."</a> "._OR." <a href='admin.php?action=convert&conv=convert_mod&amp;confirm=no'>"._NO."</a>");
88
+}
89
+}
90
+else $output .= write_message(_ALREADYUPDATED);
91
+?>
0 92
new file mode 100644
... ...
@@ -0,0 +1,64 @@
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
+// LICENSE
11
+//
12
+// This program is free software; you can redistribute it and/or
13
+// modify it under the terms of the GNU General Public License (GPL)
14
+// as published by the Free Software Foundation; either version 2
15
+// of the License, or (at your option) any later version.
16
+//
17
+// This program is distributed in the hope that it will be useful,
18
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
19
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
+// GNU General Public License for more details.
21
+//
22
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
23
+// ----------------------------------------------------------------------
24
+
25
+if(!defined("_CHARSET")) exit( );
26
+$expVer = explode(".", $version);
27
+$confirm = isset($_GET['confirm']) ? $_GET['confirm'] : false;
28
+
29
+// silly converted update script... just to further convert collation in some tables
30
+
31
+// messy version check, starting with version 3.5.9
32
+if($expVer[0] == 3 && ($expVer[1] == 5 || $expVer[1] >=6 && (!isset($expVer[2]) || $expVer[2] == 9 || $expVer[2] > 0))) {
33
+if($confirm == "yes") {
34
+	// For converting certain fields to a chosen collation, starting with versions 3.5.9
35
+    if($expVer[0] == 3 && ($expVer[1] == 5 || $expVer[1] >=6 && (!isset($expVer[2]) || $expVer[2] == 9 || $expVer[2] > 0))) {
36
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_authors CHANGE `penname` `penname` VARCHAR(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', CHANGE `realname` `realname` VARCHAR(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '';");
37
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_categories CHANGE `category` `category` VARCHAR(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '';");
38
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_characters CHANGE `charname` `charname` VARCHAR(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '';");
39
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_favorites CHANGE `type` `type` CHAR(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL;");
40
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_ratings CHANGE `rating` `rating` VARCHAR(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '';");
41
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_series CHANGE `title` `title` VARCHAR(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', CHANGE `summary` `summary` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL;");
42
+		dbquery("ALTER TABLE ".TABLEPREFIX."fanfiction_stories CHANGE `title` `title` VARCHAR(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Untitled', CHANGE `summary` `summary` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL;");
43
+		$alltables = dbquery("SHOW TABLES");
44
+	}
45
+	$update = dbquery("UPDATE ".$settingsprefix."fanfiction_settings SET version = '$version' WHERE sitekey ='".SITEKEY."'");
46
+	$alltables = dbquery("SHOW TABLES");
47
+	while ($table = dbassoc($alltables)) {
48
+		foreach ($table as $db => $tablename) {
49
+			dbquery("OPTIMIZE TABLE `".$tablename."`");
50
+		}
51
+	}
52
+	if($update) $output .= write_message(_ACTIONSUCCESSFUL);
53
+	else $output .= write_error(_ERROR);
54
+}
55
+else if($confirm == "no") {
56
+	$output .= write_message(_ACTIONCANCELLED);
57
+}
58
+else {
59
+  	$output .= write_message("Some fields in this setup will be converted back to Unicode 4.0.  You should run the eFiction 3 Mod conversion first.  You are advised to back up your database before starting! <br />
60
+Are you ready to convert back to Unicode 4.0? <a href='admin.php?action=convert&conv=convert_utf&amp;confirm=yes'>"._YES."</a> "._OR." <a href='admin.php?action=convert&conv=convert_utf&amp;confirm=no'>"._NO."</a>");
61
+}
62
+}
63
+else $output .= write_message(_ALREADYUPDATED);
64
+?>
... ...
@@ -73,6 +73,7 @@ INSERT INTO `fanfiction_panels` (`panel_name`, `panel_title`, `panel_url`, `pane
73 73
 ('skins', 'Skins', '', 3, 6, 0, 'A'),
74 74
 ('authorfields', 'Profile Information', '', 1, 9, 0, 'A'),
75 75
 ('manual', 'Admin Manual', '', '3', '6', '0', 'A'),
76
-('modules', 'Modules', '', 1, '11', 0, 'A'),
77
-('maintenance', 'Archive Maintenance', '', 1, 10, 0, 'A');
76
+('modules', 'Modules', '', 1, '12', 0, 'A'),
77
+('maintenance', 'Archive Maintenance', '', 1, 10, 0, 'A'),
78
+('convert', 'Archive Conversion', '', 1, 11, 0, 'A');
78 79
 
... ...
@@ -472,8 +472,9 @@ switch ($_GET['step'])
472 472
 					array("skins", "Skins", "", "3", "6", "0", "A"),
473 473
 					array("authorfields", "Profile Information", "", "1", "9", "0", "A"),
474 474
 					array("maintenance", "Archive Maintenance", "", "1", "10", "0", "A"),
475
+					array("convert", "Archive Conversion", "", "1", "11", "0", "A"),
475 476
 					array("manual", "Admin Manual", "", "3", "6", "0", "A"),
476
-					array('modules', 'Modules', '', 1, "11", 0, 'A')
477
+					array('modules', 'Modules', '', 1, "12", 0, 'A')
477 478
 				);
478 479
 				$output .= "<table class='tblborder' style='margin: 1em auto; padding: 1em;' cellpadding='5'><tr><th>Panel</th><th>" . _RESULT . "</th></tr>";
479 480
 				foreach ($panellist as $panel)
... ...
@@ -33,6 +33,7 @@ define ("_ALLREV", "All Reviews");
33 33
 define ("_ALREADYINSTALLED", "That module is already installed.");
34 34
 define ("_ANONREV", "Anonymous Reviews");
35 35
 define ("_ANONREVIEWS", "Allow anonymous reviews");
36
+define ("_ARCHIVECONV", "Archive Conversion");
36 37
 define ("_ARCHIVEMAINT", "Archive Maintentance");
37 38
 define ("_AUTHORRELEASED", "The author has been removed from the admin created list, and an e-mail has been sent to them with their temporary password. <br /><br /><a href=\"admin.php?action=members\">Back to Members Maintenance</a>");
38 39
 define ("_AUTHORSONLY", "Authors Only");
... ...
@@ -78,6 +79,10 @@ define ("_CONFIRMAUTHORRELEASE", "Are you sure you want to release this author?"
78 79
 define ("_CONFIRMADMINREVOKE", "Are you sure you want to revoke this admin's privileges?");
79 80
 define ("_CONFIRMVALREVOKE", "Are you sure you want to revoke this author's validation?");
80 81
 define ("_CONFIRMVALIDATE", "Are you sure you want to validate this author?");
82
+define ("_CONVERT_MOD", "Convert to eFiction 3 Mod");
83
+define ("_CONVERT_UTF", "Convert back to Unicode 4.0");
84
+define ("_CONVERT_0900", "Convert to Unicode 9.0");
85
+define ("_CONVERT_1400", "Convert to Unicode 14.0");
81 86
 define ("_COPYRIGHT", "Copyright Footer");
82 87
 define ("_COUNTCATS", "Fix Category Counts");
83 88
 define ("_CURRENTVERSION", "The current version of eFiction is ");
... ...
@@ -388,6 +393,10 @@ define ("_HELP_UPDATE", "After uploading eFiction script updates to your archive
388 393
 define ("_HELP_CATORDER", "This option will fix errors in the numbering of the category order saved in the database.  This will <strong>not</strong> change the order of your categories only correct errors in the database numbering.");
389 394
 define ("_HELP_PANELORDER", "This option will fix errors in the numbering of the panel order saved in the database.  This will <strong>not</strong> change the order of your panels only correct errors in the database numbering.");
390 395
 define ("_HELP_RECALCSTORIES", "Click here to fix the story count for authors.");
396
+define("_HELP_CONVERTMOD", "This converts your current eFiction install to eFiction 3 Mod.");
397
+define("_HELP_CONVERTUTF", "This converts your current eFiction 3 Mod install back to supporting Unicode 4.0.");
398
+define("_HELP_CONVERT0900", "This converts your current eFiction 3 Mod install to support Unicode 9.0.");
399
+define("_HELP_CONVERT1400", "This converts your current eFiction 3 Mod install to support Unicode 14.0.");
391 400
 
392 401
 // Log strings
393 402