From fea2f9ac9be03684fc53dd488553c036b988d7eb Mon Sep 17 00:00:00 2001 From: Michael Johnston Date: Tue, 19 Mar 2013 00:29:59 -0400 Subject: small fixes for events --- include/event.php | 4 +++- view/tpl/event_head.tpl | 14 +++++++------- view/tpl/smarty3/event_head.tpl | 14 +++++++------- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/include/event.php b/include/event.php index a178c717a..58ab90e90 100644 --- a/include/event.php +++ b/include/event.php @@ -169,6 +169,8 @@ function event_store($arr) { return $r[0]['id']; } + $event_hash = $r[0]['event_hash']; + // The event changed. Update it. $r = q("UPDATE `event` SET @@ -205,7 +207,7 @@ function event_store($arr) { ); $r = q("SELECT * FROM item left join xchan on author_xchan = xchan_hash WHERE resource_id = '%s' AND resource_type = 'event' and uid = %d LIMIT 1", - intval($r[0]['event_hash']), + dbesc($event_hash), intval($arr['uid']) ); diff --git a/view/tpl/event_head.tpl b/view/tpl/event_head.tpl index 471748b97..45f07cf5d 100644 --- a/view/tpl/event_head.tpl +++ b/view/tpl/event_head.tpl @@ -27,21 +27,21 @@ eventRender: function(event, element, view) { //console.log(view.name); - if (event.item['author-name']==null) return; + if (event.item['author']['xchan_name']==null) return; switch(view.name){ case "month": element.find(".fc-event-title").html( "{1} : {2}".format( - event.item['author-avatar'], - event.item['author-name'], + event.item['author']['xchan_photo_s'], + event.item['author']['xchan_name'], event.title )); break; case "agendaWeek": element.find(".fc-event-title").html( "{1}

{2}

{3}

".format( - event.item['author-avatar'], - event.item['author-name'], + event.item['author']['xchan_photo_s'], + event.item['author']['xchan_name'], event.item.desc, event.item.location )); @@ -49,8 +49,8 @@ case "agendaDay": element.find(".fc-event-title").html( "{1}

{2}

{3}

".format( - event.item['author-avatar'], - event.item['author-name'], + event.item['author']['xchan_photo_s'], + event.item['author']['xchan_name'], event.item.desc, event.item.location )); diff --git a/view/tpl/smarty3/event_head.tpl b/view/tpl/smarty3/event_head.tpl index 32288b7ad..6cbb98ae7 100644 --- a/view/tpl/smarty3/event_head.tpl +++ b/view/tpl/smarty3/event_head.tpl @@ -32,21 +32,21 @@ eventRender: function(event, element, view) { //console.log(view.name); - if (event.item['author-name']==null) return; + if (event.item['author']['xchan_name']==null) return; switch(view.name){ case "month": element.find(".fc-event-title").html( "{1} : {2}".format( - event.item['author-avatar'], - event.item['author-name'], + event.item['author']['xchan_photo_s'], + event.item['author']['xchan_name'], event.title )); break; case "agendaWeek": element.find(".fc-event-title").html( "{1}

{2}

{3}

".format( - event.item['author-avatar'], - event.item['author-name'], + event.item['author']['xchan_photo_s'], + event.item['author']['xchan_name'], event.item.desc, event.item.location )); @@ -54,8 +54,8 @@ case "agendaDay": element.find(".fc-event-title").html( "{1}

{2}

{3}

".format( - event.item['author-avatar'], - event.item['author-name'], + event.item['author']['xchan_photo_s'], + event.item['author']['xchan_name'], event.item.desc, event.item.location )); -- cgit v1.2.3