Plugin Directory

Changeset 223507


Ignore:
Timestamp:
03/31/2010 01:18:28 PM (16 years ago)
Author:
rjune
Message:

Adding 2.2

Location:
gcal-sidebar
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • gcal-sidebar/trunk/gcal-sidebar.php

    r221960 r223507  
    44Plugin URI: http://www.oriontechnologysolutions.com/gcal-sidebar/
    55Description: Pulls a Google Calendar feed and displays it in your sidebar.
    6 Version: 2.1
     6Version: 2.2
    77Author: Orion Technology Solutions
    88Author URI: http://www.oriontechnologysolutions.com
     
    209209        ?>
    210210        <div>
    211         <h4>Core</h4>
     211        <h4>Required</h4>
    212212        <p><label for="<?php echo $this->get_field_id('feed_id'); ?>"><?php _e('Feed ID:'); ?> <input class="widefat" id="<?php echo $this->get_field_id('feed_id'); ?>" name="<?php echo $this->get_field_name('feed_id'); ?>" type="text" value="<?php echo $feed_id; ?>" /></label>
    213213        </p>
    214214
     215        <h4>Optional</h4>
     216        <hr />
    215217        <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Calendar Title:'); ?> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></label>
    216218        </p>
     
    226228        </p>
    227229        <p><label for="<?php echo $this->get_field_id('max_results'); ?>"><?php _e('Max Results:'); ?> <input class="widefat" id="<?php echo $this->get_field_id('max_results'); ?>" name="<?php echo $this->get_field_name('max_results'); ?>" type="text" value="<?php echo $max_results; ?>" /></label></p>
    228         </div>
    229 <hr />
    230         <div>
    231         <h4>Optional</h4>
     230
     231        <p><label for="<?php echo $this->get_field_id('rs_offset'); ?>"><?php _e('Results Offset:'); ?> <input class="widefat" id="<?php echo $this->get_field_id('rs_offset'); ?>" name="<?php echo $this->get_field_name('rs_offset'); ?>" type="text" value="<?php echo $rs_offset; ?>" /></label></p>
     232
    232233        <p><label for="<?php echo $this->get_field_id('map_link'); ?>"><?php _e('Display link to map:'); ?>
    233234            <select name="<?php echo $this->get_field_name('map_link'); ?>" id="<?php echo $this->get_field_id('map_link'); ?>" >
     
    244245            <input class="widefat" id="<?php echo $this->get_field_id('static_url'); ?>" name="<?php echo $this->get_field_name('static_url'); ?>" type="text" value="<?php echo $static_url; ?>" />
    245246        </p>
    246 
    247         <p><label for="<?php echo $this->get_field_id('rs_offset'); ?>"><?php _e('Results Offset:'); ?> <input class="widefat" id="<?php echo $this->get_field_id('rs_offset'); ?>" name="<?php echo $this->get_field_name('rs_offset'); ?>" type="text" value="<?php echo $rs_offset; ?>" /></label></p>
    248247
    249248        <p><label for="<?php echo $this->get_field_id('pub_or_priv'); ?>"><?php _e('Public or Private:'); ?>
     
    331330        foreach(explode(",", $instance['feed_id']) as $feed_id) {
    332331            if(esc_attr($instance['pub_or_priv']) && trim(esc_attr($instance['priv_id'])))
    333                 $feedUrl = $feedUrlBase . $feed_id . "/private-" . $priv_id . $feedUrlOpt . "max-results=" . $max_results;
     332                $feedUrl = $feedUrlBase . $feed_id . "/private-" . trim(esc_attr($instance['priv_id'])) . $feedUrlOpt . "max-results=" . $max_results;
    334333            else
    335334                $feedUrl = $feedUrlBase . $feed_id . "/public" . $feedUrlOpt . "max-results=" . $max_results;
     
    370369                    $link = sprintf("%s&ctz=%s", $entry->link->attributes()->href, $calGroup['timezone']);
    371370
     371                if($entry->title == ''){
     372                    $title = "Busy";
     373                } else {
     374                    $title = sprintf("%s", $entry->title);
     375                }
    372376                $event = array(
    373                                'title'       => sprintf("%s", $entry->title),
     377                               'title'       => $title,
    374378                               'location'    => $where,
    375379                               'description' => $description,
     
    425429            $event = $eventList[$iter];
    426430
    427             $eventUrl = $event['link'];
    428431            if($pub_or_priv == 0) {
    429                 $link = sprintf("<a title='%s - %s' href='%s'>%s</a>\n", $event['location'], $event['description'], $eventUrl, $event['title']);
     432                $href = "href='".$event['link']."'";
    430433            }
    431434            else {
    432                 $link = sprintf("<a title='%s - %s'>%s</a>\n", $event['location'], $event['description'], $event['title']);
    433             }
     435                $href= '';
     436            }
     437            $link = sprintf("<a class='summary url' title='%s - %s' %s>%s</a>\n", $event['location'], $event['description'], $href, $event['title']);
    434438   
    435             $start = date("l, F j \\f\\r\o\m g:ia", strtotime($event['startTime']));
    436             $end = date("g:ia", strtotime($event['endTime']));
    437 
    438             echo '  <li class="event">';
     439
     440            echo '  <li class="event vevent">';
    439441            echo $link;
    440442            if($map_link == 1) {
     
    442444                printf("<a class='map' title='Map near %s' href='%s'>map</a>", $event['location'], $map_href);
    443445            }
    444             printf("<p class='event_time'>%s to %s</p>", date("l, F j \\f\\r\o\m g:ia", $event['startTime']), date("g:ia", $event['endTime']));
     446
     447            if((gmdate("g:ia", $event['startTime'])      == "12:00am") &&
     448               (gmdate("g:ia", $event['endTime'])        == "12:00am") &&
     449               ($event['endTime'] - $event['startTime']) == (60 * 60 * 24)) {
     450                $timeFrame = "All Day on " . gmdate("l, F j", $event['startTime']);
     451            }
     452            else {
     453                $timeFrame = sprintf("%s to %s", date("l, F j \\f\\r\o\m g:ia", $event['startTime']), date("g:ia", $event['endTime']));
     454            }
     455
     456            $isostart = date("c", $event['startTime']);
     457            printf("<p class='event_time dtstart value-title' title='$isostart'>%s</p>", $timeFrame);
    445458            echo '  </li>';
    446459        }
  • gcal-sidebar/trunk/readme.txt

    r221960 r223507  
    3333
    3434== Changelog ==
     35
     36= 2.2 =
     37* Fixed bug with private calendars
     38* Implemented "All day" idea from brady8(your patch was an old version)
     39* Added patch from Ned for richsnippets support
     40* Properly sorted required / optional configs in the widget config
    3541
    3642= 2.1 =
Note: See TracChangeset for help on using the changeset viewer.