made the date format an option

This commit is contained in:
Ryan Walberg 2012-11-26 02:41:18 +00:00
parent a9fca8ae0d
commit 6cd1031a44
3 changed files with 12 additions and 9 deletions

View file

@ -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);
}

View file

@ -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

View file

@ -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;
}