From 4115cf1c7d11729f4881932240b8150507c2b0bb Mon Sep 17 00:00:00 2001 From: Savetheinternet Date: Tue, 30 Nov 2010 20:38:36 +1100 Subject: [PATCH] More board functions --- inc/functions.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/inc/functions.php b/inc/functions.php index 230de3ef..9436e4b6 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -42,6 +42,14 @@ if(!file_exists($board['dir'] . DIR_RES)) @mkdir($board['dir'] . DIR_RES, 0777) or error("Couldn't create " . DIR_RES . ". Check permissions.", true); } + function openBoard($uri) { + $boards_res = mysql_query(sprintf("SELECT * FROM `boards` WHERE `uri` = '%s' LIMIT 1", mysql_real_escape_string($uri)), $sql) or error(mysql_error($sql)); + if($_board = mysql_fetch_array($boards_res)) { + setupBoard($_board); + return true; + } else return false; + } + function post($post, $OP) { global $sql, $board; if($OP) {