aboutsummaryrefslogtreecommitdiffstats
path: root/include/event.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-06-07 20:10:43 -0700
committerFriendika <info@friendika.com>2011-06-07 20:10:43 -0700
commit33fe26ecb01ec009a639c4c8fdfc4f93b2bd34ac (patch)
tree5bbb388dccbe87c1f34a61ee9de589ad8332c907 /include/event.php
parentd1e9af2c51d6b12d400a656f489520ccd8d54ed2 (diff)
downloadvolse-hubzilla-33fe26ecb01ec009a639c4c8fdfc4f93b2bd34ac.tar.gz
volse-hubzilla-33fe26ecb01ec009a639c4c8fdfc4f93b2bd34ac.tar.bz2
volse-hubzilla-33fe26ecb01ec009a639c4c8fdfc4f93b2bd34ac.zip
more progress on events
Diffstat (limited to 'include/event.php')
-rw-r--r--include/event.php42
1 files changed, 29 insertions, 13 deletions
diff --git a/include/event.php b/include/event.php
index 38ab83316..17e12d7cf 100644
--- a/include/event.php
+++ b/include/event.php
@@ -21,23 +21,39 @@ function format_event_html($ev) {
$ev['start'] /*, format */ ))
. '</abbr></p>';
- $o .= '<p>' . t('Ends: ') . '<abbr class="dtend" title="'
- . datetime_convert('UTC','UTC',$ev['finish'], ATOM_TIME)
- . '" >'
- . (($ev['adjust']) ? datetime_convert('UTC', date_default_timezone_get(),
- $ev['finish'] /*, format */ )
- : datetime_convert('UTC', 'UTC',
- $ev['finish'] /*, format */ ))
- . '</abbr></p>';
-
- $o .= '<p> ' . t('Location:') . '<span class="location">'
- . bbcode($ev['location'])
- . '</span></p>';
+ if(! $ev['nofinish'])
+ $o .= '<p>' . t('Ends: ') . '<abbr class="dtend" title="'
+ . datetime_convert('UTC','UTC',$ev['finish'], ATOM_TIME)
+ . '" >'
+ . (($ev['adjust']) ? datetime_convert('UTC', date_default_timezone_get(),
+ $ev['finish'] /*, format */ )
+ : datetime_convert('UTC', 'UTC',
+ $ev['finish'] /*, format */ ))
+ . '</abbr></p>';
+
+ if(strlen($ev['location']))
+ $o .= '<p> ' . t('Location:') . '<span class="location">'
+ . bbcode($ev['location'])
+ . '</span></p>';
$o .= '</div>';
-return $o;
+ return $o;
+}
+
+
+
+function sort_by_date($a) {
+
+ usort($a,'ev_compare');
+ return $a;
}
+function ev_compare($a,$b) {
+ $date_a = (($a['adjust']) ? datetime_convert('UTC',date_default_timezone_get(),$a['start']) : $a['start']);
+ $date_b = (($b['adjust']) ? datetime_convert('UTC',date_default_timezone_get(),$b['start']) : $b['start']);
+
+ return strcmp($date_a,$date_b);
+} \ No newline at end of file