summaryrefslogtreecommitdiff
path: root/inc/functions.php
diff options
context:
space:
mode:
authorSavetheinternet <savetheinternet@n0v4.com>2010-12-01 21:24:14 +1100
committerPaul Merrill <napalminc@gmail.com>2010-12-01 04:14:17 -0800
commit529da36330cc9203aee31370235f1d9b9beb6cd4 (patch)
tree49cd66e0dbcd4d3f3388d1a7c7eff8652b1961d9 /inc/functions.php
parent9923af244b1b5edff9ee23dc562e634f88f23161 (diff)
mod panel
Diffstat (limited to 'inc/functions.php')
-rw-r--r--inc/functions.php16
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);
}