This commit is contained in:
Savetheinternet 2010-11-30 19:12:35 +11:00
parent cd999b41f9
commit 27cc4af33a
3 changed files with 13 additions and 6 deletions

View File

@ -70,7 +70,6 @@
define('ALLOW_ZIP', false, true); define('ALLOW_ZIP', false, true);
define('ZIP_IMAGE', 'src/zip.png', true); define('ZIP_IMAGE', 'src/zip.png', true);
/** /**
Redraw the image using GD functions to strip any excess data (commonly ZIP archives) Redraw the image using GD functions to strip any excess data (commonly ZIP archives)
WARNING: Very beta. Currently strips animated GIFs too :( WARNING: Very beta. Currently strips animated GIFs too :(
@ -88,7 +87,7 @@
define('DIR_RES', 'res/', true); define('DIR_RES', 'res/', true);
// The root directory, including the trailing slash, for Tinyboard. // The root directory, including the trailing slash, for Tinyboard.
// examples: '/', '/board/', '/chan/' // examples: '/', 'http://boards.chan.org/', '/chan/'
define('ROOT', '/', true); define('ROOT', '/', true);
// If for some reason the folders and static HTML index files aren't in the current working direcotry, // If for some reason the folders and static HTML index files aren't in the current working direcotry,
@ -102,6 +101,9 @@
// Multi-board (%s is board abbreviation) // Multi-board (%s is board abbreviation)
define('BOARD_PATH', '%s', true); define('BOARD_PATH', '%s', true);
// Name of the boards. Typically '/%s/' (/b/, /mu/, etc)
define('BOARD_ABBREVIATION', '/%s/', true);
// Automatically convert things like "..." to Unicode characters ("…") // Automatically convert things like "..." to Unicode characters ("…")
define('AUTO_UNICODE', true, true); define('AUTO_UNICODE', true, true);
// Use some Wiki-like syntax (''em'', '''strong''', ==Heading==, etc) // Use some Wiki-like syntax (''em'', '''strong''', ==Heading==, etc)

View File

@ -25,10 +25,11 @@
} }
function post($post, $OP) { function post($post, $OP) {
global $sql; global $sql, $board;
if($OP) { if($OP) {
mysql_query( mysql_query(
sprintf("INSERT INTO `posts` VALUES ( NULL, NULL, '%s', '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%d', '%d', '%s', '%d', '%d', '%d', '%s', '%s', '%s', '%s' )", sprintf("INSERT INTO `posts` VALUES ( NULL, '%d', NULL, '%s', '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%d', '%d', '%s', '%d', '%d', '%d', '%s', '%s', '%s', '%s' )",
$board['id'],
$post['subject'], $post['subject'],
$post['email'], $post['email'],
$post['name'], $post['name'],
@ -51,7 +52,8 @@
return mysql_insert_id($sql); return mysql_insert_id($sql);
} else { } else {
mysql_query( mysql_query(
sprintf("INSERT INTO `posts` VALUES ( NULL, '%d', '%s', '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%d', '%d', '%s', '%d', '%d', '%d', '%s', '%s', '%s', '%s' )", sprintf("INSERT INTO `posts` VALUES ( NULL, '%d', '%d', '%s', '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%d', '%d', '%s', '%d', '%d', '%d', '%s', '%s', '%s', '%s' )",
$board['id'],
$post['thread'], $post['thread'],
$post['subject'], $post['subject'],
$post['email'], $post['email'],

View File

@ -8,10 +8,13 @@
require 'inc/config.php'; require 'inc/config.php';
require 'inc/user.php'; require 'inc/user.php';
// For example, we're on /b/
$board = Array( $board = Array(
'url' => '/b/', 'id' => 1,
'uri' => 'b',
'name' => 'Beta', 'name' => 'Beta',
'title' => 'In development.'); 'title' => 'In development.');
$board['url'] = sprintf(BOARD_ABBREVIATION, $board['uri']);
$body = ''; $body = '';