]> git.mxchange.org Git - friendica.git/commitdiff
event listings
authorFriendika <info@friendika.com>
Tue, 7 Jun 2011 03:17:36 +0000 (20:17 -0700)
committerFriendika <info@friendika.com>
Tue, 7 Jun 2011 03:17:36 +0000 (20:17 -0700)
include/datetime.php
include/event.php
mod/events.php
view/theme/duepuntozero/style.css

index 67c4f42fad5b09219e3ebb8a6756a8233e545fe4..8f2ec311a019a775853bc786abc3448777736bcf 100644 (file)
@@ -276,7 +276,7 @@ function get_first_dim($y,$m) {
 
 
 if(! function_exists('cal')) {
-function cal($y = 0,$m = 0, $links = false) {
+function cal($y = 0,$m = 0, $links = false, $class='') {
 
 
        // month table - start at 1 to match human usage.
@@ -306,7 +306,7 @@ function cal($y = 0,$m = 0, $links = false) {
     $tddate = intval(datetime_convert('UTC',date_default_timezone_get(),'now','j'));
 
        $str_month = day_translate($mtab[$m]);
-  $o = '<table class="calendar">';
+  $o = '<table class="calendar' . $class . '">';
   $o .= "<caption>$str_month $y</caption><tr>";
   for($a = 0; $a < 7; $a ++)
      $o .= '<th>' . mb_substr(day_translate($dn[$a]),0,3,'UTF-8') . '</th>';
index 21817086f094753594b1ab43ad041f94932f69a6..ecaa9213a0cc7265f0a14a5ad7ff647847ac33ef 100644 (file)
@@ -3,12 +3,14 @@
 
 function format_event_html($ev) {
 
+       require_once('include/bbcode.php');
+
        if(! ((is_array($ev)) && count($ev)))
                return '';
 
        $o = '<div class="vevent">';
 
-       $o .= '<p class="description">' . $ev['desc'] .  '</p>';
+       $o .= '<p class="description">' . bbcode($ev['desc']) .  '</p>';
 
        $o .= '<p>' . t('Starts: ') . '<abbr class="dtstart" title="'
                . datetime_convert('UTC','UTC',$ev['start'], ATOM_TIME)
@@ -25,7 +27,7 @@ function format_event_html($ev) {
                . '</abbr></p>';
 
        $o .= '<p> ' . t('Location:') . '<span class="location">' 
-               . $ev['location'] 
+               . bbcode($ev['location']) 
                . '</span></p>';
 
        $o .= '</div>';
index cca0f20746131f5c461a7abbda1a5cf2debb3f75..d280bc1edc4e5b160f7d792d7b51789733adf559 100644 (file)
@@ -90,6 +90,8 @@ function events_content(&$a) {
                return;
        }
 
+       $o .= '<h2>' . t('Events') . '</h2>';
+
        $mode = 'view';
        $y = 0;
        $m = 0;
@@ -119,7 +121,22 @@ function events_content(&$a) {
                        $m = intval($thismonth);
 
        
-               $o .= cal($y,$m,false);
+               $o .= cal($y,$m,false, ' eventcal');
+
+               $dim = get_dim($y,$m);
+               $start = sprintf('%d-%d-%d %d:%d:%d',$y,$m,1,0,0,0);
+               $finish = sprintf('%d-%d-%d %d:%d:%d',$y,$m,$dim,23,59,59);
+
+
+               $r = q("SELECT * FROM `event` WHERE `start` >= '%s' AND `finish` <= '%s' AND `uid` = %d ",
+                       dbesc($start),
+                       dbesc($finish),
+                       intval(local_user())
+               );
+
+               if(count($r))
+                       foreach($r as $rr) 
+                               $o .= format_event_html($rr);
 
                return $o;
        }
index 2aa0eb2e924e354885daf068c9a014bcb314e8a5..f837112b60aaab69272e1d97fcdedbfbe40b3721 100644 (file)
@@ -2223,6 +2223,9 @@ a.mail-list-link {
   cursor: pointer;
 }
 
+.eventcal {
+       font-size: 24px;
+}
 
 .calendar {
        font-family: Courier, monospace;