Add UTF-8 and IPv6 support

This commit is contained in:
Trevor Slocum 2015-09-15 19:00:05 -07:00
parent adc0f7f35f
commit b88b8a0741
4 changed files with 19 additions and 17 deletions

View File

@ -9,7 +9,7 @@ TinyIB - A Lightweight and Efficient [Image Board](http://en.wikipedia.org/wiki/
For demos see the [TinyIB Installations](https://github.com/tslocum/TinyIB/wiki) page.
**Database structure was last modified on *21st Aug 2015*.** Are you unable to create new posts? Run the SQL on [this page](https://github.com/tslocum/TinyIB/wiki/NewSQLStructure) to finish the upgrade process.
**Database structure was last modified on *15th Sep 2015*.** Are you unable to create new posts? Run the SQL on [this page](https://github.com/tslocum/TinyIB/wiki/NewSQLStructure) to finish the upgrade process.
Features
------------
@ -20,7 +20,7 @@ Features
- Delete post via password.
- Management panel:
- Administrators and moderators use separate passwords.
- Moderators are only able to delete posts, or approve them when necessary. (See ``TINYIB_REQMOD``)
- Moderators are only able to sticky threads, delete posts, and approve posts when necessary. (See ``TINYIB_REQMOD``)
- Ban offensive/abusive posters across all boards.
- Post using raw HTML.
- Upgrade automatically when installed via git. (Tested on Linux only)

View File

@ -15,6 +15,7 @@ $db_selected = mysql_select_db(TINYIB_DBNAME, $link);
if (!$db_selected) {
fancyDie("Could not select database: " . mysql_error());
}
mysql_query("SET NAMES 'utf8'");
// Create the posts table if it does not exist
if (mysql_num_rows(mysql_query("SHOW TABLES LIKE '" . TINYIB_DBPOSTS . "'")) == 0) {

View File

@ -15,6 +15,7 @@ $db_selected = @mysqli_query($link, "USE " . constant('TINYIB_DBNAME'));
if (!$db_selected) {
fancyDie("Could not select database: " . ((is_object($link)) ? mysqli_error($link) : (($link_error = mysqli_connect_error()) ? $link_error : '(unknown error')));
}
mysqli_query($link, "SET NAMES 'utf8'");
// Create the posts table if it does not exist
if (mysqli_num_rows(mysqli_query($link, "SHOW TABLES LIKE '" . TINYIB_DBPOSTS . "'")) == 0) {

View File

@ -8,22 +8,22 @@ $posts_sql = "CREATE TABLE `" . TINYIB_DBPOSTS . "` (
`parent` mediumint(7) unsigned NOT NULL,
`timestamp` int(20) NOT NULL,
`bumped` int(20) NOT NULL,
`ip` varchar(15) NOT NULL,
`name` varchar(75) NOT NULL,
`tripcode` varchar(10) NOT NULL,
`email` varchar(75) NOT NULL,
`nameblock` varchar(255) NOT NULL,
`subject` varchar(75) NOT NULL,
`message` text NOT NULL,
`password` varchar(255) NOT NULL,
`file` text NOT NULL,
`file_hex` varchar(75) NOT NULL,
`file_original` varchar(255) NOT NULL,
`ip` varchar(39) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`name` varchar(75) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`tripcode` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`email` varchar(75) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`nameblock` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`subject` varchar(75) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`message` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`password` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`file` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`file_hex` varchar(75) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`file_original` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`file_size` int(20) unsigned NOT NULL default '0',
`file_size_formatted` varchar(75) NOT NULL,
`file_size_formatted` varchar(75) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`image_width` smallint(5) unsigned NOT NULL default '0',
`image_height` smallint(5) unsigned NOT NULL default '0',
`thumb` varchar(255) NOT NULL,
`thumb` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`thumb_width` smallint(5) unsigned NOT NULL default '0',
`thumb_height` smallint(5) unsigned NOT NULL default '0',
`stickied` tinyint(1) NOT NULL default '0',
@ -37,10 +37,10 @@ $posts_sql = "CREATE TABLE `" . TINYIB_DBPOSTS . "` (
$bans_sql = "CREATE TABLE `" . TINYIB_DBBANS . "` (
`id` mediumint(7) unsigned NOT NULL auto_increment,
`ip` varchar(15) NOT NULL,
`ip` varchar(39) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`timestamp` int(20) NOT NULL,
`expire` int(20) NOT NULL,
`reason` text NOT NULL,
`reason` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
KEY `ip` (`ip`)
)";