Plugin Directory

Changeset 1370252


Ignore:
Timestamp:
03/13/2016 06:58:01 PM (10 years ago)
Author:
heimsveld
Message:

Release 2.3.3

Location:
chronosly-events-calendar
Files:
18 edited
13 copied

Legend:

Unmodified
Added
Removed
  • chronosly-events-calendar/tags/2.3.3/README.txt

    r1329627 r1370252  
    66Requires at least: 3.1
    77Tested up to:  4.4.1
    8 Stable tag: 2.3.1
     8Stable tag: 2.3.3
    99License: GPLv2
    1010
  • chronosly-events-calendar/tags/2.3.3/README.txt~

    r1329627 r1370252  
    66Requires at least: 3.1
    77Tested up to:  4.4.1
    8 Stable tag: 2.3.0
     8Stable tag: 2.3.1
    99License: GPLv2
    1010
  • chronosly-events-calendar/tags/2.3.3/chronosly.php

    r1329607 r1370252  
    44 * Plugin URI: http://www.chronosly.com
    55 * Description: Chronosly is one of the plugins you have always dreamt about. Designed to suit all users (basic, designers, and software developers). Choose your template and you are ready to publish your events. Install addons to enhance the preset plugin features. You can get a wide selection of templates and addons in our marketplace
    6  * Version: 2.3.2
     6 * Version: 2.3.3
    77 * Author: Heimsveld IPBN
    88 * Author URI: http://www.heimsveld.com
     
    2626define('CHRONOSLY_TEMPLATES_URL',  plugins_url()."/chronosly-templates"); //path para incluir scripts o css
    2727define('CHRONOSLY_DEBUG', false); //debug mode
    28 define('CHRONOSLY_VERSION', "2.3.2"); //debug mode
     28define('CHRONOSLY_VERSION', "2.3.3"); //debug mode
    2929define('CHRONOSLY_ADMIN_INTERFACE', 1);  //Todo: hacer diferentes interficies de admin simple o varios event
    3030define('CHRONOSLY_ADMIN_MODALITY', 1);  //Todo: hacer diferentes modalidades segun la tematica
     
    7272            }
    7373
    74             require_once( CHRONOSLY_PATH.DIRECTORY_SEPARATOR."classes".DIRECTORY_SEPARATOR."chronosly_shortcode.php");
    75             $Chronosly_Shortcode = new Chronosly_Shortcode();
     74            if(!is_admin() || stripos($_REQUEST["action"], "chronosly_") !== false){
     75                require_once( CHRONOSLY_PATH.DIRECTORY_SEPARATOR."classes".DIRECTORY_SEPARATOR."chronosly_shortcode.php");
     76                $Chronosly_Shortcode = new Chronosly_Shortcode();
     77            }
    7678            require_once(CHRONOSLY_PATH.DIRECTORY_SEPARATOR."classes".DIRECTORY_SEPARATOR."chronosly_dad_elements.php");
    7779            $dad_elements = new Chronosly_Dad_Elements();
  • chronosly-events-calendar/tags/2.3.3/classes/chronosly_dad_elements.php

    r1329732 r1370252  
    43314331
    43324332                    // print_r($tik);
    4333 
     4333                    $currency = $settings["chronosly_currency"];
     4334                    if($tick["currency"]) $currency = $tick["currency"];
    43344335                    $ret.= "<ul>";
    43354336                    $ret.= "<li class='title'><i class='fa fa-ticket'></i> " . $tik["title"] . "</li>";
    43364337                    if (!$tik["price"]) $tik["price"] = 0;
    4337                     if($tik["sales-price"] and $tik["sale"] ) $ret.= "<li class='price sale'><span class='ch-currency'>" . $settings["chronosly_currency"] . "</span> " . $tik["sales-price"] . "</li>";
    4338                     else $ret.= "<li class='price'><span class='ch-currency'>" . $settings["chronosly_currency"] . "</span> " . $tik["price"] . "</li>";
     4338                    if($tik["sales-price"] and $tik["sale"] ) $ret.= "<li class='price sale'><span class='ch-currency'>" . $currency . "</span> " . $tik["sales-price"] . "</li>";
     4339                    else $ret.= "<li class='price'><span class='ch-currency'>" . $currency . "</span> " . $tik["price"] . "</li>";
    43394340                    $ret.= "<li class='capacity'>" . $tik["capacity"] . "</li>";
    43404341                    // $ret.= "<li class='min'>" . $tik["min-user"] . "</li>";
     
    51345135
    51355136            }
    5136 
     5137            $currency = $settings["chronosly_currency"];
     5138            if($vars->metas['tickets_vars'][$value]["currency"]) $currency = $vars->metas['tickets_vars'][$value]["currency"];
    51375139            $currency_type = "";
    5138             $length = strlen(utf8_decode(html_entity_decode($settings["chronosly_currency"], ENT_COMPAT, 'utf-8')));
     5140            $length = strlen(utf8_decode(html_entity_decode($currency, ENT_COMPAT, 'utf-8')));
    51395141            if ($length > 1) $currency_type = "$length";
    51405142            $ant = "";
     
    51505152                        $price = $v["price"];
    51515153                        $value = $k;
     5154                        if($v["currency"]) $currency = $v["currency"];
     5155
    51525156                    }
    51535157                }
    51545158            }
    51555159            if($vars->metas['tickets_vars'][$value]["sale"] && $vars->metas['tickets_vars'][$value]["sales-price"]) {
     5160                if($vars->metas['tickets_vars'][$value]["currency"]) $currency = $vars->metas['tickets_vars'][$value]["currency"];
     5161
    51565162                $porc = " <span class='sale-discount' style='background-color: #sale-color'>".round((($vars->metas['tickets_vars'][$value]["sales-price"]-$vars->metas['tickets_vars'][$value]["price"])/$vars->metas['tickets_vars'][$value]["price"])*100)."%</span>";
    5157                 return "<div class='$soldoutClass'>$ant<span class='sale'><span class='ch-currency$currency_type'>" . $settings["chronosly_currency"] . "</span> <span class='oldprice'>" .$vars->metas['tickets_vars'][$value]["price"]."</span> <span class='price'>". $vars->metas['tickets_vars'][$value]["sales-price"] ."</span>" .$porc. $soldout."</span></div>";
     5163                return "<div class='$soldoutClass'>$ant<span class='sale'><span class='ch-currency$currency_type'>" . $currency . "</span> <span class='oldprice'>" .$vars->metas['tickets_vars'][$value]["price"]."</span> <span class='price'>". $vars->metas['tickets_vars'][$value]["sales-price"] ."</span>" .$porc. $soldout."</span></div>";
    51585164            }
    5159             return "<div class='$soldoutClass'>$ant<span class='ch-currency$currency_type'>" . $settings["chronosly_currency"] . "</span> <span class='price'>" . $vars->metas['tickets_vars'][$value]["price"] ."</span>". $soldout."</div>";
     5165            return "<div class='$soldoutClass'>$ant<span class='ch-currency$currency_type'>" . $currency . "</span> <span class='price'>" . $vars->metas['tickets_vars'][$value]["price"] ."</span>". $soldout."</div>";
    51605166        }
    51615167
  • chronosly-events-calendar/tags/2.3.3/classes/chronosly_settings.php

    r1235318 r1370252  
    162162                    "chronosly-cats-flushed" => 0,
    163163                    "chronosly-tags-flushed" => 0,
    164 
     164                    "chronosly_admin_memory_limit" => 0,   
    165165
    166166
  • chronosly-events-calendar/tags/2.3.3/classes/chronosly_shortcode.php

    r1329732 r1370252  
    2828            global $chshortcode;
    2929            if(!$chshortcode) return "";
    30             return do_shortcode("[chronosly $chshortcode]");
     30            return do_shortcode("[chronosly $chshortcode base=1]");
    3131        }
    3232
     
    5757                'after_events' => 0,
    5858                'show_past' => 0,
    59                 'template' => '' //use another template on shortcode
     59                'template' => '', //use another template on shortcode
     60                'base' => '' //is a the base shortcode
    6061            );
    6162            $args = apply_filters("chronosly-shortcode-extra-params", $args);
     
    6768            $_REQUEST["small"] = $code["small"];
    6869            $_REQUEST["navigation"] = $code["navigation"];
    69             Chronosly_Templates::set_shortcode_template_css();
     70            if(stripos($type, "format") === FALSE) Chronosly_Templates::set_shortcode_template_css();
    7071
    7172            if( $code["template"])  {
     
    153154            unset($_REQUEST["ch-price-min"]);
    154155            unset($_REQUEST["ch-price-max"]);
     156            unset($_REQUEST["ch_exclude"]);
    155157            return $content;
    156158
     
    164166            global $wp_query, $Post_Type_Chronosly, $pastformat;
    165167            $pastformat = 0;//para enseñar en formato eventos pasados
     168            $wp_queryold = $wp_query;
    166169            if(isset($_REQUEST["chronosly_event_list_time"]) and $_REQUEST["chronosly_event_list_time"] == "past"){
    167170               $pastformat = 1;
     
    188191            }
    189192            if($args["exclude"]) {
    190                 $q["post__not_in"] = explode(",",$args["exclude"]);
     193                $_REQUEST["ch_exclude"] = $q["post__not_in"] = explode(",",$args["exclude"]);
    191194            }
    192195            if($args["category"]) {
     
    237240            switch($type){
    238241                case "calendar":
    239                    
     242                     if(!$args["base"] && (stripos("http://".$_SERVER[HTTP_HOST].$_SERVER[REQUEST_URI], Post_Type_Chronosly_Calendar::get_permalink()) !== FALSE ||
     243                        stripos("https://".$_SERVER[HTTP_HOST].$_SERVER[REQUEST_URI], Post_Type_Chronosly_Calendar::get_permalink()) !== FALSE)) return;
     244
    240245                    if ( is_user_logged_in() ) new WP_Query("post_type=chronosly_calendar&post_status=publish,private");
    241246                    else $wp_query = new WP_Query("post_type=chronosly_calendar");
     
    427432            }
    428433            wp_reset_query();//reset the query status
     434            $wp_query = $wp_queryold;
    429435        }
    430436
  • chronosly-events-calendar/tags/2.3.3/classes/chronosly_templates.php

    r1316864 r1370252  
    6767
    6868        public function set_front_css(){
     69           
    6970            if($handle = opendir(CHRONOSLY_TEMPLATES_PATH.DIRECTORY_SEPARATOR."css".DIRECTORY_SEPARATOR)) {
    7071                while (false !== ($entry = readdir($handle))) {
     
    9293        //load de json with tmplate info
    9394        public function load_template_settings($templates, $array = 0){
     95
    9496            $return = "";
    9597            foreach($templates as $t){
     
    268270
    269271        public function get_tipo_template($id, $vista){
     272            // echo "$id, $vista";
    270273            $vars = unserialize(get_option("chronosly-settings"));
    271274            if($vista != "dad11" and $vista != "dad12") $template = @get_post_meta($id, $vista, true);
    272275            else {
    273276                $template = @get_option('chronosly-taxonomy-'.$vista.'_'.$id);
    274                 $template = unserialize($template);
     277                if($template2 = unserialize($template)) $template = $template2;
    275278                if(count($template)) $template = $template[0];
    276279            }
    277280            if($template) {
     281                // echo "entra";
    278282                if(strlen($template) < 50 and stripos( $template,"template-")!== FALSE) return str_replace("template-", "", $template);
    279283                else return "chbd";
     
    294298                if(strlen($template) < 50 and stripos( $template,"template-")!== FALSE) return str_replace("template-", "", $template);
    295299                else  {
    296                     $v = json_decode(str_replace(array('\\"', "\\'"), array('"',"'"), $template));
    297                     return $v->base;
     300                    $content = str_replace(array('\\"', "\\'"), "'", $template);
     301                    if(!json_decode(stripslashes($content))) {
     302                        $content =json_decode(stripslashes(str_replace(array('\\"', "\\'"), array('"',"'"),$template)));
     303                    }
     304                    return $content->base;
    298305                }
    299306            }
     
    632639                    if($template == "chbd"){
    633640                        //se trata de un template editado, cargamos los datos del template
    634                         $data = str_replace(array('\\"', "\\'"), array('"',"'"),$this->get_template($id, $vista));
     641                        $data = str_replace(array('\\"', "\\'"), "'", $this->get_template($id, $vista));
     642                        if(!json_decode(stripslashes($data))) {
     643                            $data =str_replace(array('\\"', "\\'"), array('"',"'"),$this->get_template($id, $vista));
     644                        }
    635645                    }
    636646
    637                     $this->render_template($template, $style, $vista, json_decode($data), $draganddropels, $html2 );
     647                    $this->render_template($template, $style, $vista, json_decode(stripslashes($data)), $draganddropels, $html2 );
    638648
    639649                }
     
    687697
    688698        //retrieve template vars from file
    689        private function get_template_vars($file){
     699        private function get_template_vars($file){
    690700            $f = @fopen($file, "r");
    691701            $content =str_replace(array('\\"', "\\'"), "'",@fread($f, filesize($file)));
     
    730740            if($this->vars->vista != "dad11" and $this->vars->vista != "dad12" ) $this->vars->metas = get_post_meta($this->vars->pid);//assing metas vars
    731741
    732             if(isset($this->vars->metas['organizer'])){
     742            if(isset($this->vars->metas['organizer']) && $this->vars->metas['organizer'][0]){
    733743                foreach($this->vars->metas['organizer'] as $orgs){
    734744                    $orgs = unserialize($orgs);
     
    751761            }
    752762
    753             if(isset($this->vars->metas['places'])){
     763            if(isset($this->vars->metas['places']) && $this->vars->metas['places'][0]){
    754764                foreach($this->vars->metas['places'] as $orgs){
    755765                    $orgs = unserialize($orgs);
     
    815825
    816826                foreach($this->vars->args as $k => $v){
     827                   
    817828                    switch($k){
    818829                        case "id":
     
    822833                            break;
    823834                        case "start":
     835                        // echo $v."<br>";
    824836                            $this->vars->metas['ev-from'][0] = date("Y-m-d",$v);
    825837                            //echo date("Y-m-d",$v)." ".$v;
  • chronosly-events-calendar/tags/2.3.3/js/front.js

    r1244927 r1370252  
    203203        );
    204204    }
    205    onload_calendar();});
     205   onload_calendar();
     206});
    206207
    207208function ch_load_calendar(url, id){
    208     jQuery(".ch_js_loader.id"+id+" .chronosly-content-block").html( "<div class='ch-spinner'></div>" );
     209      jQuery(".ch_js_loader.id"+id+" .chronosly-content-block").html( "<div class='ch-spinner'></div>" );
    209210    jQuery(".ch_js_loader.id"+id).html("<div class='ch-spinner'></div>" );
    210211    if(!url) url = translated1.calendarurl;
     
    214215        //jQuery(".ch_js_loader").hide().html( data ).slideDown(3000);
    215216        var content = "";
    216        
    217         if(jQuery(".ch_js_loader.id"+id+" .chronosly-content-block").length) {
     217       if(jQuery(".ch_js_loader.id"+id).length) {
    218218            if(jQuery(data).find(".chronosly-content-block").length) content = jQuery(data).find(".chronosly-content-block");
    219219            else content = jQuery(data);
    220             jQuery(".ch_js_loader.id"+id+" .chronosly-content-block").html(content);
     220             if(jQuery(".ch_js_loader.id"+id+" .chronosly-content-block").lenght) jQuery(".ch_js_loader.id"+id+" .chronosly-content-block").html(content);
     221            else jQuery(".ch_js_loader.id"+id).html(content);
    221222            if(jQuery(".ch_js_loader.id"+id+" .ch-fas-form").length){
    222223                jQuery(".ch_js_loader.id"+id+" input[name='from']").val(content.find(".ch_from").html());
  • chronosly-events-calendar/tags/2.3.3/languages/custom_strings.php

    r1256000 r1370252  
    88__("Open map", "chronosly");
    99__("View ", "chronosly");
     10__("more", "chronosly");
  • chronosly-events-calendar/tags/2.3.3/metaboxes/chronosly_tickets_metabox.php

    r1202016 r1370252  
    55            <span class='edit'><?php _e("edit", "chronosly");?></span><span class='delete'><?php _e("delete", "chonosly");?></span>
    66           
    7         </div><input type='text'  class='title'  name='title' value='' /><input    type='text' class='price' name='price' value='' /><input type="text" class="price" name="sales-price" value="" /><input   type='text' class='capacity' name='capacity' value='' /><input type="text" class="link" name="link" value="" /><br/><textarea name='notes' class='notes'></textarea>
     7        </div><input type='text'  class='title'  name='title' value='' /><input    type='text' class='price' name='price' value='' /><input type="text" class="price" name="sales-price" value="" /><input   type='text' class='currency' name='currency' value='<?php echo $currency; ?>' /><input   type='text' class='capacity' name='capacity' value='' /><input type="text" class="link" name="link" value="" /><br/><textarea name='notes' class='notes'></textarea>
    88       </li>
    99</div>
     
    1313
    1414    // echo "<li class='ticket-head'><span class='title'>".__("Title","chronosly")."</span><span class='price'>".__("Price","chronosly")."</span><span class='capacity'>".__("Capacity","chronosly")."</span><span class='min-user'>".__("Min.","chronosly")."</span><span class='max-user'>".__("Max.","chronosly")."</span><span class='start-time'>".__("From","chronosly")."</span><span class='end-time'>".__("To","chronosly")."</span><span class='link'>".__("Link","chronosly")."</span></li>";
    15     echo "<li class='ticket-head'><span class='title'>".__("Title","chronosly")."</span><span class='price'>".__("Price","chronosly")."</span><span class='price'>".__("Sale Price","chronosly")."</span><span class='capacity'>".__("Capacity","chronosly")."</span><span class='link'>".__("Link","chronosly")."</span></li>";
     15    echo "<li class='ticket-head'><span class='title'>".__("Title","chronosly")."</span><span class='price'>".__("Price","chronosly")."</span><span class='price'>".__("Sale Price","chronosly")."</span><span class='currency'>".__("Currency","chronosly")."</span><span class='capacity'>".__("Capacity","chronosly")."</span><span class='link'>".__("Link","chronosly")."</span></li>";
    1616
    1717    if(isset($vars->tickets)){
     
    3131            ."<input  readonly  type='text' class='price' name='price' value='".$ticket["price"]."' />"
    3232            ."<input  readonly type='text' class='price' name='sales-price' value='".$ticket["sales-price"]."' />"
     33            ."<input readonly  type='text' class='currency' name='currency' value='".$ticket["currency"]."' />"
    3334            ."<input readonly  type='text' class='capacity' name='capacity' value='".$ticket["capacity"]."' />"
    34             // ."<input readonly  type='text' class='min-user' name='min-user' value='".$ticket["min-user"]."' />"
    3535            // ."<input  readonly type='text' class='max-user' name='max-user' value='".$ticket["max-user"]."' />"
    3636            // ."<input  readonly type='text' class='sales-start-time' name='start-time' value='".$ticket["start-time"]."' />"
     
    4848    <?php _e("PRICE: Show ticket prices, also change currency and availability", "chronosly");?><br/><br/>
    4949    <?php _e("SALE PRICE: Set discounted price for the ticket, enable checking on sale.", "chronosly");?><br/><br/>
     50    <?php _e("CURRENCY: Set different currencies for tickets", "chronosly");?><br/><br/>
    5051    <?php _e("SALE: Active sale price", "chronosly");?><br/><br/>
    5152    <?php _e("SOLD OUT: Set ticket sold out", "chronosly");?><br/><br/>
  • chronosly-events-calendar/tags/2.3.3/metaboxes/settings/settings.php

    r1202016 r1370252  
    124124              <input type="hidden" name="chronosly-base-templates-id" value="<?php echo $vars['chronosly-base-templates-id'] ?>" />
    125125              <br/> <br/>
     126              <label> <?php _e("Solve memory limit on admin", "chronosly")?></label> <input type="checkbox" name="chronosly_admin_memory_limit" value="1" <?php if(isset($vars['chronosly_admin_memory_limit']) and $vars['chronosly_admin_memory_limit']) echo "checked" ?> /><span class="info"></span>           <div class="info-hide"><?php _e("Some sites with low memory servers will need to active this to reduce the memory consumption on admin panels. If your admin panels throws an Allowed memory size exhausted you should active it.", "chronosly");?></div><br/>
    126127              <label> <?php _e("Disable jquery admin", "chronosly")?></label> <input type="checkbox" name="jquery-admin-disable" value="1" <?php if(isset($vars['jquery-admin-disable']) and $vars['jquery-admin-disable']) echo "checked" ?> /><span class="info"></span>           <div class="info-hide"><?php _e("Disable jquery script if another plugins adds jquery source(this will prevent incompatibilities and source code duplication)", "chronosly");?></div><br/>
    127128              <label> <?php _e("Disable gmap script", "chronosly")?></label> <input type="checkbox" name="chronosly-disable-gmap-js" value="1" <?php if(isset($vars['chronosly-disable-gmap-js']) and $vars['chronosly-disable-gmap-js']) echo "checked" ?> /><span class="info"></span>           <div class="info-hide"><?php _e("Disable Google maps script if you already have Gmap on your theme (this will prevent incompatibilities and source code duplication)", "chronosly");?></div><br/>
  • chronosly-events-calendar/tags/2.3.3/post-types/post_type_chronosly.php

    r1329732 r1370252  
    891891            switch($ordertype ){
    892892                case "date":
    893                     //se podria añadir el order por order en vez de por time
    894893                    $pos = $id;//max id = 99999
    895894                  //  141773760 00000
    896895                    $pos += $time*10000;
    897896                    //echo $time;
    898                     if(isset($meta["ev-from-h"][0]) and $meta["ev-from-h"][0] != "") $pos += $meta["ev-from-h"][0]*60*60*10000;
     897                    if($h < 0 && $m < 0){
     898                        if(isset($meta["ev-from-h"][0]) and $meta["ev-from-h"][0] != "") $pos += $meta["ev-from-h"][0]*60*60*10000;
     899                        if(isset($meta["ev-from-m"][0])) $pos += $meta["ev-from-m"][0]*10000*60;
     900                    } else {
     901                        //no se suma nada porque ya esta en time de las seasons
     902                        // $pos += $h*60*60*10000;
     903                        // $pos += $m*10000*60;
     904                    }
    899905//                    else $pos += 10000000;
    900                     if(isset($meta["ev-from-m"][0])) $pos += $meta["ev-from-m"][0]*10000*60;
    901                     if($settings["chronosly_featured_first"] and !$pastformat and (!isset($meta["featured"][0]) or $meta["featured"][0] != 1)) $pos += 10000000000000;
     906                    if( $settings["chronosly_featured_first"] and !$pastformat and (!isset($meta["featured"][0]) or $meta["featured"][0] != 1)) $pos += 10000000000000;
    902907                    if($pastformat or $_REQUEST["orderdir"] == "DESC") $pos = 10000000000000-$pos;
    903                     break;
     908                 break;
    904909                case "order":
    905910                    if(isset($meta["order"][0]) and $meta["order"][0] != "") $pos += $meta["order"][0]*100000;
     
    10471052                   
    10481053                     if(class_exists("Chronosly_Tickets_and_Repeats_Extended") and isset($meta["events"][0])){
    1049                         if($_REQUEST["repeats_past_hide"]) $from = date("Y-m-d");
     1054                        if($_REQUEST["repeats_past_hide"] and time() > strtotime($from)) {
     1055                            $from = date("Y-m-d");
     1056                        }
    10501057                        $eventos = json_decode($meta["events"][0]);
    10511058                        $find = 0;
     
    13761383
    13771384        public static function insert_og_in_head() {
    1378             global $post;
    1379 
    1380             if(!stripos($post->post_content, "chronoslybase")) return ;
    1381 
    1382             remove_action( 'wp_head', 'rel_canonical' );
    1383             $settings = unserialize(get_option("chronosly-settings"));
    1384 
    1385              if( isset($settings["chronosly-base-templates-id"]) and $settings["chronosly-base-templates-id"] != 0 and !isset($_REQUEST["js_render"])){
    1386                 if ( !is_singular()) //if it is not a post or a page
    1387                     return;
    1388                     echo '<meta property="og:title" content="' . get_the_title() . '"/>';
    1389                     echo '<meta property="og:type" content="article"/>';
    1390                     echo '<meta property="og:url" content="' . get_permalink($post->ID) . '"/>';
    1391                     echo "<link rel='canonical' href='".get_permalink($post->ID)."' />";
    1392 
    1393                     // echo '<meta property="og:site_name" content="Your Site NAME Goes HERE"/>';
    1394                 if(has_post_thumbnail( $post->ID )) {
    1395                    $thumbnail_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'medium' );
    1396                     echo '<meta property="og:image" content="' . esc_attr( $thumbnail_src[0] ) . '"/>';
    1397                 }
    1398                 echo "\r\n";
    1399             }
    1400         }
     1385        global $post;
     1386
     1387        $settings = unserialize(get_option("chronosly-settings"));
     1388        if((!isset($settings["chronosly-display-ogmetas"]) || !$settings["chronosly-display-ogmetas"]) &&  !stripos($post->post_content, "chronoslybase")) return ;
     1389
     1390        remove_action( 'wp_head', 'rel_canonical' );
     1391
     1392         if( ($settings["chronosly-display-ogmetas"] || (isset($settings["chronosly-base-templates-id"]) and $settings["chronosly-base-templates-id"] != 0 )) and !$_REQUEST["js_render"]){
     1393            if ( !is_singular()) //if it is not a post or a page
     1394                return;
     1395                echo '<meta property="og:title" content="' . get_the_title() . '"/>';
     1396                echo '<meta property="og:type" content="article"/>';
     1397                echo '<meta property="og:url" content="' . get_permalink($post->ID) . '"/>';
     1398                echo "<link rel='canonical' href='".get_permalink($post->ID)."' />";
     1399
     1400                // echo '<meta property="og:site_name" content="Your Site NAME Goes HERE"/>';
     1401                $thumb = "";
     1402            if(has_post_thumbnail( $post->ID )) {
     1403               $thumbnail_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'medium' );
     1404               $thumb = esc_attr( $thumbnail_src[0] );
     1405            }
     1406           if(!$thumb) {
     1407                if(class_exists("Chronosly_Social_Media_Share")){
     1408                    $settingsSM = unserialize(get_option("chronosly_settings_social_media_share"));
     1409                    $thumb = $settingsSM["default_image"];
     1410                }
     1411           }
     1412            if($thumb) echo '<meta property="og:image" content="' . $thumb . '"/>';
     1413            echo "\r\n";
     1414        }
     1415    }
    14011416
    14021417
     
    23552370                } elseif ('ticket' == $metabox['args']['type']) {
    23562371                    $vars = json_decode(@get_post_meta($post->ID, "tickets", true));
     2372                     $settings = unserialize(get_option("chronosly-settings"));
     2373                    $currency = $settings["chronosly_currency"];
     2374
    23572375                    require_once(CHRONOSLY_PATH.DIRECTORY_SEPARATOR."metaboxes".DIRECTORY_SEPARATOR.self::POST_TYPE."_tickets_metabox.php");
    23582376
  • chronosly-events-calendar/tags/2.3.3/post-types/post_type_chronosly_calendar.php

    r1329607 r1370252  
    226226                        }//si no empezamos en el primer dia del año
    227227                        else $end = strtotime("31-12-".$year);
     228                        $end_top = strtotime("31-12-".$year);
    228229                        if($settings["chronosly_week_start"] == 1) {
    229230                            //$start -= (60*60*24);
     
    232233
    233234                        $start_ini = $start;
    234 
     235                        $endHours = $end + ($meta["ev-to-h"][0]*60*60) + ($meta["ev-to-m"][0]*60);
    235236                        $pos = Post_Type_Chronosly_Calendar::get_event_position_by_hour($meta, get_the_ID());
    236237                        do{
    237238                            if($settings["hide_past_on_calendar"] != 1 or $start>= strtotime(date("Y-m-d"))) {$elements["days"][date('Y-m-d',$start)][$pos]= get_the_ID();}
    238239                            $start = strtotime("+ 1 day",$start);
    239                         }while ( $start<=$end );
     240                        }while ( $start<=$end and ($endHours < $end_top or date('Y-m-d',$start) != date('Y-m-d',$endHours)));
    240241
    241242                        //repeats
     
    284285                        }//si no acabamos en el ultimo dia del mes
    285286                        else $end = $top;
     287                        $end_top = $top;
    286288
    287289                        if($settings["chronosly_week_start"] == 1) {
     
    292294                        $start_ini = $start;
    293295                        $pos = Post_Type_Chronosly_Calendar::get_event_position_by_hour($meta, get_the_ID());
    294 
     296                        $endHours = $end + ($meta["ev-to-h"][0]*60*60) + ($meta["ev-to-m"][0]*60);
    295297                        do{
    296298                            $elements["days"][date('Y-m-d',$start)][$pos]= get_the_ID();
    297299                            $start = strtotime("+ 1 day",$start);
    298                         }while ( $start<=$end );
     300                        }while ( $start<=$end and ($endHours < $end_top or date('Y-m-d',$start) != date('Y-m-d',$endHours))  );
    299301
    300302                        //repeats
     
    331333                        }//si no acabamos en el ultimo dia del mes
    332334                        else $end = strtotime(date("Y-m-t", strtotime($year."-".$month)));
     335                        $end_top = strtotime(date("Y-m-t", strtotime($year."-".$month)));
    333336
    334337                        if($settings["chronosly_week_start"] == 1) {
     
    338341
    339342                        }
     343
    340344                        $start_ini = $start;
    341345                        $pos = Post_Type_Chronosly_Calendar::get_event_position_by_hour($meta, get_the_ID());
    342 
     346                        $endHours = $end + ($meta["ev-to-h"][0]*60*60) + ($meta["ev-to-m"][0]*60);
    343347                        do{
    344348                            $elements["days"][date('Y-m-d',$start)][$pos]= get_the_ID();
    345349                            $start = strtotime("+ 1 day",$start);
    346                         }while ( $start<=$end );
     350                        }while ( $start<=$end and ($endHours < $end_top or date('Y-m-d',$start) != date('Y-m-d',$endHours)));
    347351
    348352                        //repeats
     
    362366                while ( $query->have_posts() ){
    363367                    $query->the_post();
    364                     if(is_array($elements["ids"]) and in_array(get_the_ID(), $elements["ids"])) continue;//if the day is already done.
     368                    // if(is_array($elements["ids"]) and in_array(get_the_ID(), $elements["ids"])) continue;//if the day is already done.
    365369                    $meta = get_post_meta(get_the_ID());
    366370                    if(isset($meta["ev-from"][0])){
     
    383387                while ( $query->have_posts() ){
    384388                    $query->the_post();
    385                     if(is_array($elements["ids"]) and in_array(get_the_ID(), $elements["ids"])) continue;//if the day is already done.
     389                    // if(is_array($elements["ids"]) and in_array(get_the_ID(), $elements["ids"])) continue;//if the day is already done.
    386390                    $meta = get_post_meta(get_the_ID());
    387391
     
    397401                           // $end -= (60*60*24);
    398402                        }
    399 
     403                        // echo get_the_ID()." ".date("d-m-Y ", $start)."<br/>";
    400404
    401405                        //do repeats
     
    408412                while ( $query->have_posts() ){
    409413                    $query->the_post();
    410                     if(is_array($elements["ids"]) and in_array(get_the_ID(), $elements["ids"])) continue;//if the day is already done.
     414                    // if(is_array($elements["ids"]) and in_array(get_the_ID(), $elements["ids"])) continue;//if the day is already done.
    411415
    412416                    $meta = get_post_meta(get_the_ID());
     
    434438
    435439        public static function repeats($meta, $year, $month, $week, $start, $end, $id, $elements, $repeated=0){
     440                                        // echo $id." ".date('Y-m-d H:i',$start)." ".date('Y-m-d H:i',$end)." ".date('Y-m-d H:i',$end_top)."<br/>";
     441
    436442            $settings =  unserialize(get_option("chronosly-settings"));
    437443            $pos = Post_Type_Chronosly_Calendar::get_event_position_by_hour($meta, $id);
     
    455461                        $end_top = strtotime($meta["ev-until"][0]);
    456462                    }
     463                    // echo $end_top;
    457464                    // if($settings["chronosly_week_start"] == 1) {
    458465                    //     // $start_min -= (60*60*24);
     
    487494                            $start1 = $start;
    488495                            $end = $start+$event_days;//recalculamos el final
     496                             $endHours = $end + ($meta["ev-to-h"][0]*60*60) + ($meta["ev-to-m"][0]*60);
    489497                            --$count;
    490498                            while($start <= $end and $start <= $end_top){//rellenamos los dias de este tramo
    491                                 if($start >= $start_min and ($settings["hide_past_on_calendar"] != 1 or $start>= strtotime(date("Y-m-d")))) $elements["days"][date('Y-m-d',$start)][$pos]= array("id" => $id, "start" => $start1, "end" => $end );
     499                                if($start >= $start_min and ($endHours < $end_top or date('Y-m-d',$start) != date('Y-m-d',$endHours)) and ($settings["hide_past_on_calendar"] != 1 or $start>= strtotime(date("Y-m-d")))) $elements["days"][date('Y-m-d',$start)][$pos]= array("id" => $id, "start" => $start1, "end" => $end );
    492500                                $start = strtotime("+ 1 day",$start);
    493501                                //echo date('Y-m-d',$start)." ".date('Y-m-d',$end)."<br/>";
     
    501509
    502510                        while($start < $end_top and $count){//mientras no estemos en el tope superior
     511                            // echo $id." ".date('Y-m-d H:i',$start)." ".date('Y-m-d H:i',$endHours)." ".date('Y-m-d H:i',$end_top)."<br/>";
     512                            // echo $event_days;
    503513                            $start += ($distance*7*60*60*24)-$event_days;//añadimos la distancia de semanas, restando los dias que dura el evento...si el evento dura mas de una semana es un total absurdo usarlo
    504514                            $start1 = $start;
    505515
    506516                            $end = $start+$event_days;//recalculamos el final
     517                            $endHours = $end + ($meta["ev-to-h"][0]*60*60) + ($meta["ev-to-m"][0]*60);
    507518                            --$count;
    508519                            //echo date('Y-m-d',$start)." ".date('Y-m-d',$end)."<br/>";
    509520                            while($start <= $end and $start <= $end_top){//rellenamos los dias de este tramo
    510                                 if((!$repeated or $start >= $start_min) and ($settings["hide_past_on_calendar"] != 1 or $start>= strtotime(date("Y-m-d")))) $elements["days"][date('Y-m-d',$start)][$pos]= array("id" => $id, "start" => $start1, "end" => $end );
     521                                if((!$repeated or $start >= $start_min) and ($endHours < $end_top or date('Y-m-d',$start) != date('Y-m-d',$endHours)) and ($settings["hide_past_on_calendar"] != 1 or $start>= strtotime(date("Y-m-d")))) $elements["days"][date('Y-m-d',$start)][$pos]= array("id" => $id, "start" => $start1, "end" => $end );
     522                               // echo $id." ".date('Y-m-d H:i',$start)." ".date('Y-m-d H:i',$endHours)." ".date('Y-m-d H:i',$end_top)."<br/>";
     523
    511524                                $start = strtotime("+ 1 day",$start);
    512525                                //echo date('Y-m-d',$start)." ".date('Y-m-d',$end)."<br/>";
     
    521534                            $start = strtotime("+$distance month", $start)-$event_days;//añadimos la distancia de semanas, restando los dias que dura el evento...si el evento dura mas de una semana es un total absurdo usarlo
    522535                            $start1 = $start;
    523 
     536                            // echo $event_days;
    524537                            $end = $start+$event_days;//recalculamos el final
     538                            $endHours = $end + ($meta["ev-to-h"][0]*60*60) + ($meta["ev-to-m"][0]*60);
     539
    525540                            --$count;
    526541                            //echo date('Y-m-d',$start)." ".date('Y-m-d',$end)."<br/>";
    527542                            while($start <= $end and $start <= $end_top){//rellenamos los dias de este tramo
    528                                 if((!$repeated or $start >= $start_min) and ($settings["hide_past_on_calendar"] != 1 or $start>= strtotime(date("Y-m-d")))) $elements["days"][date('Y-m-d',$start)][$pos]= array("id" => $id, "start" => $start1, "end" => $end );
     543                                if((!$repeated or $start >= $start_min) and ($endHours < $end_top or date('Y-m-d',$start) != date('Y-m-d',$endHours)) and ($settings["hide_past_on_calendar"] != 1 or $start>= strtotime(date("Y-m-d")))) $elements["days"][date('Y-m-d',$start)][$pos]= array("id" => $id, "start" => $start1, "end" => $end );
     544                                // echo $id." ".date('Y-m-d H:i',$start)." ".date('Y-m-d H:i',$endHours)." ".date('Y-m-d H:i',$end_top)."<br/>";
    529545                                $start = strtotime("+ 1 day",$start);
    530                                 //echo date('Y-m-d',$start)." ".date('Y-m-d',$end)."<br/>";
    531546                            }
    532547                            $start = strtotime("- 1 day",$start);//restamos un dia porque si no el ultimo dia no se cuenta al salir del bucle
     
    541556
    542557                            $end = $start+$event_days;//recalculamos el final
     558                             $endHours = $end + ($meta["ev-to-h"][0]*60*60) + ($meta["ev-to-m"][0]*60);
    543559                            --$count;
    544560                            //echo date('Y-m-d',$start)." ".date('Y-m-d',$end)."<br/>";
    545                             while($start <= $end and $start <= $end_top){//rellenamos los dias de este tramo
    546                                 if((!$repeated or $start >= $start_min) and ($settings["hide_past_on_calendar"] != 1 or $start>= strtotime(date("Y-m-d")))) $elements["days"][date('Y-m-d',$start)][$pos]= array("id" => $id, "start" => $start1, "end" => $end );
     561                            while($start <= $end and $start <= $end_top ){//rellenamos los dias de este tramo
     562                                if((!$repeated or $start >= $start_min) and ($endHours < $end_top or date('Y-m-d',$start) != date('Y-m-d',$endHours)) and ($settings["hide_past_on_calendar"] != 1 or $start>= strtotime(date("Y-m-d")))) $elements["days"][date('Y-m-d',$start)][$pos]= array("id" => $id, "start" => $start1, "end" => $end );
    547563                                $start = strtotime("+ 1 day",$start);
    548564                                //echo date('Y-m-d',$start)." ".date('Y-m-d',$end)."<br/>";
     
    868884            if( $_REQUEST["event_name"]) {
    869885                 $args['post_title_like'] =$_REQUEST["event_name"];
     886            }
     887            if( $_REQUEST["ch_exclude"]) {
     888                 $args['post__not_in'] =$_REQUEST["ch_exclude"];
    870889            }
    871890
  • chronosly-events-calendar/trunk/README.txt

    r1329627 r1370252  
    66Requires at least: 3.1
    77Tested up to:  4.4.1
    8 Stable tag: 2.3.1
     8Stable tag: 2.3.3
    99License: GPLv2
    1010
  • chronosly-events-calendar/trunk/README.txt~

    r1329627 r1370252  
    66Requires at least: 3.1
    77Tested up to:  4.4.1
    8 Stable tag: 2.3.0
     8Stable tag: 2.3.1
    99License: GPLv2
    1010
  • chronosly-events-calendar/trunk/chronosly.php

    r1329607 r1370252  
    44 * Plugin URI: http://www.chronosly.com
    55 * Description: Chronosly is one of the plugins you have always dreamt about. Designed to suit all users (basic, designers, and software developers). Choose your template and you are ready to publish your events. Install addons to enhance the preset plugin features. You can get a wide selection of templates and addons in our marketplace
    6  * Version: 2.3.2
     6 * Version: 2.3.3
    77 * Author: Heimsveld IPBN
    88 * Author URI: http://www.heimsveld.com
     
    2626define('CHRONOSLY_TEMPLATES_URL',  plugins_url()."/chronosly-templates"); //path para incluir scripts o css
    2727define('CHRONOSLY_DEBUG', false); //debug mode
    28 define('CHRONOSLY_VERSION', "2.3.2"); //debug mode
     28define('CHRONOSLY_VERSION', "2.3.3"); //debug mode
    2929define('CHRONOSLY_ADMIN_INTERFACE', 1);  //Todo: hacer diferentes interficies de admin simple o varios event
    3030define('CHRONOSLY_ADMIN_MODALITY', 1);  //Todo: hacer diferentes modalidades segun la tematica
     
    7272            }
    7373
    74             require_once( CHRONOSLY_PATH.DIRECTORY_SEPARATOR."classes".DIRECTORY_SEPARATOR."chronosly_shortcode.php");
    75             $Chronosly_Shortcode = new Chronosly_Shortcode();
     74            if(!is_admin() || stripos($_REQUEST["action"], "chronosly_") !== false){
     75                require_once( CHRONOSLY_PATH.DIRECTORY_SEPARATOR."classes".DIRECTORY_SEPARATOR."chronosly_shortcode.php");
     76                $Chronosly_Shortcode = new Chronosly_Shortcode();
     77            }
    7678            require_once(CHRONOSLY_PATH.DIRECTORY_SEPARATOR."classes".DIRECTORY_SEPARATOR."chronosly_dad_elements.php");
    7779            $dad_elements = new Chronosly_Dad_Elements();
  • chronosly-events-calendar/trunk/classes/chronosly_dad_elements.php

    r1329732 r1370252  
    43314331
    43324332                    // print_r($tik);
    4333 
     4333                    $currency = $settings["chronosly_currency"];
     4334                    if($tick["currency"]) $currency = $tick["currency"];
    43344335                    $ret.= "<ul>";
    43354336                    $ret.= "<li class='title'><i class='fa fa-ticket'></i> " . $tik["title"] . "</li>";
    43364337                    if (!$tik["price"]) $tik["price"] = 0;
    4337                     if($tik["sales-price"] and $tik["sale"] ) $ret.= "<li class='price sale'><span class='ch-currency'>" . $settings["chronosly_currency"] . "</span> " . $tik["sales-price"] . "</li>";
    4338                     else $ret.= "<li class='price'><span class='ch-currency'>" . $settings["chronosly_currency"] . "</span> " . $tik["price"] . "</li>";
     4338                    if($tik["sales-price"] and $tik["sale"] ) $ret.= "<li class='price sale'><span class='ch-currency'>" . $currency . "</span> " . $tik["sales-price"] . "</li>";
     4339                    else $ret.= "<li class='price'><span class='ch-currency'>" . $currency . "</span> " . $tik["price"] . "</li>";
    43394340                    $ret.= "<li class='capacity'>" . $tik["capacity"] . "</li>";
    43404341                    // $ret.= "<li class='min'>" . $tik["min-user"] . "</li>";
     
    51345135
    51355136            }
    5136 
     5137            $currency = $settings["chronosly_currency"];
     5138            if($vars->metas['tickets_vars'][$value]["currency"]) $currency = $vars->metas['tickets_vars'][$value]["currency"];
    51375139            $currency_type = "";
    5138             $length = strlen(utf8_decode(html_entity_decode($settings["chronosly_currency"], ENT_COMPAT, 'utf-8')));
     5140            $length = strlen(utf8_decode(html_entity_decode($currency, ENT_COMPAT, 'utf-8')));
    51395141            if ($length > 1) $currency_type = "$length";
    51405142            $ant = "";
     
    51505152                        $price = $v["price"];
    51515153                        $value = $k;
     5154                        if($v["currency"]) $currency = $v["currency"];
     5155
    51525156                    }
    51535157                }
    51545158            }
    51555159            if($vars->metas['tickets_vars'][$value]["sale"] && $vars->metas['tickets_vars'][$value]["sales-price"]) {
     5160                if($vars->metas['tickets_vars'][$value]["currency"]) $currency = $vars->metas['tickets_vars'][$value]["currency"];
     5161
    51565162                $porc = " <span class='sale-discount' style='background-color: #sale-color'>".round((($vars->metas['tickets_vars'][$value]["sales-price"]-$vars->metas['tickets_vars'][$value]["price"])/$vars->metas['tickets_vars'][$value]["price"])*100)."%</span>";
    5157                 return "<div class='$soldoutClass'>$ant<span class='sale'><span class='ch-currency$currency_type'>" . $settings["chronosly_currency"] . "</span> <span class='oldprice'>" .$vars->metas['tickets_vars'][$value]["price"]."</span> <span class='price'>". $vars->metas['tickets_vars'][$value]["sales-price"] ."</span>" .$porc. $soldout."</span></div>";
     5163                return "<div class='$soldoutClass'>$ant<span class='sale'><span class='ch-currency$currency_type'>" . $currency . "</span> <span class='oldprice'>" .$vars->metas['tickets_vars'][$value]["price"]."</span> <span class='price'>". $vars->metas['tickets_vars'][$value]["sales-price"] ."</span>" .$porc. $soldout."</span></div>";
    51585164            }
    5159             return "<div class='$soldoutClass'>$ant<span class='ch-currency$currency_type'>" . $settings["chronosly_currency"] . "</span> <span class='price'>" . $vars->metas['tickets_vars'][$value]["price"] ."</span>". $soldout."</div>";
     5165            return "<div class='$soldoutClass'>$ant<span class='ch-currency$currency_type'>" . $currency . "</span> <span class='price'>" . $vars->metas['tickets_vars'][$value]["price"] ."</span>". $soldout."</div>";
    51605166        }
    51615167
  • chronosly-events-calendar/trunk/classes/chronosly_settings.php

    r1235318 r1370252  
    162162                    "chronosly-cats-flushed" => 0,
    163163                    "chronosly-tags-flushed" => 0,
    164 
     164                    "chronosly_admin_memory_limit" => 0,   
    165165
    166166
  • chronosly-events-calendar/trunk/classes/chronosly_shortcode.php

    r1329732 r1370252  
    2828            global $chshortcode;
    2929            if(!$chshortcode) return "";
    30             return do_shortcode("[chronosly $chshortcode]");
     30            return do_shortcode("[chronosly $chshortcode base=1]");
    3131        }
    3232
     
    5757                'after_events' => 0,
    5858                'show_past' => 0,
    59                 'template' => '' //use another template on shortcode
     59                'template' => '', //use another template on shortcode
     60                'base' => '' //is a the base shortcode
    6061            );
    6162            $args = apply_filters("chronosly-shortcode-extra-params", $args);
     
    6768            $_REQUEST["small"] = $code["small"];
    6869            $_REQUEST["navigation"] = $code["navigation"];
    69             Chronosly_Templates::set_shortcode_template_css();
     70            if(stripos($type, "format") === FALSE) Chronosly_Templates::set_shortcode_template_css();
    7071
    7172            if( $code["template"])  {
     
    153154            unset($_REQUEST["ch-price-min"]);
    154155            unset($_REQUEST["ch-price-max"]);
     156            unset($_REQUEST["ch_exclude"]);
    155157            return $content;
    156158
     
    164166            global $wp_query, $Post_Type_Chronosly, $pastformat;
    165167            $pastformat = 0;//para enseñar en formato eventos pasados
     168            $wp_queryold = $wp_query;
    166169            if(isset($_REQUEST["chronosly_event_list_time"]) and $_REQUEST["chronosly_event_list_time"] == "past"){
    167170               $pastformat = 1;
     
    188191            }
    189192            if($args["exclude"]) {
    190                 $q["post__not_in"] = explode(",",$args["exclude"]);
     193                $_REQUEST["ch_exclude"] = $q["post__not_in"] = explode(",",$args["exclude"]);
    191194            }
    192195            if($args["category"]) {
     
    237240            switch($type){
    238241                case "calendar":
    239                    
     242                     if(!$args["base"] && (stripos("http://".$_SERVER[HTTP_HOST].$_SERVER[REQUEST_URI], Post_Type_Chronosly_Calendar::get_permalink()) !== FALSE ||
     243                        stripos("https://".$_SERVER[HTTP_HOST].$_SERVER[REQUEST_URI], Post_Type_Chronosly_Calendar::get_permalink()) !== FALSE)) return;
     244
    240245                    if ( is_user_logged_in() ) new WP_Query("post_type=chronosly_calendar&post_status=publish,private");
    241246                    else $wp_query = new WP_Query("post_type=chronosly_calendar");
     
    427432            }
    428433            wp_reset_query();//reset the query status
     434            $wp_query = $wp_queryold;
    429435        }
    430436
  • chronosly-events-calendar/trunk/classes/chronosly_templates.php

    r1316864 r1370252  
    6767
    6868        public function set_front_css(){
     69           
    6970            if($handle = opendir(CHRONOSLY_TEMPLATES_PATH.DIRECTORY_SEPARATOR."css".DIRECTORY_SEPARATOR)) {
    7071                while (false !== ($entry = readdir($handle))) {
     
    9293        //load de json with tmplate info
    9394        public function load_template_settings($templates, $array = 0){
     95
    9496            $return = "";
    9597            foreach($templates as $t){
     
    268270
    269271        public function get_tipo_template($id, $vista){
     272            // echo "$id, $vista";
    270273            $vars = unserialize(get_option("chronosly-settings"));
    271274            if($vista != "dad11" and $vista != "dad12") $template = @get_post_meta($id, $vista, true);
    272275            else {
    273276                $template = @get_option('chronosly-taxonomy-'.$vista.'_'.$id);
    274                 $template = unserialize($template);
     277                if($template2 = unserialize($template)) $template = $template2;
    275278                if(count($template)) $template = $template[0];
    276279            }
    277280            if($template) {
     281                // echo "entra";
    278282                if(strlen($template) < 50 and stripos( $template,"template-")!== FALSE) return str_replace("template-", "", $template);
    279283                else return "chbd";
     
    294298                if(strlen($template) < 50 and stripos( $template,"template-")!== FALSE) return str_replace("template-", "", $template);
    295299                else  {
    296                     $v = json_decode(str_replace(array('\\"', "\\'"), array('"',"'"), $template));
    297                     return $v->base;
     300                    $content = str_replace(array('\\"', "\\'"), "'", $template);
     301                    if(!json_decode(stripslashes($content))) {
     302                        $content =json_decode(stripslashes(str_replace(array('\\"', "\\'"), array('"',"'"),$template)));
     303                    }
     304                    return $content->base;
    298305                }
    299306            }
     
    632639                    if($template == "chbd"){
    633640                        //se trata de un template editado, cargamos los datos del template
    634                         $data = str_replace(array('\\"', "\\'"), array('"',"'"),$this->get_template($id, $vista));
     641                        $data = str_replace(array('\\"', "\\'"), "'", $this->get_template($id, $vista));
     642                        if(!json_decode(stripslashes($data))) {
     643                            $data =str_replace(array('\\"', "\\'"), array('"',"'"),$this->get_template($id, $vista));
     644                        }
    635645                    }
    636646
    637                     $this->render_template($template, $style, $vista, json_decode($data), $draganddropels, $html2 );
     647                    $this->render_template($template, $style, $vista, json_decode(stripslashes($data)), $draganddropels, $html2 );
    638648
    639649                }
     
    687697
    688698        //retrieve template vars from file
    689        private function get_template_vars($file){
     699        private function get_template_vars($file){
    690700            $f = @fopen($file, "r");
    691701            $content =str_replace(array('\\"', "\\'"), "'",@fread($f, filesize($file)));
     
    730740            if($this->vars->vista != "dad11" and $this->vars->vista != "dad12" ) $this->vars->metas = get_post_meta($this->vars->pid);//assing metas vars
    731741
    732             if(isset($this->vars->metas['organizer'])){
     742            if(isset($this->vars->metas['organizer']) && $this->vars->metas['organizer'][0]){
    733743                foreach($this->vars->metas['organizer'] as $orgs){
    734744                    $orgs = unserialize($orgs);
     
    751761            }
    752762
    753             if(isset($this->vars->metas['places'])){
     763            if(isset($this->vars->metas['places']) && $this->vars->metas['places'][0]){
    754764                foreach($this->vars->metas['places'] as $orgs){
    755765                    $orgs = unserialize($orgs);
     
    815825
    816826                foreach($this->vars->args as $k => $v){
     827                   
    817828                    switch($k){
    818829                        case "id":
     
    822833                            break;
    823834                        case "start":
     835                        // echo $v."<br>";
    824836                            $this->vars->metas['ev-from'][0] = date("Y-m-d",$v);
    825837                            //echo date("Y-m-d",$v)." ".$v;
  • chronosly-events-calendar/trunk/js/front.js

    r1244927 r1370252  
    203203        );
    204204    }
    205    onload_calendar();});
     205   onload_calendar();
     206});
    206207
    207208function ch_load_calendar(url, id){
    208     jQuery(".ch_js_loader.id"+id+" .chronosly-content-block").html( "<div class='ch-spinner'></div>" );
     209      jQuery(".ch_js_loader.id"+id+" .chronosly-content-block").html( "<div class='ch-spinner'></div>" );
    209210    jQuery(".ch_js_loader.id"+id).html("<div class='ch-spinner'></div>" );
    210211    if(!url) url = translated1.calendarurl;
     
    214215        //jQuery(".ch_js_loader").hide().html( data ).slideDown(3000);
    215216        var content = "";
    216        
    217         if(jQuery(".ch_js_loader.id"+id+" .chronosly-content-block").length) {
     217       if(jQuery(".ch_js_loader.id"+id).length) {
    218218            if(jQuery(data).find(".chronosly-content-block").length) content = jQuery(data).find(".chronosly-content-block");
    219219            else content = jQuery(data);
    220             jQuery(".ch_js_loader.id"+id+" .chronosly-content-block").html(content);
     220             if(jQuery(".ch_js_loader.id"+id+" .chronosly-content-block").lenght) jQuery(".ch_js_loader.id"+id+" .chronosly-content-block").html(content);
     221            else jQuery(".ch_js_loader.id"+id).html(content);
    221222            if(jQuery(".ch_js_loader.id"+id+" .ch-fas-form").length){
    222223                jQuery(".ch_js_loader.id"+id+" input[name='from']").val(content.find(".ch_from").html());
  • chronosly-events-calendar/trunk/languages/custom_strings.php

    r1256000 r1370252  
    88__("Open map", "chronosly");
    99__("View ", "chronosly");
     10__("more", "chronosly");
  • chronosly-events-calendar/trunk/metaboxes/chronosly_tickets_metabox.php

    r1202016 r1370252  
    55            <span class='edit'><?php _e("edit", "chronosly");?></span><span class='delete'><?php _e("delete", "chonosly");?></span>
    66           
    7         </div><input type='text'  class='title'  name='title' value='' /><input    type='text' class='price' name='price' value='' /><input type="text" class="price" name="sales-price" value="" /><input   type='text' class='capacity' name='capacity' value='' /><input type="text" class="link" name="link" value="" /><br/><textarea name='notes' class='notes'></textarea>
     7        </div><input type='text'  class='title'  name='title' value='' /><input    type='text' class='price' name='price' value='' /><input type="text" class="price" name="sales-price" value="" /><input   type='text' class='currency' name='currency' value='<?php echo $currency; ?>' /><input   type='text' class='capacity' name='capacity' value='' /><input type="text" class="link" name="link" value="" /><br/><textarea name='notes' class='notes'></textarea>
    88       </li>
    99</div>
     
    1313
    1414    // echo "<li class='ticket-head'><span class='title'>".__("Title","chronosly")."</span><span class='price'>".__("Price","chronosly")."</span><span class='capacity'>".__("Capacity","chronosly")."</span><span class='min-user'>".__("Min.","chronosly")."</span><span class='max-user'>".__("Max.","chronosly")."</span><span class='start-time'>".__("From","chronosly")."</span><span class='end-time'>".__("To","chronosly")."</span><span class='link'>".__("Link","chronosly")."</span></li>";
    15     echo "<li class='ticket-head'><span class='title'>".__("Title","chronosly")."</span><span class='price'>".__("Price","chronosly")."</span><span class='price'>".__("Sale Price","chronosly")."</span><span class='capacity'>".__("Capacity","chronosly")."</span><span class='link'>".__("Link","chronosly")."</span></li>";
     15    echo "<li class='ticket-head'><span class='title'>".__("Title","chronosly")."</span><span class='price'>".__("Price","chronosly")."</span><span class='price'>".__("Sale Price","chronosly")."</span><span class='currency'>".__("Currency","chronosly")."</span><span class='capacity'>".__("Capacity","chronosly")."</span><span class='link'>".__("Link","chronosly")."</span></li>";
    1616
    1717    if(isset($vars->tickets)){
     
    3131            ."<input  readonly  type='text' class='price' name='price' value='".$ticket["price"]."' />"
    3232            ."<input  readonly type='text' class='price' name='sales-price' value='".$ticket["sales-price"]."' />"
     33            ."<input readonly  type='text' class='currency' name='currency' value='".$ticket["currency"]."' />"
    3334            ."<input readonly  type='text' class='capacity' name='capacity' value='".$ticket["capacity"]."' />"
    34             // ."<input readonly  type='text' class='min-user' name='min-user' value='".$ticket["min-user"]."' />"
    3535            // ."<input  readonly type='text' class='max-user' name='max-user' value='".$ticket["max-user"]."' />"
    3636            // ."<input  readonly type='text' class='sales-start-time' name='start-time' value='".$ticket["start-time"]."' />"
     
    4848    <?php _e("PRICE: Show ticket prices, also change currency and availability", "chronosly");?><br/><br/>
    4949    <?php _e("SALE PRICE: Set discounted price for the ticket, enable checking on sale.", "chronosly");?><br/><br/>
     50    <?php _e("CURRENCY: Set different currencies for tickets", "chronosly");?><br/><br/>
    5051    <?php _e("SALE: Active sale price", "chronosly");?><br/><br/>
    5152    <?php _e("SOLD OUT: Set ticket sold out", "chronosly");?><br/><br/>
  • chronosly-events-calendar/trunk/metaboxes/settings/settings.php

    r1202016 r1370252  
    124124              <input type="hidden" name="chronosly-base-templates-id" value="<?php echo $vars['chronosly-base-templates-id'] ?>" />
    125125              <br/> <br/>
     126              <label> <?php _e("Solve memory limit on admin", "chronosly")?></label> <input type="checkbox" name="chronosly_admin_memory_limit" value="1" <?php if(isset($vars['chronosly_admin_memory_limit']) and $vars['chronosly_admin_memory_limit']) echo "checked" ?> /><span class="info"></span>           <div class="info-hide"><?php _e("Some sites with low memory servers will need to active this to reduce the memory consumption on admin panels. If your admin panels throws an Allowed memory size exhausted you should active it.", "chronosly");?></div><br/>
    126127              <label> <?php _e("Disable jquery admin", "chronosly")?></label> <input type="checkbox" name="jquery-admin-disable" value="1" <?php if(isset($vars['jquery-admin-disable']) and $vars['jquery-admin-disable']) echo "checked" ?> /><span class="info"></span>           <div class="info-hide"><?php _e("Disable jquery script if another plugins adds jquery source(this will prevent incompatibilities and source code duplication)", "chronosly");?></div><br/>
    127128              <label> <?php _e("Disable gmap script", "chronosly")?></label> <input type="checkbox" name="chronosly-disable-gmap-js" value="1" <?php if(isset($vars['chronosly-disable-gmap-js']) and $vars['chronosly-disable-gmap-js']) echo "checked" ?> /><span class="info"></span>           <div class="info-hide"><?php _e("Disable Google maps script if you already have Gmap on your theme (this will prevent incompatibilities and source code duplication)", "chronosly");?></div><br/>
  • chronosly-events-calendar/trunk/post-types/post_type_chronosly.php

    r1329732 r1370252  
    891891            switch($ordertype ){
    892892                case "date":
    893                     //se podria añadir el order por order en vez de por time
    894893                    $pos = $id;//max id = 99999
    895894                  //  141773760 00000
    896895                    $pos += $time*10000;
    897896                    //echo $time;
    898                     if(isset($meta["ev-from-h"][0]) and $meta["ev-from-h"][0] != "") $pos += $meta["ev-from-h"][0]*60*60*10000;
     897                    if($h < 0 && $m < 0){
     898                        if(isset($meta["ev-from-h"][0]) and $meta["ev-from-h"][0] != "") $pos += $meta["ev-from-h"][0]*60*60*10000;
     899                        if(isset($meta["ev-from-m"][0])) $pos += $meta["ev-from-m"][0]*10000*60;
     900                    } else {
     901                        //no se suma nada porque ya esta en time de las seasons
     902                        // $pos += $h*60*60*10000;
     903                        // $pos += $m*10000*60;
     904                    }
    899905//                    else $pos += 10000000;
    900                     if(isset($meta["ev-from-m"][0])) $pos += $meta["ev-from-m"][0]*10000*60;
    901                     if($settings["chronosly_featured_first"] and !$pastformat and (!isset($meta["featured"][0]) or $meta["featured"][0] != 1)) $pos += 10000000000000;
     906                    if( $settings["chronosly_featured_first"] and !$pastformat and (!isset($meta["featured"][0]) or $meta["featured"][0] != 1)) $pos += 10000000000000;
    902907                    if($pastformat or $_REQUEST["orderdir"] == "DESC") $pos = 10000000000000-$pos;
    903                     break;
     908                 break;
    904909                case "order":
    905910                    if(isset($meta["order"][0]) and $meta["order"][0] != "") $pos += $meta["order"][0]*100000;
     
    10471052                   
    10481053                     if(class_exists("Chronosly_Tickets_and_Repeats_Extended") and isset($meta["events"][0])){
    1049                         if($_REQUEST["repeats_past_hide"]) $from = date("Y-m-d");
     1054                        if($_REQUEST["repeats_past_hide"] and time() > strtotime($from)) {
     1055                            $from = date("Y-m-d");
     1056                        }
    10501057                        $eventos = json_decode($meta["events"][0]);
    10511058                        $find = 0;
     
    13761383
    13771384        public static function insert_og_in_head() {
    1378             global $post;
    1379 
    1380             if(!stripos($post->post_content, "chronoslybase")) return ;
    1381 
    1382             remove_action( 'wp_head', 'rel_canonical' );
    1383             $settings = unserialize(get_option("chronosly-settings"));
    1384 
    1385              if( isset($settings["chronosly-base-templates-id"]) and $settings["chronosly-base-templates-id"] != 0 and !isset($_REQUEST["js_render"])){
    1386                 if ( !is_singular()) //if it is not a post or a page
    1387                     return;
    1388                     echo '<meta property="og:title" content="' . get_the_title() . '"/>';
    1389                     echo '<meta property="og:type" content="article"/>';
    1390                     echo '<meta property="og:url" content="' . get_permalink($post->ID) . '"/>';
    1391                     echo "<link rel='canonical' href='".get_permalink($post->ID)."' />";
    1392 
    1393                     // echo '<meta property="og:site_name" content="Your Site NAME Goes HERE"/>';
    1394                 if(has_post_thumbnail( $post->ID )) {
    1395                    $thumbnail_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'medium' );
    1396                     echo '<meta property="og:image" content="' . esc_attr( $thumbnail_src[0] ) . '"/>';
    1397                 }
    1398                 echo "\r\n";
    1399             }
    1400         }
     1385        global $post;
     1386
     1387        $settings = unserialize(get_option("chronosly-settings"));
     1388        if((!isset($settings["chronosly-display-ogmetas"]) || !$settings["chronosly-display-ogmetas"]) &&  !stripos($post->post_content, "chronoslybase")) return ;
     1389
     1390        remove_action( 'wp_head', 'rel_canonical' );
     1391
     1392         if( ($settings["chronosly-display-ogmetas"] || (isset($settings["chronosly-base-templates-id"]) and $settings["chronosly-base-templates-id"] != 0 )) and !$_REQUEST["js_render"]){
     1393            if ( !is_singular()) //if it is not a post or a page
     1394                return;
     1395                echo '<meta property="og:title" content="' . get_the_title() . '"/>';
     1396                echo '<meta property="og:type" content="article"/>';
     1397                echo '<meta property="og:url" content="' . get_permalink($post->ID) . '"/>';
     1398                echo "<link rel='canonical' href='".get_permalink($post->ID)."' />";
     1399
     1400                // echo '<meta property="og:site_name" content="Your Site NAME Goes HERE"/>';
     1401                $thumb = "";
     1402            if(has_post_thumbnail( $post->ID )) {
     1403               $thumbnail_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'medium' );
     1404               $thumb = esc_attr( $thumbnail_src[0] );
     1405            }
     1406           if(!$thumb) {
     1407                if(class_exists("Chronosly_Social_Media_Share")){
     1408                    $settingsSM = unserialize(get_option("chronosly_settings_social_media_share"));
     1409                    $thumb = $settingsSM["default_image"];
     1410                }
     1411           }
     1412            if($thumb) echo '<meta property="og:image" content="' . $thumb . '"/>';
     1413            echo "\r\n";
     1414        }
     1415    }
    14011416
    14021417
     
    23552370                } elseif ('ticket' == $metabox['args']['type']) {
    23562371                    $vars = json_decode(@get_post_meta($post->ID, "tickets", true));
     2372                     $settings = unserialize(get_option("chronosly-settings"));
     2373                    $currency = $settings["chronosly_currency"];
     2374
    23572375                    require_once(CHRONOSLY_PATH.DIRECTORY_SEPARATOR."metaboxes".DIRECTORY_SEPARATOR.self::POST_TYPE."_tickets_metabox.php");
    23582376
  • chronosly-events-calendar/trunk/post-types/post_type_chronosly_calendar.php

    r1329607 r1370252  
    226226                        }//si no empezamos en el primer dia del año
    227227                        else $end = strtotime("31-12-".$year);
     228                        $end_top = strtotime("31-12-".$year);
    228229                        if($settings["chronosly_week_start"] == 1) {
    229230                            //$start -= (60*60*24);
     
    232233
    233234                        $start_ini = $start;
    234 
     235                        $endHours = $end + ($meta["ev-to-h"][0]*60*60) + ($meta["ev-to-m"][0]*60);
    235236                        $pos = Post_Type_Chronosly_Calendar::get_event_position_by_hour($meta, get_the_ID());
    236237                        do{
    237238                            if($settings["hide_past_on_calendar"] != 1 or $start>= strtotime(date("Y-m-d"))) {$elements["days"][date('Y-m-d',$start)][$pos]= get_the_ID();}
    238239                            $start = strtotime("+ 1 day",$start);
    239                         }while ( $start<=$end );
     240                        }while ( $start<=$end and ($endHours < $end_top or date('Y-m-d',$start) != date('Y-m-d',$endHours)));
    240241
    241242                        //repeats
     
    284285                        }//si no acabamos en el ultimo dia del mes
    285286                        else $end = $top;
     287                        $end_top = $top;
    286288
    287289                        if($settings["chronosly_week_start"] == 1) {
     
    292294                        $start_ini = $start;
    293295                        $pos = Post_Type_Chronosly_Calendar::get_event_position_by_hour($meta, get_the_ID());
    294 
     296                        $endHours = $end + ($meta["ev-to-h"][0]*60*60) + ($meta["ev-to-m"][0]*60);
    295297                        do{
    296298                            $elements["days"][date('Y-m-d',$start)][$pos]= get_the_ID();
    297299                            $start = strtotime("+ 1 day",$start);
    298                         }while ( $start<=$end );
     300                        }while ( $start<=$end and ($endHours < $end_top or date('Y-m-d',$start) != date('Y-m-d',$endHours))  );
    299301
    300302                        //repeats
     
    331333                        }//si no acabamos en el ultimo dia del mes
    332334                        else $end = strtotime(date("Y-m-t", strtotime($year."-".$month)));
     335                        $end_top = strtotime(date("Y-m-t", strtotime($year."-".$month)));
    333336
    334337                        if($settings["chronosly_week_start"] == 1) {
     
    338341
    339342                        }
     343
    340344                        $start_ini = $start;
    341345                        $pos = Post_Type_Chronosly_Calendar::get_event_position_by_hour($meta, get_the_ID());
    342 
     346                        $endHours = $end + ($meta["ev-to-h"][0]*60*60) + ($meta["ev-to-m"][0]*60);
    343347                        do{
    344348                            $elements["days"][date('Y-m-d',$start)][$pos]= get_the_ID();
    345349                            $start = strtotime("+ 1 day",$start);
    346                         }while ( $start<=$end );
     350                        }while ( $start<=$end and ($endHours < $end_top or date('Y-m-d',$start) != date('Y-m-d',$endHours)));
    347351
    348352                        //repeats
     
    362366                while ( $query->have_posts() ){
    363367                    $query->the_post();
    364                     if(is_array($elements["ids"]) and in_array(get_the_ID(), $elements["ids"])) continue;//if the day is already done.
     368                    // if(is_array($elements["ids"]) and in_array(get_the_ID(), $elements["ids"])) continue;//if the day is already done.
    365369                    $meta = get_post_meta(get_the_ID());
    366370                    if(isset($meta["ev-from"][0])){
     
    383387                while ( $query->have_posts() ){
    384388                    $query->the_post();
    385                     if(is_array($elements["ids"]) and in_array(get_the_ID(), $elements["ids"])) continue;//if the day is already done.
     389                    // if(is_array($elements["ids"]) and in_array(get_the_ID(), $elements["ids"])) continue;//if the day is already done.
    386390                    $meta = get_post_meta(get_the_ID());
    387391
     
    397401                           // $end -= (60*60*24);
    398402                        }
    399 
     403                        // echo get_the_ID()." ".date("d-m-Y ", $start)."<br/>";
    400404
    401405                        //do repeats
     
    408412                while ( $query->have_posts() ){
    409413                    $query->the_post();
    410                     if(is_array($elements["ids"]) and in_array(get_the_ID(), $elements["ids"])) continue;//if the day is already done.
     414                    // if(is_array($elements["ids"]) and in_array(get_the_ID(), $elements["ids"])) continue;//if the day is already done.
    411415
    412416                    $meta = get_post_meta(get_the_ID());
     
    434438
    435439        public static function repeats($meta, $year, $month, $week, $start, $end, $id, $elements, $repeated=0){
     440                                        // echo $id." ".date('Y-m-d H:i',$start)." ".date('Y-m-d H:i',$end)." ".date('Y-m-d H:i',$end_top)."<br/>";
     441
    436442            $settings =  unserialize(get_option("chronosly-settings"));
    437443            $pos = Post_Type_Chronosly_Calendar::get_event_position_by_hour($meta, $id);
     
    455461                        $end_top = strtotime($meta["ev-until"][0]);
    456462                    }
     463                    // echo $end_top;
    457464                    // if($settings["chronosly_week_start"] == 1) {
    458465                    //     // $start_min -= (60*60*24);
     
    487494                            $start1 = $start;
    488495                            $end = $start+$event_days;//recalculamos el final
     496                             $endHours = $end + ($meta["ev-to-h"][0]*60*60) + ($meta["ev-to-m"][0]*60);
    489497                            --$count;
    490498                            while($start <= $end and $start <= $end_top){//rellenamos los dias de este tramo
    491                                 if($start >= $start_min and ($settings["hide_past_on_calendar"] != 1 or $start>= strtotime(date("Y-m-d")))) $elements["days"][date('Y-m-d',$start)][$pos]= array("id" => $id, "start" => $start1, "end" => $end );
     499                                if($start >= $start_min and ($endHours < $end_top or date('Y-m-d',$start) != date('Y-m-d',$endHours)) and ($settings["hide_past_on_calendar"] != 1 or $start>= strtotime(date("Y-m-d")))) $elements["days"][date('Y-m-d',$start)][$pos]= array("id" => $id, "start" => $start1, "end" => $end );
    492500                                $start = strtotime("+ 1 day",$start);
    493501                                //echo date('Y-m-d',$start)." ".date('Y-m-d',$end)."<br/>";
     
    501509
    502510                        while($start < $end_top and $count){//mientras no estemos en el tope superior
     511                            // echo $id." ".date('Y-m-d H:i',$start)." ".date('Y-m-d H:i',$endHours)." ".date('Y-m-d H:i',$end_top)."<br/>";
     512                            // echo $event_days;
    503513                            $start += ($distance*7*60*60*24)-$event_days;//añadimos la distancia de semanas, restando los dias que dura el evento...si el evento dura mas de una semana es un total absurdo usarlo
    504514                            $start1 = $start;
    505515
    506516                            $end = $start+$event_days;//recalculamos el final
     517                            $endHours = $end + ($meta["ev-to-h"][0]*60*60) + ($meta["ev-to-m"][0]*60);
    507518                            --$count;
    508519                            //echo date('Y-m-d',$start)." ".date('Y-m-d',$end)."<br/>";
    509520                            while($start <= $end and $start <= $end_top){//rellenamos los dias de este tramo
    510                                 if((!$repeated or $start >= $start_min) and ($settings["hide_past_on_calendar"] != 1 or $start>= strtotime(date("Y-m-d")))) $elements["days"][date('Y-m-d',$start)][$pos]= array("id" => $id, "start" => $start1, "end" => $end );
     521                                if((!$repeated or $start >= $start_min) and ($endHours < $end_top or date('Y-m-d',$start) != date('Y-m-d',$endHours)) and ($settings["hide_past_on_calendar"] != 1 or $start>= strtotime(date("Y-m-d")))) $elements["days"][date('Y-m-d',$start)][$pos]= array("id" => $id, "start" => $start1, "end" => $end );
     522                               // echo $id." ".date('Y-m-d H:i',$start)." ".date('Y-m-d H:i',$endHours)." ".date('Y-m-d H:i',$end_top)."<br/>";
     523
    511524                                $start = strtotime("+ 1 day",$start);
    512525                                //echo date('Y-m-d',$start)." ".date('Y-m-d',$end)."<br/>";
     
    521534                            $start = strtotime("+$distance month", $start)-$event_days;//añadimos la distancia de semanas, restando los dias que dura el evento...si el evento dura mas de una semana es un total absurdo usarlo
    522535                            $start1 = $start;
    523 
     536                            // echo $event_days;
    524537                            $end = $start+$event_days;//recalculamos el final
     538                            $endHours = $end + ($meta["ev-to-h"][0]*60*60) + ($meta["ev-to-m"][0]*60);
     539
    525540                            --$count;
    526541                            //echo date('Y-m-d',$start)." ".date('Y-m-d',$end)."<br/>";
    527542                            while($start <= $end and $start <= $end_top){//rellenamos los dias de este tramo
    528                                 if((!$repeated or $start >= $start_min) and ($settings["hide_past_on_calendar"] != 1 or $start>= strtotime(date("Y-m-d")))) $elements["days"][date('Y-m-d',$start)][$pos]= array("id" => $id, "start" => $start1, "end" => $end );
     543                                if((!$repeated or $start >= $start_min) and ($endHours < $end_top or date('Y-m-d',$start) != date('Y-m-d',$endHours)) and ($settings["hide_past_on_calendar"] != 1 or $start>= strtotime(date("Y-m-d")))) $elements["days"][date('Y-m-d',$start)][$pos]= array("id" => $id, "start" => $start1, "end" => $end );
     544                                // echo $id." ".date('Y-m-d H:i',$start)." ".date('Y-m-d H:i',$endHours)." ".date('Y-m-d H:i',$end_top)."<br/>";
    529545                                $start = strtotime("+ 1 day",$start);
    530                                 //echo date('Y-m-d',$start)." ".date('Y-m-d',$end)."<br/>";
    531546                            }
    532547                            $start = strtotime("- 1 day",$start);//restamos un dia porque si no el ultimo dia no se cuenta al salir del bucle
     
    541556
    542557                            $end = $start+$event_days;//recalculamos el final
     558                             $endHours = $end + ($meta["ev-to-h"][0]*60*60) + ($meta["ev-to-m"][0]*60);
    543559                            --$count;
    544560                            //echo date('Y-m-d',$start)." ".date('Y-m-d',$end)."<br/>";
    545                             while($start <= $end and $start <= $end_top){//rellenamos los dias de este tramo
    546                                 if((!$repeated or $start >= $start_min) and ($settings["hide_past_on_calendar"] != 1 or $start>= strtotime(date("Y-m-d")))) $elements["days"][date('Y-m-d',$start)][$pos]= array("id" => $id, "start" => $start1, "end" => $end );
     561                            while($start <= $end and $start <= $end_top ){//rellenamos los dias de este tramo
     562                                if((!$repeated or $start >= $start_min) and ($endHours < $end_top or date('Y-m-d',$start) != date('Y-m-d',$endHours)) and ($settings["hide_past_on_calendar"] != 1 or $start>= strtotime(date("Y-m-d")))) $elements["days"][date('Y-m-d',$start)][$pos]= array("id" => $id, "start" => $start1, "end" => $end );
    547563                                $start = strtotime("+ 1 day",$start);
    548564                                //echo date('Y-m-d',$start)." ".date('Y-m-d',$end)."<br/>";
     
    868884            if( $_REQUEST["event_name"]) {
    869885                 $args['post_title_like'] =$_REQUEST["event_name"];
     886            }
     887            if( $_REQUEST["ch_exclude"]) {
     888                 $args['post__not_in'] =$_REQUEST["ch_exclude"];
    870889            }
    871890
Note: See TracChangeset for help on using the changeset viewer.