From 4b60e8396cd7c3f5848d022272c469de941e0bc6 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Fri, 11 Jul 2003 16:01:26 +0000 Subject: [PATCH] Added a first (useless) version of the website. --- index.php | 66 +++++++++++++++++++++++++++++++++++ index.xbf | 5 +++ templates/bife_link.tpl.html | 1 + templates/bife_page.tpl.html | 12 +++++++ templates/bife_title.tpl.html | 1 + 5 files changed, 85 insertions(+) create mode 100644 index.php create mode 100644 index.xbf create mode 100644 templates/bife_link.tpl.html create mode 100644 templates/bife_page.tpl.html create mode 100644 templates/bife_title.tpl.html diff --git a/index.php b/index.php new file mode 100644 index 0000000..862cc1f --- /dev/null +++ b/index.php @@ -0,0 +1,66 @@ + | +// +--------------------------------------------------------------------+ +// +// $Id$ +// + +// Inicialization {{{ +#ini_set('include_path', '../src:../../hit/src:../../bife/src:'. +# ini_get('include_path')); +umask('002'); +require_once 'HTML/Template/HIT.php'; +require_once 'BIFE/Parser.php'; +require_once 'BIFE/Translate.php'; +// }}} + +// Selects the file to view {{{ +$file = (@$_SERVER['PATH_INFO'] and ($_SERVER['PATH_INFO'] != '/')) + ? ".{$_SERVER['PATH_INFO']}" + : 'index.xbf'; +// }}} + +// Looks if we want to show the source {{{ +if (@$_REQUEST['S']) { + if (@$_REQUEST['B']) { + // We want to see the BIFE file source. + echo '
';
+        echo htmlentities(join('', file($file)));
+    } else {
+        // We want to see the php file source.
+        highlight_file($_SERVER['SCRIPT_FILENAME']);
+    }
+    exit;
+}
+// }}}
+
+// If we are not looking at the source, we use BIFE to show the page {{{
+$template =& new HTML_Template_HIT('templates');
+$parser   =& new BIFE_Parser('BIFE_Translate');
+$page     =& $parser->parseFile($file);
+$parser->__destruct();
+echo $page->render($template);
+// }}}
+
+?>
diff --git a/index.xbf b/index.xbf
new file mode 100644
index 0000000..cb96fa5
--- /dev/null
+++ b/index.xbf
@@ -0,0 +1,5 @@
+
+
+    Welcome to BIFE!
+    

BIFE is a blah.

+
diff --git a/templates/bife_link.tpl.html b/templates/bife_link.tpl.html new file mode 100644 index 0000000..873ba85 --- /dev/null +++ b/templates/bife_link.tpl.html @@ -0,0 +1 @@ +{CONTENTS} diff --git a/templates/bife_page.tpl.html b/templates/bife_page.tpl.html new file mode 100644 index 0000000..7f99f80 --- /dev/null +++ b/templates/bife_page.tpl.html @@ -0,0 +1,12 @@ + + + {TITLE} + + +

{TITLE}

+ {CONTENTS} +
+ View BIFE (xbf) source | + View PHP source + + diff --git a/templates/bife_title.tpl.html b/templates/bife_title.tpl.html new file mode 100644 index 0000000..3590da3 --- /dev/null +++ b/templates/bife_title.tpl.html @@ -0,0 +1 @@ +

{CONTENTS}

-- 2.43.0