diff options
author | Michael Johnston <michaelgeorgejohnston@gmail.com> | 2013-03-07 02:05:19 -0500 |
---|---|---|
committer | Michael Johnston <michaelgeorgejohnston@gmail.com> | 2013-03-07 02:07:51 -0500 |
commit | 41cd10f9035f52dce664aea443f06b15d3463994 (patch) | |
tree | 8b18faef9e89da9bcb7bf55ddb77d5c785d01ac2 /mod/events.php | |
parent | 863dcda8ee2e6a193729b4cb74a0bb60d364372b (diff) | |
download | volse-hubzilla-41cd10f9035f52dce664aea443f06b15d3463994.tar.gz volse-hubzilla-41cd10f9035f52dce664aea443f06b15d3463994.tar.bz2 volse-hubzilla-41cd10f9035f52dce664aea443f06b15d3463994.zip |
some fixes related to events
- add backticks around column "desc" in sql query
- fixed query for data passed to showEvent
- showEvent was picking up on id from item instead of id from event
- fixed references to author info in template
Diffstat (limited to 'mod/events.php')
-rwxr-xr-x | mod/events.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/mod/events.php b/mod/events.php index 8c509cfea..dd1f92f66 100755 --- a/mod/events.php +++ b/mod/events.php @@ -229,9 +229,9 @@ function events_content(&$a) { $adjust_start = datetime_convert('UTC', date_default_timezone_get(), $start); $adjust_finish = datetime_convert('UTC', date_default_timezone_get(), $finish); - if (x($_GET,'id')){ - $r = q("SELECT * from event left join item on resource_id = event_hash where resource_type = 'event' and event.uid = %d and event.id = %d limit 1", + $r = q("SELECT event.*, item.plink, item.item_flags, item.author_xchan, item.owner_xchan + from event left join item on resource_id = event_hash where resource_type = 'event' and event.uid = %d and event.id = %d limit 1", intval(local_user()), intval($_GET['id']) ); @@ -242,8 +242,8 @@ function events_content(&$a) { // Noting this for now - it will need to be fixed here and in Friendica. // Ultimately the finish date shouldn't be involved in the query. - - $r = q("SELECT * from event left join item on event_hash = resource_id + $r = q("SELECT event.*, item.plink, item.item_flags, item.author_xchan, item.owner_xchan + from event left join item on event_hash = resource_id where resource_type = 'event' and event.uid = %d and event.ignore = %d AND (( `adjust` = 0 AND ( `finish` >= '%s' or nofinish ) AND `start` <= '%s' ) OR ( `adjust` = 1 AND ( `finish` >= '%s' or nofinish ) AND `start` <= '%s' )) ", @@ -339,6 +339,7 @@ function events_content(&$a) { else { $tpl = get_markup_template("events-js.tpl"); } + $o = replace_macros($tpl, array( '$baseurl' => $a->get_baseurl(), '$tabs' => $tabs, |