summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSavetheinternet <savetheinternet@n0v4.com>2010-11-30 19:12:35 +1100
committerSavetheinternet <savetheinternet@n0v4.com>2010-11-30 19:12:35 +1100
commit27cc4af33a526ca56f9bd648e20c5669b4775139 (patch)
treed64ac2df0653f9f81d6e21ecc2e06ace5e3c9ab4
parentcd999b41f922cfbc71aae6c375f0971b9f29996c (diff)
boards
-rw-r--r--inc/config.php6
-rw-r--r--inc/functions.php8
-rw-r--r--post.php5
3 files changed, 13 insertions, 6 deletions
diff --git a/inc/config.php b/inc/config.php
index 529fd6eb..eeab72de 100644
--- a/inc/config.php
+++ b/inc/config.php
@@ -70,7 +70,6 @@
define('ALLOW_ZIP', false, true);
define('ZIP_IMAGE', 'src/zip.png', true);
-
/**
Redraw the image using GD functions to strip any excess data (commonly ZIP archives)
WARNING: Very beta. Currently strips animated GIFs too :(
@@ -88,7 +87,7 @@
define('DIR_RES', 'res/', true);
// The root directory, including the trailing slash, for Tinyboard.
- // examples: '/', '/board/', '/chan/'
+ // examples: '/', 'http://boards.chan.org/', '/chan/'
define('ROOT', '/', true);
// If for some reason the folders and static HTML index files aren't in the current working direcotry,
@@ -101,6 +100,9 @@
// Multi-board (%s is board abbreviation)
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 ("…")
define('AUTO_UNICODE', true, true);
diff --git a/inc/functions.php b/inc/functions.php
index 4e03a531..ff568e30 100644
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -25,10 +25,11 @@
}
function post($post, $OP) {
- global $sql;
+ global $sql, $board;
if($OP) {
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['email'],
$post['name'],
@@ -51,7 +52,8 @@
return mysql_insert_id($sql);
} else {
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['subject'],
$post['email'],
diff --git a/post.php b/post.php
index cbd6da59..3e4e6934 100644
--- a/post.php
+++ b/post.php
@@ -8,10 +8,13 @@
require 'inc/config.php';
require 'inc/user.php';
+ // For example, we're on /b/
$board = Array(
- 'url' => '/b/',
+ 'id' => 1,
+ 'uri' => 'b',
'name' => 'Beta',
'title' => 'In development.');
+ $board['url'] = sprintf(BOARD_ABBREVIATION, $board['uri']);
$body = '';