diff options
| author | Savetheinternet <savetheinternet@n0v4.com> | 2010-12-16 23:08:52 +1100 |
|---|---|---|
| committer | Savetheinternet <savetheinternet@n0v4.com> | 2010-12-16 23:08:52 +1100 |
| commit | 627c6ac91a338cfbd9fcc618b28dd678902da8f7 (patch) | |
| tree | 8fe18f675ad3ad005ec4f762c4ed26bbbbc2bfbe /inc | |
| parent | b0bee3556f7932949a929c0077c454314d5dbb42 (diff) | |
Stickies
Diffstat (limited to 'inc')
| -rw-r--r-- | inc/config.php | 5 | ||||
| -rw-r--r-- | inc/display.php | 7 | ||||
| -rw-r--r-- | inc/functions.php | 6 |
3 files changed, 13 insertions, 5 deletions
diff --git a/inc/config.php b/inc/config.php index 78b78403..4e48b6d5 100644 --- a/inc/config.php +++ b/inc/config.php @@ -72,6 +72,7 @@ define('ERROR_INVALIDFIELD', 'The %s field was invalid.', true); define('ERROR_NOACCESS', 'You don\'t have permission to do that.', true); define('ERROR_INVALIDPOST', 'That post doesn\'t exist…', true); + define('ERROR_404', 'Page not found.', true); // For resizing, max values define('THUMB_WIDTH', 200, true); @@ -129,6 +130,10 @@ // "302" is recommended. define('REDIRECT_HTTP', 302, true); + // Static images + // These can be URLs OR base64 (data URI scheme) + define('IMAGE_STICKY', 'data:image/gif;base64,R0lGODlhEgASAIcAACM8mR5BnAFPowNVpwBZqQBerhNPpRpLoxhSqABgrwBksgFvughltA5ttwBwuwR0vyN2vDdosDJ9tQB6wkJqtGN2tgODyweR1QCZ3gGc3wiR1ROr6SGGyCqJyDqEwjaX0Das4j256GaFu22Fs0qFwkyNx1mLxEun2k264lO76V+45WSezW2Vx2+fzGCrxWW30X6/5oaIvo+rvqidtr29vo+RwIWj0ISp1KSn0aG337euxbGwxry71KW84LbMvJLLzZDK1ZDI2Y3S76fJ5qbK6KrP6K3U7aDd8bzI6Mu6vMC/z83NwtDO39PW2drd0cPO7tXW5tje7MXk9t7u4+LJw+bX1ezhz+Hg8uDr9Obw+PHo6v//7gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAMAAFsALAAAAAASABIAAAieALcIHEiwoMGDRT6ckHLQYJYhRixcENKQIBYiUmBowHCkYRQWLVZ0AJFCBYYNB6FUiGCixAILFjRkCHEwxhUbAxI4mHCAA4opB2vk6EGigIMHB4JUVEIBwg0PCxYYAFJxywgBBBo4YBDgRVUtIgYoWAAAwY+qSHDIkHAAgIuqT3ZYEejDR1UmM5xUJZhEx5K9A6nwoAF4YJUmhRMXDAgAOw==', true); + /* Mod stuff */ diff --git a/inc/display.php b/inc/display.php index a485f906..8cf4a18e 100644 --- a/inc/display.php +++ b/inc/display.php @@ -180,7 +180,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, $root=ROOT) { + public function __construct($id, $subject, $email, $name, $trip, $body, $time, $thumb, $thumbx, $thumby, $file, $filex, $filey, $filesize, $filename, $ip, $sticky, $root=ROOT) { $this->id = $id; $this->subject = utf8tohtml($subject); $this->email = $email; @@ -199,13 +199,13 @@ $this->omitted = 0; $this->posts = Array(); $this->ip = $ip; + $this->sticky = $sticky; $this->root = $root; } public function add(Post $post) { $this->posts[] = $post; } - public function build($index=false) { global $board, $mod; @@ -255,8 +255,11 @@ ' href="' . $this->root . $board['dir'] . DIR_RES . $this->id . '.html' . '#' . $this->id . '">No.</a>' . // JavaScript cite '<a class="post_no"' . ($index?'':'onclick="citeReply(' . $this->id . ');"') . 'href="' . ($index?$this->root . $board['dir'] . DIR_RES . $this->id . '.html' . '#q' . $this->id:'javascript:void(0);') . '">'.$this->id.'</a>' . + // Sticky + ($this->sticky ? '<img class="icon" title="Sticky" src="' . IMAGE_STICKY . '" />' : '') . // [Reply] ($index ? '<a href="' . $this->root . $board['dir'] . DIR_RES . $this->id . '.html">[Reply]</a>' : '') . + // Mod controls postControls($this->id, true) . '</p>'; diff --git a/inc/functions.php b/inc/functions.php index 04340be1..fd87de43 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -151,7 +151,7 @@ if(mysql_num_rows($query) < 1 && $page > 1) return false; while($th = mysql_fetch_array($query)) { - $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'], $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); $newposts = mysql_query(sprintf( "SELECT `id`, `subject`, `email`, `name`, `trip`, `body`, `time`, `thumb`, `thumbwidth`, `thumbheight`, `file`, `filewidth`, `fileheight`, `filesize`, `filename`,`ip` FROM `posts_%s` WHERE `thread` = '%s' ORDER BY `time` DESC LIMIT %d", @@ -341,7 +341,7 @@ $id = round($id); $query = mysql_query(sprintf( - "SELECT `id`,`thread`,`subject`,`name`,`email`,`trip`,`body`,`time`,`thumb`,`thumbwidth`,`thumbheight`,`file`,`filewidth`,`fileheight`,`filesize`,`filename`,`ip` FROM `posts_%s` WHERE (`thread` IS NULL AND `id` = '%d') OR `thread` = '%d' ORDER BY `thread`,`time`", + "SELECT `id`,`thread`,`subject`,`name`,`email`,`trip`,`body`,`time`,`thumb`,`thumbwidth`,`thumbheight`,`file`,`filewidth`,`fileheight`,`filesize`,`filename`,`ip`,`sticky` FROM `posts_%s` WHERE (`thread` IS NULL AND `id` = '%d') OR `thread` = '%d' ORDER BY `thread`,`time`", mysql_real_escape_string($board['uri']), $id, $id @@ -349,7 +349,7 @@ while($post = mysql_fetch_array($query)) { 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'], $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); } 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)); } |
