' .
'
';
@@ -120,7 +119,7 @@
. (!empty($this->trip) ? ' '.$this->trip.' ':'');
// IP Address
- if($mod && $mod['type'] >= MOD_SHOW_IP) {
+ if($this->mod && $this->mod['type'] >= MOD_SHOW_IP) {
$built .= ' [' . $this->ip . ' ]';
}
@@ -140,7 +139,7 @@
'
';
// File info
- if(!empty($this->file)) {
+ if(!empty($this->file) && $this->file != 'deleted') {
$built .= '
File: ' . $this->file . ' (' .
// Filesize
format_bytes($this->filesize) . ', ' .
@@ -156,6 +155,8 @@
// Thumbnail
' ';
+ } elseif($this->file == 'deleted') {
+ $built .= ' ';
}
$built .= $this->postControls();
@@ -169,7 +170,7 @@
class Thread {
public $omitted = 0;
- public function __construct($id, $subject, $email, $name, $trip, $body, $time, $thumb, $thumbx, $thumby, $file, $filex, $filey, $filesize, $filename, $ip, $sticky, $root=ROOT) {
+ public function __construct($id, $subject, $email, $name, $trip, $body, $time, $thumb, $thumbx, $thumby, $file, $filex, $filey, $filesize, $filename, $ip, $sticky, $root=ROOT, $mod=false) {
$this->id = $id;
$this->subject = utf8tohtml($subject);
$this->email = $email;
@@ -190,36 +191,35 @@
$this->ip = $ip;
$this->sticky = $sticky;
$this->root = $root;
+ $this->mod = $mod;
}
public function add(Post $post) {
$this->posts[] = $post;
}
- public function postControls() {
- global $mod;
-
+ public function postControls() {
$built = '';
- if($mod) {
+ if($this->mod) {
// Mod controls (on posts)
$built .= '';
// Delete
- if($mod['type'] >= MOD_DELETE)
+ if($this->mod['type'] >= MOD_DELETE)
$built .= ' ' . MOD_LINK_DELETE . ' ';
// Delete all posts by IP
- if($mod['type'] >= MOD_DELETEBYIP)
+ if($this->mod['type'] >= MOD_DELETEBYIP)
$built .= ' ' . MOD_LINK_DELETEBYIP . ' ';
// Ban
- if($mod['type'] >= MOD_BAN)
+ if($this->mod['type'] >= MOD_BAN)
$built .= ' ' . MOD_LINK_BAN . ' ';
// Ban & Delete
- if($mod['type'] >= MOD_BANDELETE)
+ if($this->mod['type'] >= MOD_BANDELETE)
$built .= ' ' . MOD_LINK_BANDELETE . ' ';
// Delete file (keep post)
- if($mod['type'] >= MOD_STICKY)
+ if($this->mod['type'] >= MOD_STICKY)
if($this->sticky)
$built .= ' ' . MOD_LINK_DESTICKY . ' ';
else
@@ -231,7 +231,7 @@
}
public function build($index=false) {
- global $board, $mod;
+ global $board;
$built = 'File: ' . $this->file . ' (' .
// Filesize
@@ -262,7 +262,7 @@
. (!empty($this->trip) ? ' '.$this->trip.' ':'');
// IP Address
- if($mod && $mod['type'] >= MOD_SHOW_IP) {
+ if($this->mod && $this->mod['type'] >= MOD_SHOW_IP) {
$built .= ' [' . $this->ip . ' ]';
}
diff --git a/inc/functions.php b/inc/functions.php
index 2ba34827..36ee9807 100644
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -131,7 +131,7 @@
if($query->rowcount() < 1 && $page > 1) return false;
while($th = $query->fetch()) {
- $thread = new Thread($th['id'], $th['subject'], $th['email'], $th['name'], $th['trip'], $th['body'], $th['time'], $th['thumb'], $th['thumbwidth'], $th['thumbheight'], $th['file'], $th['filewidth'], $th['fileheight'], $th['filesize'], $th['filename'], $th['ip'], $th['sticky'], $mod ? '?/' : ROOT);
+ $thread = new Thread($th['id'], $th['subject'], $th['email'], $th['name'], $th['trip'], $th['body'], $th['time'], $th['thumb'], $th['thumbwidth'], $th['thumbheight'], $th['file'], $th['filewidth'], $th['fileheight'], $th['filesize'], $th['filename'], $th['ip'], $th['sticky'], $mod ? '?/' : ROOT, $mod);
$posts = prepare(sprintf("SELECT `id`, `subject`, `email`, `name`, `trip`, `body`, `time`, `thumb`, `thumbwidth`, `thumbheight`, `file`, `filewidth`, `fileheight`, `filesize`, `filename`,`ip` FROM `posts_%s` WHERE `thread` = ? ORDER BY `time` DESC LIMIT ?", $board['uri']));
$posts->bindValue(1, $th['id']);
@@ -151,7 +151,7 @@
}
while($po = $posts->fetch()) {
- $thread->add(new Post($po['id'], $th['id'], $po['subject'], $po['email'], $po['name'], $po['trip'], $po['body'], $po['time'], $po['thumb'], $po['thumbwidth'], $po['thumbheight'], $po['file'], $po['filewidth'], $po['fileheight'], $po['filesize'], $po['filename'], $po['ip'], $mod ? '?/' : ROOT));
+ $thread->add(new Post($po['id'], $th['id'], $po['subject'], $po['email'], $po['name'], $po['trip'], $po['body'], $po['time'], $po['thumb'], $po['thumbwidth'], $po['thumbheight'], $po['file'], $po['filewidth'], $po['fileheight'], $po['filesize'], $po['filename'], $po['ip'], $mod ? '?/' : ROOT, $mod));
}
$thread->posts = array_reverse($thread->posts);
@@ -319,9 +319,9 @@
while($post = $query->fetch()) {
if(!isset($thread)) {
- $thread = new Thread($post['id'], $post['subject'], $post['email'], $post['name'], $post['trip'], $post['body'], $post['time'], $post['thumb'], $post['thumbwidth'], $post['thumbheight'], $post['file'], $post['filewidth'], $post['fileheight'], $post['filesize'], $post['filename'], $post['ip'], $post['sticky'], $mod ? '?/' : ROOT);
+ $thread = new Thread($post['id'], $post['subject'], $post['email'], $post['name'], $post['trip'], $post['body'], $post['time'], $post['thumb'], $post['thumbwidth'], $post['thumbheight'], $post['file'], $post['filewidth'], $post['fileheight'], $post['filesize'], $post['filename'], $post['ip'], $post['sticky'], $mod ? '?/' : ROOT, $mod);
} else {
- $thread->add(new Post($post['id'], $thread->id, $post['subject'], $post['email'], $post['name'], $post['trip'], $post['body'], $post['time'], $post['thumb'], $post['thumbwidth'], $post['thumbheight'], $post['file'], $post['filewidth'], $post['fileheight'], $post['filesize'], $post['filename'], $post['ip'], $mod ? '?/' : ROOT));
+ $thread->add(new Post($post['id'], $thread->id, $post['subject'], $post['email'], $post['name'], $post['trip'], $post['body'], $post['time'], $post['thumb'], $post['thumbwidth'], $post['thumbheight'], $post['file'], $post['filewidth'], $post['fileheight'], $post['filesize'], $post['filename'], $post['ip'], $mod ? '?/' : ROOT, $mod));
}
}
diff --git a/inc/mod.php b/inc/mod.php
index a2ee93ce..c73b72f0 100644
--- a/inc/mod.php
+++ b/inc/mod.php
@@ -159,7 +159,12 @@
// Delete file
@unlink($board['dir'] . DIR_IMG . $post['file']);
+ // Update database
+ $query = prepare(sprintf("UPDATE `posts_%s` SET `thumb` = NULL, `thumbwidth` = NULL, `thumbheight` = NULL, `filewidth` = NULL, `fileheight` = NULL, `filesize` = NULL, `filename` = NULL, `filehash` = NULL, `file` = 'deleted' WHERE `id` = :id OR `thread` = :id", $board['uri']));
+ $query->bindValue(':id', $id, PDO::PARAM_INT);
+ $query->execute() or error(db_error($query));
+ buildThread($post['thread']);
}
// Delete a post (reply or thread)
diff --git a/mod.php b/mod.php
index 6bce948f..be9268a0 100644
--- a/mod.php
+++ b/mod.php
@@ -219,7 +219,7 @@
if(!openBoard($boardName))
error(ERROR_NOBOARD);
- if(!$page = index(empty($matches[2]) || $matches[2] == FILE_INDEX ? 1 : $matches[2], true)) {
+ if(!$page = index(empty($matches[2]) || $matches[2] == FILE_INDEX ? 1 : $matches[2], $mod)) {
error(ERROR_404);
}
$page['pages'] = getPages(true);
@@ -235,9 +235,31 @@
if(!openBoard($boardName))
error(ERROR_NOBOARD);
- $page = buildThread($thread, true, true);
+ $page = buildThread($thread, true, $mod);
echo $page;
+ } elseif(preg_match('/^\/' . $regex['board'] . 'deletefile\/(\d+)$/', $query, $matches)) {
+ if($mod['type'] < MOD_DELETEFILE) error(ERROR_NOACCESS);
+ // Delete file from post
+
+ $boardName = $matches[1];
+ $post = $matches[2];
+ // Open board
+ if(!openBoard($boardName))
+ error(ERROR_NOBOARD);
+
+ // Delete post
+ deleteFile($post);
+ // Rebuild board
+ buildIndex();
+
+
+ // Redirect
+ if(isset($_SERVER['HTTP_REFERER']))
+ header('Location: ' . $_SERVER['HTTP_REFERER'], true, REDIRECT_HTTP);
+ else
+ header('Location: ?/' . sprintf(BOARD_PATH, $boardName) . FILE_INDEX, true, REDIRECT_HTTP);
+
} elseif(preg_match('/^\/' . $regex['board'] . 'delete\/(\d+)$/', $query, $matches)) {
if($mod['type'] < MOD_DELETE) error(ERROR_NOACCESS);
// Delete post
--
cgit v1.3
From f1c48f61227475fad5faa95796b04888089ed589 Mon Sep 17 00:00:00 2001
From: Savetheinternet
Date: Sat, 1 Jan 2011 22:18:58 +1100
Subject: When removing an already-removed image, make it a no-post post.
---
inc/mod.php | 22 +++++++++++++++-------
1 file changed, 15 insertions(+), 7 deletions(-)
(limited to 'inc/mod.php')
diff --git a/inc/mod.php b/inc/mod.php
index c73b72f0..1058cca8 100644
--- a/inc/mod.php
+++ b/inc/mod.php
@@ -153,14 +153,22 @@
$post = $query->fetch();
- // Delete thumbnail
- @unlink($board['dir'] . DIR_THUMB . $post['thumb']);
-
- // Delete file
- @unlink($board['dir'] . DIR_IMG . $post['file']);
-
+ $query = prepare(sprintf("UPDATE `posts_%s` SET `thumb` = NULL, `thumbwidth` = NULL, `thumbheight` = NULL, `filewidth` = NULL, `fileheight` = NULL, `filesize` = NULL, `filename` = NULL, `filehash` = NULL, `file` = :file WHERE `id` = :id OR `thread` = :id", $board['uri']));
+ if($post['file'] == 'deleted') {
+ // Already deleted; remove file fully
+ $query->bindValue(':file', null, PDO::PARAM_NULL);
+ } else {
+ // Delete thumbnail
+ @unlink($board['dir'] . DIR_THUMB . $post['thumb']);
+
+ // Delete file
+ @unlink($board['dir'] . DIR_IMG . $post['file']);
+
+ // Set file to 'deleted'
+ $query->bindValue(':file', 'deleted', PDO::PARAM_INT);
+ }
// Update database
- $query = prepare(sprintf("UPDATE `posts_%s` SET `thumb` = NULL, `thumbwidth` = NULL, `thumbheight` = NULL, `filewidth` = NULL, `fileheight` = NULL, `filesize` = NULL, `filename` = NULL, `filehash` = NULL, `file` = 'deleted' WHERE `id` = :id OR `thread` = :id", $board['uri']));
+
$query->bindValue(':id', $id, PDO::PARAM_INT);
$query->execute() or error(db_error($query));
--
cgit v1.3
From ca7faa835ea8ed5004c66f81b4fb9cecc639bb5d Mon Sep 17 00:00:00 2001
From: Savetheinternet
Date: Sun, 2 Jan 2011 00:27:30 +1100
Subject: Basic ban-adding
---
inc/mod.php | 45 +++++++++++++++++++++++++----
mod.php | 95 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 134 insertions(+), 6 deletions(-)
(limited to 'inc/mod.php')
diff --git a/inc/mod.php b/inc/mod.php
index 1058cca8..4670dc8d 100644
--- a/inc/mod.php
+++ b/inc/mod.php
@@ -111,24 +111,57 @@
return $body;
}
+ function form_newBan($ip=null, $reason='', $continue=false) {
+ return 'New ban ' .
+ '' .
+ ' ';
+ }
+
function form_newBoard() {
return 'New board ' .
'' .
'' .
'' .
- 'URI: ' .
+ 'URI ' .
' ' .
- ' (eg. "b"; "mu") ' .
+ ' (eg. "b"; "mu") ' .
' ' .
'' .
- 'Title: ' .
+ 'Title ' .
' ' .
- ' (eg. "Random") ' .
+ ' (eg. "Random") ' .
' ' .
'' .
- 'Subtitle: ' .
+ 'Subtitle ' .
' ' .
- ' (optional) ' .
+ ' (optional) ' .
' ' .
'' .
' ' .
diff --git a/mod.php b/mod.php
index be9268a0..57c385b2 100644
--- a/mod.php
+++ b/mod.php
@@ -280,7 +280,102 @@
header('Location: ' . $_SERVER['HTTP_REFERER'], true, REDIRECT_HTTP);
else
header('Location: ?/' . sprintf(BOARD_PATH, $boardName) . FILE_INDEX, true, REDIRECT_HTTP);
+ } elseif(preg_match('/^\/' . $regex['board'] . 'ban\/(\d+)$/', $query, $matches)) {
+ if($mod['type'] < MOD_DELETE) error(ERROR_NOACCESS);
+ // Ban by post
+
+ $boardName = $matches[1];
+ $post = $matches[2];
+ // Open board
+ if(!openBoard($boardName))
+ error(ERROR_NOBOARD);
+
+ // Delete post
+ //deletePost($post);
+ // Rebuild board
+ //buildIndex();
+
+ $query = prepare(sprintf("SELECT `ip`,`id` FROM `posts_%s` WHERE `id` = :id LIMIT 1", $board['uri']));
+ $query->bindValue(':id', $post, PDO::PARAM_INT);
+ $query->execute() or error(db_error($query));
+ if($query->rowCount() < 1) {
+ error(ERROR_INVALIDPOST);
+ }
+
+ $post = $query->fetch();
+
+ if(isset($_POST['new_ban'])) {
+ if( !isset($_POST['ip']) ||
+ !isset($_POST['reason']) ||
+ !isset($_POST['length'])
+ ) error(ERROR_MISSEDAFIELD);
+
+ // Check required fields
+ if(empty($_POST['ip']))
+ error(sprintf(ERROR_REQUIRED, 'IP address'));
+
+ $query = prepare("INSERT INTO `bans` VALUES (:ip, :mod, :expires, :reason)");
+
+ // 1yr2hrs30mins
+ // 1y2h30m
+ if(preg_match('/^((\d+)\s?ye?a?r?s?)?\s?+((\d+)\s?we?e?k?s?)?\s?+((\d+)\s?da?y?s?)?((\d+)\s?ho?u?r?s?)?\s?+((\d+)\s?m?i?n?u?t?e?s?)?\s?+((\d+)\s?s?e?c?o?n?d?s?)?$/', $_POST['length'], $m)) {
+ $expire = 0;
+ if(isset($m[2])) {
+ // Years
+ $expire += $m[2]*60*60*24*7*52;
+ }
+ if(isset($m[4])) {
+ // Weeks
+ $expire += $m[4]*60*60*24*7;
+ }
+ if(isset($m[6])) {
+ // Days
+ $expire += $m[6]*60*60*24;
+ }
+ if(isset($m[8])) {
+ // Hours
+ $expire += $m[8]*60*60;
+ }
+ if(isset($m[10])) {
+ // Minutes
+ $expire += $m[10]*60;
+ }
+ if(isset($m[12])) {
+ // Seconds
+ $expire += $m[12];
+ }
+ $query->bindValue(':expires', time()+$expire, PDO::PARAM_INT);
+ } else {
+ // Never expire
+ $query->bindValue(':expires', null, PDO::PARAM_NULL);
+ }
+
+ $query->bindValue(':ip', $_POST['ip'], PDO::PARAM_STR);
+ $query->bindValue(':mod', $mod['id'], PDO::PARAM_INT);
+ if(isset($_POST['reason'])) {
+ $query->bindValue(':reason', $_POST['reason'], PDO::PARAM_STR);
+ } else {
+ $query->bindValue(':reason', null, PDO::PARAM_NULL);
+ }
+ $query->execute() or error(db_error($query));
+
+ // Redirect
+ if(isset($_POST['continue']))
+ header('Location: ' . $_POST['continue'], true, REDIRECT_HTTP);
+ else
+ header('Location: ?/' . sprintf(BOARD_PATH, $boardName) . FILE_INDEX, true, REDIRECT_HTTP);
+ }
+
+ $body = form_newBan($post['ip'], null, isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : false);
+
+ echo Element('page.html', Array(
+ 'index'=>ROOT,
+ 'title'=>'New ban',
+ 'body'=>$body,
+ 'mod'=>true
+ )
+ );
} else {
error(ERROR_404);
}
--
cgit v1.3
From eeb512f54971245dcc7ba63eb616265e0de90902 Mon Sep 17 00:00:00 2001
From: Savetheinternet
Date: Sun, 2 Jan 2011 00:51:20 +1100
Subject: Fixed code to use new column
---
inc/mod.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'inc/mod.php')
diff --git a/inc/mod.php b/inc/mod.php
index 4670dc8d..23ec43af 100644
--- a/inc/mod.php
+++ b/inc/mod.php
@@ -10,7 +10,7 @@
}
function login($username, $password, $makehash=true) {
- global $sql, $mod;
+ global $mod;
// SHA1 password
if($makehash) {
--
cgit v1.3
From f47cccab019f3e7882a188c7d09e3070eb8f82ce Mon Sep 17 00:00:00 2001
From: Savetheinternet
Date: Sat, 15 Jan 2011 15:37:39 +1100
Subject: fixed ban addition page
---
inc/mod.php | 6 ++++--
mod.php | 50 +++++++++++++++++++++++++++-----------------------
2 files changed, 31 insertions(+), 25 deletions(-)
(limited to 'inc/mod.php')
diff --git a/inc/mod.php b/inc/mod.php
index 23ec43af..a325d589 100644
--- a/inc/mod.php
+++ b/inc/mod.php
@@ -111,10 +111,12 @@
return $body;
}
- function form_newBan($ip=null, $reason='', $continue=false) {
+ function form_newBan($ip=null, $reason='', $continue=false, $delete=false, $board=false) {
return 'New ban ' .
- '' .
+ ' ' .
($continue ? ' ' : '') .
+ ($delete ? ' ' : '') .
+ ($board ? ' ' : '') .
'' .
'' .
'IP ' .
diff --git a/mod.php b/mod.php
index f93430b8..b4355fe4 100644
--- a/mod.php
+++ b/mod.php
@@ -348,26 +348,8 @@
header('Location: ' . $_SERVER['HTTP_REFERER'], true, REDIRECT_HTTP);
else
header('Location: ?/' . sprintf(BOARD_PATH, $boardName) . FILE_INDEX, true, REDIRECT_HTTP);
- } elseif(preg_match('/^\/' . $regex['board'] . 'ban(&delete)\/(\d+)$/', $query, $matches)) {
- if($mod['type'] < MOD_DELETE) error(ERROR_NOACCESS);
- // Ban by post
-
- $boardName = $matches[1];
- $delete = isset($matches[2]) && $matches[2] == '&delete';
- $post = $matches[3];
- // Open board
- if(!openBoard($boardName))
- error(ERROR_NOBOARD);
-
- $query = prepare(sprintf("SELECT `ip`,`id` FROM `posts_%s` WHERE `id` = :id LIMIT 1", $board['uri']));
- $query->bindValue(':id', $post, PDO::PARAM_INT);
- $query->execute() or error(db_error($query));
-
- if($query->rowCount() < 1) {
- error(ERROR_INVALIDPOST);
- }
-
- $post = $query->fetch();
+ } elseif(preg_match('/^\/ban$/', $query)) {
+ // Ban page
if(isset($_POST['new_ban'])) {
if( !isset($_POST['ip']) ||
@@ -429,8 +411,10 @@
$query->execute() or error(db_error($query));
// Delete too
- if($delete)
- deletePost($post['id']);
+ if($mod['type'] >= MOD_DELETE && isset($_POST['delete']) && isset($_POST['board'])) {
+ openBoard($_POST['board']);
+ deletePost(round($_POST['delete']));
+ }
// Redirect
if(isset($_POST['continue']))
@@ -438,8 +422,28 @@
else
header('Location: ?/' . sprintf(BOARD_PATH, $boardName) . FILE_INDEX, true, REDIRECT_HTTP);
}
+ } elseif(preg_match('/^\/' . $regex['board'] . 'ban(&delete)?\/(\d+)$/', $query, $matches)) {
+ if($mod['type'] < MOD_DELETE) error(ERROR_NOACCESS);
+ // Ban by post
+
+ $boardName = $matches[1];
+ $delete = isset($matches[2]) && $matches[2] == '&delete';
+ $post = $matches[3];
+ // Open board
+ if(!openBoard($boardName))
+ error(ERROR_NOBOARD);
+
+ $query = prepare(sprintf("SELECT `ip`,`id` FROM `posts_%s` WHERE `id` = :id LIMIT 1", $board['uri']));
+ $query->bindValue(':id', $post, PDO::PARAM_INT);
+ $query->execute() or error(db_error($query));
+
+ if($query->rowCount() < 1) {
+ error(ERROR_INVALIDPOST);
+ }
+
+ $post = $query->fetch();
- $body = form_newBan($post['ip'], null, isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : false);
+ $body = form_newBan($post['ip'], null, isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : false, $delete ? $post['id'] : false, $delete ? $boardName : false);
echo Element('page.html', Array(
'index'=>ROOT,
--
cgit v1.3
From 62bd2ee348f460b3d4cbbdbd8469a783b4c64c78 Mon Sep 17 00:00:00 2001
From: Savetheinternet
Date: Wed, 19 Jan 2011 00:41:43 +1100
Subject: A bunch of stuff.
---
inc/config.php | 9 ++++++
inc/functions.php | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
inc/mod.php | 41 -------------------------
post.php | 9 ++++--
style.css | 10 ++++++
5 files changed, 117 insertions(+), 44 deletions(-)
(limited to 'inc/mod.php')
diff --git a/inc/config.php b/inc/config.php
index f3906b1b..746efb63 100644
--- a/inc/config.php
+++ b/inc/config.php
@@ -76,6 +76,7 @@
define('ERROR_LOCKED', 'Thread locked. You may not reply at this time.', true);
define('ERROR_NOPOST', 'You didn\'t make a post.', true);
define('ERROR_FLOOD', 'Flood detected; Post discared.', true);
+ define('ERROR_UNORIGINAL', 'Unoriginal content!', true);
define('ERR_INVALIDIMG','Invalid image.', true);
define('ERR_FILESIZE', 'Maximum file size: %maxsz% bytes Your file\'s size: %filesz% bytes', true);
define('ERR_MAXSIZE', 'The file was too big.', true);
@@ -163,6 +164,12 @@
// "302" is recommended.
define('REDIRECT_HTTP', 302, true);
+ // Robot stuff
+ // Strip repeating characters when making hashes
+ define('ROBOT_ENABLE', true, true);
+ define('ROBOT_STRIP_REPEATING', true, true);
+
+
/*
Mod stuff
*/
@@ -206,6 +213,8 @@
define('MOD_LOCK', MOD_MOD, true);
// Post in a locked thread
define('MOD_POSTINLOCKED', MOD_MOD, true);
+ // Post bypass unoriginal content check
+ define('MOD_POSTUNORIGINAL', MOD_MOD, true);
/* Administration */
// Display the contents of instant-config.php
diff --git a/inc/functions.php b/inc/functions.php
index 70a17d23..4f4a69bd 100644
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -261,7 +261,62 @@
$query->bindValue(':id', $id, PDO::PARAM_INT);
$query->execute() or error(db_error($query));
}
-
+
+ // Delete a post (reply or thread)
+ function deletePost($id) {
+ global $board;
+
+ // Select post and replies (if thread) in one query
+ $query = prepare(sprintf("SELECT `id`,`thread`,`thumb`,`file` FROM `posts_%s` WHERE `id` = :id OR `thread` = :id", $board['uri']));
+ $query->bindValue(':id', $id, PDO::PARAM_INT);
+ $query->execute() or error(db_error($query));
+
+ if($query->rowCount() < 1) {
+ error(ERROR_INVALIDPOST);
+ }
+
+ // Delete posts and maybe replies
+ while($post = $query->fetch()) {
+ if(!$post['thread']) {
+ // Delete thread HTML page
+ @unlink($board['dir'] . DIR_RES . sprintf(FILE_PAGE, $post['id']));
+ } elseif($query->rowCount() == 1) {
+ // Rebuild thread
+ $rebuild = $post['thread'];
+ }
+ if($post['thumb']) {
+ // Delete thumbnail
+ @unlink($board['dir'] . DIR_THUMB . $post['thumb']);
+ }
+ if($post['file']) {
+ // Delete file
+ @unlink($board['dir'] . DIR_IMG . $post['file']);
+ }
+ }
+
+ $query = prepare(sprintf("DELETE FROM `posts_%s` WHERE `id` = :id OR `thread` = :id", $board['uri']));
+ $query->bindValue(':id', $id, PDO::PARAM_INT);
+ $query->execute() or error(db_error($query));
+
+ if(isset($rebuild)) {
+ buildThread($rebuild);
+ }
+ }
+
+ function clean() {
+ global $board;
+ $offset = round(MAX_PAGES*THREADS_PER_PAGE);
+
+ // I too wish there was an easier way of doing this...
+ $query = prepare(sprintf("SELECT `id` FROM `posts_%s` WHERE `thread` IS NULL ORDER BY `sticky` DESC, `bump` DESC LIMIT :offset, 9001", $board['uri']));
+ $query->bindValue(':offset', $offset, PDO::PARAM_INT);
+
+ $query->execute() or error(db_error($query));
+ while($post = $query->fetch()) {
+ deletePost($post['id']);
+ }
+ }
+
function index($page, $mod=false) {
global $board;
@@ -323,7 +378,41 @@
return $pages;
}
+
+ function makerobot($body) {
+ $body = strtolower($body);
+
+ // Leave only letters
+ $body = preg_replace('/[^a-z]/i', '', $body);
+ // Remove repeating characters
+ if(ROBOT_STRIP_REPEATING)
+ $body = preg_replace('/(.)\\1+/', '$1', $body);
+
+ return sha1($body);
+ }
+
+ function checkRobot($body) {
+ /* CREATE TABLE `robot` (
+`hash` VARCHAR( 40 ) NOT NULL COMMENT 'SHA1'
+) ENGINE = INNODB; */
+
+ $body = makerobot($body);
+ $query = prepare("SELECT 1 FROM `robot` WHERE `hash` = :hash LIMIT 1");
+ $query->bindValue(':hash', $body);
+ $query->execute() or error(db_error($query));
+ if($query->fetch()) {
+ return true;
+ } else {
+ // Insert new hash
+
+ $query = prepare("INSERT INTO `robot` VALUES (:hash)");
+ $query->bindValue(':hash', $body);
+ $query->execute() or error(db_error($query));
+ return false;
+ }
+ }
+
function buildIndex() {
global $board;
sql_open();
@@ -417,6 +506,7 @@
$body = preg_replace("/(^|\n)==(.+?)==\n?/m", "$2 ", $body);
$body = preg_replace("/'''(.+?)'''/m", "$1 ", $body);
$body = preg_replace("/''(.+?)''/m", "$1 ", $body);
+ $body = preg_replace("/\*\*(.+?)\*\*/m", "$1 ", $body);
}
$body = preg_replace("/\n/", ' ', $body);
}
diff --git a/inc/mod.php b/inc/mod.php
index a325d589..5e3a2c87 100644
--- a/inc/mod.php
+++ b/inc/mod.php
@@ -209,45 +209,4 @@
buildThread($post['thread']);
}
-
- // Delete a post (reply or thread)
- function deletePost($id) {
- global $board;
-
- // Select post and replies (if thread) in one query
- $query = prepare(sprintf("SELECT `id`,`thread`,`thumb`,`file` FROM `posts_%s` WHERE `id` = :id OR `thread` = :id", $board['uri']));
- $query->bindValue(':id', $id, PDO::PARAM_INT);
- $query->execute() or error(db_error($query));
-
- if($query->rowCount() < 1) {
- error(ERROR_INVALIDPOST);
- }
-
- // Delete posts and maybe replies
- while($post = $query->fetch()) {
- if(!$post['thread']) {
- // Delete thread HTML page
- @unlink($board['dir'] . DIR_RES . sprintf(FILE_PAGE, $post['id']));
- } elseif($query->rowCount() == 1) {
- // Rebuild thread
- $rebuild = $post['thread'];
- }
- if($post['thumb']) {
- // Delete thumbnail
- @unlink($board['dir'] . DIR_THUMB . $post['thumb']);
- }
- if($post['file']) {
- // Delete file
- @unlink($board['dir'] . DIR_IMG . $post['file']);
- }
- }
-
- $query = prepare(sprintf("DELETE FROM `posts_%s` WHERE `id` = :id OR `thread` = :id", $board['uri']));
- $query->bindValue(':id', $id, PDO::PARAM_INT);
- $query->execute() or error(db_error($query));
-
- if(isset($rebuild)) {
- buildThread($rebuild);
- }
- }
?>
\ No newline at end of file
diff --git a/post.php b/post.php
index 66247f4f..40830f0f 100644
--- a/post.php
+++ b/post.php
@@ -147,6 +147,9 @@
if(checkFlood($post))
error(ERROR_FLOOD);
+ if(!($mod && $mod['type'] >= MOD_POSTUNORIGINAL) && ROBOT_ENABLE && checkRobot($post['body']))
+ error(ERROR_UNORIGINAL);
+
if($post['has_file']) {
// Just trim the filename if it's too long
if(strlen($post['filename']) > 30) $post['filename'] = substr($post['filename'], 0, 27).'…';
@@ -221,7 +224,6 @@
}
// Todo: Validate some more, remove messy code, allow more specific configuration
-
$id = post($post, $OP);
if($post['has_file'] && $post['zip']) {
@@ -322,10 +324,13 @@
buildThread(($OP?$id:$post['thread']));
- if(!$OP) {
+ if(!$OP && $post['email'] != 'sage') {
bumpThread($post['thread']);
}
+ if($OP)
+ clean();
+
buildIndex();
sql_close();
diff --git a/style.css b/style.css
index ca26a8da..60c36d19 100644
--- a/style.css
+++ b/style.css
@@ -199,6 +199,10 @@ span.controls.op {
span.controls a {
margin: 0;
}
+div#wrap {
+ width: 900px;
+ margin:0 auto;
+}
div.ban {
background: white;
border: 1px solid #98E;
@@ -219,4 +223,10 @@ div.ban p {
}
div.ban p.reason {
font-weight: bold;
+}
+span.spoiler {
+ background: black;
+}
+span.spoiler:hover {
+ color: white;
}
\ No newline at end of file
--
cgit v1.3
From 67148f28463f8d4f2b7b61d38aa5d71df9658e4c Mon Sep 17 00:00:00 2001
From: Savetheinternet
Date: Fri, 21 Jan 2011 13:14:55 +1100
Subject: ...
---
default.css | 0
inc/display.php | 13 ++++++++++++-
inc/functions.php | 36 ++++++++++++++++++++++++++++++++++++
inc/mod.php | 37 +------------------------------------
main.js | 23 +++++++++++++++++++++--
style.css | 13 ++++++++++++-
6 files changed, 82 insertions(+), 40 deletions(-)
create mode 100644 default.css
(limited to 'inc/mod.php')
diff --git a/default.css b/default.css
new file mode 100644
index 00000000..e69de29b
diff --git a/inc/display.php b/inc/display.php
index 66637d0d..0678cef7 100644
--- a/inc/display.php
+++ b/inc/display.php
@@ -110,7 +110,9 @@
global $board;
$built = '' .
- '
';
+ '
' .
+ // Delete
+ '';
// Subject
if(!empty($this->subject))
@@ -135,6 +137,9 @@
// Date/time
$built .= ' ' . date(POST_DATE, $this->time);
+ // End delete
+ $built .= ' ';
+
$built .= ' ';
+ // Delete
+ $built .= '';
+
// Subject
if(!empty($this->subject))
$built .= '' . $this->subject . ' ';
@@ -289,6 +297,9 @@
// Date/time
$built .= ' ' . date(POST_DATE, $this->time);
+ // End delete
+ $built .= ' ';
+
$built .= ' execute() or error(db_error($query));
}
+ // Remove file from post
+ function deleteFile($id, $remove_entirely_if_already=true) {
+ global $board;
+
+ $query = prepare(sprintf("SELECT `thread`,`thumb`,`file` FROM `posts_%s` WHERE `id` = :id AND `thread` IS NOT NULL LIMIT 1", $board['uri']));
+ $query->bindValue(':id', $id, PDO::PARAM_INT);
+ $query->execute() or error(db_error($query));
+
+ if($query->rowCount() < 1) {
+ error(ERROR_INVALIDPOST);
+ }
+
+ $post = $query->fetch();
+
+ $query = prepare(sprintf("UPDATE `posts_%s` SET `thumb` = NULL, `thumbwidth` = NULL, `thumbheight` = NULL, `filewidth` = NULL, `fileheight` = NULL, `filesize` = NULL, `filename` = NULL, `filehash` = NULL, `file` = :file WHERE `id` = :id OR `thread` = :id", $board['uri']));
+ if($post['file'] == 'deleted' && $remove_entirely_if_already) {
+ // Already deleted; remove file fully
+ $query->bindValue(':file', null, PDO::PARAM_NULL);
+ } else {
+ // Delete thumbnail
+ @unlink($board['dir'] . DIR_THUMB . $post['thumb']);
+
+ // Delete file
+ @unlink($board['dir'] . DIR_IMG . $post['file']);
+
+ // Set file to 'deleted'
+ $query->bindValue(':file', 'deleted', PDO::PARAM_INT);
+ }
+ // Update database
+
+ $query->bindValue(':id', $id, PDO::PARAM_INT);
+ $query->execute() or error(db_error($query));
+
+ buildThread($post['thread']);
+ }
+
// Delete a post (reply or thread)
function deletePost($id) {
global $board;
diff --git a/inc/mod.php b/inc/mod.php
index 5e3a2c87..5a3e6157 100644
--- a/inc/mod.php
+++ b/inc/mod.php
@@ -173,40 +173,5 @@
'' .
'';
}
-
- // Remove file from post
- function deleteFile($id) {
- global $board;
-
- $query = prepare(sprintf("SELECT `thread`,`thumb`,`file` FROM `posts_%s` WHERE `id` = :id AND `thread` IS NOT NULL LIMIT 1", $board['uri']));
- $query->bindValue(':id', $id, PDO::PARAM_INT);
- $query->execute() or error(db_error($query));
-
- if($query->rowCount() < 1) {
- error(ERROR_INVALIDPOST);
- }
-
- $post = $query->fetch();
-
- $query = prepare(sprintf("UPDATE `posts_%s` SET `thumb` = NULL, `thumbwidth` = NULL, `thumbheight` = NULL, `filewidth` = NULL, `fileheight` = NULL, `filesize` = NULL, `filename` = NULL, `filehash` = NULL, `file` = :file WHERE `id` = :id OR `thread` = :id", $board['uri']));
- if($post['file'] == 'deleted') {
- // Already deleted; remove file fully
- $query->bindValue(':file', null, PDO::PARAM_NULL);
- } else {
- // Delete thumbnail
- @unlink($board['dir'] . DIR_THUMB . $post['thumb']);
-
- // Delete file
- @unlink($board['dir'] . DIR_IMG . $post['file']);
-
- // Set file to 'deleted'
- $query->bindValue(':file', 'deleted', PDO::PARAM_INT);
- }
- // Update database
-
- $query->bindValue(':id', $id, PDO::PARAM_INT);
- $query->execute() or error(db_error($query));
-
- buildThread($post['thread']);
- }
+
?>
\ No newline at end of file
diff --git a/main.js b/main.js
index dd46cd18..d0a82dda 100644
--- a/main.js
+++ b/main.js
@@ -14,9 +14,21 @@ function focusId(id)
document.getElementById(id).focus();
init();
}
+
+function generatePassword() {
+ pass = '';
+ chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+';
+ for(i=0;i<8;i++) {
+ rnd = Math.floor(Math.random() * chars.length);
+ pass += chars.substring(rnd,rnd + 1);
+ }
+ return pass;
+}
+
function dopost(form) {
- localStorage.name = form.name.value;
- localStorage.email = form.email.value;
+ localStorage.name = form.name.value.replace(/ ##.+$/, '');
+ if(form.email.value != 'sage')
+ localStorage.email = form.email.value;
return form.body.value != "" || (typeof form.thread != "undefined" && form.file.value != "");
}
@@ -65,6 +77,13 @@ function init()
newElement.appendChild(style);
}
+ if(!localStorage.password)
+ localStorage.password = generatePassword();
+ elements = document.getElementsByName('password');
+ for(x=0;x
Date: Fri, 11 Feb 2011 23:02:30 +1100
Subject: a Fixed delete by IP, plus a bunch of small stuff
---
inc/functions.php | 12 ++++++++----
inc/mod.php | 12 +++++++++++-
main.js | 7 +++++--
mod.php | 39 ++++++++++++++++++++++++++++++++++++++-
post.php | 2 +-
5 files changed, 63 insertions(+), 9 deletions(-)
(limited to 'inc/mod.php')
diff --git a/inc/functions.php b/inc/functions.php
index c9b85ad4..6901de62 100644
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -299,7 +299,7 @@
}
// Delete a post (reply or thread)
- function deletePost($id) {
+ function deletePost($id, $error_if_doesnt_exist=true) {
global $board;
// Select post and replies (if thread) in one query
@@ -308,7 +308,9 @@
$query->execute() or error(db_error($query));
if($query->rowCount() < 1) {
- error(ERROR_INVALIDPOST);
+ if($error_if_doesnt_exist)
+ error(ERROR_INVALIDPOST);
+ else return false;
}
// Delete posts and maybe replies
@@ -337,6 +339,8 @@
if(isset($rebuild)) {
buildThread($rebuild);
}
+
+ return true;
}
function clean() {
@@ -370,7 +374,7 @@
while($th = $query->fetch()) {
$thread = new Thread($th['id'], $th['subject'], $th['email'], $th['name'], $th['trip'], $th['body'], $th['time'], $th['thumb'], $th['thumbwidth'], $th['thumbheight'], $th['file'], $th['filewidth'], $th['fileheight'], $th['filesize'], $th['filename'], $th['ip'], $th['sticky'], $th['locked'], $mod ? '?/' : ROOT, $mod);
- $posts = prepare(sprintf("SELECT `id`, `subject`, `email`, `name`, `trip`, `body`, `time`, `thumb`, `thumbwidth`, `thumbheight`, `file`, `filewidth`, `fileheight`, `filesize`, `filename`,`ip` FROM `posts_%s` WHERE `thread` = ? ORDER BY `time` DESC LIMIT ?", $board['uri']));
+ $posts = prepare(sprintf("SELECT `id`, `subject`, `email`, `name`, `trip`, `body`, `time`, `thumb`, `thumbwidth`, `thumbheight`, `file`, `filewidth`, `fileheight`, `filesize`, `filename`,`ip` FROM `posts_%s` WHERE `thread` = ? ORDER BY `id` DESC LIMIT ?", $board['uri']));
$posts->bindValue(1, $th['id']);
$posts->bindValue(2, THREADS_PREVIEW, PDO::PARAM_INT);
$posts->execute() or error(db_error($posts));
@@ -859,7 +863,7 @@
switch($type) {
case 'jpg':
case 'jpeg':
- if(!$image = imagecreatefromjpeg($source_pic)) {
+ if(!$image = @imagecreatefromjpeg($source_pic)) {
unlink($source_pic);
error(ERR_INVALIDIMG);
}
diff --git a/inc/mod.php b/inc/mod.php
index 5a3e6157..115c595a 100644
--- a/inc/mod.php
+++ b/inc/mod.php
@@ -20,7 +20,7 @@
$query = prepare("SELECT `id`,`type` FROM `mods` WHERE `username` = :username AND `password` = :password LIMIT 1");
$query->bindValue(':username', $username);
$query->bindValue(':password', $password);
- $query->execute();
+ $query->execute() or error(db_error($query));
if($user = $query->fetch()) {
return $mod = Array(
@@ -56,6 +56,16 @@
unset($_SESSION['mod']);
}
+ function modLog($action) {
+ global $mod;
+ $query = prepare("INSERT INTO `modlogs` VALUES (:id, :ip, :time, :text)");
+ $query->bindValue(':id', $mod['id'], PDO::PARAM_INT);
+ $query->bindValue(':ip', $_SERVER['REMOTE_ADDR']);
+ $query->bindValue(':time', time(), PDO::PARAM_INT);
+ $query->bindValue(':text', $action);
+ $query->execute() or error(db_error($query));
+ }
+
if(isset($_COOKIE['mod']) && isset($_SESSION['mod']) && is_array($_SESSION['mod'])) {
// Should be username:session hash
$cookie = explode(':', $_COOKIE['mod']);
diff --git a/main.js b/main.js
index d0a82dda..038713cd 100644
--- a/main.js
+++ b/main.js
@@ -6,8 +6,11 @@ function highlightReply(id)
if (divs[i].className.indexOf('post') != -1)
divs[i].className = divs[i].className.replace(/highlighted/, '');
}
- if (id)
- document.getElementById('reply_'+id).className += ' highlighted';
+ if (id) {
+ post = document.getElementById('reply_'+id);
+ if(post)
+ post.className += ' highlighted';
+ }
}
function focusId(id)
{
diff --git a/mod.php b/mod.php
index 43dd8d26..12b730a0 100644
--- a/mod.php
+++ b/mod.php
@@ -43,6 +43,8 @@
if(!login($_POST['username'], $_POST['password']))
loginForm(ERROR_INVALID, $_POST['username']);
+ modLog("Logged in.");
+
// Login successful
// Set cookies
setCookies();
@@ -295,6 +297,9 @@
}
$query->execute() or error(db_error($query));
+ // Record the action
+ modLog("Created a new board: {$b['title']}");
+
// Open the board
openBoard($b['uri']) or error("Couldn't open board after creation.");
@@ -356,6 +361,10 @@
// Delete post
deleteFile($post);
+
+ // Record the action
+ modLog("Removed file from post #{$post}");
+
// Rebuild board
buildIndex();
@@ -377,6 +386,10 @@
// Delete post
deletePost($post);
+
+ // Record the action
+ modLog("Deleted post #{$post}");
+
// Rebuild board
buildIndex();
@@ -399,8 +412,12 @@
$query->bindValue(':id', $post, PDO::PARAM_INT);
if($matches[2] == 'un') {
+ // Record the action
+ modLog("Unstickied post #{$post}");
$query->bindValue(':sticky', 0, PDO::PARAM_INT);
} else {
+ // Record the action
+ modLog("Stickied post #{$post}");
$query->bindValue(':sticky', 1, PDO::PARAM_INT);
}
@@ -429,8 +446,12 @@
$query->bindValue(':id', $post, PDO::PARAM_INT);
if($matches[2] == 'un') {
+ // Record the action
+ modLog("Unlocked post #{$post}");
$query->bindValue(':locked', 0, PDO::PARAM_INT);
} else {
+ // Record the action
+ modLog("Locked post #{$post}");
$query->bindValue(':locked', 1, PDO::PARAM_INT);
}
@@ -454,10 +475,22 @@
if(!openBoard($boardName))
error(ERROR_NOBOARD);
- $query = prepare(sprintf("SELECT `id` FROM `posts_%s` WHERE `ip` = (SELECT `ip` FROM `posts_%s` WHERE `id` = :id)", $board['uri'], $board['uri']));
+ $query = prepare(sprintf("SELECT `ip` FROM `posts_%s` WHERE `id` = :id", $board['uri']));
$query->bindValue(':id', $post);
$query->execute() or error(db_error($query));
+ if(!$post = $query->fetch())
+ error(ERROR_INVALIDPOST);
+
+ $ip = $post['ip'];
+
+ // Record the action
+ modLog("Deleted all posts by IP address: #{$ip}");
+
+ $query = prepare(sprintf("SELECT `id` FROM `posts_%s` WHERE `ip` = :ip", $board['uri']));
+ $query->bindValue(':ip', $ip);
+ $query->execute() or error(db_error($query));
+
if($query->rowCount() < 1)
error(ERROR_INVALIDPOST);
@@ -529,6 +562,10 @@
} else {
$query->bindValue(':reason', null, PDO::PARAM_NULL);
}
+
+ // Record the action
+ modLog("Created a ban for {$_POST['ip']} with reason {$_POST['reason']}");
+
$query->execute() or error(db_error($query));
// Delete too
diff --git a/post.php b/post.php
index 62260e1b..38599222 100644
--- a/post.php
+++ b/post.php
@@ -221,7 +221,7 @@
if(strlen($post['name']) > 50) error(sprintf(ERROR_TOOLONG, 'name'));
if(strlen($post['email']) > 30) error(sprintf(ERROR_TOOLONG, 'email'));
if(strlen($post['subject']) > 40) error(sprintf(ERROR_TOOLONG, 'subject'));
- if(strlen($post['body']) > MAX_BODY) error(ERROR_TOOLONGBODY);
+ if(!$mod && strlen($post['body']) > MAX_BODY) error(ERROR_TOOLONGBODY);
if(!(!$OP && $post['has_file']) && strlen($post['body']) < 1) error(ERROR_TOOSHORTBODY);
if(strlen($post['password']) > 20) error(sprintf(ERROR_TOOLONG, 'password'));
--
cgit v1.3
From 44d280e120a3c7e1912f101c6ce8f8dfaf963cc8 Mon Sep 17 00:00:00 2001
From: Savetheinternet
Date: Wed, 16 Feb 2011 14:44:42 +1100
Subject: ...
---
inc/mod.php | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
(limited to 'inc/mod.php')
diff --git a/inc/mod.php b/inc/mod.php
index 115c595a..4e82aaeb 100644
--- a/inc/mod.php
+++ b/inc/mod.php
@@ -34,23 +34,23 @@
}
function setCookies() {
- global $mod;
+ global $mod, $config;
if(!$mod) error('setCookies() was called for a non-moderator!');
- // MOD_COOKIE contains username:hash
- setcookie(MOD_COOKIE, $mod['username'] . ':' . $mod['hash'], time()+COOKIE_EXPIRE, JAIL_COOKIES?ROOT:'/', null, false, true);
+ // $config['cookies']['mod'] contains username:hash
+ setcookie($config['cookies']['mod'], $mod['username'] . ':' . $mod['hash'], time()+$config['cookies']['expire'], $config['cookies']['jail']?$config['root']:'/', null, false, true);
// Put $mod in the session
$_SESSION['mod'] = $mod;
// Lock sessions to IP addresses
- if(MOD_LOCK_IP)
+ if($mod['lock_ip'])
$_SESSION['mod']['ip'] = $_SERVER['REMOTE_ADDR'];
}
function destroyCookies() {
// Delete the cookies
- setcookie(MOD_COOKIE, 'deleted', time()-COOKIE_EXPIRE, JAIL_COOKIES?ROOT:'/', null, false, true);
+ setcookie($config['cookies']['mod'], 'deleted', time()-$config['cookies']['expire'], $config['cookies']['jail']?$config['root']:'/', null, false, true);
// Unset the session
unset($_SESSION['mod']);
@@ -71,7 +71,7 @@
$cookie = explode(':', $_COOKIE['mod']);
if(count($cookie) != 2) {
destroyCookies();
- error(ERROR_MALFORMED);
+ error($config['error']['malformed']);
}
// Validate session
@@ -79,7 +79,7 @@
$cookie[1] != $_SESSION['mod']['hash']) {
// Malformed cookies
destroyCookies();
- error(ERROR_MALFORMED);
+ error($config['error']['malformed']);
}
// Open connection
@@ -88,7 +88,7 @@
// Check username/password
if(!login($_SESSION['mod']['username'], $_SESSION['mod']['password'], false)) {
destroyCookies();
- error(ERROR_INVALIDAFTER);
+ error($config['error']['invalidafter']);
}
}
@@ -96,7 +96,7 @@
// Generates a element with a list of linked
// boards and their subtitles. (without the