Browse Source

increased board uri/title/subtitle character limits

pull/40/head
Michael Save 12 years ago
parent
commit
3b17f32047
  1. 6
      inc/mod.php
  2. 7
      install.php
  3. 6
      install.sql
  4. 6
      mod.php

6
inc/mod.php

@ -213,17 +213,17 @@
'<table>' .
'<tr>' .
'<th><label for="board">URI</label></th>' .
'<td><input type="text" name="uri" id="board" size="3" maxlength="8" />' .
'<td><input type="text" name="uri" id="board" size="10" maxlength="15" />' .
' <span class="unimportant">(eg. "b"; "mu")</span></td>' .
'</tr>' .
'<tr>' .
'<th><label for="title">Title</label></th>' .
'<td><input type="text" name="title" id="title" size="15" maxlength="20" />' .
'<td><input type="text" name="title" id="title" size="25" maxlength="40" />' .
' <span class="unimportant">(eg. "Random")</span></td>' .
'</tr>' .
'<tr>' .
'<th><label for="subtitle">Subtitle</label></th>' .
'<td><input type="text" name="subtitle" id="subtitle" size="20" maxlength="40" />' .
'<td><input type="text" name="subtitle" id="subtitle" size="25" maxlength="120" />' .
' <span class="unimportant">(optional)</span></td>' .
'</tr>' .
'<tr>' .

7
install.php

@ -1,6 +1,6 @@
<?php
// Installation/upgrade file
define('VERSION', 'v0.9.5-dev-2');
define('VERSION', 'v0.9.5-dev-3');
require 'inc/functions.php';
require 'inc/display.php';
@ -164,6 +164,11 @@
query(sprintf("ALTER TABLE `posts_%s` ADD `body_nomarkup` TEXT NULL AFTER `body`", $board['uri'])) or error(db_error());
}
query("CREATE TABLE IF NOT EXISTS `cites` ( `board` varchar(8) NOT NULL, `post` int(11) NOT NULL, `target_board` varchar(8) NOT NULL, `target` int(11) NOT NULL, KEY `target` (`target_board`,`target`), KEY `post` (`board`,`post`)) ENGINE=MyISAM DEFAULT CHARSET=utf8;") or error(db_error());
case 'v0.9.5-dev-2':
query("ALTER TABLE `boards`
CHANGE `uri` `uri` VARCHAR( 15 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
CHANGE `title` `title` VARCHAR( 40 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
CHANGE `subtitle` `subtitle` VARCHAR( 120 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL");
case false:
// Update version number
file_write($config['has_installed'], VERSION);

6
install.sql

@ -46,9 +46,9 @@ CREATE TABLE IF NOT EXISTS `bans` (
CREATE TABLE IF NOT EXISTS `boards` (
`id` smallint(6) NOT NULL AUTO_INCREMENT,
`uri` varchar(8) NOT NULL,
`title` varchar(20) NOT NULL,
`subtitle` varchar(40) DEFAULT NULL,
`uri` varchar(15) NOT NULL,
`title` varchar(40) NOT NULL,
`subtitle` varchar(120) DEFAULT NULL,
PRIMARY KEY (`uri`),
UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;

6
mod.php

@ -2024,11 +2024,11 @@
error(sprintf($config['error']['required'], 'title'));
// Check string lengths
if(mb_strlen($b['uri']) > 8)
if(mb_strlen($b['uri']) > 15)
error(sprintf($config['error']['toolong'], 'URI'));
if(mb_strlen($b['title']) > 20)
if(strlen($b['title']) > 40)
error(sprintf($config['error']['toolong'], 'title'));
if(mb_strlen($b['subtitle']) > 40)
if(strlen($b['subtitle']) > 120)
error(sprintf($config['error']['toolong'], 'subtitle'));
if(!preg_match('/^\w+$/', $b['uri']))

Loading…
Cancel
Save