/[drupal]/contributions/modules/game_calendar/game_calendar.install
ViewVC logotype

Diff of /contributions/modules/game_calendar/game_calendar.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.2.1, Fri Jan 2 03:42:06 2009 UTC revision 1.1.2.2, Sat Oct 3 03:14:22 2009 UTC
# Line 1  Line 1 
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
# Line 75  function game_calendar_install() { Line 75  function game_calendar_install() {
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) {
# Line 86  function game_calendar_install() { Line 89  function game_calendar_install() {
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   */   */

Legend:
Removed from v.1.1.2.1  
changed lines
  Added in v.1.1.2.2

  ViewVC Help
Powered by ViewVC 1.1.2