-require_once(__DIR__ . '/template.php');
+require_once(__DIR__.'/'.'template.php');
function calendar_week(&$template) {
$template->sub('week');
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-require_once(__DIR__ . '/encode.php');
-require_once(__DIR__ . '/format.php');
+require_once(__DIR__.'/'.'encode.php');
+require_once(__DIR__.'/'.'format.php');
# db_connect() -- connect to a mysql database
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-require_once(__DIR__ . '/file.php');
+require_once(__DIR__.'/'.'file.php');
function dwt_reset() {
$GLOBALS['_dwt_keys'] = array('<!-- TemplateEndEditable -->');
<?php
-require_once('code/wfpl/db.php');
+require_once(__DIR__.'/'.'code/wfpl/db.php');
# fill in whatever database credentials you need here:
db_connect('database_name', 'username', 'password', 'host');
# fdb_set_dir() passing the path to that directory.
-require_once(__DIR__ . '/file.php');
-require_once(__DIR__ . '/binary.php');
+require_once(__DIR__.'/'.'file.php');
+require_once(__DIR__.'/'.'binary.php');
# call this to set what directory is used to store the files
function fdb_set_dir($dir) {
# date is edited as mm/dd/yyyy but stored as yyyy-mm-dd
function format_mdy_to_ymd($str) {
if($str == '') return '';
- require_once(__DIR__ . '/time.php');
+ require_once(__DIR__.'/'.'time.php');
return mdy_to_ymd(format_oneline($str));
}
# date is yyyy-mm-dd
function format_ymd($str) {
- require_once(__DIR__ . '/time.php');
+ require_once(__DIR__.'/'.'time.php');
list($year, $month, $day) = ymd_clean($str);
return sprintf('%04u-%02u-%02u', $year, $month, $day);
}
# display_messages() for you automaticallly after your main function returns
# (so long as you require_once this file.) If you want these messages to
# persist accross browser redirects, then you should
-# require_once("code/wfpl/session_messages.php")
+# require_once(__DIR__.'/'.'code/wfpl/session_messages.php')
#
# Just make sure your template has a <!--~$messages {~--> section with a
# ~message html~ tag in it.
# </div>
# <!--~}~-->
-require_once(__DIR__ . '/template.php');
+require_once(__DIR__.'/'.'template.php');
# call this to display a message
function message($msg) {
# This file writes the code for you (sql, php, html, email) to handle a form.
-require_once(__DIR__ . '/template.php');
-require_once(__DIR__ . '/http.php');
-require_once(__DIR__ . '/tar.php');
-require_once(__DIR__ . '/format.php');
+require_once(__DIR__.'/'.'template.php');
+require_once(__DIR__.'/'.'http.php');
+require_once(__DIR__.'/'.'tar.php');
+require_once(__DIR__.'/'.'format.php');
# see code/wfpl/metaform/template.html for the html templates for these elements
$GLOBALS['types'] = array(
$GLOBALS['~name~_file_name'] = uniqid() . getmypid() . '.jpg'; # comment this out to use uploader's filename
~}~~}~
-require_once('code/wfpl/format.php');
-require_once('code/wfpl/email.php');~uploads_include {~
-require_once('code/wfpl/upload.php');~}~
+require_once(__DIR__.'/'.'code/wfpl/format.php');
+require_once(__DIR__.'/'.'code/wfpl/email.php');~uploads_include {~
+require_once(__DIR__.'/'.'code/wfpl/upload.php');~}~
$GLOBALS['~file_name~_field_to_caption'] = array(~name_to_caption {~
'~name~' => '~caption phpsq~'~ sep {~,~}~~}~
}~}~~opt_listing {~
function ~file_name~_csv_download() {
- require_once('code/wfpl/csv.php');
+ require_once(__DIR__.'/'.'code/wfpl/csv.php');
$rows = db_get_rows('~table_name~', 'id,'.~file_name upper~_DB_FIELDS, 'order by id');
$fields = explode(',', 'id,'.~file_name upper~_DB_FIELDS);
$header = array();
# RewriteRule ^$ /foo/run.php
# RewriteRule ^foo/[^/]*\.html$ /foo/run.php
-require_once('code/wfpl/file_run.php');
-require_once('code/wfpl/http.php');
-require_once('code/wfpl/template.php');
+require_once(__DIR__.'/'.'code/wfpl/file_run.php');
+require_once(__DIR__.'/'.'code/wfpl/http.php');
+require_once(__DIR__.'/'.'code/wfpl/template.php');
-if(file_exists('code/config.php')) {
- file_run('code/config.php');
+if(file_exists(__DIR__.'/'.'code/config.php')) {
+ file_run(__DIR__.'/'.'code/config.php');
}
# pass the basename of the page you want for normal execution
}
- # You'll probably want to require_once('code/wfpl/messages.php') or
- # require_once('code/wfpl/session_messages.php') in code/config.php
+ # You'll probably want to require_once(__DIR__.'/'.'code/wfpl/messages.php') or
+ # require_once(__DIR__.'/'.'code/wfpl/session_messages.php') in code/config.php
if(function_exists('display_messages')) {
if(function_exists('atexit_now')) {
atexit_now();
# RewriteRule ^$ /foo/run.php
# RewriteRule ^foo/[^/]*\.html$ /foo/run.php
-require_once('code/wfpl/file_run.php');
-require_once('code/wfpl/http.php');
-require_once('code/wfpl/template.php');
+require_once(__DIR__.'/'.'code/wfpl/file_run.php');
+require_once(__DIR__.'/'.'code/wfpl/http.php');
+require_once(__DIR__.'/'.'code/wfpl/template.php');
if(file_exists('code/config.php')) {
file_run('code/config.php');
# see messages.php for documentation on how to use it.
-require_once(__DIR__ . '/session.php');
-require_once(__DIR__ . '/string_array.php');
-require_once(__DIR__ . '/messages.php');
+require_once(__DIR__.'/'.'session.php');
+require_once(__DIR__.'/'.'string_array.php');
+require_once(__DIR__.'/'.'messages.php');
function session_save_messages() {
if(!isset($GLOBALS['wfpl_messages'])) {
# tem_auto_* function to munge the data, automating certain common use
# cases. See the comments on the tem_auto functions for more details.
-require_once(__DIR__ . '/encode.php');
-require_once(__DIR__ . '/file.php');
-require_once(__DIR__ . '/misc.php');
+require_once(__DIR__.'/'.'encode.php');
+require_once(__DIR__.'/'.'file.php');
+require_once(__DIR__.'/'.'misc.php');
# Top-Level Functions
# WARNING: this code deletes all wfpl sessions. Do not use on a live site's database
##############
-require_once('code/wfpl/test/session_test_db_connect.php');
-require_once('code/wfpl/session.php');
+require_once(__DIR__.'/'.'code/wfpl/test/session_test_db_connect.php');
+require_once(__DIR__.'/'.'code/wfpl/session.php');
function session_dump($message) {
$ses = db_get_rows('wfpl_sessions', 'id,session_key,length,expires');
<?php
-require_once('code/wfpl/db.php');
+require_once(__DIR__.'/'.'code/wfpl/db.php');
db_connect('DATABASE_NAME', 'USERNAME', 'PASSWORD');
<?php
-require_once('code/wfpl/tar.php');
+require_once(__DIR__.'/'.'code/wfpl/tar.php');
# Unfortunately, I don't know how to set the suggested filename for downloads,
# so you'll have to deal with that yourself.
# the template system.
# First we'll need the functions in wfpl/template.php:
-require_once('code/wfpl/template.php');
+require_once(__DIR__.'/'.'code/wfpl/template.php');
# Always use the exact require_once statement above to get access to these
# functions. You should have in each directory of your projects a copy of wfpl
# or a symbolic link to it. This allows there to be different versions of wfpl
# This file is for running unit tests. Either on wfpl or your own code.
-require_once('code/wfpl/template.php');
-require_once('code/wfpl/messages.php');
+require_once(__DIR__.'/'.'code/wfpl/template.php');
+require_once(__DIR__.'/'.'code/wfpl/messages.php');
# call this to declare that a unit test has passed
function unit_test_passed($msg) {
# See code/wfpl/test.php for details on how to run or create tests
-require_once('code/wfpl/db.php');
+require_once(__DIR__.'/'.'code/wfpl/db.php');
function test_db_reposition($table = 'reposition') {
db_delete($table);
# See code/wfpl/test.php for details on how to run or create tests
-require_once('code/wfpl/encode.php');
+require_once(__DIR__.'/'.'code/wfpl/encode.php');
function _test_encode_pulled($field, $value, $correct) {
unit_test_func('enc_pulled', $value, $field, $correct);
# See code/wfpl/test.php for details on how to run or create tests
-require_once('code/wfpl/format.php');
+require_once(__DIR__.'/'.'code/wfpl/format.php');
function _test_format_money($arg, $dollars_correct, $money_correct) {
unit_test_func('format_dollars', $arg, $dollars_correct);
# See code/wfpl/unit_tests.php for details on how to run or create tests
-require_once('code/wfpl/misc.php');
+require_once(__DIR__.'/'.'code/wfpl/misc.php');
function test_ordinalize() {
$tests = array(
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-require_once(__DIR__ . '/template.php');
-require_once(__DIR__ . '/encode.php');
-require_once(__DIR__ . '/session.php');
-require_once(__DIR__ . '/upload.php'); # FIXME for path_to() which should be somewhere else
+require_once(__DIR__.'/'.'template.php');
+require_once(__DIR__.'/'.'encode.php');
+require_once(__DIR__.'/'.'session.php');
+require_once(__DIR__.'/'.'upload.php'); # FIXME for path_to() which should be somewhere else
# This function is for making an uploader with a progress bar.
#