Browse Source

Error handling

pull/40/head
Savetheinternet 14 years ago
parent
commit
4754493e53
  1. 4
      inc/functions.php

4
inc/functions.php

@ -79,7 +79,7 @@
if(file_exists($filename)) $md5 = md5_file($filename); if(file_exists($filename)) $md5 = md5_file($filename);
$content['pages'] = $pages; $content['pages'] = $pages;
file_put_contents($filename, Element('index.html', $content)) or error("Couldn't write to file."); @file_put_contents($filename, Element('index.html', $content)) or error("Couldn't write to file.");
if(isset($md5) && $md5 == md5_file($filename)) { if(isset($md5) && $md5 == md5_file($filename)) {
break; break;
@ -189,7 +189,7 @@
} else { } 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'])); $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(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."); @file_put_contents(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.");
} }
mysql_free_result($query); mysql_free_result($query);
} }

Loading…
Cancel
Save