From 6cd1031a44b872b685cc064b5e13a512edf8555a Mon Sep 17 00:00:00 2001 From: Ryan Walberg Date: Mon, 26 Nov 2012 02:41:18 +0000 Subject: [PATCH] made the date format an option --- src/event.php | 4 ++-- src/includes/config.php | 11 +++++++---- src/index.php | 6 +++--- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/event.php b/src/event.php index 3038543..854f616 100644 --- a/src/event.php +++ b/src/event.php @@ -179,7 +179,7 @@ try { $events = array(); while ($row = $stmt->fetch()) { - $row['eventdate'] = strftime("%m/%d/%Y", strtotime($row['eventdate'])); + $row['eventdate'] = strftime($opt["date_format"], strtotime($row['eventdate'])); $events[] = $row; } @@ -189,7 +189,7 @@ try { $smarty->assign('action', $action); $smarty->assign('haserror', $haserror); $smarty->assign('events', $events); - $smarty->assign('eventdate', strftime("%m/%d/%Y", strtotime($eventdate))); + $smarty->assign('eventdate', strftime($opt["date_format"], strtotime($eventdate))); if (isset($eventdate_error)) { $smarty->assign('eventdate_error', $eventdate_error); } diff --git a/src/includes/config.php b/src/includes/config.php index 429716f..e529048 100644 --- a/src/includes/config.php +++ b/src/includes/config.php @@ -21,8 +21,8 @@ function getGlobalOptions() { "pdo_connection_string" => "mysql:host=localhost;dbname=giftreg", /* The database username and password. */ - "pdo_username" => "dbusername", - "pdo_password" => "dbpassword", + "pdo_username" => "giftreg", + "pdo_password" => "cn3Malk", /* The maximum number of days before an event which produces a notification. */ "event_threshold" => "60", @@ -49,7 +49,7 @@ function getGlobalOptions() { "email_from" => "webmaster@" . $_SERVER['SERVER_NAME'], /* The e-mail Reply-To: header. */ - "email_reply_to" => "your@address.com", + "email_reply_to" => "rwalberg@mts.net", /* The e-mail X-Mailer header. */ "email_xmailer" => "PHP/" . phpversion(), @@ -78,6 +78,9 @@ function getGlobalOptions() { //"currency_symbol" => "€", // Euro //"currency_symbol" => "€", // Euro alternative + /* The date format used in PHP's strftime function. */ + "date_format" => "%m/%d/%Y", + /* If this is set to something other than "" then phpgiftreg will expect that string to prefix all tables in this installation. Useful for running multiple phpgiftreg installations in the same MySQL database. @@ -109,7 +112,7 @@ function getGlobalOptions() { UPDATE users SET password = MD5(password) on your database to convert the passwords. This operation is NON-REVERSIBLE! */ - "password_hasher" => "SHA1", + "password_hasher" => "MD5", /* Whether or not to allow image uploads. If on, the next option must point to a valid subdirectory that is writeable by the web server. The setup.php diff --git a/src/index.php b/src/index.php index 07b9bd8..06ff443 100644 --- a/src/index.php +++ b/src/index.php @@ -138,7 +138,7 @@ $stmt->bindParam(1, $userid, PDO::PARAM_INT); $stmt->execute(); $shoppees = array(); while ($row = $stmt->fetch()) { - $row['list_stamp'] = ($row['list_stamp == 0'] ? '-' : strftime("%m/%d/%Y", strtotime($row['list_stamp']))); + $row['list_stamp'] = ($row['list_stamp == 0'] ? '-' : strftime($opt["date_format"], strtotime($row['list_stamp']))); $shoppees[] = $row; } @@ -173,7 +173,7 @@ $stmt->bindParam(1, $userid, PDO::PARAM_INT); $stmt->execute(); $messages = array(); while ($row = $stmt->fetch()) { - $row['created'] = strftime("%m/%d/%Y", strtotime($row['created'])); + $row['created'] = strftime($opt["date_format"], strtotime($row['created'])); $messages[] = $row; } @@ -218,7 +218,7 @@ while ($row = $stmt->fetch()) { 'fullname' => $event_fullname, 'eventname' => $row['description'], 'daysleft' => $days_left, - 'date' => strftime("%m/%d/%Y", $event_date) + 'date' => strftime($opt["date_format"], $event_date) ); $events[] = $thisevent; }