/wiki/edit-do.php |
---|
0,0 → 1,36 |
<?php |
require '../_taios.php'; |
$pageName = $_POST['page']; |
if (empty($pageName)) |
{ |
$pageName = 'Index'; |
} |
$page = new Taios_Page('Edit Page - ' . $pageName, '../'); |
if ($page->isUserGM($page->getLoggedInUser())) |
{ |
$filename = 'pages/' . $pageName . '.txt'; |
$fp = @fopen($filename, 'w'); |
if ($fp) |
{ |
fwrite($fp, $_POST['content']); |
fclose($fp); |
} |
else |
{ |
$page->drawError('Failed to write file.'); |
} |
} |
else |
{ |
$page->drawError('You do not have permission to access this page.'); |
} |
$page->drawFooter(); |
?> |
/wiki/index.php |
---|
19,7 → 19,7 |
$filename = 'pages/' . $pageName . '.txt'; |
$fp = fopen($filename, 'r'); |
$fp = @fopen($filename, 'r'); |
if ($fp) |
{ |
write('<p>' . $page->replaceBBCode(fread($fp, filesize($filename))) . '</p>'); |
/wiki/edit.php |
---|
0,0 → 1,51 |
<?php |
require '../_taios.php'; |
$pageName = $_GET['page']; |
if (empty($pageName)) |
{ |
$pageName = 'Index'; |
} |
$page = new Taios_Page('Edit Page - ' . $pageName, '../'); |
$page->drawHeader(); |
$page->drawMiddle(); |
if ($page->isUserGM($page->getLoggedInUser())) |
{ |
$filename = 'pages/' . $pageName . '.txt'; |
$content = ""; |
$fp = @fopen($filename, 'r'); |
if ($fp) |
{ |
$content = fread($fp, filesize($filename)); |
fclose($fp); |
} |
?> |
<form action="edit-do.php" method="POST"> |
<table> |
<tr> |
<td><textarea name="content"><?php echo $content; ?></textarea></td> |
</tr> |
<tr> |
<td><input type="submit" value="Edit" /></td> |
</tr> |
</table> |
</form> |
<?php |
} |
else |
{ |
$page->drawError('You do not have permission to access this page.'); |
} |
$page->drawFooter(); |
?> |