From: Jason Woofenden Date: Mon, 2 Apr 2007 21:07:56 +0000 (-0400) Subject: copyrighted dwt.php, metaform textboxes aren't puny by default, added kill_session() X-Git-Url: https://jasonwoof.com/gitweb/?p=wfpl.git;a=commitdiff_plain;h=ddd681b6dcd0ef511238e96a0c3b94d9e8600ef2 copyrighted dwt.php, metaform textboxes aren't puny by default, added kill_session() --- diff --git a/dwt.php b/dwt.php new file mode 100644 index 0000000..7d68258 --- /dev/null +++ b/dwt.php @@ -0,0 +1,54 @@ +", $value); +} + +function dwt_output($filename = null) { + if($filename !== null) { + dwt_load($filename); + } + print(str_replace($GLOBALS['_dwt_keys'], $GLOBALS['_dwt_values'], $GLOBALS['_dwt_template'])); +} diff --git a/metaform/template.html b/metaform/template.html index 07cf014..57a0d19 100644 --- a/metaform/template.html +++ b/metaform/template.html @@ -19,7 +19,7 @@ div.error { border: 2px solid red; padding: 13px; margin: 20px; background: #ffd
- +
~caption.html~: ~caption.html~: ~caption.html~: ~caption.html~: ~caption.html~:
~caption.html~: ~caption.html~: ~caption.html~: ~caption.html~: ~caption.html~:
diff --git a/misc.php b/misc.php index ff0d227..18a1a41 100644 --- a/misc.php +++ b/misc.php @@ -18,6 +18,9 @@ # along with wfpl; if not, write to the Free Software Foundation, Inc., 51 # Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# This exists because file_get_contents() is not documented well. (It says that +# the second parameter is optional, but does not specify what happens when you +# do not pass anything.) And because it's nice to work in PHP4.2 function read_whole_file($name) { $fd = fopen($name, 'r'); if($fd === false) { diff --git a/session.php b/session.php index 41670a6..07b759a 100644 --- a/session.php +++ b/session.php @@ -130,6 +130,15 @@ function init_session() { } } +# delete the current session +function kill_session() { + if(!session_exists()) { + return; + } + db_delete('wfpl_session_data', 'where session_id=%i', $GLOBALS['session_id']); + db_delete('wfpl_sessions', 'where id=%i', $GLOBALS['session_id']); +} + # save a variable into the session function session_set($name, $value) { db_delete('wfpl_session_data', 'where session_id=%i && name=%"', $GLOBALS['session_id'], $name);