| 1 |
<?php |
<?php |
| 2 |
// $Id$ |
// $Id: game_calendar.install,v 1.1.2.1 2009/01/02 03:42:06 aaron Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 75 |
// Note that UI strings in the following SQL, e.g. "Default", aren't |
// Note that UI strings in the following SQL, e.g. "Default", aren't |
| 76 |
// wrapped in t() and that's intentional: they are passed to t() later, |
// wrapped in t() and that's intentional: they are passed to t() later, |
| 77 |
// thus allowing for multilingual sites. |
// thus allowing for multilingual sites. |
| 78 |
db_query("INSERT INTO {game_calendars} (cid, name, title, rate, date) VALUES (%d, 'default', 'Default', '+1 hour', %d)", $state->cid, time()); |
|
| 79 |
|
// Convert the date to DATE_ISO and save it to the database. |
| 80 |
|
$date = date_convert(time(), DATE_OBJECT, DATE_ISO); |
| 81 |
|
db_query("INSERT INTO {game_calendars} (cid, name, title, rate, date) VALUES (%d, 'default', 'Default', '+1 hour', %d)", $state->cid, $date); |
| 82 |
} |
} |
| 83 |
|
|
| 84 |
if ($success) { |
if ($success) { |
| 89 |
} |
} |
| 90 |
} |
} |
| 91 |
|
|
| 92 |
|
function _TODO_game_calendar_update_6001() { |
| 93 |
|
$ret = array(); |
| 94 |
|
|
| 95 |
|
$results = db_query("SELECT calid, date FROM {game_calendars} WHERE cid = 1"); |
| 96 |
|
while ($state = db_fetch_object($results)) {drupal_set_message($state->date); |
| 97 |
|
if ($state->date = date_convert($state->date, DATE_UNIX, DATE_ISO)) {drupal_set_message($state->date); |
| 98 |
|
$ret[] = update_sql("UPDATE {game_calendars} SET date = '%s' WHERE calid = %d", $state->date, $state->calid); |
| 99 |
|
} |
| 100 |
|
} |
| 101 |
|
return $ret; |
| 102 |
|
} |
| 103 |
|
|
| 104 |
/** |
/** |
| 105 |
* Implementation of hook_uninstall(). |
* Implementation of hook_uninstall(). |
| 106 |
*/ |
*/ |