JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
make metaform tarballs come with install doc
authorJason Woofenden <jason@jasonwoof.com>
Fri, 23 Jul 2010 05:21:49 +0000 (01:21 -0400)
committerJason Woofenden <jason@jasonwoof.com>
Fri, 23 Jul 2010 05:21:49 +0000 (01:21 -0400)
INSTALL
doc/template.php.txt
metaform.php
metaform/INSTALL [new file with mode: 0644]
metaform/htaccess

diff --git a/INSTALL b/INSTALL
index 4894263..09fa003 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -29,6 +29,9 @@ ln -s code/wfpl/metaform.php index.php
 
 4) make a file named .htaccess that looks like this:
 
+php_flag register_globals off
+php_flag magic_quotes_gpc off
+AddDefaultCharset UTF-8
 RewriteEngine  on
 RewriteBase    /metaform/
 RewriteRule    .*\.tgz$  /metaform/index.php
index 0abfb73..416b6ac 100644 (file)
@@ -17,7 +17,7 @@ This should work for simple templates such as:  foo: '~foo~'
 
 <table>
 <tr><th>foo</th><th>bar</th></tr>
-<!--~foobar_row start~--><tr><td>~foo~</td><td><input value="~bar~"></tr><!--~end~-->
+<!--~foobar_row {~--><tr><td>~foo~</td><td><input value="~bar~"></tr><!--~}~-->
 </table>
 
 tem_load('foobar.html');
@@ -37,6 +37,3 @@ tem_load('foobar.html');
                sub templates:
                        key: foobar_row
                        value: <tr><td>~foo.....html~</td><td><input value="~bar.attr~"></tr>
-
-
-tmpl_insert('foobar_row');
index ed10c8d..3e8c380 100644 (file)
@@ -522,6 +522,7 @@ function preview() {
 function download_tar() {
        $name = $GLOBALS['file_name'];
        $data = array(
+               "INSTALL" => read_whole_file('code/wfpl/metaform/INSTALL'),
                ".htaccess" => make_htaccess(),
                #"run.php ->" => 'code/wfpl/run.php',
                "style.css" => read_whole_file('code/wfpl/metaform/style.css'),
diff --git a/metaform/INSTALL b/metaform/INSTALL
new file mode 100644 (file)
index 0000000..0ae06bb
--- /dev/null
@@ -0,0 +1,36 @@
+INSTALL INSTRUCTIONS FOR THE FILES IN THIS DIRECTORY:
+
+If your directory is already set up for WFPL, then all you have to do is copy the files from this directory (except INSTALL and .htaccess) to that directory, and it should run as-is.
+
+INSTRUCTIONS FOR SETTING UP A DIRECTORY FOR WFPL:
+
+1) "cd" to the directory that will contain all your content and code files.
+
+2) make a "code" directory:
+
+mkdir code
+
+3) download wfpl:
+
+cd code
+git clone git://gitorious.org/wfpl/wfpl.git
+cd ..
+
+4) make the run.php link:
+
+ln -s code/wfpl/run.php
+
+5) Install the .htaccess file from this directory (it's a hidden file, but you
+can see it with ls -a)
+
+6) If you have a domain name pointing directly at the directory you're setting
+up (for example, it's accessible as http://example.com/) then you're done! But
+if this directory is acessed with a directory (or multiple directories) in the
+URL path (for example: http://example.com/foo/bar/) then you'll need to edit
+the RewriteRule in .htaccess (read the comments in that file for further
+explanation and examples.
+
+
+That's it! Now that you've got the directory set up, just place your php files
+and your html templates in there, and you should be good to go. Remember to
+omit the file extension in the URL.
index 4073890..acd597b 100644 (file)
@@ -1,6 +1,31 @@
+# Tell php not to mangle form data or let the user set globals.
 php_flag register_globals off
 php_flag magic_quotes_gpc off
-Options -MultiViews
+
+# All your files are UTF-8... RIGHT?
 AddDefaultCharset UTF-8
+
+############ START OF PRETTY URLS SETTINGS
+# This section contains directives to enable pretty URLs, and instruct apache
+# to run wfpl on them. This runs code/config.php if it exists, then loads
+# templates, then loads the php file, and call's it's main function. See
+# code/wfpl/run.php and code/wfpl/README for more details.
+
+# To have "pretty" urls (no file extension at the end) we use mod_rewrite. But
+# first we've got to disable a couple url-mangling features of apache that take
+# precedence over mod_rewrite:
+Options -MultiViews
+DirectorySlash Off
+
+# Activate mod_rewrite:
 RewriteEngine  on
-RewriteRule    ^[^/.]*$  /~form~/run.php
+
+# Unfortunately, the rewrite rules only work with absolute paths, so if your
+# files are not at the top level of the domain, you'll have to customize this
+# part. Here's the config for running at the top level:
+RewriteRule    ^[^/.]*$  /run.php
+
+# use this line instead if you have this (.htaccess) file and your php and html
+# files in the ~form~ directory:
+#RewriteRule    ^[^/.]*$  /~form~/run.php
+############ END OF PRETTY URLS SETTINGS