JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
define INC_WFPL, separate wfpl_main.php
authorJason Woofenden <jason@jasonwoof.com>
Tue, 3 Mar 2015 14:32:31 +0000 (09:32 -0500)
committerJason Woofenden <jason@jasonwoof.com>
Tue, 3 Mar 2015 14:32:31 +0000 (09:32 -0500)
.htaccess
admin.php
admin_admins.php
admin_files.php
admin_images.php
admin_login.php
admin_pages.php
config.php
contact.php
inc/wfpl
wfpl_main.php [new file with mode: 0644]

index 6d04476..7ba7ac4 100644 (file)
--- a/.htaccess
+++ b/.htaccess
@@ -7,7 +7,7 @@ DirectorySlash Off
 DirectoryIndex disabled
 AddDefaultCharset UTF-8
 RewriteEngine  on
-RewriteRule    ^[^/.]*$  /config.php [L]
+RewriteRule    ^[^/.]*$  /wfpl_main.php [L]
 
 <FilesMatch "\.(css|jpg|png)$">
        ExpiresActive On
index 68f9b38..c2d1935 100644 (file)
--- a/admin.php
+++ b/admin.php
@@ -1,6 +1,6 @@
 <?php
 
-require_once('inc/wfpl/session.php');
+require_once(INC_WFPL . 'session.php');
 
 function admin_main() {
        if(!logged_in_as_admin()) {
index bc3961f..420faf3 100644 (file)
@@ -5,8 +5,8 @@
 define('ADMIN_ADMINS_DB_FIELDS', 'name,username,password,privs');
 
 
-require_once('inc/wfpl/format.php');
-require_once('inc/wfpl/email.php');
+require_once(INC_WFPL . 'format.php');
+require_once(INC_WFPL . 'email.php');
 
 function admin_admins_get_fields() {
        $data = array();
index ba0e507..db70f86 100644 (file)
@@ -1,21 +1,6 @@
 <?php
 
-# This form requires wfpl. See: http://jasonwoof.org/wfpl
-
-# This form was initially auto-generated. If you would like to alter the
-# parameters and generate a new one try this URL:
-#
-# http://metaform.l/?file_name=admin_files&table_name=files&singular=file&plural=files&opt_email=No&opt_db=Yes&opt_listing=Yes&opt_display=No&opt_pass=Yes&opt_public_form=No&opt_public_display=No&fields=filename+file%0D%0Adescription+textbox&edit=yes
-
-
-# SETUP
-
-# To save results to a database, you'll need to create the files table
-# (the file admin_files.sql should help with this), and create the file
-# 'code/db_connect.php' which calls db_connect() see:
-# inc/wfpl/examples/db_connect.php
-#
-# if you rename any of the database fields, you'll need to update this:
+# This form requires wfpl. See: http://sametwice.com/wfpl
 
 define('ADMIN_FILES_DB_FIELDS', 'filename,description');
 
@@ -27,9 +12,9 @@ $GLOBALS['upload_directory'] = 'files/';
 $GLOBALS['filename_file_name'] = uniqid() . getmypid() . '.txt';
 
 
-require_once('inc/wfpl/format.php');
-require_once('inc/wfpl/email.php');
-require_once('inc/wfpl/upload.php');
+require_once(INC_WFPL . 'format.php');
+require_once(INC_WFPL . 'email.php');
+require_once(INC_WFPL . 'upload.php');
 
 function admin_files_get_fields() {
        $data = array();
index 8b6e513..3635b24 100644 (file)
@@ -1,21 +1,6 @@
 <?php
 
-# This form requires wfpl. See: http://jasonwoof.org/wfpl
-
-# This form was initially auto-generated. If you would like to alter the
-# parameters and generate a new one try this URL:
-#
-# http://jasonwoof.com/metaform/?file_name=admin_images&table_name=cms_images&singular=image&plural=images&opt_email=No&opt_db=Yes&opt_listing=Yes&opt_display=Yes&opt_pass=Yes&fields=image+thumb%0D%0Aname+textbox%0D%0Acaption+textbox%0D%0Asizes+textarea&edit=yes
-
-
-# SETUP
-
-# To save results to a database, you'll need to create the cms_images table
-# (the file admin_images.sql should help with this), and create the file
-# 'code/db_connect.php' which calls db_connect() see:
-# inc/wfpl/examples/db_connect.php
-#
-# if you rename any of the database fields, you'll need to update this:
+# This form requires wfpl. See: http://sametwice.com/wfpl
 
 define('ADMIN_IMAGES_DB_FIELDS', 'image,name,caption,sizes');
 
@@ -30,8 +15,8 @@ $GLOBALS['image_thumb_max_height'] = '70';
 $GLOBALS['image_file_name'] = uniqid() . getmypid() . '.jpg'; # comment this out to use uploader's filename
 
 
-require_once('inc/wfpl/format.php');
-require_once('inc/wfpl/upload.php');
+require_once(INC_WFPL . 'format.php');
+require_once(INC_WFPL . 'upload.php');
 
 # example: 200x300
 function format_width_height($str) {
index 3668d90..e68f86e 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-# This form requires wfpl. See: http://jasonwoof.org/wfpl
+# This form requires wfpl. See: http://sametwice.com/wfpl
 
 function admin_login_get_fields() {
        $data = array();
index 829f3a5..ae6e4c4 100644 (file)
@@ -1,12 +1,12 @@
 <?php
 
-# This form requires wfpl. See: http://jasonwoof.org/wfpl
+# This form requires wfpl. See: http://sametwice.com/wfpl
 
 define('ADMIN_PAGES_DB_FIELDS', 'title,filename,navbar,nav_title,content,description,keywords');
 
 
-require_once('inc/wfpl/format.php');
-require_once('inc/wfpl/email.php');
+require_once(INC_WFPL . 'format.php');
+require_once(INC_WFPL . 'email.php');
 
 function format_cms_filename($str) {
        $str = format_filename($str);
index 1dc9d0d..a3698ae 100644 (file)
@@ -8,14 +8,14 @@ define('WFPL_DB_PASS', 'fixme');
 date_default_timezone_set('America/New_York');
 
 # Enable features, auto-includes
-require_once(__DIR__.'/'.'inc/wfpl/format.php');
-require_once(__DIR__.'/'.'inc/wfpl/db.php');
-require_once(__DIR__.'/'.'inc/wfpl/session_messages.php');
+require_once(INC_WFPL . 'format.php');
+require_once(INC_WFPL . 'db.php');
+require_once(INC_WFPL . 'session_messages.php');
 require_once(__DIR__.'/'.'inc/cms.php');
 
 # Connect to the database
 db_connect(WFPL_DB, WFPL_DB_USER, WFPL_DB_PASS);
 
 # Load the requested page (php and/or html)
-require_once(__DIR__.'/'.'inc/wfpl/main.php');
+require_once(INC_WFPL . 'main.php');
 wfpl_main();
index b2a4cc7..5d9c233 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-# This form requires wfpl. See: http://jasonwoof.org/wfpl
+# This form requires wfpl. See: http://sametwice.com/wfpl
 
 # SETUP
 
@@ -9,8 +9,8 @@ $GLOBALS['contact_form_recipient'] = 'fixme@example.com';
 $GLOBALS['contact_robot_answer'] = 1002;
 
 
-require_once('inc/wfpl/format.php');
-require_once('inc/wfpl/email.php');
+require_once(INC_WFPL . 'format.php');
+require_once(INC_WFPL . 'email.php');
 
 function contact_get_fields() {
        $data = array();
index fe9a487..ca97288 160000 (submodule)
--- a/inc/wfpl
+++ b/inc/wfpl
@@ -1 +1 @@
-Subproject commit fe9a487e1b5ed0700481aee4609055dc6c47505d
+Subproject commit ca972885f2beb03f94cc8b8418d40bf715a7cb4d
diff --git a/wfpl_main.php b/wfpl_main.php
new file mode 100644 (file)
index 0000000..86b0693
--- /dev/null
@@ -0,0 +1,9 @@
+<?php
+
+define('DOCROOT', __DIR__ .'/');
+define('INC_WFPL', DOCROOT . 'inc/wfpl/');
+
+require_once(DOCROOT . 'config.php');
+
+require_once(INC_WFPL . 'main.php');
+wfpl_main();