From 4c629e274bbf368e79e47133869c923a2e6dd4a9 Mon Sep 17 00:00:00 2001 From: Friendika Date: Sun, 5 Jun 2011 23:10:07 -0700 Subject: [PATCH] begin event module --- boot.php | 2 +- database.sql | 1 + include/event.php | 5 ++- mod/events.php | 84 +++++++++++++++++++++++++++++++++++++++++++++++ update.php | 6 +++- 5 files changed, 95 insertions(+), 3 deletions(-) create mode 100644 mod/events.php diff --git a/boot.php b/boot.php index 3c82083395..a112b9d0dc 100644 --- a/boot.php +++ b/boot.php @@ -6,7 +6,7 @@ ini_set('pcre.backtrack_limit', 250000); define ( 'FRIENDIKA_VERSION', '2.2.1002' ); define ( 'DFRN_PROTOCOL_VERSION', '2.21' ); -define ( 'DB_UPDATE_VERSION', 1060 ); +define ( 'DB_UPDATE_VERSION', 1061 ); define ( 'EOL', "
\r\n" ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); diff --git a/database.sql b/database.sql index 7c26af341b..ab047968eb 100644 --- a/database.sql +++ b/database.sql @@ -476,6 +476,7 @@ CREATE TABLE IF NOT EXISTS `event` ( `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , `uid` INT NOT NULL , `cid` INT NOT NULL , +`uri` CHAR( 255 ) NOT NULL, `created` DATETIME NOT NULL , `edited` DATETIME NOT NULL , `start` DATETIME NOT NULL , diff --git a/include/event.php b/include/event.php index 06239b2abb..21817086f0 100644 --- a/include/event.php +++ b/include/event.php @@ -31,4 +31,7 @@ function format_event_html($ev) { $o .= ''; return $o; -} \ No newline at end of file +} + + + diff --git a/mod/events.php b/mod/events.php new file mode 100644 index 0000000000..73328b959e --- /dev/null +++ b/mod/events.php @@ -0,0 +1,84 @@ +get_hostname(),local_user()); + + $r = q("INSERT INTO `event` ( `uid`,`uri`,`created`,`edited`,`start`,`finish`,`desc`,`location`,`type`, + `adjust`,`allow_cid`,`allow_gid`,`deny_cid`,`deny_gid`) + VALUES ( %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, '%s', '%s', '%s', '%s' ) ", + intval(local_user()), + + dbesc(datetime_convert()), + dbesc(datetime_convert()), + dbesc($start), + dbesc($finish), + dbesc($desc), + dbesc($location), + dbesc($type), + intval($adjust), + dbesc($str_contact_allow), + dbesc($str_group_allow), + dbesc($str_contact_deny), + dbesc($str_group_deny) + + ); + } + +} + + diff --git a/update.php b/update.php index be1b184ae9..be78f068f0 100644 --- a/update.php +++ b/update.php @@ -1,6 +1,6 @@