From: Leandro Lucarella Date: Fri, 11 Jul 2003 16:01:26 +0000 (+0000) Subject: Added a first (useless) version of the website. X-Git-Tag: svn_import~7 X-Git-Url: https://git.llucax.com/software/bife/web.git/commitdiff_plain/4b60e8396cd7c3f5848d022272c469de941e0bc6?B=1;S=1 Added a first (useless) version of the website. --- 4b60e8396cd7c3f5848d022272c469de941e0bc6 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}