1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-30 18:24:29 +01:00

setupBoard() function

This commit is contained in:
Savetheinternet 2010-11-30 20:24:09 +11:00 committed by Paul Merrill
parent 20e50fe9e8
commit b801e3fc74

View File

@ -23,7 +23,25 @@
$item = mysql_real_escape_string($item);
}
}
function setupBoard($array) {
global $board;
$board = Array(
'id' => $array['id'],
'uri' => $array['uri'],
'name' => $array['title'],
'title' => $array['subtitle']);
$board['dir'] = sprintf(BOARD_PATH, $board['uri']);
$board['url'] = sprintf(BOARD_ABBREVIATION, $board['uri']);
if(!file_exists($board['dir'])) mkdir($board['dir'], 0777);
if(!file_exists($board['dir'] . DIR_IMG)) @mkdir($board['dir'] . DIR_IMG, 0777) or error("Couldn't create " . DIR_IMG . ". Check permissions.", true);
if(!file_exists($board['dir'] . DIR_THUMB)) @mkdir($board['dir'] . DIR_THUMB, 0777) or error("Couldn't create " . DIR_THUMB . ". Check permissions.", true);
if(!file_exists($board['dir'] . DIR_RES)) @mkdir($board['dir'] . DIR_RES, 0777) or error("Couldn't create " . DIR_RES . ". Check permissions.", true);
}
function post($post, $OP) {
global $sql, $board;
if($OP) {