diff options
| author | Savetheinternet <savetheinternet@n0v4.com> | 2010-12-01 21:24:14 +1100 |
|---|---|---|
| committer | Savetheinternet <savetheinternet@n0v4.com> | 2010-12-01 21:28:35 +1100 |
| commit | 84027c6d83d4a836ea362026df778b7507a9429e (patch) | |
| tree | 0009fd7acd880ff94567fefa86df6ebb3ad2b80d /inc/functions.php | |
| parent | 8a387bff1e51733f3d25d2269d16b6e8584d0b6e (diff) | |
mod panel
Diffstat (limited to 'inc/functions.php')
| -rw-r--r-- | inc/functions.php | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/inc/functions.php b/inc/functions.php index 4a70da32..b20ed091 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -318,7 +318,7 @@ return $result; } - function buildThread($id) { + function buildThread($id, $return=false) { global $sql, $board; $id = round($id); @@ -335,7 +335,19 @@ } 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'])); } - @file_put_contents($board['dir'] . DIR_RES . $id . '.html', Element('thread.html', Array('button'=>BUTTON_REPLY, 'board'=>$board, 'body'=>$thread->build(), 'post_url' => POST_URL, 'index' => ROOT, 'id' => $id))) or error("Couldn't write to file."); + $body = Element('thread.html', Array( + 'button'=>BUTTON_REPLY, + 'board'=>$board, + 'body'=>$thread->build(), + 'post_url' => POST_URL, + 'index' => ROOT, + 'id' => $id + )); + + if($return) + return $body; + else + @file_put_contents($board['dir'] . DIR_RES . $id . '.html', $body) or error("Couldn't write to file."); } mysql_free_result($query); } |
