JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
Merge branch 'master' of /home/jason/dev/git/wfpl
authorjason <jason@lappy.(none)>
Wed, 16 Apr 2008 22:24:38 +0000 (18:24 -0400)
committerjason <jason@lappy.(none)>
Wed, 16 Apr 2008 22:24:38 +0000 (18:24 -0400)
db.php
misc.php
session.php

diff --git a/db.php b/db.php
index 9390035..0a1369f 100644 (file)
--- a/db.php
+++ b/db.php
@@ -212,7 +212,9 @@ function db_get_value($table, $columns, $where = '') {
 }
 
 function db_count($table, $where = '') {
-       return db_get_value($table, 'count(*)', $where);
+       $args = func_get_args();
+       array_splice($args, 1, 0, array('count(*)'));
+       return call_user_func_array('db_get_value', $args);
 }
 
 # call either of these ways:
index 5678b67..e604e61 100644 (file)
--- a/misc.php
+++ b/misc.php
@@ -33,6 +33,10 @@ function this_month() {
        return ereg_replace('^0', '', strftime('%m'));
 }
 
+# return today's date in yyyy-mm-dd format
+function today_ymd() {
+       return strftime('%Y-%m-%d');
+}
 
 # php4 is broken, in that you cannot set a default value for a parameter that
 # is passed by reference. So, this is set up to use the following screwy
index 1ac709c..dc20360 100644 (file)
@@ -71,6 +71,7 @@ function session_new($length = 86400) {
        $GLOBALS['session_key'] = $session_key;
        $_REQUEST['session_key'] = $session_key; #just in case someone calls session_exists() after session_new()
        session_touch($length);
+       return $GLOBALS['session_key'];
 }
 
 # call to renew the timeout for the session.