Subversion Repositories taios

Compare Revisions

Ignore whitespace Rev 228 → Rev 235

/photos/index.php
2,12 → 2,21
 
require '../_taios.php';
 
$page = new Taios_Page('Photos', '../');
$page = new Taios_Page('Photo Albums', '../');
$page->drawHeader();
$page->drawMiddle();
 
write('<br /><p class="bold">This page is currently under construction.</p>');
write('<p>Here we have all sorts of photos from Tim32.</p><br />');
 
$dir = dir('albums/');
while (($file = $dir->read()) !== false)
{
if ($file[0] != '.')
{
write('<p><a href="album.php?dir=' . $file . '">' . $file . '</a></p>');
}
}
 
$page->drawFooter();
 
?>
/photos/albums/ArchLinux Wallpapers/archlinux-firestarter.jpg
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/photos/albums/ArchLinux Wallpapers/archlinux-firestarter.jpg
Property changes:
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: photos/albums/ArchLinux Wallpapers/archlinux-berry.jpg
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: photos/albums/ArchLinux Wallpapers/archlinux-berry.jpg
===================================================================
--- photos/albums/ArchLinux Wallpapers/archlinux-berry.jpg (nonexistent)
+++ photos/albums/ArchLinux Wallpapers/archlinux-berry.jpg (revision 235)
/photos/albums/ArchLinux Wallpapers/archlinux-berry.jpg
Property changes:
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: wiki/edit.php
===================================================================
--- wiki/edit.php (nonexistent)
+++ wiki/edit.php (revision 235)
@@ -0,0 +1,52 @@
+
+
+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);
+ }
+
+?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+}
+else
+{
+ $page->drawError('You do not have permission to access this page.');
+}
+
+$page->drawFooter();
+
+?>
+
Index: wiki/edit-do.php
===================================================================
--- wiki/edit-do.php (nonexistent)
+++ wiki/edit-do.php (revision 235)
@@ -0,0 +1,38 @@
+
+
+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);
+
+ $page->redirect('index.php?page=' . $pageName);
+ }
+ else
+ {
+ $page->drawError('Failed to write file.');
+ }
+}
+else
+{
+ $page->drawError('You do not have permission to access this page.');
+}
+
+$page->drawFooter();
+
+?>
+
Index: wiki/index.php
===================================================================
--- wiki/index.php (revision 228)
+++ wiki/index.php (revision 235)
@@ -19,7 +19,7 @@
$filename = 'pages/' . $pageName . '.txt';
-$fp = fopen($filename, 'r');
+$fp = @fopen($filename, 'r');
if ($fp)
{
write('

' . $page->replaceBBCode(fread($fp, filesize($filename))) . '

');