From abcc70722c3577e63b53fcd3acf19d2916d810df Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 5 Feb 2015 19:37:55 -0800 Subject: event form cleanup backported from trinidad - still need to style the checkboxes --- mod/events.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'mod') diff --git a/mod/events.php b/mod/events.php index 9347331d8..7143963f4 100755 --- a/mod/events.php +++ b/mod/events.php @@ -577,12 +577,13 @@ function events_content(&$a) { '$catsenabled' => $catsenabled, '$placeholdercategory' => t('Categories (comma-separated list)'), '$category' => $category, - '$s_text' => t('Event Starts:') . ' *', + '$s_text' => t('Event Starts:'), '$stext' => $stext, '$ftext' => $ftext, + '$required' => ' *', '$ModalCANCEL' => t('Cancel'), '$ModalOK' => t('OK'), - '$s_dsel' => datetimesel($f,new DateTime(),DateTime::createFromFormat('Y',$syear+5),DateTime::createFromFormat('Y-m-d H:i',"$syear-$smonth-$sday $shour:$sminute"),'start_text'), + '$s_dsel' => datetimesel($f,new DateTime(),DateTime::createFromFormat('Y',$syear+5),DateTime::createFromFormat('Y-m-d H:i',"$syear-$smonth-$sday $shour:$sminute"),'start_text',true,true,'','',true), '$n_text' => t('Finish date/time is not known or not relevant'), '$n_checked' => $n_checked, '$f_text' => t('Event Finishes:'), @@ -593,7 +594,7 @@ function events_content(&$a) { '$d_orig' => $d_orig, '$l_text' => t('Location:'), '$l_orig' => $l_orig, - '$t_text' => t('Title:') . ' *', + '$t_text' => t('Title:'), '$t_orig' => $t_orig, '$sh_text' => t('Share this event'), '$sh_checked' => $sh_checked, -- cgit v1.2.3 From e7a68eaef002a9263d20076bcbe6b4c93378255f Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 5 Feb 2015 21:01:02 -0800 Subject: style the checkboxes in the event form --- mod/events.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/events.php b/mod/events.php index 7143963f4..233447cb1 100755 --- a/mod/events.php +++ b/mod/events.php @@ -588,8 +588,8 @@ function events_content(&$a) { '$n_checked' => $n_checked, '$f_text' => t('Event Finishes:'), '$f_dsel' => datetimesel($f,new DateTime(),DateTime::createFromFormat('Y',$fyear+5),DateTime::createFromFormat('Y-m-d H:i',"$fyear-$fmonth-$fday $fhour:$fminute"),'finish_text',true,true,'start_text'), + '$adjust' => array('adjust', t('Adjust for viewer timezone'), $a_checked), '$a_text' => t('Adjust for viewer timezone'), - '$a_checked' => $a_checked, '$d_text' => t('Description:'), '$d_orig' => $d_orig, '$l_text' => t('Location:'), -- cgit v1.2.3 From ed050e8ede9eb4a6f5b45d06a8385026db93106e Mon Sep 17 00:00:00 2001 From: marijus Date: Fri, 6 Feb 2015 10:40:55 +0100 Subject: fix objurl until get_rel_link() gets sorted --- mod/sharedwithme.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/sharedwithme.php b/mod/sharedwithme.php index d91987027..3c03b7412 100644 --- a/mod/sharedwithme.php +++ b/mod/sharedwithme.php @@ -83,7 +83,7 @@ function sharedwithme_content(&$a) { $item['id'] = $rr['id']; $item['objfiletype'] = $object['filetype']; $item['objfiletypeclass'] = getIconFromType($object['filetype']); - $item['objurl'] = rawurldecode(get_rel_link($object['link'],'alternate')) . '?f=&zid=' . $channel['xchan_addr']; + $item['objurl'] = rawurldecode($object['link'][0]['href']) . '?f=&zid=' . $channel['xchan_addr']; $item['objfilename'] = $object['filename']; $item['objfilesize'] = userReadableSize($object['filesize']); $item['objedited'] = $object['edited']; -- cgit v1.2.3 From 712bc643b5f26315602f34e9d9822ef83cb6b65a Mon Sep 17 00:00:00 2001 From: marijus Date: Fri, 6 Feb 2015 11:34:23 +0100 Subject: revert to get_rel_link() --- mod/sharedwithme.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/sharedwithme.php b/mod/sharedwithme.php index 3c03b7412..d91987027 100644 --- a/mod/sharedwithme.php +++ b/mod/sharedwithme.php @@ -83,7 +83,7 @@ function sharedwithme_content(&$a) { $item['id'] = $rr['id']; $item['objfiletype'] = $object['filetype']; $item['objfiletypeclass'] = getIconFromType($object['filetype']); - $item['objurl'] = rawurldecode($object['link'][0]['href']) . '?f=&zid=' . $channel['xchan_addr']; + $item['objurl'] = rawurldecode(get_rel_link($object['link'],'alternate')) . '?f=&zid=' . $channel['xchan_addr']; $item['objfilename'] = $object['filename']; $item['objfilesize'] = userReadableSize($object['filesize']); $item['objedited'] = $object['edited']; -- cgit v1.2.3 From 9b1c09fe83bd0201c326059e6fe9e3823ae11f5b Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 8 Feb 2015 13:52:46 -0800 Subject: restrict "mark all events seen" to only the events that are presented in the notification view. --- mod/ping.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'mod') diff --git a/mod/ping.php b/mod/ping.php index c69f42a6f..6a89ad5cf 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -173,8 +173,10 @@ function ping_init(&$a) { ); break; case 'all_events': - $r = q("update event set `ignore` = 1 where `ignore` = 0 and uid = %d", - intval(local_channel()) + $r = q("update event set `ignore` = 1 where `ignore` = 0 and uid = %d AND start < '%s' AND start > '%s' ", + intval(local_channel()), + dbesc(datetime_convert('UTC', date_default_timezone_get(), 'now + ' . intval($evdays) . ' days')), + dbesc(datetime_convert('UTC', date_default_timezone_get(), 'now - 1 days')) ); break; case 'notify': -- cgit v1.2.3 From 7893b649552f23125835cd759ba00230b02a0ab3 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 8 Feb 2015 15:14:45 -0800 Subject: make default calendar view ambivalent to the state of the ignore flag. --- mod/events.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'mod') diff --git a/mod/events.php b/mod/events.php index 233447cb1..a34aa62ab 100755 --- a/mod/events.php +++ b/mod/events.php @@ -242,7 +242,7 @@ function events_content(&$a) { $mode = 'view'; $y = 0; $m = 0; - $ignored = ((x($_REQUEST,'ignored')) ? intval($_REQUEST['ignored']) : 0); + $ignored = ((x($_REQUEST,'ignored')) ? " and ignored = " . intval($_REQUEST['ignored']) . " " : ''); if(argc() > 1) { if(argc() > 2 && argv(1) == 'event') { @@ -338,11 +338,10 @@ function events_content(&$a) { $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 + where resource_type = 'event' and event.uid = %d $ignored AND (( `adjust` = 0 AND ( `finish` >= '%s' or nofinish = 1 ) AND `start` <= '%s' ) OR ( `adjust` = 1 AND ( `finish` >= '%s' or nofinish = 1 ) AND `start` <= '%s' )) ", intval(local_channel()), - intval($ignored), dbesc($start), dbesc($finish), dbesc($adjust_start), -- cgit v1.2.3 From b8add899a22039697b1ea92d4a854f541ad8f7cb Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 8 Feb 2015 19:28:18 -0800 Subject: undo extra logging --- mod/item.php | 1 + 1 file changed, 1 insertion(+) (limited to 'mod') diff --git a/mod/item.php b/mod/item.php index d8cbeadc7..6ae02b510 100644 --- a/mod/item.php +++ b/mod/item.php @@ -516,6 +516,7 @@ function item_post(&$a) { * First protect any url inside certain bbcode tags so we don't double link it. */ + $body = preg_replace_callback('/\[code(.*?)\[\/(code)\]/ism','red_escape_codeblock',$body); $body = preg_replace_callback('/\[url(.*?)\[\/(url)\]/ism','red_escape_codeblock',$body); $body = preg_replace_callback('/\[zrl(.*?)\[\/(zrl)\]/ism','red_escape_codeblock',$body); -- cgit v1.2.3