WordPress.org

Plugin Directory

Changeset 627944


Ignore:
Timestamp:
11/20/12 22:26:32 (17 months ago)
Author:
joedolson
Message:

Commit version 2.1.0

Location:
my-calendar/trunk
Files:
30 edited

Legend:

Unmodified
Added
Removed
  • my-calendar/trunk/button/generator.php

    r624718 r627944  
    44    $slash = ($iswin) ? "\\" : "/"; 
    55    $wp_path = preg_split('/(?=((\\\|\/)wp-content)).*/', dirname(__file__)); 
    6     $wp_path = (isset($wp_path[0]) && $wp_path[0] != "") ? $wp_path[0] : $_SERVER["DOCUMENT_ROOT"]; 
     6    $wp_path = ( isset($wp_path[0]) && $wp_path[0] != "" && $wp_path[0] != dirname(__FILE__) ) ? $wp_path[0] : $_SERVER["DOCUMENT_ROOT"]; 
    77require_once($wp_path . $slash . 'wp-load.php'); 
    88require_once($wp_path . $slash . 'wp-admin' . $slash . 'admin.php');  
  • my-calendar/trunk/mc-styles.css

    r598242 r627944  
    3636#my-calendar .break ul {padding: 10px 10px 0;margin-right: 180px;} 
    3737#my-calendar .columns, .jd-my-calendar .columns {-moz-column-count: 3;-moz-column-gap: 20px;-webkit-column-count: 3;-webkit-column-gap: 20px;column-count: 3;column-gap: 20px;} 
     38#my-calendar .two-columns {-moz-column-count: 2;-moz-column-gap: 30px;-webkit-column-count: 2;-webkit-column-gap: 30px;column-count: 2;column-gap: 30px;} 
    3839.jd-my-calendar .event_image img { max-width: 480px; } 
    3940.event_image img {margin-top: 2px;} 
    4041.mc_support {font-family:'Courier New';background:#fff;padding:5px;} 
    41 .jd-my-calendar .button-primary { position: absolute; top: -24px; right: 10px;} 
     42.jd-my-calendar .button-primary { position: absolute; top: 0; right: 10px;} 
    4243.jd-my-calendar .button-primary.group { top: -40px; } 
    4344.template-editor, .style-editor { width: 98%; } 
     
    5556.jd-my-calendar .button-adjust { top: 10px; right: 0; } 
    5657.jd-my-calendar hr { width: 20%; margin: 0 auto; border: none; border-top: 1px solid #ccc;} 
     58#mc-shortcodes code { font-size: 1.4em; line-height: 1.5; display: inline-block;} 
  • my-calendar/trunk/my-calendar-categories.php

    r618836 r627944  
    6262function is_custom_icon() { 
    6363    global $wp_plugin_dir; 
    64     if (file_exists( $wp_plugin_dir . '/my-calendar-custom/' ) ) { 
    65         $results = my_dirlist( $wp_plugin_dir . '/my-calendar-custom/' ); 
     64    if (file_exists( str_replace('/my-calendar','',$wp_plugin_dir ). '/my-calendar-custom/' ) ) { 
     65        $results = my_dirlist(  str_replace('/my-calendar','',$wp_plugin_dir ) . '/my-calendar-custom/' ); 
    6666        if ( empty($results) ) { 
    6767            return false; 
     
    174174global $path, $wp_plugin_dir,$wp_plugin_url; 
    175175    if ( is_custom_icon() ) { 
    176         $directory = $wp_plugin_dir . '/my-calendar-custom/'; 
     176        $directory = str_replace('/my-calendar','',$wp_plugin_dir) . '/my-calendar-custom/'; 
    177177        $path = '/my-calendar-custom'; 
    178178        $iconlist = my_dirlist($directory); 
  • my-calendar/trunk/my-calendar-core.php

    r624321 r627944  
    217217        $ajax_js = stripcslashes( get_option( 'mc_ajaxjs' ) ); 
    218218 
    219             if (is_object($wp_query)) { 
     219            if ( is_object($wp_query) && isset($wp_query->post) ) { 
    220220                $id = $wp_query->post->ID; 
    221221            }  
     
    409409// Function to check what version of My Calendar is installed and install or upgrade if needed 
    410410function check_my_calendar() { 
    411     global $wpdb, $initial_listjs, $initial_caljs, $initial_minijs, $initial_ajaxjs,$mc_version,$grid_template,$list_template,$mini_template,$single_template, $defaults; 
     411    global $wpdb, $initial_listjs, $initial_caljs, $initial_minijs, $initial_ajaxjs,$mc_version,$grid_template,$rss_template, $list_template,$mini_template,$single_template, $defaults; 
    412412    $mcdb = $wpdb; 
    413413    mc_if_needs_permissions(); 
     
    461461        if ( version_compare( $current_version, "1.11.1", "<" ) ) { $upgrade_path[] = "1.11.1"; } 
    462462        if ( version_compare( $current_version, "2.0.0", "<" ) ) { $upgrade_path[] = "2.0.0"; }  
    463         if ( version_compare( $current_version, "2.0.4", "<" ) ) { $upgrade_path[] = "2.0.4"; }          
     463        if ( version_compare( $current_version, "2.0.4", "<" ) ) { $upgrade_path[] = "2.0.4"; }  
     464        if ( version_compare( $current_version, "2.1.0", "<" ) ) { $upgrade_path[] = "2.1.0"; }  
    464465    } 
    465466    // having determined upgrade path, assign new version number 
     
    479480        switch ($upgrade) { 
    480481        // only upgrade db on most recent version 
     482            case '2.1.0': 
     483                $templates = get_option( 'mc_templates' ); 
     484                global $rss_template; 
     485                $templates['rss'] = $rss_template; 
     486                update_option( 'mc_templates', $templates ); 
     487                break; 
    481488            case '2.0.4': 
    482489                update_option('mc_ical_utc','true'); 
     
    13741381$plugins_string 
    13751382"; 
     1383    $request = ''; 
    13761384    if ( isset($_POST['mc_support']) ) { 
    13771385        $nonce=$_REQUEST['_wpnonce']; 
     
    16241632                        $newbegin = my_calendar_add_date(date('Y-m-d  H:i:s',$newbegin),28,0,0); 
    16251633                        $newend = my_calendar_add_date(date('Y-m-d  H:i:s',$newend),28,0,0); 
    1626                     // JCD NOTE old method of calculating month-by-day events, keeping in case of problems with new method. (Replaced in version 2.0.0) 
    1627                     //$day_diff = jd_date_diff($approxbegin, $approxend);                        
    1628                         //$day_of_event = date('D',strtotime($event->event_begin) ); 
    1629                         /*for ($n=-6;$n<=6;$n++) {                               
    1630                             $timestamp = strtotime(my_calendar_add_date($approxbegin,$n,0,0)); 
    1631                             $current_day = date('D',$timestamp); 
    1632                             if ($current_day == $day_of_event) { 
    1633                             $current_week = week_of_month( date( 'd',$timestamp)); 
    1634                             $current_date = date( 'd',$timestamp); 
    1635                                 if ($current_day == $day_of_event && $current_week == $week_of_event) { 
    1636                                     $this_date = $current_date; 
    1637                                 } else { 
    1638                                     $first = $week_of_event*7; 
    1639                                     $last = $first+7; 
    1640                                     for ($s=$first;$s<=$last;$s++) { 
    1641                                         if ( $s > date('t',$timestamp) ) { 
    1642                                             $day = $s-date('t',$timestamp); 
    1643                                             $month = (date('m',$timestamp) == 12)?1:date('m',$timestamp)+1; 
    1644                                         } else { 
    1645                                             $day = $s; 
    1646                                             $month = date( 'm', $timestamp); 
    1647                                         } 
    1648                                         $string = date( 'Y', $timestamp ).'-'.$month.'-'.$day; 
    1649                                         $week = week_of_month($s); 
    1650                                             if ( date('D',strtotime($string)) == $day_of_event && $week == $week_of_event ) { 
    1651                                                 $this_date = $s; break; 
    1652                                             }  
    1653                                     } 
    1654                                     if ( $fifth_week == 1 && $this_date > date('t',$timestamp) ) { 
    1655                                         $first = $first; 
    1656                                         $last = $first-7; 
    1657                                         for ($s=$last;$s<=$first;$s++) { 
    1658                                             $string = date( 'Y', $timestamp ).'-'.date('m', $timestamp).'-'.$s; 
    1659                                             if ( date('D',strtotime($string)) == $day_of_event ) { 
    1660                                                 $this_date = $s; break; 
    1661                                             } 
    1662                                         } 
    1663                                     } 
    1664                                 } 
    1665                                 if ( ($current_day == $day_of_event && $current_week == $week_of_event) || ($current_date >= $this_date && $current_date <= $this_date+$day_diff && $this_date != '' ) ) {               
    1666                                     $begin = my_calendar_add_date($approxbegin,$n,0,0); 
    1667                                     $end = my_calendar_add_date($approxend,$n,0,0);                                                                      
    1668                                         $data = array( 'occur_event_id'=>$id, 'occur_begin'=>date('Y-m-d  H:i:s',$begin), 'occur_end'=>date('Y-m-d  H:i:s',$end), 'occur_group_id'=>$group_id ); 
    1669                                         $sql = $wpdb->insert( my_calendar_event_table(), $data, $format ); 
    1670                                 } 
    1671                             } 
    1672                         }*/ 
    16731634                    } 
    16741635                break; 
  • my-calendar/trunk/my-calendar-event-manager.php

    r624321 r627944  
    465465<div class="ui-sortable meta-box-sortables"> 
    466466<div class="postbox">    
    467     <h3><?php _e('Add/Edit Event','my-calendar'); ?></h3> 
     467    <h3><?php _e('Add/Edit Event','my-calendar'); ?> <small>(<a href="#mc-manage"><?php _e('Edit events','my-calendar'); ?>)</a></small></h3> 
    468468    <div class="inside"> 
    469469            <p> 
     
    954954    $items = $found_rows[0]; 
    955955    ?> 
    956     <h2 class='mc-clear'><?php _e('Manage Events','my-calendar'); ?></h2> 
     956    <h2 class='mc-clear' id='mc-manage'><?php _e('Manage Events','my-calendar'); ?></h2> 
    957957        <?php if ( get_option('mc_event_approve') == 'true' ) { ?> 
    958958        <ul class="links"> 
  • my-calendar/trunk/my-calendar-events.php

    r624660 r627944  
    11<?php 
    22// used to generate upcoming events lists 
    3 function mc_get_all_events( $category, $before, $after, $today, $author ) { 
     3function mc_get_all_events( $category, $before, $after, $today, $author, $host ) { 
    44global $wpdb; 
    55    $mcdb = $wpdb; 
     
    88    $limit_string = mc_limit_string(); 
    99    $select_author = ( $author != 'default' )?mc_select_author($author):''; 
     10    $select_host = ( $host != 'default' )?mc_select_host($host):''; 
     11     
    1012    $date = date('Y', current_time('timestamp')).'-'.date('m', current_time('timestamp')).'-'.date('d', current_time('timestamp')); 
    1113    // if a value is non-zero, I'll grab a handful of extra events so I can throw out holidays and others like that. 
     
    1719        ON (event_id=occur_event_id)  
    1820        JOIN " . MY_CALENDAR_CATEGORIES_TABLE . "  
    19         ON (event_category=category_id) WHERE $select_category $select_author $limit_string event_approved = 1 AND event_flagged <> 1  
     21        ON (event_category=category_id) WHERE $select_category $select_author $select_host $limit_string event_approved = 1 AND event_flagged <> 1  
    2022        AND DATE(occur_begin) < '$date' ORDER BY occur_begin DESC LIMIT 0,$before"); 
    2123    } else { $events1 = array(); } 
     
    2628        ON (event_id=occur_event_id)  
    2729        JOIN " . MY_CALENDAR_CATEGORIES_TABLE . "  
    28         ON (event_category=category_id) WHERE $select_category $select_author $limit_string event_approved = 1 AND event_flagged <> 1  
     30        ON (event_category=category_id) WHERE $select_category $select_author $select_host $limit_string event_approved = 1 AND event_flagged <> 1  
    2931        AND DATE(occur_begin) = '$date'");   
    3032    } else { 
     
    3840        ON (event_id=occur_event_id)  
    3941        JOIN " . MY_CALENDAR_CATEGORIES_TABLE . "  
    40         ON (event_category=category_id) WHERE $select_category $select_author $limit_string event_approved = 1 AND event_flagged <> 1  
     42        ON (event_category=category_id) WHERE $select_category $select_author $select_host $limit_string event_approved = 1 AND event_flagged <> 1  
    4143        AND DATE(occur_begin) > '$date' ORDER BY occur_begin ASC LIMIT 0,$after"); 
    4244    } else { $events2 = array(); } 
     
    133135 
    134136// Grab all events for the requested date from calendar 
    135 function my_calendar_grab_events($from, $to,$category=null,$ltype='',$lvalue='',$source='calendar',$author=null) { 
     137function my_calendar_grab_events($from, $to,$category=null,$ltype='',$lvalue='',$source='calendar',$author=null, $host=null) { 
    136138    if ( isset($_GET['mcat']) ) { $ccategory = $_GET['mcat']; } else { $ccategory = $category; } 
    137139    if ( isset($_GET['ltype']) ) { $cltype = $_GET['ltype']; } else { $cltype = $ltype; } 
    138140    if ( isset($_GET['loc']) ) { $clvalue = $_GET['loc']; } else { $clvalue = $lvalue; } 
    139141    if ( isset($_GET['mc_auth']) ) { $clauth = $_GET['mc_auth']; } else { $clauth = $author; } 
     142    if ( isset($_GET['mc_host']) ) { $clhost = $_GET['mc_host']; } else { $clhost = $host; } 
    140143     
    141144    if ( $ccategory == '' ) { $ccategory = 'all'; } 
     
    144147    if ( $clvalue == 'all' ) { $cltype = 'all'; } 
    145148    if ( $clauth == '' ) { $clauth = 'all'; } 
     149    if ( $clhost == '' ) { $clhost = 'all'; } 
    146150 
    147151    if ( !mc_checkdate($from) || !mc_checkdate($to) ) { return; } // not valid dates 
    148152    $caching = ( get_option('mc_caching_enabled') == 'true' )?true:false; 
    149     $hash = md5($from.$to.$ccategory.$cltype.$clvalue.$clauth); 
     153    $hash = md5($from.$to.$ccategory.$cltype.$clvalue.$clauth.$clhost); 
    150154    if ( $source != 'upcoming' ) { // no caching on upcoming events by days widgets or lists 
    151155        if ( $caching ) { 
    152             $output = mc_check_cache( $ccategory, $cltype, $clvalue, $clauth, $hash ); 
     156            $output = mc_check_cache( $ccategory, $cltype, $clvalue, $clauth, $clhost, $hash ); 
    153157            if ( $output && $output != 'empty' ) { return $output; } 
    154158            if ( $output == 'empty' ) { return; } 
     
    160164    $select_category = ( $category != null )?mc_select_category($category):''; 
    161165    $select_author = ( $author != null )?mc_select_author($author):'';   
     166    $select_host = ( $author != null )?mc_select_host($host):'';         
    162167    $select_location = mc_limit_string( 'grab', $ltype, $lvalue ); 
    163168 
    164     if ( $caching && $source != 'upcoming' ) { $select_category = ''; $select_location = ''; $select_author = ''; }  
     169    if ( $caching && $source != 'upcoming' ) { $select_category = ''; $select_location = ''; $select_author = ''; $select_host = ''; }  
    165170    // if caching, then need all categories/locations in cache. UNLESS this is an upcoming events list 
    166171 
     
    174179                    JOIN " . MY_CALENDAR_CATEGORIES_TABLE . "  
    175180                    ON (event_category=category_id)  
    176                     WHERE $select_category $select_location $select_author $limit_string  
     181                    WHERE $select_category $select_location $select_author $select_host $limit_string  
    177182                    AND ( DATE(occur_begin) BETWEEN '$from 00:00:00' AND '$to 23:59:59'  
    178183                        OR DATE(occur_end) BETWEEN '$from 00:00:00' and '$to 23:59:59'  
     
    190195        $new_cache = mc_create_cache( $arr_events, $hash ); 
    191196        if ( $new_cache ) { 
    192             $output = mc_check_cache( $ccategory, $cltype, $clvalue, $clauth, $hash ); 
     197            $output = mc_check_cache( $ccategory, $cltype, $clvalue, $clauth, $clhost, $hash ); 
    193198            return $output;  
    194199        } else {  
    195200            // need to clean cache if the cache is maxed. 
    196             return mc_clean_cache( $arr_events, $ccategory, $cltype, $clvalue, $clauth );  
     201            return mc_clean_cache( $arr_events, $ccategory, $cltype, $clvalue, $clauth, $clhost );  
    197202        }        
    198203    } else { 
     
    201206} 
    202207 
    203 function mc_check_cache( $category, $ltype, $lvalue, $auth, $hash) { 
     208function mc_check_cache( $category, $ltype, $lvalue, $auth, $host, $hash) { 
    204209    $caching = ( get_option('mc_caching_enabled') == 'true' )?true:false; 
    205210    if ( $caching == true ) { 
     
    210215            return false; 
    211216        } 
    212         if ( $value ) { return mc_clean_cache($value, $category,$ltype,$lvalue,$auth); } else { return false; } 
     217        if ( $value ) { return mc_clean_cache($value, $category,$ltype,$lvalue,$auth,$host); } else { return false; } 
    213218    } else { 
    214219        return false; 
     
    216221} 
    217222 
    218 function mc_clean_cache( $cache, $category, $ltype, $lvalue, $auth ) { 
     223function mc_clean_cache( $cache, $category, $ltype, $lvalue, $auth, $host ) { 
    219224global $wpdb; 
    220225    $mcdb = $wpdb; 
     
    238243                $authors = array($auth); 
    239244            } 
     245            if ( strpos( $host, ',' ) !== false ) { 
     246                $authors = explode(',',$host); 
     247            } else if ( strpos( $host, '|' ) !== false ) { 
     248                $authors = explode('|',$host); 
     249            } else { 
     250                $hosts = array($host); 
     251            }            
    240252            foreach ( $authors as $k=>$v ) { 
    241253                if ( !is_numeric($v) && $v != 'all' ) {  
     
    245257                } 
    246258            } 
     259            foreach ( $hosts as $k=>$v ) { 
     260                if ( !is_numeric($v) && $v != 'all' ) {  
     261                    $u = get_user_by('login',$v); 
     262                    $id = $u->ID; 
     263                    $hosts[$k]= $id; 
     264                } 
     265            }            
    247266        foreach ( $cache as $key=>$value ) { 
    248267            foreach ( $cats as $cat ) { 
     
    250269                if ( ( $value->event_category == $cat || $category == 'all' || $value->category_name == $cat )  
    251270                        && ( $value->event_author == $auth || $auth == 'all' || in_array( $value->event_author,$authors ) ) 
     271                        && ( $value->event_host == $host || $host == 'all' || in_array( $value->event_host,$hosts ) ) 
    252272                        && ( $value->$type == $lvalue || ( $ltype == 'all' && $lvalue == 'all' ) ) ) {               
    253273                    $return[$key]=$value; 
  • my-calendar/trunk/my-calendar-group-manager.php

    r604930 r627944  
    527527    $desc = !empty($post['content']) ? trim($post['content']) : ''; 
    528528    $short = !empty($post['event_short']) ? trim($post['event_short']) : ''; 
    529     $repeats = ( !empty($post['event_repeats']) || trim($post['event_repeats'])=='' ) ? trim($post['event_repeats']) : 0; 
     529    $repeats = ( empty($post['event_repeats']) || trim($post['event_repeats'])=='' ) ? 0 : trim($post['event_repeats']); 
    530530    $host = !empty($post['event_host']) ? $post['event_host'] : $current_user->ID; 
    531531    $category = !empty($post['event_category']) ? $post['event_category'] : ''; 
  • my-calendar/trunk/my-calendar-help.php

    r624321 r627944  
    1 <?php 
    2 function my_calendar_help() { 
    3 global $wp_plugin_dir; 
    4 ?> 
     1<?php function my_calendar_help() { ?> 
    52 
    63<div class="wrap jd-my-calendar"> 
     
    96<div class="metabox-holder"> 
    107 
     8<div class="ui-sortable meta-box-sortables">    
     9<div class="postbox"> 
     10    <h3><?php _e('My Calendar Help','my-calendar'); ?></h3> 
     11    <div class="inside"> 
     12    <ul class="mc-settings"> 
     13        <li><a href="#mc-shortcodes"><?php _e('Shortcodes','my-calendar'); ?></a></li> 
     14        <li><a href="#icons"><?php _e('Icons','my-calendar'); ?></a></li> 
     15        <li><a href="#mc-styles"><?php _e('Styles','my-calendar'); ?></a></li> 
     16        <li><a href="#templates"><?php _e('Templating','my-calendar'); ?></a></li> 
     17        <li><a href="#get-support"><?php _e('Support Form','my-calendar'); ?></a></li> 
     18        <li><a href="#notes"><?php _e('Helpful Information','my-calendar'); ?></a></li> 
     19    </ul> 
     20    </div> 
     21</div> 
     22</div> 
     23 
     24<div class="ui-sortable meta-box-sortables" id="get-started"> 
     25<div class="postbox"> 
     26<h3 id="help"><?php _e('Getting Started','my-calendar'); ?></h3> 
     27    <div class="inside"> 
     28    <p> 
     29    <?php _e('Although the My Calendar plug-in is very complicated in terms of what can be customized, the basic usage is quite simple.','my-calendar'); ?> 
     30    </p> 
     31    <ul> 
     32        <li> - <?php _e('Add the My Calendar shortcode (<code>[my_calendar]</code>) to a page.','my-calendar'); ?></li> 
     33        <li> - <?php _e('Add events by clicking on the Add/Edit Events link in the admin sidebar or on "Add Events" in the admin toolbar.','my-calendar'); ?></li> 
     34        <li> - <?php _e('Select your preferred stylesheet in the Styles Editor','my-calendar'); ?></li> 
     35    </ul> 
     36    <p> 
     37    <?php _e('Read more of the basic help documentation on this page or purchase the My Calendar User\'s Guide to customize further -- but the above is all that you need to do to begin using the calendar.','my-calendar'); ?> 
     38    </p> 
     39    </div> 
     40</div> 
     41</div> 
     42 
    1143<div class="ui-sortable meta-box-sortables"> 
    12 <div class="postbox"> 
     44<div class="postbox" id="mc-shortcodes"> 
    1345    <h3><?php _e('Shortcode Syntax','my-calendar'); ?></h3> 
    1446    <div class="inside">     
     
    2355<p><code>[my_calendar format="list" showkey="yes" shownav="yes" toggle="no" time="week"]</code></p> 
    2456<p> 
    25 <?php _e('The shortcode supports nine attributes:','my-calendar'); ?> 
     57<?php _e('The shortcode supports these attributes:','my-calendar'); ?> 
    2658</p> 
    2759    <ul> 
     
    3668    <li><code>lvalue</code>: <?php _e('The specific location information to filter to.','my-calendar'); ?></li> 
    3769    <li><code>author</code>: <?php _e('Author or comma-separated list of authors (usernames or IDs) to show events from.','my-calendar'); ?></li> 
     70    <li><code>host</code>: <?php _e('Host or comma-separated list of hosts (WordPress usernames or IDs) to show events from.','my-calendar'); ?></li> 
    3871    </ul> 
    3972<p> 
     
    84117        </p> 
    85118        <p> 
    86         <?php _e('The pre-installed category icons may not be especially useful for your needs or design. I\'m assuming that you\'re going to upload your own icons -- all you need to do is upload them to the plugin\'s icons folder, and they\'ll be available for immediate use, or place them in a folder at "my-calendar-custom" to avoid having them overwritten by upgrades.','my-calendar'); ?> <?php _e('Your icons folder is:','my-calendar'); ?> <code><?php echo $wp_plugin_dir; ?>/my-calendar/icons/</code> <?php _e('You can alternately place icons in:','my-calendar'); ?> <code><?php echo $wp_plugin_dir; ?>/my-calendar-custom/</code> 
     119        <?php _e('The pre-installed category icons may not be especially useful for your needs or design. I\'m assuming that you\'re going to upload your own icons -- all you need to do is upload them to the plugin\'s icons folder, and they\'ll be available for immediate use, or place them in a folder at "my-calendar-custom" to avoid having them overwritten by upgrades.','my-calendar'); ?> <?php _e('Your icons folder is:','my-calendar'); ?> <code><?php echo plugin_dir_path( __FILE__ ).'icons/'; ?></code> <?php _e('You can alternately place icons in:','my-calendar'); ?> <code><?php echo str_replace( '/my-calendar','',plugin_dir_path( __FILE__ ) ).'my-calendar-custom/'; ?></code> 
    87120        </p> 
    88121        </div> 
     
    91124 
    92125 
    93 <div class="ui-sortable meta-box-sortables"> 
     126<div class="ui-sortable meta-box-sortables" id="mc-styles"> 
    94127    <div class="postbox"> 
    95128    <h3><?php _e('Custom Styles','my-calendar'); ?></h3> 
     
    99132        </p> 
    100133        <ul> 
    101         <li><?php _e('Your stylesheet directory is','my-calendar'); ?>: <code><?php echo $wp_plugin_dir; ?>/my-calendar/styles/</code></li> 
    102         <li><?php _e('Your custom stylesheets directory is','my-calendar'); ?>: <code><?php echo $wp_plugin_dir; ?>/my-calendar-custom/styles/</code></li> 
     134        <li><?php _e('Your stylesheet directory is','my-calendar'); ?>: <code><?php echo plugin_dir_path( __FILE__ ).'styles/'; ?></code></li> 
     135        <li><?php _e('Your custom stylesheets directory is','my-calendar'); ?>: <code><?php echo str_replace( '/my-calendar','',plugin_dir_path( __FILE__ ) ).'my-calendar-custom/styles/'; ?></code></li> 
    103136        </ul> 
    104137        <p> 
     
    181214        <dd><?php _e('Displays short description without converting paragraphs.','my-calendar'); ?></dd> 
    182215 
     216        <dt><code>{shortdesc_stripped}</code></dt> 
     217        <dd><?php _e('Displays short description with any HTML stripped out.','my-calendar'); ?></dd> 
     218 
    183219        <dt><code>{description}</code></dt> 
    184220        <dd><?php _e('Displays the description of the event.','my-calendar'); ?></dd> 
     
    186222        <dt><code>{description_raw}</code></dt> 
    187223        <dd><?php _e('Displays description without converting paragraphs.','my-calendar'); ?></dd> 
     224 
     225        <dt><code>{description_stripped}</code></dt> 
     226        <dd><?php _e('Displays description with any HTML stripped out.','my-calendar'); ?></dd> 
    188227 
    189228        <dt><code>{image}</code></dt> 
     
    302341    </div> 
    303342</div> 
    304      
     343         
    305344<div class="ui-sortable meta-box-sortables" id="notes"> 
    306345<div class="postbox"> 
  • my-calendar/trunk/my-calendar-install.php

    r610194 r627944  
    11<?php 
    22// define global variables; 
    3 global $initial_listjs, $initial_caljs, $initial_minijs, $initial_ajaxjs, $initial_db, $initial_occur_db, $initial_loc_db, $initial_cat_db, $default_template,$default_user_settings, $mcdb,$grid_template,$list_template,$mini_template,$single_template, $defaults; 
     3global $initial_listjs, $initial_caljs, $initial_minijs, $initial_ajaxjs, $initial_db, $initial_occur_db, $initial_loc_db, $initial_cat_db, $default_template,$default_user_settings, $mcdb,$grid_template,$list_template,$rss_template,$mini_template,$single_template, $defaults; 
    44 
    55$defaults = array( 
     
    5959<div class="shortdesc">{image}{description}</div> 
    6060<p><a href="{link}" class="event-link external">{title}</a></p></div>'); 
     61 
     62$rss_template = addslashes("\n<item> 
     63    <title>{title}</title> 
     64    <link>{link}</link> 
     65    <pubDate>{rssdate}</pubDate> 
     66    <dc:creator>{author}</dc:creator>    
     67    <description><![CDATA[{rss_description}]]></description> 
     68    <content:encoded><![CDATA[<div class='vevent'> 
     69    <h1 class='summary'>{rss_title}</h1> 
     70    <div class='description'>{rss_description}</div> 
     71    <p class='dtstart' title='{ical_start}'>Begins: {time} on {date}</p> 
     72    <p class='dtend' title='{ical_end}'>Ends: {endtime} on {enddate}</p>     
     73    <p>Recurrance: {recurs}</p> 
     74    <p>Repetition: {repeats} times</p> 
     75    <div class='location'>{rss_hcard}</div> 
     76    {link_title} 
     77    </div>]]></content:encoded> 
     78    <dc:format xmlns:dc='http://purl.org/dc/elements/1.1/'>text/html</dc:format> 
     79    <dc:source xmlns:dc='http://purl.org/dc/elements/1.1/'>".home_url()."</dc:source>    
     80    {guid} 
     81  </item>\n"); 
    6182 
    6283$initial_ajaxjs = "jQuery(document).ready(function($){ 
     
    325346 
    326347function mc_default_settings( ) { 
    327 global $default_template, $initial_listjs, $initial_caljs, $initial_minijs, $initial_ajaxjs, $initial_db, $initial_occur_db, $initial_loc_db, $initial_cat_db, $default_user_settings,$grid_template,$list_template,$mini_template,$single_template,$mc_version, $defaults; 
     348global $default_template, $initial_listjs, $initial_caljs, $initial_minijs, $initial_ajaxjs, $initial_db, $initial_occur_db, $initial_loc_db, $initial_cat_db, $default_user_settings,$grid_template,$rss_template, $list_template,$mini_template,$single_template,$mc_version, $defaults; 
    328349// no arguments 
    329350    add_option('mc_display_author','false'); 
     
    375396        'list'=>$list_template, 
    376397        'mini'=>$mini_template, 
     398        'rss'=>$rss_template, 
    377399        'details'=>$single_template, 
    378400        'label'=>'{title}' 
  • my-calendar/trunk/my-calendar-limits.php

    r618836 r627944  
    6060    } 
    6161} 
    62  
    6362 
    6463function mc_select_author( $author, $type='event' ) { 
     
    127126} 
    128127 
     128function mc_select_host( $host, $type='event' ) { 
     129$host = urldecode($host); 
     130$key = ''; 
     131if ( $host == '' || $host == 'all' || $host == 'default' || $host == null ) { return; } 
     132global $wpdb; 
     133    $mcdb = $wpdb; 
     134    if ( get_option( 'mc_remote' ) == 'true' && function_exists('mc_remote_db') ) { $mcdb = mc_remote_db(); } 
     135    $select_author = ''; 
     136    $data = 'event_host'; 
     137    if ( isset( $_GET['mc_auth'] ) ) { $host = $_GET['mc_host']; } 
     138    if ( preg_match( '/^all$|^all,|,all$|,all,/i', $host ) > 0 ) { 
     139        return ''; 
     140    } else { 
     141    if ( strpos( $host, "|" ) || strpos( $host, "," ) ) { 
     142        if ( strpos($host, "|" ) ) { 
     143            $hosts = explode( "|", $host ); 
     144        } else { 
     145            $hosts = explode( ",", $host );      
     146        } 
     147        $numhost = count($hosts); 
     148        $i = 1; 
     149        foreach ($hosts as $key) { 
     150            if ( is_numeric($key) ) { 
     151                $key = (int) $key; 
     152                if ($i == 1) { $select_host .= ($type=='all')?" WHERE (":' ('; }                 
     153                $select_host .= " $data = $key"; 
     154                if ($i < $numhost) { 
     155                    $select_host .= " OR "; 
     156                } else if ($i == $numhost) { 
     157                    $select_host .= ($type=='all')?") ":' ) AND'; 
     158                } 
     159            $i++; 
     160            } else { 
     161                $key = esc_sql(trim($key)); 
     162                $host = get_user_by( 'login', $key ); // get host by username 
     163                $host_id = $host->ID; 
     164                if ($i == 1) {  $select_host .= ($type=='all')?" WHERE (":' ('; } 
     165                $select_host .= " $data = $host_id"; 
     166                if ($i < $numhost) { 
     167                    $select_host .= " OR "; 
     168                } else if ($i == $numhost) { 
     169                    $select_host .= ($type=='all')?") ":' ) AND'; 
     170                } 
     171                $i++;                        
     172            } 
     173        } 
     174    } else { 
     175        if ( is_numeric( $host ) ) { 
     176            $select_host = ($type=='all')?" WHERE $data = $host":" event_host = $host AND"; 
     177        } else { 
     178            $host = esc_sql(trim($host)); 
     179            $host = get_user_by( 'login', $host ); // get author by username 
     180             
     181            if ( is_object($host) ) { 
     182                $host_id = $host->ID; 
     183                $select_host = ($type=='all')?" WHERE $data = $host_id":" $data = $host_id AND"; 
     184            } else { 
     185                $select_host = ''; 
     186            } 
     187        } 
     188    } 
     189    return $select_host; 
     190    } 
     191} 
     192 
    129193function mc_limit_string($type='',$ltype='',$lvalue='') { 
    130194global $user_ID; 
  • my-calendar/trunk/my-calendar-output.php

    r624321 r627944  
    5555        $output_array[] = my_calendar_draw_event($event, $type, $process_date,$time,$template); 
    5656    } 
    57     //} else { 
    58         /* foreach(array_keys($events) as $key ) { 
    59             $event =& $events[$key]; 
    60             $output_array[] = my_calendar_draw_event($event, $type, $process_date,$time,$template); 
    61         }        
    62         /*foreach(array_keys($temp_array) as $key) { 
    63             $event =& $temp_array[$key]; 
    64             // if any event this date is in the holiday category, we are skipping 
    65             if ( $event->event_category == get_option('mc_skip_holidays_category') ) { 
    66                 $skipping = true; 
    67                 break; 
    68             } 
    69         } 
    70         // check each event, if we're skipping, only include the holiday events. 
    71         $sum = 0; 
    72         foreach(array_keys($temp_array) as $key) { 
    73             $event =& $temp_array[$key];     
    74             if ($skipping == true) { 
    75                 if ($event->event_category == get_option('mc_skip_holidays_category') ) { 
    76                     $output_array[] = my_calendar_draw_event($event, $type, $process_date,$time,$template); 
    77                 } else { 
    78                     if ( $event->event_holiday == '0' ) { // '1' means "is canceled" 
    79                         $output_array[] = my_calendar_draw_event($event, $type, $process_date,$time,$template); 
    80                     } 
    81                 } 
    82             } else { 
    83                 $output_array[] = my_calendar_draw_event($event, $type, $process_date,$time,$template); 
    84             } 
    85         }*/ 
    86     //} 
    8757    if ( is_array($output_array) ) { 
    8858        foreach (array_keys($output_array) as $key) { 
     
    201171    $event_date = ($type == 'single')?$current_date.', ':''; 
    202172    if ( $event->event_span == 1 ) { $group_class = ' multidate group'.$event->event_group_id; } else { $group_class = ''; } 
    203     $header_details .= ($type != 'list' && $type != 'single')?"<h3 class='event-title summary$group_class'>$wrap$image".$mytitle."$balance</h3>\n":''; 
     173    $header_details .= ( $type != 'single' && $type != 'list' )?"<h3 class='event-title summary$group_class'>$wrap$image".$mytitle."$balance</h3>\n":''; 
    204174    $title = apply_filters( 'mc_before_event_title','',$event ); 
    205175    $title .= ($type == 'single' )?"<h2 class='event-title summary'>$image $mytitle</h2>\n":''; 
     
    325295        if ( $type == 'calendar' && get_option('mc_open_uri') == 'true' && $time != 'day' ) $body_details = $description = $short = $status = ''; 
    326296 
    327         $subdetails = ( get_option('mc_open_uri') =='true')?"":"<div class='sub-details'>$subdetails</div>"; 
     297        $subdetails = ( get_option('mc_open_uri') == 'true' && $type == 'grid' || $type == 'mini' )?"":"<div class='sub-details'>$subdetails</div>"; 
    328298        $body_details .= $subdetails; 
    329299        if ( $event_link != '' && get_option( 'mc_event_link' ) != 'false' ) { 
     
    11861156        } else if ( is_home() ) { 
    11871157            $page = get_option('page_for_posts'); 
    1188             $home = get_permalink($page);    
     1158            $home = get_permalink( $page );      
    11891159        } else if ( is_archive() ) { 
    11901160            $home = ''; // an empty string seems to work best; leaving it open. 
    11911161        } else { 
    1192             $home = get_permalink();    // so, if the calendar is in a custom post type which is inserted in a page, this gets the post type's link.  
    1193                                         // I think that's actually what it should do, and am not inclined to fix it...have to think. 
     1162            wp_reset_query(); // break out of any alternate loop that's been set up. 
     1163            $home = get_permalink(); 
    11941164        } 
    11951165    } 
  • my-calendar/trunk/my-calendar-rss.php

    r598242 r627944  
    2424    {guid} 
    2525  </item>\n"; 
     26  if ( get_option( 'mc_use_rss_template' ) == 1 ) { $templates = get_option('mc_templates'); $template = $templates['rss']; } 
    2627// add RSS headers 
    2728$charset = get_bloginfo('charset'); 
  • my-calendar/trunk/my-calendar-settings.php

    r624321 r627944  
    144144    // output 
    145145    if (isset($_POST['mc_show_months']) ) { 
    146         $mc_title_template = $_POST['mc_title_template']; 
    147         $mc_details_label = $_POST['mc_details_label']; 
    148         $mc_link_label = $_POST['mc_link_label']; 
     146 
    149147        $mc_open_day_uri = ( !empty($_POST['mc_open_day_uri']) )?$_POST['mc_open_day_uri']:''; 
    150         $templates = get_option('mc_templates'); 
    151         $templates['title'] = $mc_title_template; 
    152         $templates['label'] = $mc_details_label; 
    153         $templates['link'] = $mc_link_label; 
    154148        update_option('mc_uri',$_POST['mc_uri'] ); 
    155149        update_option('mc_open_uri',( !empty($_POST['mc_open_uri']) && $_POST['mc_open_uri']=='on' && get_option('mc_uri') != '')?'true':'false'); 
     
    159153        update_option('mc_skip_holidays_category',(int) $_POST['mc_skip_holidays_category']); 
    160154        update_option('mc_skip_holidays',( !empty($_POST['mc_skip_holidays']) && $_POST['mc_skip_holidays']=='on')?'true':'false'); 
    161         update_option('mc_templates',$templates); 
    162155        update_option('mc_display_author',( !empty($_POST['mc_display_author']) && $_POST['mc_display_author']=='on')?'true':'false'); 
    163156        update_option('mc_show_event_vcal',( !empty($_POST['mc_show_event_vcal']) && $_POST['mc_show_event_vcal']=='on')?'true':'false');        
     
    165158        update_option('mc_show_list_info',( !empty($_POST['mc_show_list_info']) && $_POST['mc_show_list_info']=='on')?'true':'false');       
    166159        update_option('mc_show_months',(int) $_POST['mc_show_months']); 
    167         update_option('mc_date_format',stripslashes($_POST['mc_date_format'])); 
    168         update_option('mc_week_format',stripslashes($_POST['my_calendar_week_format'])); 
    169         update_option('mc_time_format',stripslashes($_POST['mc_time_format'])); 
    170         update_option('mc_month_format',stripslashes($_POST['mc_month_format'])); 
    171160        update_option('mc_show_map',( !empty($_POST['mc_show_map']) && $_POST['mc_show_map']=='on')?'true':'false'); 
    172161        update_option('mc_show_address',( !empty($_POST['mc_show_address']) && $_POST['mc_show_address']=='on')?'true':'false');  
     
    198187    } 
    199188    // input 
     189    if ( isset($_POST['mc_dates']) ) { 
     190        update_option('mc_date_format',stripslashes($_POST['mc_date_format'])); 
     191        update_option('mc_week_format',stripslashes($_POST['my_calendar_week_format'])); 
     192        update_option('mc_time_format',stripslashes($_POST['mc_time_format'])); 
     193        update_option('mc_month_format',stripslashes($_POST['mc_month_format'])); 
     194        echo "<div class=\"updated\"><p><strong>".__('Date/Time Format Settings saved','my-calendar')."</strong></p></div>";         
     195    } 
    200196    if (isset($_POST['mc_input'])) { 
    201197        $mc_input_options_administrators = ( !empty($_POST['mc_input_options_administrators']) && $_POST['mc_input_options_administrators']=='on')?'true':'false';  
     
    227223    // custom text 
    228224    if (isset( $_POST['mc_previous_events'] ) ) { 
     225        $mc_title_template = $_POST['mc_title_template']; 
     226        $mc_details_label = $_POST['mc_details_label']; 
     227        $mc_link_label = $_POST['mc_link_label']; 
    229228        $mc_notime_text = $_POST['mc_notime_text']; 
    230229        $mc_previous_events = $_POST['mc_previous_events']; 
     
    234233        $mc_week_caption = $_POST['mc_week_caption']; 
    235234        $my_calendar_caption = $_POST['my_calendar_caption']; 
     235        $templates = get_option('mc_templates'); 
     236        $templates['title'] = $mc_title_template; 
     237        $templates['label'] = $mc_details_label; 
     238        $templates['link'] = $mc_link_label;     
     239        update_option('mc_templates',$templates); 
     240 
    236241        update_option('mc_notime_text',$mc_notime_text); 
    237242        update_option('mc_week_caption',$mc_week_caption); 
     
    338343        <li><a href="#my-calendar-text"><?php _e('Customizable Text','my-calendar'); ?></a></li> 
    339344        <li><a href="#my-calendar-output"><?php _e('Output','my-calendar'); ?></a></li> 
     345        <li><a href="#my-calendar-time"><?php _e('Date/Time','my-calendar'); ?></a></li> 
    340346        <li><a href="#my-calendar-input"><?php _e('Input','my-calendar'); ?></a></li> 
    341347        <?php if ( current_user_can('manage_network') ) { ?> 
     
    448454    <label for="my_calendar_caption"><?php _e('Extended caption:','my-calendar'); ?></label> <input type="text" id="my_calendar_caption" name="my_calendar_caption" value="<?php echo esc_attr( stripslashes( get_option('mc_caption') ) ); ?>" /><br /><small><?php _e('The calendar caption shows month and year in list and grid formats. This text is displayed after the month/year.','my-calendar'); ?></small> 
    449455    </li> 
    450     </ul> 
     456    <li> 
     457    <label for="mc_title_template"><?php _e('Event title template','my-calendar'); ?></label>  
     458    <input type="text" name="mc_title_template" id="mc_title_template" size="30" value="<?php echo stripslashes(esc_attr($mc_title_template)); ?>" /> <small><a href="<?php echo admin_url("admin.php?page=my-calendar-help#templates"); ?>"><?php _e("Templating Help",'my-calendar'); ?></a> <?php _e('All template tags are available.','my-calendar'); ?></small> 
     459    </li> 
     460    <li> 
     461    <label for="mc_details_label"><?php _e('Event details link text','my-calendar'); ?></label> 
     462    <input type="text" name="mc_details_label" id="mc_details_label" size="30" value="<?php echo stripslashes(esc_attr($mc_details_label)); ?>" /> 
     463    <br /><small><?php _e('Available tags: <code>{title}</code>, <code>{location}</code>, <code>{color}</code>, <code>{icon}</code>, <code>{date}</code>, <code>{time}</code>.','my-calendar'); ?></small> 
     464    </li> 
     465    <li> 
     466    <label for="mc_link_label"><?php _e('Event URL link text','my-calendar'); ?></label> 
     467    <input type="text" name="mc_link_label" id="mc_link_label" size="30" value="<?php echo stripslashes(esc_attr($mc_link_label)); ?>" /> 
     468    <small><a href="<?php echo admin_url("admin.php?page=my-calendar-help#templates"); ?>"><?php _e("Templating Help",'my-calendar'); ?></a> <?php _e('All template tags are available.','my-calendar'); ?></small> 
     469    </li>   </ul> 
    451470    </fieldset>  
    452471        <p> 
     
    468487    <legend><?php _e('Calendar Options: Customize the Output of your Calendar','my-calendar'); ?></legend> 
    469488    <fieldset> 
    470     <legend><?php _e('General Calendar Options','my-calendar'); ?></legend> 
     489    <legend><?php _e('Calendar Link Targets','my-calendar'); ?></legend> 
    471490    <ul> 
    472491    <li> 
     
    482501    <input type="text" name="mc_mini_uri" id="mc_mini_uri" size="60" value="<?php echo esc_url($mc_mini_uri); ?>" /><br /><small><?php _e('Can be any Page or Post with the <code>[my_calendar]</code> shortcode using format selected below','my-calendar'); ?></small> 
    483502    </li> 
    484     <li><strong><?php _e('With above settings:','my-calendar'); ?></strong></li> 
     503    <li><strong><?php _e('Modify date and event link behaviors:','my-calendar'); ?></strong></li> 
    485504    <li> 
    486505    <input type="checkbox" id="mc_open_uri" name="mc_open_uri"<?php if ( $mc_uri == '' ) { echo ' disabled="disabled"'; } ?> <?php mc_is_checked('mc_open_uri','true'); ?> /> <label for="mc_open_uri"><?php _e('Open calendar links to event details URL','my-calendar'); ?></label> <small><?php _e('Replaces pop-up in grid view.','my-calendar'); ?></small> 
     
    495514    <small><?php _e('Replaces pop-up in mini calendar','my-calendar'); ?></small> 
    496515    </li> 
    497     <li class='mc-month-format'> 
    498     <label for='mc_month_format'><?php _e('Month format (calendar headings)','my-calendar'); ?></label><br /><input type="text" id="mc_month_format" name="mc_month_format" value="<?php if ( get_option('mc_month_format')  == "") { echo ''; } else { echo esc_attr( get_option( 'mc_month_format') ); } ?>" /> <code><?php _e('Current:','my-calendar'); ?> <?php if ( get_option('mc_month_format') == '') { echo date_i18n( 'F Y' ); } else { echo date_i18n( get_option('mc_month_format') ); } ?></code> 
    499     <li class='mc-time-format'> 
    500     <label for="mc_time_format"><?php _e('Time format','my-calendar'); ?></label><br /><input type="text" id="mc_time_format" name="mc_time_format" value="<?php if ( get_option('mc_time_format')  == "") { echo ''; } else { echo esc_attr( get_option( 'mc_time_format') ); } ?>" /> <code><?php _e('Current:','my-calendar'); ?> <?php if ( get_option('mc_time_format') == '') { echo date_i18n( get_option('time_format') ); } else { echo date_i18n( get_option('mc_time_format') ); } ?></code> 
    501     </li>    
    502     <li class='mc-week-format'> 
    503     <label for="mc_week_format"><?php _e('Date in grid mode, week view','my-calendar'); ?></label><br /><input type="text" id="mc_week_format" name="my_calendar_week_format" value="<?php if ( get_option('mc_week_format')  == "") { echo ''; } else { echo esc_attr( get_option( 'mc_week_format') ); } ?>" /> <code><?php _e('Current:','my-calendar'); ?> <?php if ( get_option('mc_week_format') == '') { echo date_i18n('M j, \'y'); } else { echo date_i18n( get_option('mc_week_format') ); } ?></code> 
    504     </li>    
    505     <li class='mc-date-format'> 
    506     <label for="mc_date_format"><?php _e('Date Format in other views','my-calendar'); ?></label><br /><input type="text" id="mc_date_format" name="mc_date_format" value="<?php if ( get_option('mc_date_format')  == "") { echo esc_attr( get_option('date_format') ); } else { echo esc_attr(  get_option( 'mc_date_format') ); } ?>" /> <code><?php _e('Current:','my-calendar'); ?> <?php if ( get_option('mc_date_format') == '') { echo date_i18n(get_option('date_format')); } else { echo date_i18n( get_option('mc_date_format') ); } ?></code> 
    507     </li> 
    508     <li> 
    509     <small><?php _e('Date formats use the same syntax as the <a href="http://php.net/date">PHP <code>date()</code> function</a>. Save options to update sample output.','my-calendar'); ?></small> 
    510     </li> 
     516    <li><strong><?php _e('Show links to alternate formats:','my-calendar'); ?></strong></li> 
    511517    <li> 
    512518    <input type="checkbox" id="mc_show_rss" name="mc_show_rss" <?php mc_is_checked('mc_show_rss','true'); ?> /> <label for="mc_show_rss"><?php _e('Show link to My Calendar RSS feed.','my-calendar'); ?></label> <small><?php _e('RSS feed shows recently added events.','my-calendar'); ?></small> 
     
    518524    <li> 
    519525    <input type="checkbox" id="mc_show_print" name="mc_show_print" <?php mc_is_checked('mc_show_print','true'); ?> /> <label for="mc_show_print"><?php _e('Show link to print-formatted view of calendar','my-calendar'); ?></label> 
    520     </li>    
    521     <li> 
    522     <input type="checkbox" id="mc_display_jump" name="mc_display_jump" <?php mc_is_checked('mc_display_jump','true'); ?> /> <label for="mc_display_jump"><?php _e('Display a jumpbox for changing month and year quickly?','my-calendar'); ?></label> 
    523     </li>        
    524     </ul>    
     526    </li> 
     527    </ul> 
    525528    <?php // End General Options // ?> 
    526529    </fieldset> 
     
    554557    <fieldset> 
    555558    <legend><?php _e('Event Details Options','my-calendar'); ?></legend> 
    556     <ul> 
    557     <li> 
    558     <label for="mc_title_template"><?php _e('Event title template','my-calendar'); ?></label>  
    559     <input type="text" name="mc_title_template" id="mc_title_template" size="30" value="<?php echo stripslashes(esc_attr($mc_title_template)); ?>" /> <small><a href="<?php echo admin_url("admin.php?page=my-calendar-help#templates"); ?>"><?php _e("Templating Help",'my-calendar'); ?></a> <?php _e('All template tags are available.','my-calendar'); ?></small> 
    560     </li> 
    561     <li> 
    562     <label for="mc_details_label"><?php _e('Event details link text','my-calendar'); ?></label> 
    563     <input type="text" name="mc_details_label" id="mc_details_label" size="30" value="<?php echo stripslashes(esc_attr($mc_details_label)); ?>" /> 
    564     <br /><small><?php _e('Available tags: <code>{title}</code>, <code>{location}</code>, <code>{color}</code>, <code>{icon}</code>, <code>{date}</code>, <code>{time}</code>.','my-calendar'); ?></small> 
    565     </li> 
    566     <li> 
    567     <label for="mc_link_label"><?php _e('Event URL link text','my-calendar'); ?></label> 
    568     <input type="text" name="mc_link_label" id="mc_link_label" size="30" value="<?php echo stripslashes(esc_attr($mc_link_label)); ?>" /> 
    569     <small><a href="<?php echo admin_url("admin.php?page=my-calendar-help#templates"); ?>"><?php _e("Templating Help",'my-calendar'); ?></a> <?php _e('All template tags are available.','my-calendar'); ?></small> 
    570     </li> 
    571     </ul> 
    572559    <ul class="columns"> 
    573560    <li> 
     
    614601    </ul>    
    615602    <?php // End Event Options // ?> 
    616     </fieldset>  
    617     <fieldset> 
    618     <legend><?php _e('Event Scheduling Options','my-calendar'); ?></legend> 
     603    </fieldset> 
     604    <fieldset> 
     605    <legend><?php _e('Event Scheduling Defaults','my-calendar'); ?></legend> 
    619606    <ul> 
    620607    <li> 
     
    653640</div> 
    654641</div> 
     642 
     643<div class="ui-sortable meta-box-sortables"> 
     644<div class="postbox" id="my-calendar-time"> 
     645    <h3><?php _e('Calendar Time Formats','my-calendar'); ?></h3> 
     646    <div class="inside"> 
     647    <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-config"); ?>"> 
     648    <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div> 
     649    <fieldset> 
     650    <legend><?php _e('Set default date/time formats','my-calendar'); ?></legend> 
     651    <div><input type='hidden' name='mc_dates' value='true' /></div> 
     652    <ul class="two-columns">     
     653    <li class='mc-month-format'> 
     654    <label for='mc_month_format'><?php _e('Month format (calendar headings)','my-calendar'); ?></label><br /><input type="text" id="mc_month_format" name="mc_month_format" value="<?php if ( get_option('mc_month_format')  == "") { echo ''; } else { echo esc_attr( get_option( 'mc_month_format') ); } ?>" /> <code><?php _e('Now:','my-calendar'); ?> <?php if ( get_option('mc_month_format') == '') { echo date_i18n( 'F Y' ); } else { echo date_i18n( get_option('mc_month_format') ); } ?></code> 
     655    <li class='mc-time-format'> 
     656    <label for="mc_time_format"><?php _e('Time format','my-calendar'); ?></label><br /><input type="text" id="mc_time_format" name="mc_time_format" value="<?php if ( get_option('mc_time_format')  == "") { echo ''; } else { echo esc_attr( get_option( 'mc_time_format') ); } ?>" /> <code><?php _e('Now:','my-calendar'); ?> <?php if ( get_option('mc_time_format') == '') { echo date_i18n( get_option('time_format') ); } else { echo date_i18n( get_option('mc_time_format') ); } ?></code> 
     657    </li>    
     658    <li class='mc-week-format'> 
     659    <label for="mc_week_format"><?php _e('Date in grid mode, week view','my-calendar'); ?></label><br /><input type="text" id="mc_week_format" name="my_calendar_week_format" value="<?php if ( get_option('mc_week_format')  == "") { echo ''; } else { echo esc_attr( get_option( 'mc_week_format') ); } ?>" /> <code><?php _e('Now:','my-calendar'); ?> <?php if ( get_option('mc_week_format') == '') { echo date_i18n('M j, \'y'); } else { echo date_i18n( get_option('mc_week_format') ); } ?></code> 
     660    </li>    
     661    <li class='mc-date-format'> 
     662    <label for="mc_date_format"><?php _e('Date Format in other views','my-calendar'); ?></label><br /><input type="text" id="mc_date_format" name="mc_date_format" value="<?php if ( get_option('mc_date_format')  == "") { echo esc_attr( get_option('date_format') ); } else { echo esc_attr(  get_option( 'mc_date_format') ); } ?>" /> <code><?php _e('Now:','my-calendar'); ?> <?php if ( get_option('mc_date_format') == '') { echo date_i18n(get_option('date_format')); } else { echo date_i18n( get_option('mc_date_format') ); } ?></code> 
     663    </li> 
     664    <li> 
     665    <?php _e('Date formats use the same syntax as the <a href="http://php.net/date">PHP <code>date()</code> function</a>. Save options to update sample output.','my-calendar'); ?> 
     666    </li>    
     667    </ul> 
     668    </fieldset> 
     669        <p> 
     670        <input type="submit" name="save" class="button-primary" value="<?php _e('Save Date/Time Settings','my-calendar'); ?>" /> 
     671    </p> 
     672    </form>  
     673    </div> 
     674</div> 
     675</div> 
     676 
    655677 
    656678<div class="ui-sortable meta-box-sortables">    
  • my-calendar/trunk/my-calendar-shortcodes.php

    r599338 r627944  
    11<?php 
    2  
    3  
    42function my_calendar_insert($atts,$content=null) { 
    53    extract(shortcode_atts(array( 
     
    1513                'lvalue' => '', 
    1614                'author' => 'all', 
     15                'host' => 'all', 
    1716                'id' => 'jd-calendar', 
    1817                'template' => '' 
     
    2423    } 
    2524    //apply_filters( 'mc_filter_calendar_name',$all_styles,$styles ); 
    26     return my_calendar($name,$format,$category,$showkey,$shownav,$showjump,$toggle,$time, $ltype, $lvalue, $id, $template,$content,$author ); 
     25    return my_calendar($name,$format,$category,$showkey,$shownav,$showjump,$toggle,$time, $ltype, $lvalue, $id, $template,$content,$author,$host ); 
    2726} 
    2827 
     
    3837                'skip' => '0', 
    3938                'show_today' => 'yes', 
    40                 'author' => 'default'            
     39                'author' => 'default', 
     40                'host' => 'default' 
    4141            ), $atts)); 
    4242    return my_calendar_upcoming_events($before, $after, $type, $category, $template, $fallback, $order, $skip, $show_today, $author ); 
     
    4747                'category' => 'default', 
    4848                'author' => 'default', 
     49                'host' => 'default', 
    4950                'template' => 'default', 
    5051                'fallback' => '' 
  • my-calendar/trunk/my-calendar-styles.php

    r624321 r627944  
    6565    $wp_plugin_dir = plugin_dir_path( __FILE__ ); 
    6666    $mcdb = $wpdb; 
     67    $wrote_styles = ''; 
    6768    // We can't use this page unless My Calendar is installed/upgraded 
    6869    check_my_calendar(); 
     
    8081            delete_option('mc_style'); 
    8182        } 
    82         if ( $wrote_styles == 'disabled' ) { 
    83             $message .= "<p>".__('Styles are disabled, and were not edited.','my-calendar')."</p>"; 
    84         } else { 
    85             $message .= ( $wrote_styles == true)?'<p>'. __('The stylesheet has been updated.', 'my-calendar') .'</p>':'<p><strong>'. __('Write Error! Please verify write permissions on the style file.', 'my-calendar') .'</strong></p>'; 
     83        if ( $wrote_styles === 'disabled' ) { 
     84            $message = "<p>".__( "Styles are disabled, and were not edited.",'my-calendar')."</p>"; 
     85        } else { 
     86            $message = ( $wrote_styles == true)?'<p>'. __('The stylesheet has been updated.', 'my-calendar') .'</p>':'<p><strong>'. __('Write Error! Please verify write permissions on the style file.', 'my-calendar') .'</strong></p>'; 
    8687        } 
    8788     
  • my-calendar/trunk/my-calendar-templates.php

    r618836 r627944  
    188188        $ical_link = mc_build_url( array('vcal'=>$dateid), array('month','dy','yr','ltype','loc','mcat','format'), get_option( 'mc_uri' ) ); 
    189189    $details['ical'] = $ical_link; 
    190     $dates = mc_event_date_span( $event->event_group_id, $event->event_span, $date ); 
     190        $date_arr = array('occur_begin'=>$event->occur_begin,'occur_end'=>$event->occur_end ); 
     191        $date_obj = (object) $date_arr; 
     192    $dates = mc_event_date_span( $event->event_group_id, $event->event_span, array( 0=>$date_obj ) ); 
    191193    $details['ical_html'] = "<a class='ical' rel='nofollow' href='$ical_link'>".__('iCal','my-calendar')."</a>"; 
    192194    $details['dtstart'] = date( 'Y-m-d\TH:i:s', strtotime( $event->occur_begin ) );// hcal formatted 
     
    221223    $details['description'] = ( get_option('mc_process_shortcodes') == 'true' )?apply_filters('the_content',$event->event_desc):wpautop(stripslashes($event->event_desc)); 
    222224    $details['description_raw'] = stripslashes($event->event_desc); 
     225    $details['description_stripped'] = strip_tags(stripslashes($event->event_desc)); 
    223226    $details['link_title'] = ($details['link'] != '')?"<a href='".$event->event_link."'>".stripslashes($event->event_title)."</a>":stripslashes($event->event_title); 
    224227    $details['location'] = stripslashes($event->event_label); 
     
    234237    $details['shortdesc'] = ( get_option('mc_process_shortcodes') == 'true' )?apply_filters('the_content',$event->event_short):wpautop(stripslashes($event->event_short)); 
    235238    $details['shortdesc_raw'] = stripslashes($event->event_short); 
     239    $details['shortdesc_stripped'] = strip_tags(stripslashes($event->event_short)); 
    236240    $details['event_open'] = $event_open; 
    237241    $details['icon'] = $category_icon; 
     
    255259    $details['group'] = $event->event_group_id; 
    256260    $details['event_span'] = $event->event_span; 
    257     $details['datespan'] = ($event->event_span != 1)?$date:mc_format_date_span( $dates ); 
     261    $details['datespan'] = ($event->event_span == 1 || ($details['date'] != $details['enddate']) )?mc_format_date_span( $dates ):$date; 
    258262    $details['multidate'] = mc_format_date_span( $dates, 'complex', "<span class='fallback-date'>$date</span><span class='separator'>,</span> <span class='fallback-time'>$details[time]</span>&ndash;<span class='fallback-endtime'>$details[endtime]</span>" ); 
    259263    // RSS guid 
     
    269273} 
    270274 
    271 function mc_event_date_span( $group_id, $event_span ) { 
     275function mc_event_date_span( $group_id, $event_span, $dates=array() ) { 
    272276global $wpdb; 
    273277    $mcdb = $wpdb; 
    274278  if ( get_option( 'mc_remote' ) == 'true' && function_exists('mc_remote_db') ) { $mcdb = mc_remote_db(); } 
    275 $group_id = (int) $group_id; 
    276 if ( $group_id == 0 || $event_span != 1 ) return false; 
    277     $sql = "SELECT occur_begin, occur_end FROM ".my_calendar_event_table()." WHERE occur_group_id = $group_id ORDER BY occur_begin ASC"; 
    278     $dates = $mcdb->get_results( $sql ); 
    279     return $dates;  
     279    $group_id = (int) $group_id; 
     280    if ( $group_id == 0 && $event_span != 1 ) { 
     281        return $dates; 
     282    } else { 
     283        $sql = "SELECT occur_begin, occur_end FROM ".my_calendar_event_table()." WHERE occur_group_id = $group_id ORDER BY occur_begin ASC"; 
     284        $dates = $mcdb->get_results( $sql ); 
     285        return $dates;  
     286    } 
    280287} 
    281288function mc_format_date_span( $dates, $display='simple',$default='' ) { 
  • my-calendar/trunk/my-calendar-templating.php

    r598242 r627944  
    1919        echo "<div class=\"updated\"><p><strong>".__('Grid Output Template saved','my-calendar').".</strong></p></div>"; 
    2020    } 
     21     
     22    if ( isset($_POST['mc_rss_template'] ) ) { 
     23        $nonce=$_REQUEST['_wpnonce']; 
     24        if ( !wp_verify_nonce($nonce,'my-calendar-nonce') ) die("Security check failed"); 
     25 
     26        $mc_rss_template = $_POST['mc_rss_template']; 
     27        $templates['rss'] = $mc_rss_template; 
     28        update_option( 'mc_templates', $templates ); 
     29        update_option( 'mc_use_rss_template',( empty($_POST['mc_use_rss_template'])?0:1 ) ); 
     30 
     31        echo "<div class=\"updated\"><p><strong>".__('RSS Feed Output Template saved','my-calendar').".</strong></p></div>"; 
     32    }    
    2133     
    2234    if ( isset($_POST['mc_list_template'] ) ) { 
     
    5365        echo "<div class=\"updated\"><p><strong>".__('Event Details Template saved','my-calendar').".</strong></p></div>"; 
    5466    }    
    55     global $grid_template, $list_template, $mini_template, $single_template; 
     67    global $grid_template, $list_template, $mini_template, $single_template, $rss_template; 
    5668    $mc_grid_template = stripslashes( ($templates['grid']!='')?$templates['grid']:$grid_template ); 
    5769    $mc_use_grid_template = get_option('mc_use_grid_template'); 
     70    $mc_rss_template = stripslashes( ($templates['rss']!='')?$templates['rss']:$rss_template ); 
     71    $mc_use_rss_template = get_option('mc_use_rss_template');    
    5872    $mc_list_template = stripslashes( ($templates['list']!='')?$templates['list']:$list_template ); 
    5973    $mc_use_list_template = get_option('mc_use_list_template'); 
     
    154168    </div> 
    155169    </div> 
     170     
     171    <div class="ui-sortable meta-box-sortables">    
     172    <div class="postbox"> 
     173        <h3><?php _e('My Calendar: RSS Event Template','my-calendar'); ?></h3> 
     174        <div class="inside"> 
     175        <p><?php _e('Notice: HTML templates are very forgiving of errors. RSS templates are not. Be sure to test your changes.','my-calendar'); ?></p> 
     176        <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-templates"); ?>"> 
     177        <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div> 
     178        <p> 
     179        <input type="checkbox" id="mc_use_rss_template" name="mc_use_rss_template" value="1"  <?php mc_is_checked('mc_use_rss_template',1); ?>/> <label for="mc_use_grid_template"><?php _e('Use this custom RSS event template','my-calendar'); ?></label> 
     180        </p> 
     181        <p> 
     182        <label for="mc_rss_template"><?php _e('Your custom template for events in the RSS feed.','my-calendar'); ?></label><br /><textarea id="mc_rss_template" name="mc_rss_template" class="template-editor" rows="12" cols="76"><?php echo $mc_rss_template; ?></textarea> 
     183        </p> 
     184        <p> 
     185            <input type="submit" name="save" class="button-primary" value="<?php _e('Save RSS Template','my-calendar'); ?>" /> 
     186        </p> 
     187        </form> 
     188        </div> 
     189    </div> 
     190    </div>   
     191     
    156192</div> 
    157193</div> 
  • my-calendar/trunk/my-calendar-widgets.php

    r625713 r627944  
    1313    $the_category = ($instance['my_calendar_today_category']=='')?'default':esc_attr($instance['my_calendar_today_category']); 
    1414    $author = ( !isset($instance['my_calendar_today_author']) || $instance['my_calendar_today_author']=='')?'all':esc_attr($instance['my_calendar_today_author']); 
     15    $host = ( !isset($instance['mc_host']) || $instance['mc_host']=='')?'all':esc_attr($instance['mc_host']); 
    1516    $widget_link = (!empty($instance['my_calendar_today_linked']) && $instance['my_calendar_today_linked']=='yes')?get_option('mc_uri'):''; 
    1617    $widget_link = ( !empty($instance['mc_link']) )?esc_url($instance['mc_link']):$widget_link; 
     
    2021    $widget_title = ($widget_link=='') ? $widget_title : "<a href='$widget_link'>$widget_title</a>";     
    2122    $widget_title = ($widget_title!='') ? $before_title . $widget_title . $after_title : ''; 
    22     $the_events = my_calendar_todays_events($the_category,$the_template,$the_substitute,$author); 
     23    $the_events = my_calendar_todays_events($the_category,$the_template,$the_substitute,$author, $host); 
    2324        if ($the_events != '') { 
    2425          echo $before_widget; 
     
    4041    $widget_link = (!empty($instance['mc_link']))?esc_url($instance['mc_link']):$default_link; 
    4142    $widget_author = (isset($instance['my_calendar_today_author']))?esc_attr($instance['my_calendar_today_author']):''; 
     43    $widget_host = (isset($instance['mc_host']))?esc_attr($instance['mc_host']):''; 
    4244     
    4345?> 
     
    7274    <label for="<?php echo $this->get_field_id('my_calendar_today_author'); ?>"><?php _e('Author or authors to show:','my-calendar'); ?></label><br /> 
    7375    <input class="widefat" type="text" id="<?php echo $this->get_field_id('my_calendar_today_author'); ?>" name="<?php echo $this->get_field_name('my_calendar_today_author'); ?>" value="<?php echo $widget_author; ?>" /></textarea> 
     76    </p> 
     77    <p> 
     78    <label for="<?php echo $this->get_field_id('mc_host'); ?>"><?php _e('Host or hosts to show:','my-calendar'); ?></label><br /> 
     79    <input class="widefat" type="text" id="<?php echo $this->get_field_id('mc_host'); ?>" name="<?php echo $this->get_field_name('mc_host'); ?>" value="<?php echo $widget_host; ?>" /></textarea> 
    7480    </p>     
    7581    <?php 
     
    8591        $instance['mc_link'] = esc_url($new_instance['mc_link']); 
    8692        $instance['my_calendar_today_author'] = strip_tags($new_instance['my_calendar_today_author']); 
     93        $instance['mc_host'] = strip_tags($new_instance['mc_host']); 
    8794        return $instance; 
    8895    } 
     
    109116    $the_category = ($instance['my_calendar_upcoming_category']=='')?'default':esc_attr($instance['my_calendar_upcoming_category']); 
    110117    $author = ( !isset($instance['my_calendar_upcoming_author']) || $instance['my_calendar_upcoming_author']=='')?'default':esc_attr($instance['my_calendar_upcoming_author']); 
     118    $host = ( !isset($instance['mc_host']) || $instance['mc_host']=='')?'default':esc_attr($instance['mc_host']); 
    111119    $widget_link = ($instance['my_calendar_upcoming_linked']=='yes')?get_option('mc_uri'):''; 
    112120    $widget_link = ( !empty($instance['mc_link']) )?esc_url($instance['mc_link']):$widget_link; 
     
    114122    $widget_title = ($widget_link=='') ? $widget_title : "<a href='$widget_link'>$widget_title</a>"; 
    115123    $widget_title = ($widget_title!='') ? $before_title . $widget_title . $after_title : ''; 
    116     $the_events = my_calendar_upcoming_events($before,$after,$type,$the_category,$the_template,$the_substitute, $order,$skip, $show_today,$author); 
     124    $the_events = my_calendar_upcoming_events($before,$after,$type,$the_category,$the_template,$the_substitute, $order,$skip, $show_today,$author, $host); 
    117125        if ($the_events != '') { 
    118126            echo $before_widget; 
     
    133141    $widget_category = (isset($instance['my_calendar_upcoming_category']) )?esc_attr($instance['my_calendar_upcoming_category']):''; 
    134142    $widget_author = (isset($instance['my_calendar_upcoming_author']) )?esc_attr($instance['my_calendar_upcoming_author']):''; 
     143    $widget_host = (isset($instance['mc_host']) )?esc_attr($instance['mc_host']):''; 
    135144    $widget_before = (isset($instance['my_calendar_upcoming_before']) )?esc_attr($instance['my_calendar_upcoming_before']):''; 
    136145    $widget_after = (isset($instance['my_calendar_upcoming_after']) )?esc_attr($instance['my_calendar_upcoming_after']):''; 
     
    200209    <input class="widefat" type="text" id="<?php echo $this->get_field_id('my_calendar_upcoming_author'); ?>" name="<?php echo $this->get_field_name('my_calendar_upcoming_author'); ?>" value="<?php echo $widget_author; ?>" /></textarea> 
    201210    </p> 
     211    <p> 
     212    <label for="<?php echo $this->get_field_id('mc_host'); ?>"><?php _e('Host or hosts to show:','my-calendar'); ?></label><br /> 
     213    <input class="widefat" type="text" id="<?php echo $this->get_field_id('mc_host'); ?>" name="<?php echo $this->get_field_name('mc_host'); ?>" value="<?php echo $widget_host; ?>" /></textarea> 
     214    </p>     
    202215    <?php 
    203216 
     
    210223        $instance['my_calendar_upcoming_category'] = strip_tags($new_instance['my_calendar_upcoming_category']);         
    211224        $instance['my_calendar_upcoming_author'] = strip_tags($new_instance['my_calendar_upcoming_author']);         
     225        $instance['mc_host'] = strip_tags($new_instance['mc_host']);         
    212226        $instance['my_calendar_upcoming_before'] = strip_tags($new_instance['my_calendar_upcoming_before']); 
    213227        $instance['my_calendar_upcoming_after'] = strip_tags($new_instance['my_calendar_upcoming_after']); 
     
    223237 
    224238// Widget upcoming events 
    225 function my_calendar_upcoming_events($before='default',$after='default',$type='default',$category='default',$template='default',$substitute='',$order='asc',$skip=0, $show_today='yes',$author='default' ) { 
     239function my_calendar_upcoming_events($before='default',$after='default',$type='default',$category='default',$template='default',$substitute='',$order='asc',$skip=0, $show_today='yes',$author='default',$host='default' ) { 
    226240  global $wpdb,$default_template,$defaults; 
    227241  $mcdb = $wpdb; 
     
    252266    if ($display_upcoming_type == "days") { 
    253267        $temp_array = array(); 
     268        $event_array = array(); 
    254269            $from = date('Y-m-d',strtotime("-$before days") ); 
    255270            $to = date('Y-m-d',strtotime("+$after days") ); 
    256             $events = my_calendar_grab_events( $from, $to, $category,'','','upcoming',$author );             
     271            $events = my_calendar_grab_events( $from, $to, $category,'','','upcoming',$author, $host );          
    257272            if ( !get_option('mc_skip_holidays_category') || get_option('mc_skip_holidays_category') == '' ) {  
    258273                $holidays = array(); 
    259274            } else { 
    260                 $holidays = my_calendar_grab_events( $from, $to, get_option('mc_skip_holidays_category'),'','', 'upcoming', $author ); 
     275                $holidays = my_calendar_grab_events( $from, $to, get_option('mc_skip_holidays_category'),'','', 'upcoming', $author, $host ); 
    261276                $holiday_array = mc_set_date_array( $holidays ); 
    262277            } 
     
    297312                    $cache = false; // take cache out of memory 
    298313                } else { 
    299                     $events = mc_get_all_events($category, $before, $after, $show_today, $author); 
     314                    $events = mc_get_all_events($category, $before, $after, $show_today, $author, $host); 
    300315                    $cache[$category] = $events; 
    301316                    set_transient( 'mc_cache_upcoming', $cache, 60*30 ); 
    302317                } 
    303318            } else { 
    304                 $events = mc_get_all_events($category, $before, $after, $show_today, $author); 
     319                $events = mc_get_all_events($category, $before, $after, $show_today, $author, $host); 
    305320                $cache[$category] = $events; 
    306321                set_transient( 'mc_cache_upcoming', $cache, 60*30 );             
    307322            } 
    308323        } else { 
    309             $events = mc_get_all_events($category, $before, $after, $show_today, $author);   // grab all events within reasonable proximity 
     324            $events = mc_get_all_events($category, $before, $after, $show_today, $author, $host);    // grab all events within reasonable proximity 
    310325        } 
    311326        if ( !get_option('mc_skip_holidays_category') || get_option('mc_skip_holidays_category') == '' ) {  
     
    440455            $i = 0; 
    441456            $groups = array(); 
     457            $skips = array(); 
     458             
    442459            foreach( reverse_array($temp_array, true, $order) as $details ) { 
    443460                if ( !in_array( $details['group'], $groups ) ) { 
     
    456473                        $prepend = $append = ''; 
    457474                    } 
    458                     // if any event this date is in the holiday category, we are skipping 
    459475                    if ( $i < $skip && $skip != 0 ) { 
    460476                        $i++; 
    461                     } else {         
    462                         $output .= apply_filters('mc_event_upcoming',"$prepend".jd_draw_template($details,$template,$type)."$append",$event);      
     477                    } else { 
     478                        if ( !in_array( $details['dateid'], $skips ) ) { 
     479                            $output .= apply_filters('mc_event_upcoming',"$prepend".jd_draw_template($details,$template,$type)."$append",$event);      
     480                            $skips[] = $details['dateid']; 
     481                        } 
    463482                    } 
    464483                    if ( $details['event_span'] == 1 ) { 
     
    474493 
    475494// Widget todays events 
    476 function my_calendar_todays_events($category='default',$template='default',$substitute='',$author='all') { 
     495function my_calendar_todays_events($category='default',$template='default',$substitute='',$author='all', $host='all') { 
    477496    $caching = ( get_option('mc_caching_enabled') == 'true' )?true:false; 
    478497    $todays_cache = ($caching)? get_transient('mc_todays_cache') :''; 
     
    494513 
    495514    $from = $to = date( 'Y-m-d',time()+$offset ); 
    496     $events = my_calendar_grab_events($from, $to,$category,'','','upcoming',$author); 
     515    $events = my_calendar_grab_events($from, $to,$category,'','','upcoming',$author, $host); 
    497516    $header = "<ul id='todays-events'>"; 
    498517    $footer = "</ul>";       
  • my-calendar/trunk/my-calendar.php

    r624660 r627944  
    66Author: Joseph C Dolson 
    77Author URI: http://www.joedolson.com 
    8 Version: 2.0.12 
     8Version: 2.1.0 
    99*/ 
    1010/*  Copyright 2009-2012  Joe Dolson (email : joe@joedolson.com) 
     
    2525*/ 
    2626global $mc_version, $wpdb; 
    27 $mc_version = '2.0.12'; 
     27$mc_version = '2.1.0'; 
    2828 
    2929// Define the tables used in My Calendar 
     
    151151            <div class="inside"> 
    152152                <ul> 
     153                    <li><strong><a href="<?php echo admin_url("admin.php?page=my-calendar-help"); ?>#get-started"><?php _e("Getting Started",'my-calendar'); ?></strong></a></li>                                
    153154                    <li><a href="<?php echo admin_url("admin.php?page=my-calendar-help"); ?>#get-support"><?php _e("Get Support",'my-calendar'); ?></a></li> 
    154155                    <li><a href="<?php echo admin_url("admin.php?page=my-calendar-help"); ?>"><?php _e("My Calendar Help",'my-calendar'); ?></a></li>                
  • my-calendar/trunk/readme.txt

    r624660 r627944  
    8989 
    9090== Changelog == 
     91 
     92= 2.1.0 = 
     93 
     94* Miscellaneous filepath fixes for custom icons 
     95* Fixed filepath issue for custom content directory in loading calendar generator 
     96* Added templating options to RSS feed event format 
     97* Added two new template tags: description_stripped and shortdesc_stripped; returns the description fields with HTML removed. 
     98* Re-organized settings to provide better grouping. 
     99* Removed jumpbox default setting; jumpbox now only configurable via shortcode. 
     100* Bug fix: titles missing in list view when open to details link enabled. 
     101* Bug fix: Multi-day events listed only once in upcoming events lists. 
     102* Minor stylesheet tweaks. 
    91103 
    92104= 2.0.12 = 
  • my-calendar/trunk/styles/dark.css

    r598242 r627944  
    99.mc-main .category-key .no-icon {border: 1px solid #bbb;} 
    1010 
     11.mc-main,.mc-list  {background: #333; padding: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px;color:#fff;} 
    1112.mc-main caption, .mc-main .my-calendar-date-switcher, .mc-main .my-calendar-nav li a:hover, .mc-main .category-key { 
    1213border: 1px solid #222; 
    1314} 
    1415.mc-main .my-calendar-date-switcher {padding: 4px;margin: 0 0 10px;} 
    15 .mc-main .my-calendar-date-switcher input, .mc-main .my-calendar-date-switcher label, .mc-main .my-calendar-date-switcher select {margin: 0;padding: 0;color: #333;} 
     16.mc-main .my-calendar-date-switcher input, .mc-main .my-calendar-date-switcher select {margin: 0;padding: 0;color: #333;} 
     17 .mc-main .my-calendar-date-switcher label {  margin: 0; padding: 0; color: #fff; } 
    1618.mc-main .my-calendar-date-switcher .button {font-size: .9em;} 
    1719.mc-main .list-event .details, .mc-main td {border:1px solid #222;} 
     
    4345.mc-main th {text-align: center;padding: 5px 0!important;letter-spacing: 1px;} 
    4446.mc-main th abbr {border-bottom: none;} 
    45 .mc-main h3 { 
    46 font: 700 .8em Arial, Verdana, sans-serif; 
     47.mc-main h3, .mc-main h3 a { 
     48font: 700 10px Arial, Verdana, sans-serif; 
    4749margin:3px 0; 
    4850padding:0; 
  • my-calendar/trunk/styles/inherit.css

    r598242 r627944  
    5454border-bottom: none; 
    5555} 
    56 .mc-main h3 { 
    57 font: 700 .8em Arial, Verdana, sans-serif; 
     56.mc-main h3, .mc-main h3 a { 
     57font: 700 10px Arial, Verdana, sans-serif; 
    5858margin:3px 0; 
    5959padding:0; 
  • my-calendar/trunk/styles/light.css

    r598242 r627944  
    11/* A light-colored theme almost entirely in whites and light grays with black text. */ 
    2 .mc-main,.mc-list {background: #fff; } 
     2.mc-main,.mc-list  {background: #fff; padding: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px;color:#333;} 
    33.mc-main caption, .mc-main .my-calendar-date-switcher, .mc-main .category-key, .mc-main .calendar-event .details,  
    44.mc-main .calendar-events {background: #fff; } 
     
    7171} 
    7272.mc-main th abbr {border-bottom: none;} 
    73 .mc-main h3 { 
    74 font: 700 .8em Arial, Verdana, sans-serif; 
     73.mc-main h3, .mc-main h3 a { 
     74font: 700 10px Arial, Verdana, sans-serif; 
    7575margin:3px 0; 
    7676padding:0; 
     
    195195 
    196196.mc-main .my-calendar-nav li { 
    197 float:left; 
    198197list-style-type: none!important; /* It really is pretty important. */; 
    199198} 
     
    212211} 
    213212.mc-main .my-calendar-next { 
    214 margin-left: 4px; 
    215213text-align:right; 
    216214} 
     
    245243.mini .my-calendar-nav li a { 
    246244padding: 1px 3px!important; 
    247 font-size: .7em; 
     245font-size: 10px; 
    248246} 
    249247.mc-main .nextmonth { 
     
    251249color: #888; 
    252250} 
     251.mc-main .my-calendar-nav { position: relative; } 
     252.mc-main .my-calendar-prev { position: absolute; left: 0; top: 0;} 
     253.mc-main .my-calendar-next { position: absolute; right: 0; top: 0; } 
     254 
    253255.mc-main .nextmonth .event-title {opacity: .7;} 
    254256.mc-main .nextmonth .mc-date {background: #eee;} 
  • my-calendar/trunk/styles/my-calendar.css

    r598242 r627944  
    1 .mc-main,.mc-list  {background: #fff;} 
     1.mc-main,.mc-list  {background: #fff; padding: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px;color:#333;} 
    22.mc-main caption, .mc-main .my-calendar-date-switcher,  
    33.mc-main .category-key, .mc-main .calendar-event .details,  
     
    7373} 
    7474.mc-main th abbr {border-bottom: none;} 
    75 .mc-main h3 { 
    76 font-size:.8em!important; 
     75.mc-main h3, .mc-main h3 a { 
     76font-size:10px!important; 
    7777font-family: Arial, Verdana, sans-serif; 
    7878font-weight:700; 
  • my-calendar/trunk/styles/refresh.css

    r598242 r627944  
    1 .mc-main,.mc-list  {background: #fff;} 
     1.mc-main,.mc-list  {background: #fff; padding: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px;color:#333;} 
    22.mc-main .my-calendar-date-switcher, .mc-main .calendar-event .details, .mc-main .calendar-events {background: #edf7ff;} 
    33.mc-main .my-calendar-date-switcher { 
     
    7171 
    7272.mc-main th abbr {border-bottom: none;} 
    73 .mc-main h3 { 
    74 font-size:.7em!important; 
     73.mc-main h3, .mc-main h3 a { 
     74font-size:10px!important; 
    7575font-family: Arial, Verdana, sans-serif; 
    7676font-weight:400; 
  • my-calendar/trunk/templates/dark.css

    r598242 r627944  
    99.mc-main .category-key .no-icon {border: 1px solid #bbb;} 
    1010 
     11.mc-main,.mc-list  {background: #333; padding: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px;color:#fff;} 
    1112.mc-main caption, .mc-main .my-calendar-date-switcher, .mc-main .my-calendar-nav li a:hover, .mc-main .category-key { 
    1213border: 1px solid #222; 
    1314} 
    1415.mc-main .my-calendar-date-switcher {padding: 4px;margin: 0 0 10px;} 
    15 .mc-main .my-calendar-date-switcher input, .mc-main .my-calendar-date-switcher label, .mc-main .my-calendar-date-switcher select {margin: 0;padding: 0;color: #333;} 
     16.mc-main .my-calendar-date-switcher input, .mc-main .my-calendar-date-switcher select {margin: 0;padding: 0;color: #333;} 
     17 .mc-main .my-calendar-date-switcher label {  margin: 0; padding: 0; color: #fff; } 
    1618.mc-main .my-calendar-date-switcher .button {font-size: .9em;} 
    1719.mc-main .list-event .details, .mc-main td {border:1px solid #222;} 
     
    4345.mc-main th {text-align: center;padding: 5px 0!important;letter-spacing: 1px;} 
    4446.mc-main th abbr {border-bottom: none;} 
    45 .mc-main h3 { 
    46 font: 700 .8em Arial, Verdana, sans-serif; 
     47.mc-main h3, .mc-main h3 a { 
     48font: 700 10px Arial, Verdana, sans-serif; 
    4749margin:3px 0; 
    4850padding:0; 
  • my-calendar/trunk/templates/inherit.css

    r598242 r627944  
    5454border-bottom: none; 
    5555} 
    56 .mc-main h3 { 
    57 font: 700 .8em Arial, Verdana, sans-serif; 
     56.mc-main h3, .mc-main h3 a { 
     57font: 700 10px Arial, Verdana, sans-serif; 
    5858margin:3px 0; 
    5959padding:0; 
  • my-calendar/trunk/templates/light.css

    r598242 r627944  
    11/* A light-colored theme almost entirely in whites and light grays with black text. */ 
    2 .mc-main,.mc-list {background: #fff; } 
     2.mc-main,.mc-list  {background: #fff; padding: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px;color:#333;} 
    33.mc-main caption, .mc-main .my-calendar-date-switcher, .mc-main .category-key, .mc-main .calendar-event .details,  
    44.mc-main .calendar-events {background: #fff; } 
     
    7171} 
    7272.mc-main th abbr {border-bottom: none;} 
    73 .mc-main h3 { 
    74 font: 700 .8em Arial, Verdana, sans-serif; 
     73.mc-main h3, .mc-main h3 a { 
     74font: 700 10px Arial, Verdana, sans-serif; 
    7575margin:3px 0; 
    7676padding:0; 
  • my-calendar/trunk/templates/my-calendar.css

    r598242 r627944  
    1 .mc-main,.mc-list  {background: #fff;} 
     1.mc-main,.mc-list  {background: #fff; padding: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px;color:#333;} 
    22.mc-main caption, .mc-main .my-calendar-date-switcher,  
    33.mc-main .category-key, .mc-main .calendar-event .details,  
     
    7373} 
    7474.mc-main th abbr {border-bottom: none;} 
    75 .mc-main h3 { 
    76 font-size:.8em!important; 
     75.mc-main h3, .mc-main h3 a { 
     76font-size:10px!important; 
    7777font-family: Arial, Verdana, sans-serif; 
    7878font-weight:700; 
  • my-calendar/trunk/templates/refresh.css

    r598242 r627944  
    1 .mc-main,.mc-list  {background: #fff;} 
     1.mc-main,.mc-list  {background: #fff; padding: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px;color:#333;} 
    22.mc-main .my-calendar-date-switcher, .mc-main .calendar-event .details, .mc-main .calendar-events {background: #edf7ff;} 
    33.mc-main .my-calendar-date-switcher { 
     
    7171 
    7272.mc-main th abbr {border-bottom: none;} 
    73 .mc-main h3 { 
    74 font-size:.7em!important; 
     73.mc-main h3, .mc-main h3 a { 
     74font-size:10px!important; 
    7575font-family: Arial, Verdana, sans-serif; 
    7676font-weight:400; 
Note: See TracChangeset for help on using the changeset viewer.