Multi-board support.
This commit is contained in:
parent
0cda963197
commit
9b2135c3f9
@ -20,13 +20,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function error($message) {
|
function error($message) {
|
||||||
|
global $board;
|
||||||
die(Element('page.html', Array(
|
die(Element('page.html', Array(
|
||||||
'index'=>ROOT,
|
'index'=>ROOT,
|
||||||
'title'=>'Error',
|
'title'=>'Error',
|
||||||
'subtitle'=>'An error has occured.',
|
'subtitle'=>'An error has occured.',
|
||||||
'body'=>"<center>" .
|
'body'=>"<center>" .
|
||||||
"<h2>$message</h2>" .
|
"<h2>$message</h2>" .
|
||||||
"<p><a href=\"" . ROOT . FILE_INDEX . "\">Go back</a>.</p>" .
|
"<p><a href=\"" . ROOT . $board['dir'] . FILE_INDEX . "\">Go back</a>.</p>" .
|
||||||
"</center>"
|
"</center>"
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
@ -51,6 +52,8 @@
|
|||||||
$this->filename = $filename;
|
$this->filename = $filename;
|
||||||
}
|
}
|
||||||
public function build($index=false) {
|
public function build($index=false) {
|
||||||
|
global $board;
|
||||||
|
|
||||||
$built = '<div class="post reply"' . (!$index?' id="reply_' . $this->id . '"':'') . '>' .
|
$built = '<div class="post reply"' . (!$index?' id="reply_' . $this->id . '"':'') . '>' .
|
||||||
'<p class="intro"' . (!$index?' id="' . $this->id . '"':'') . '>';
|
'<p class="intro"' . (!$index?' id="' . $this->id . '"':'') . '>';
|
||||||
|
|
||||||
@ -75,14 +78,14 @@
|
|||||||
$built .= ' <a class="post_no"' .
|
$built .= ' <a class="post_no"' .
|
||||||
// JavaScript highlight
|
// JavaScript highlight
|
||||||
($index?'':' onclick="highlightReply(' . $this->id . ');"') .
|
($index?'':' onclick="highlightReply(' . $this->id . ');"') .
|
||||||
' href="' . ROOT . DIR_RES . $this->thread . '.html' . '#' . $this->id . '">No.</a>' .
|
' href="' . ROOT . $board['dir'] . DIR_RES . $this->thread . '.html' . '#' . $this->id . '">No.</a>' .
|
||||||
// JavaScript cite
|
// JavaScript cite
|
||||||
'<a class="post_no"' . ($index?'':'onclick="citeReply(' . $this->id . ');"') . 'href="' . ($index?ROOT . DIR_RES . $this->thread . '.html' . '#q' . $this->id:'javascript:void(0);') . '">'.$this->id.'</a>' .
|
'<a class="post_no"' . ($index?'':'onclick="citeReply(' . $this->id . ');"') . 'href="' . ($index?ROOT . DIR_RES . $this->thread . '.html' . '#q' . $this->id:'javascript:void(0);') . '">'.$this->id.'</a>' .
|
||||||
'</p>';
|
'</p>';
|
||||||
|
|
||||||
// File info
|
// File info
|
||||||
if(!empty($this->file)) {
|
if(!empty($this->file)) {
|
||||||
$built .= '<p class="fileinfo">File: <a href="' . ROOT . DIR_IMG . $this->file .'">' . $this->file . '</a> <span class="unimportant">(' .
|
$built .= '<p class="fileinfo">File: <a href="' . ROOT . $board['dir'] . DIR_IMG . $this->file .'">' . $this->file . '</a> <span class="unimportant">(' .
|
||||||
// Filesize
|
// Filesize
|
||||||
format_bytes($this->filesize) . ', ' .
|
format_bytes($this->filesize) . ', ' .
|
||||||
// File dimensions
|
// File dimensions
|
||||||
@ -95,7 +98,7 @@
|
|||||||
// Filename
|
// Filename
|
||||||
$built .= ', ' . $this->filename . ')</span></p>' .
|
$built .= ', ' . $this->filename . ')</span></p>' .
|
||||||
// Thumbnail
|
// Thumbnail
|
||||||
'<a href="' . ROOT . DIR_IMG . $this->file.'"><img src="' . ROOT . DIR_THUMB . $this->thumb.'" style="width:'.$this->thumbx.'px;height:'.$this->thumby.'px;" /></a>';
|
'<a href="' . ROOT . $board['dir'] . DIR_IMG . $this->file.'"><img src="' . ROOT . $board['dir'] . DIR_THUMB . $this->thumb.'" style="width:'.$this->thumbx.'px;height:'.$this->thumby.'px;" /></a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Body
|
// Body
|
||||||
@ -132,7 +135,9 @@
|
|||||||
|
|
||||||
|
|
||||||
public function build($index=false) {
|
public function build($index=false) {
|
||||||
$built = '<p class="fileinfo">File: <a href="' . ROOT . DIR_IMG . $this->file .'">' . $this->file . '</a> <span class="unimportant">(' .
|
global $board;
|
||||||
|
|
||||||
|
$built = '<p class="fileinfo">File: <a href="' . ROOT . $board['dir'] . DIR_IMG . $this->file .'">' . $this->file . '</a> <span class="unimportant">(' .
|
||||||
// Filesize
|
// Filesize
|
||||||
format_bytes($this->filesize) . ', ' .
|
format_bytes($this->filesize) . ', ' .
|
||||||
// File dimensions
|
// File dimensions
|
||||||
@ -145,7 +150,7 @@
|
|||||||
// Filename
|
// Filename
|
||||||
$built .= ', ' . $this->filename . ')</span></p>' .
|
$built .= ', ' . $this->filename . ')</span></p>' .
|
||||||
// Thumbnail
|
// Thumbnail
|
||||||
'<a href="' . ROOT . DIR_IMG . $this->file.'"><img src="' . ROOT . DIR_THUMB . $this->thumb.'" style="width:'.$this->thumbx.'px;height:'.$this->thumby.'px;" /></a>';
|
'<a href="' . ROOT . $board['dir'] . DIR_IMG . $this->file.'"><img src="' . ROOT . $board['dir'] . DIR_THUMB . $this->thumb.'" style="width:'.$this->thumbx.'px;height:'.$this->thumby.'px;" /></a>';
|
||||||
|
|
||||||
$built .= '<div class="post op"><p class="intro"' . (!$index?' id="' . $this->id . '"':'') . '>';
|
$built .= '<div class="post op"><p class="intro"' . (!$index?' id="' . $this->id . '"':'') . '>';
|
||||||
|
|
||||||
@ -170,11 +175,11 @@
|
|||||||
$built .= ' <a class="post_no"' .
|
$built .= ' <a class="post_no"' .
|
||||||
// JavaScript highlight
|
// JavaScript highlight
|
||||||
($index?'':' onclick="highlightReply(' . $this->id . ');"') .
|
($index?'':' onclick="highlightReply(' . $this->id . ');"') .
|
||||||
' href="' . ROOT . DIR_RES . $this->id . '.html' . '#' . $this->id . '">No.</a>' .
|
' href="' . ROOT . $board['dir'] . DIR_RES . $this->id . '.html' . '#' . $this->id . '">No.</a>' .
|
||||||
// JavaScript cite
|
// JavaScript cite
|
||||||
'<a class="post_no"' . ($index?'':'onclick="citeReply(' . $this->id . ');"') . 'href="' . ($index?ROOT . DIR_RES . $this->id . '.html' . '#q' . $this->id:'javascript:void(0);') . '">'.$this->id.'</a>' .
|
'<a class="post_no"' . ($index?'':'onclick="citeReply(' . $this->id . ');"') . 'href="' . ($index?ROOT . $board['dir'] . DIR_RES . $this->id . '.html' . '#q' . $this->id:'javascript:void(0);') . '">'.$this->id.'</a>' .
|
||||||
// [Reply]
|
// [Reply]
|
||||||
($index ? '<a href="' . ROOT . DIR_RES . $this->id . '.html">[Reply]</a>' : '') .
|
($index ? '<a href="' . ROOT . $board['dir'] . DIR_RES . $this->id . '.html">[Reply]</a>' : '') .
|
||||||
'</p>';
|
'</p>';
|
||||||
|
|
||||||
// Body
|
// Body
|
||||||
|
Loading…
Reference in New Issue
Block a user