mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-23 23:20:57 +01:00
Show locked threads
This commit is contained in:
parent
5c094429d7
commit
97e927bef9
@ -127,6 +127,7 @@
|
||||
// Static images
|
||||
// These can be URLs OR base64 (data URI scheme)
|
||||
define('IMAGE_STICKY', ROOT . DIR_STATIC . 'sticky.gif', true);
|
||||
define('IMAGE_LOCKED', ROOT . DIR_STATIC . 'locked.gif', true);
|
||||
define('DELETED_IMAGE', ROOT . DIR_STATIC . 'deleted.png', true);
|
||||
define('ZIP_IMAGE', ROOT . DIR_STATIC . 'zip.png', true);
|
||||
|
||||
|
@ -170,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, $mod=false) {
|
||||
public function __construct($id, $subject, $email, $name, $trip, $body, $time, $thumb, $thumbx, $thumby, $file, $filex, $filey, $filesize, $filename, $ip, $sticky, $locked, $root=ROOT, $mod=false) {
|
||||
$this->id = $id;
|
||||
$this->subject = utf8tohtml($subject);
|
||||
$this->email = $email;
|
||||
@ -190,6 +190,7 @@
|
||||
$this->posts = Array();
|
||||
$this->ip = $ip;
|
||||
$this->sticky = $sticky;
|
||||
$this->locked = $locked;
|
||||
$this->root = $root;
|
||||
$this->mod = $mod;
|
||||
}
|
||||
@ -281,6 +282,8 @@
|
||||
'<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 . '" />' : '') .
|
||||
// Locked
|
||||
($this->locked ? '<img class="icon" title="Locked" src="' . IMAGE_LOCKED . '" />' : '') .
|
||||
// [Reply]
|
||||
($index ? '<a href="' . $this->root . $board['dir'] . DIR_RES . $this->id . '.html">[Reply]</a>' : '') .
|
||||
|
||||
|
@ -214,7 +214,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, $mod);
|
||||
$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->bindValue(1, $th['id']);
|
||||
@ -407,7 +407,7 @@
|
||||
|
||||
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, $mod);
|
||||
$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'], $th['locked'], $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, $mod));
|
||||
}
|
||||
|
BIN
static/locked.gif
Normal file
BIN
static/locked.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 423 B |
Loading…
Reference in New Issue
Block a user