Changeset 1370252
- Timestamp:
- 03/13/2016 06:58:01 PM (10 years ago)
- Location:
- chronosly-events-calendar
- Files:
-
- 18 edited
- 13 copied
-
tags/2.3.3 (copied) (copied from chronosly-events-calendar/trunk)
-
tags/2.3.3/README.txt (copied) (copied from chronosly-events-calendar/trunk/README.txt) (1 diff)
-
tags/2.3.3/README.txt~ (copied) (copied from chronosly-events-calendar/trunk/README.txt~) (1 diff)
-
tags/2.3.3/chronosly.php (copied) (copied from chronosly-events-calendar/trunk/chronosly.php) (3 diffs)
-
tags/2.3.3/classes/chronosly_dad_elements.php (copied) (copied from chronosly-events-calendar/trunk/classes/chronosly_dad_elements.php) (3 diffs)
-
tags/2.3.3/classes/chronosly_extend.php (copied) (copied from chronosly-events-calendar/trunk/classes/chronosly_extend.php)
-
tags/2.3.3/classes/chronosly_settings.php (modified) (1 diff)
-
tags/2.3.3/classes/chronosly_shortcode.php (copied) (copied from chronosly-events-calendar/trunk/classes/chronosly_shortcode.php) (8 diffs)
-
tags/2.3.3/classes/chronosly_templates.php (copied) (copied from chronosly-events-calendar/trunk/classes/chronosly_templates.php) (10 diffs)
-
tags/2.3.3/classes/chronosly_widgets.php (copied) (copied from chronosly-events-calendar/trunk/classes/chronosly_widgets.php)
-
tags/2.3.3/custom-templates/dad2/default.html (copied) (copied from chronosly-events-calendar/trunk/custom-templates/dad2/default.html)
-
tags/2.3.3/custom-templates/dad2/default_featured.html (copied) (copied from chronosly-events-calendar/trunk/custom-templates/dad2/default_featured.html)
-
tags/2.3.3/js/front.js (modified) (2 diffs)
-
tags/2.3.3/languages/custom_strings.php (modified) (1 diff)
-
tags/2.3.3/metaboxes/chronosly_tickets_metabox.php (modified) (4 diffs)
-
tags/2.3.3/metaboxes/settings/settings.php (modified) (1 diff)
-
tags/2.3.3/post-types/post_type_chronosly.php (copied) (copied from chronosly-events-calendar/trunk/post-types/post_type_chronosly.php) (4 diffs)
-
tags/2.3.3/post-types/post_type_chronosly_calendar.php (copied) (copied from chronosly-events-calendar/trunk/post-types/post_type_chronosly_calendar.php) (17 diffs)
-
trunk/README.txt (modified) (1 diff)
-
trunk/README.txt~ (modified) (1 diff)
-
trunk/chronosly.php (modified) (3 diffs)
-
trunk/classes/chronosly_dad_elements.php (modified) (3 diffs)
-
trunk/classes/chronosly_settings.php (modified) (1 diff)
-
trunk/classes/chronosly_shortcode.php (modified) (8 diffs)
-
trunk/classes/chronosly_templates.php (modified) (10 diffs)
-
trunk/js/front.js (modified) (2 diffs)
-
trunk/languages/custom_strings.php (modified) (1 diff)
-
trunk/metaboxes/chronosly_tickets_metabox.php (modified) (4 diffs)
-
trunk/metaboxes/settings/settings.php (modified) (1 diff)
-
trunk/post-types/post_type_chronosly.php (modified) (4 diffs)
-
trunk/post-types/post_type_chronosly_calendar.php (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
-
chronosly-events-calendar/tags/2.3.3/README.txt
r1329627 r1370252 6 6 Requires at least: 3.1 7 7 Tested up to: 4.4.1 8 Stable tag: 2.3. 18 Stable tag: 2.3.3 9 9 License: GPLv2 10 10 -
chronosly-events-calendar/tags/2.3.3/README.txt~
r1329627 r1370252 6 6 Requires at least: 3.1 7 7 Tested up to: 4.4.1 8 Stable tag: 2.3. 08 Stable tag: 2.3.1 9 9 License: GPLv2 10 10 -
chronosly-events-calendar/tags/2.3.3/chronosly.php
r1329607 r1370252 4 4 * Plugin URI: http://www.chronosly.com 5 5 * 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. 26 * Version: 2.3.3 7 7 * Author: Heimsveld IPBN 8 8 * Author URI: http://www.heimsveld.com … … 26 26 define('CHRONOSLY_TEMPLATES_URL', plugins_url()."/chronosly-templates"); //path para incluir scripts o css 27 27 define('CHRONOSLY_DEBUG', false); //debug mode 28 define('CHRONOSLY_VERSION', "2.3. 2"); //debug mode28 define('CHRONOSLY_VERSION', "2.3.3"); //debug mode 29 29 define('CHRONOSLY_ADMIN_INTERFACE', 1); //Todo: hacer diferentes interficies de admin simple o varios event 30 30 define('CHRONOSLY_ADMIN_MODALITY', 1); //Todo: hacer diferentes modalidades segun la tematica … … 72 72 } 73 73 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 } 76 78 require_once(CHRONOSLY_PATH.DIRECTORY_SEPARATOR."classes".DIRECTORY_SEPARATOR."chronosly_dad_elements.php"); 77 79 $dad_elements = new Chronosly_Dad_Elements(); -
chronosly-events-calendar/tags/2.3.3/classes/chronosly_dad_elements.php
r1329732 r1370252 4331 4331 4332 4332 // print_r($tik); 4333 4333 $currency = $settings["chronosly_currency"]; 4334 if($tick["currency"]) $currency = $tick["currency"]; 4334 4335 $ret.= "<ul>"; 4335 4336 $ret.= "<li class='title'><i class='fa fa-ticket'></i> " . $tik["title"] . "</li>"; 4336 4337 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>"; 4339 4340 $ret.= "<li class='capacity'>" . $tik["capacity"] . "</li>"; 4340 4341 // $ret.= "<li class='min'>" . $tik["min-user"] . "</li>"; … … 5134 5135 5135 5136 } 5136 5137 $currency = $settings["chronosly_currency"]; 5138 if($vars->metas['tickets_vars'][$value]["currency"]) $currency = $vars->metas['tickets_vars'][$value]["currency"]; 5137 5139 $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'))); 5139 5141 if ($length > 1) $currency_type = "$length"; 5140 5142 $ant = ""; … … 5150 5152 $price = $v["price"]; 5151 5153 $value = $k; 5154 if($v["currency"]) $currency = $v["currency"]; 5155 5152 5156 } 5153 5157 } 5154 5158 } 5155 5159 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 5156 5162 $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>"; 5158 5164 } 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>"; 5160 5166 } 5161 5167 -
chronosly-events-calendar/tags/2.3.3/classes/chronosly_settings.php
r1235318 r1370252 162 162 "chronosly-cats-flushed" => 0, 163 163 "chronosly-tags-flushed" => 0, 164 164 "chronosly_admin_memory_limit" => 0, 165 165 166 166 -
chronosly-events-calendar/tags/2.3.3/classes/chronosly_shortcode.php
r1329732 r1370252 28 28 global $chshortcode; 29 29 if(!$chshortcode) return ""; 30 return do_shortcode("[chronosly $chshortcode ]");30 return do_shortcode("[chronosly $chshortcode base=1]"); 31 31 } 32 32 … … 57 57 'after_events' => 0, 58 58 'show_past' => 0, 59 'template' => '' //use another template on shortcode 59 'template' => '', //use another template on shortcode 60 'base' => '' //is a the base shortcode 60 61 ); 61 62 $args = apply_filters("chronosly-shortcode-extra-params", $args); … … 67 68 $_REQUEST["small"] = $code["small"]; 68 69 $_REQUEST["navigation"] = $code["navigation"]; 69 Chronosly_Templates::set_shortcode_template_css();70 if(stripos($type, "format") === FALSE) Chronosly_Templates::set_shortcode_template_css(); 70 71 71 72 if( $code["template"]) { … … 153 154 unset($_REQUEST["ch-price-min"]); 154 155 unset($_REQUEST["ch-price-max"]); 156 unset($_REQUEST["ch_exclude"]); 155 157 return $content; 156 158 … … 164 166 global $wp_query, $Post_Type_Chronosly, $pastformat; 165 167 $pastformat = 0;//para enseñar en formato eventos pasados 168 $wp_queryold = $wp_query; 166 169 if(isset($_REQUEST["chronosly_event_list_time"]) and $_REQUEST["chronosly_event_list_time"] == "past"){ 167 170 $pastformat = 1; … … 188 191 } 189 192 if($args["exclude"]) { 190 $ q["post__not_in"] = explode(",",$args["exclude"]);193 $_REQUEST["ch_exclude"] = $q["post__not_in"] = explode(",",$args["exclude"]); 191 194 } 192 195 if($args["category"]) { … … 237 240 switch($type){ 238 241 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 240 245 if ( is_user_logged_in() ) new WP_Query("post_type=chronosly_calendar&post_status=publish,private"); 241 246 else $wp_query = new WP_Query("post_type=chronosly_calendar"); … … 427 432 } 428 433 wp_reset_query();//reset the query status 434 $wp_query = $wp_queryold; 429 435 } 430 436 -
chronosly-events-calendar/tags/2.3.3/classes/chronosly_templates.php
r1316864 r1370252 67 67 68 68 public function set_front_css(){ 69 69 70 if($handle = opendir(CHRONOSLY_TEMPLATES_PATH.DIRECTORY_SEPARATOR."css".DIRECTORY_SEPARATOR)) { 70 71 while (false !== ($entry = readdir($handle))) { … … 92 93 //load de json with tmplate info 93 94 public function load_template_settings($templates, $array = 0){ 95 94 96 $return = ""; 95 97 foreach($templates as $t){ … … 268 270 269 271 public function get_tipo_template($id, $vista){ 272 // echo "$id, $vista"; 270 273 $vars = unserialize(get_option("chronosly-settings")); 271 274 if($vista != "dad11" and $vista != "dad12") $template = @get_post_meta($id, $vista, true); 272 275 else { 273 276 $template = @get_option('chronosly-taxonomy-'.$vista.'_'.$id); 274 $template = unserialize($template);277 if($template2 = unserialize($template)) $template = $template2; 275 278 if(count($template)) $template = $template[0]; 276 279 } 277 280 if($template) { 281 // echo "entra"; 278 282 if(strlen($template) < 50 and stripos( $template,"template-")!== FALSE) return str_replace("template-", "", $template); 279 283 else return "chbd"; … … 294 298 if(strlen($template) < 50 and stripos( $template,"template-")!== FALSE) return str_replace("template-", "", $template); 295 299 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; 298 305 } 299 306 } … … 632 639 if($template == "chbd"){ 633 640 //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 } 635 645 } 636 646 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 ); 638 648 639 649 } … … 687 697 688 698 //retrieve template vars from file 689 private function get_template_vars($file){699 private function get_template_vars($file){ 690 700 $f = @fopen($file, "r"); 691 701 $content =str_replace(array('\\"', "\\'"), "'",@fread($f, filesize($file))); … … 730 740 if($this->vars->vista != "dad11" and $this->vars->vista != "dad12" ) $this->vars->metas = get_post_meta($this->vars->pid);//assing metas vars 731 741 732 if(isset($this->vars->metas['organizer']) ){742 if(isset($this->vars->metas['organizer']) && $this->vars->metas['organizer'][0]){ 733 743 foreach($this->vars->metas['organizer'] as $orgs){ 734 744 $orgs = unserialize($orgs); … … 751 761 } 752 762 753 if(isset($this->vars->metas['places']) ){763 if(isset($this->vars->metas['places']) && $this->vars->metas['places'][0]){ 754 764 foreach($this->vars->metas['places'] as $orgs){ 755 765 $orgs = unserialize($orgs); … … 815 825 816 826 foreach($this->vars->args as $k => $v){ 827 817 828 switch($k){ 818 829 case "id": … … 822 833 break; 823 834 case "start": 835 // echo $v."<br>"; 824 836 $this->vars->metas['ev-from'][0] = date("Y-m-d",$v); 825 837 //echo date("Y-m-d",$v)." ".$v; -
chronosly-events-calendar/tags/2.3.3/js/front.js
r1244927 r1370252 203 203 ); 204 204 } 205 onload_calendar();}); 205 onload_calendar(); 206 }); 206 207 207 208 function 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>" ); 209 210 jQuery(".ch_js_loader.id"+id).html("<div class='ch-spinner'></div>" ); 210 211 if(!url) url = translated1.calendarurl; … … 214 215 //jQuery(".ch_js_loader").hide().html( data ).slideDown(3000); 215 216 var content = ""; 216 217 if(jQuery(".ch_js_loader.id"+id+" .chronosly-content-block").length) { 217 if(jQuery(".ch_js_loader.id"+id).length) { 218 218 if(jQuery(data).find(".chronosly-content-block").length) content = jQuery(data).find(".chronosly-content-block"); 219 219 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); 221 222 if(jQuery(".ch_js_loader.id"+id+" .ch-fas-form").length){ 222 223 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 8 8 __("Open map", "chronosly"); 9 9 __("View ", "chronosly"); 10 __("more", "chronosly"); -
chronosly-events-calendar/tags/2.3.3/metaboxes/chronosly_tickets_metabox.php
r1202016 r1370252 5 5 <span class='edit'><?php _e("edit", "chronosly");?></span><span class='delete'><?php _e("delete", "chonosly");?></span> 6 6 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='c apacity' 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> 8 8 </li> 9 9 </div> … … 13 13 14 14 // 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='c apacity'>".__("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>"; 16 16 17 17 if(isset($vars->tickets)){ … … 31 31 ."<input readonly type='text' class='price' name='price' value='".$ticket["price"]."' />" 32 32 ."<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"]."' />" 33 34 ."<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"]."' />"35 35 // ."<input readonly type='text' class='max-user' name='max-user' value='".$ticket["max-user"]."' />" 36 36 // ."<input readonly type='text' class='sales-start-time' name='start-time' value='".$ticket["start-time"]."' />" … … 48 48 <?php _e("PRICE: Show ticket prices, also change currency and availability", "chronosly");?><br/><br/> 49 49 <?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/> 50 51 <?php _e("SALE: Active sale price", "chronosly");?><br/><br/> 51 52 <?php _e("SOLD OUT: Set ticket sold out", "chronosly");?><br/><br/> -
chronosly-events-calendar/tags/2.3.3/metaboxes/settings/settings.php
r1202016 r1370252 124 124 <input type="hidden" name="chronosly-base-templates-id" value="<?php echo $vars['chronosly-base-templates-id'] ?>" /> 125 125 <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/> 126 127 <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/> 127 128 <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 891 891 switch($ordertype ){ 892 892 case "date": 893 //se podria añadir el order por order en vez de por time894 893 $pos = $id;//max id = 99999 895 894 // 141773760 00000 896 895 $pos += $time*10000; 897 896 //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 } 899 905 // 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; 902 907 if($pastformat or $_REQUEST["orderdir"] == "DESC") $pos = 10000000000000-$pos; 903 break;908 break; 904 909 case "order": 905 910 if(isset($meta["order"][0]) and $meta["order"][0] != "") $pos += $meta["order"][0]*100000; … … 1047 1052 1048 1053 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 } 1050 1057 $eventos = json_decode($meta["events"][0]); 1051 1058 $find = 0; … … 1376 1383 1377 1384 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 } 1401 1416 1402 1417 … … 2355 2370 } elseif ('ticket' == $metabox['args']['type']) { 2356 2371 $vars = json_decode(@get_post_meta($post->ID, "tickets", true)); 2372 $settings = unserialize(get_option("chronosly-settings")); 2373 $currency = $settings["chronosly_currency"]; 2374 2357 2375 require_once(CHRONOSLY_PATH.DIRECTORY_SEPARATOR."metaboxes".DIRECTORY_SEPARATOR.self::POST_TYPE."_tickets_metabox.php"); 2358 2376 -
chronosly-events-calendar/tags/2.3.3/post-types/post_type_chronosly_calendar.php
r1329607 r1370252 226 226 }//si no empezamos en el primer dia del año 227 227 else $end = strtotime("31-12-".$year); 228 $end_top = strtotime("31-12-".$year); 228 229 if($settings["chronosly_week_start"] == 1) { 229 230 //$start -= (60*60*24); … … 232 233 233 234 $start_ini = $start; 234 235 $endHours = $end + ($meta["ev-to-h"][0]*60*60) + ($meta["ev-to-m"][0]*60); 235 236 $pos = Post_Type_Chronosly_Calendar::get_event_position_by_hour($meta, get_the_ID()); 236 237 do{ 237 238 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();} 238 239 $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))); 240 241 241 242 //repeats … … 284 285 }//si no acabamos en el ultimo dia del mes 285 286 else $end = $top; 287 $end_top = $top; 286 288 287 289 if($settings["chronosly_week_start"] == 1) { … … 292 294 $start_ini = $start; 293 295 $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); 295 297 do{ 296 298 $elements["days"][date('Y-m-d',$start)][$pos]= get_the_ID(); 297 299 $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)) ); 299 301 300 302 //repeats … … 331 333 }//si no acabamos en el ultimo dia del mes 332 334 else $end = strtotime(date("Y-m-t", strtotime($year."-".$month))); 335 $end_top = strtotime(date("Y-m-t", strtotime($year."-".$month))); 333 336 334 337 if($settings["chronosly_week_start"] == 1) { … … 338 341 339 342 } 343 340 344 $start_ini = $start; 341 345 $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); 343 347 do{ 344 348 $elements["days"][date('Y-m-d',$start)][$pos]= get_the_ID(); 345 349 $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))); 347 351 348 352 //repeats … … 362 366 while ( $query->have_posts() ){ 363 367 $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. 365 369 $meta = get_post_meta(get_the_ID()); 366 370 if(isset($meta["ev-from"][0])){ … … 383 387 while ( $query->have_posts() ){ 384 388 $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. 386 390 $meta = get_post_meta(get_the_ID()); 387 391 … … 397 401 // $end -= (60*60*24); 398 402 } 399 403 // echo get_the_ID()." ".date("d-m-Y ", $start)."<br/>"; 400 404 401 405 //do repeats … … 408 412 while ( $query->have_posts() ){ 409 413 $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. 411 415 412 416 $meta = get_post_meta(get_the_ID()); … … 434 438 435 439 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 436 442 $settings = unserialize(get_option("chronosly-settings")); 437 443 $pos = Post_Type_Chronosly_Calendar::get_event_position_by_hour($meta, $id); … … 455 461 $end_top = strtotime($meta["ev-until"][0]); 456 462 } 463 // echo $end_top; 457 464 // if($settings["chronosly_week_start"] == 1) { 458 465 // // $start_min -= (60*60*24); … … 487 494 $start1 = $start; 488 495 $end = $start+$event_days;//recalculamos el final 496 $endHours = $end + ($meta["ev-to-h"][0]*60*60) + ($meta["ev-to-m"][0]*60); 489 497 --$count; 490 498 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 ); 492 500 $start = strtotime("+ 1 day",$start); 493 501 //echo date('Y-m-d',$start)." ".date('Y-m-d',$end)."<br/>"; … … 501 509 502 510 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; 503 513 $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 504 514 $start1 = $start; 505 515 506 516 $end = $start+$event_days;//recalculamos el final 517 $endHours = $end + ($meta["ev-to-h"][0]*60*60) + ($meta["ev-to-m"][0]*60); 507 518 --$count; 508 519 //echo date('Y-m-d',$start)." ".date('Y-m-d',$end)."<br/>"; 509 520 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 511 524 $start = strtotime("+ 1 day",$start); 512 525 //echo date('Y-m-d',$start)." ".date('Y-m-d',$end)."<br/>"; … … 521 534 $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 522 535 $start1 = $start; 523 536 // echo $event_days; 524 537 $end = $start+$event_days;//recalculamos el final 538 $endHours = $end + ($meta["ev-to-h"][0]*60*60) + ($meta["ev-to-m"][0]*60); 539 525 540 --$count; 526 541 //echo date('Y-m-d',$start)." ".date('Y-m-d',$end)."<br/>"; 527 542 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/>"; 529 545 $start = strtotime("+ 1 day",$start); 530 //echo date('Y-m-d',$start)." ".date('Y-m-d',$end)."<br/>";531 546 } 532 547 $start = strtotime("- 1 day",$start);//restamos un dia porque si no el ultimo dia no se cuenta al salir del bucle … … 541 556 542 557 $end = $start+$event_days;//recalculamos el final 558 $endHours = $end + ($meta["ev-to-h"][0]*60*60) + ($meta["ev-to-m"][0]*60); 543 559 --$count; 544 560 //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 tramo546 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 ); 547 563 $start = strtotime("+ 1 day",$start); 548 564 //echo date('Y-m-d',$start)." ".date('Y-m-d',$end)."<br/>"; … … 868 884 if( $_REQUEST["event_name"]) { 869 885 $args['post_title_like'] =$_REQUEST["event_name"]; 886 } 887 if( $_REQUEST["ch_exclude"]) { 888 $args['post__not_in'] =$_REQUEST["ch_exclude"]; 870 889 } 871 890 -
chronosly-events-calendar/trunk/README.txt
r1329627 r1370252 6 6 Requires at least: 3.1 7 7 Tested up to: 4.4.1 8 Stable tag: 2.3. 18 Stable tag: 2.3.3 9 9 License: GPLv2 10 10 -
chronosly-events-calendar/trunk/README.txt~
r1329627 r1370252 6 6 Requires at least: 3.1 7 7 Tested up to: 4.4.1 8 Stable tag: 2.3. 08 Stable tag: 2.3.1 9 9 License: GPLv2 10 10 -
chronosly-events-calendar/trunk/chronosly.php
r1329607 r1370252 4 4 * Plugin URI: http://www.chronosly.com 5 5 * 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. 26 * Version: 2.3.3 7 7 * Author: Heimsveld IPBN 8 8 * Author URI: http://www.heimsveld.com … … 26 26 define('CHRONOSLY_TEMPLATES_URL', plugins_url()."/chronosly-templates"); //path para incluir scripts o css 27 27 define('CHRONOSLY_DEBUG', false); //debug mode 28 define('CHRONOSLY_VERSION', "2.3. 2"); //debug mode28 define('CHRONOSLY_VERSION', "2.3.3"); //debug mode 29 29 define('CHRONOSLY_ADMIN_INTERFACE', 1); //Todo: hacer diferentes interficies de admin simple o varios event 30 30 define('CHRONOSLY_ADMIN_MODALITY', 1); //Todo: hacer diferentes modalidades segun la tematica … … 72 72 } 73 73 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 } 76 78 require_once(CHRONOSLY_PATH.DIRECTORY_SEPARATOR."classes".DIRECTORY_SEPARATOR."chronosly_dad_elements.php"); 77 79 $dad_elements = new Chronosly_Dad_Elements(); -
chronosly-events-calendar/trunk/classes/chronosly_dad_elements.php
r1329732 r1370252 4331 4331 4332 4332 // print_r($tik); 4333 4333 $currency = $settings["chronosly_currency"]; 4334 if($tick["currency"]) $currency = $tick["currency"]; 4334 4335 $ret.= "<ul>"; 4335 4336 $ret.= "<li class='title'><i class='fa fa-ticket'></i> " . $tik["title"] . "</li>"; 4336 4337 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>"; 4339 4340 $ret.= "<li class='capacity'>" . $tik["capacity"] . "</li>"; 4340 4341 // $ret.= "<li class='min'>" . $tik["min-user"] . "</li>"; … … 5134 5135 5135 5136 } 5136 5137 $currency = $settings["chronosly_currency"]; 5138 if($vars->metas['tickets_vars'][$value]["currency"]) $currency = $vars->metas['tickets_vars'][$value]["currency"]; 5137 5139 $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'))); 5139 5141 if ($length > 1) $currency_type = "$length"; 5140 5142 $ant = ""; … … 5150 5152 $price = $v["price"]; 5151 5153 $value = $k; 5154 if($v["currency"]) $currency = $v["currency"]; 5155 5152 5156 } 5153 5157 } 5154 5158 } 5155 5159 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 5156 5162 $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>"; 5158 5164 } 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>"; 5160 5166 } 5161 5167 -
chronosly-events-calendar/trunk/classes/chronosly_settings.php
r1235318 r1370252 162 162 "chronosly-cats-flushed" => 0, 163 163 "chronosly-tags-flushed" => 0, 164 164 "chronosly_admin_memory_limit" => 0, 165 165 166 166 -
chronosly-events-calendar/trunk/classes/chronosly_shortcode.php
r1329732 r1370252 28 28 global $chshortcode; 29 29 if(!$chshortcode) return ""; 30 return do_shortcode("[chronosly $chshortcode ]");30 return do_shortcode("[chronosly $chshortcode base=1]"); 31 31 } 32 32 … … 57 57 'after_events' => 0, 58 58 'show_past' => 0, 59 'template' => '' //use another template on shortcode 59 'template' => '', //use another template on shortcode 60 'base' => '' //is a the base shortcode 60 61 ); 61 62 $args = apply_filters("chronosly-shortcode-extra-params", $args); … … 67 68 $_REQUEST["small"] = $code["small"]; 68 69 $_REQUEST["navigation"] = $code["navigation"]; 69 Chronosly_Templates::set_shortcode_template_css();70 if(stripos($type, "format") === FALSE) Chronosly_Templates::set_shortcode_template_css(); 70 71 71 72 if( $code["template"]) { … … 153 154 unset($_REQUEST["ch-price-min"]); 154 155 unset($_REQUEST["ch-price-max"]); 156 unset($_REQUEST["ch_exclude"]); 155 157 return $content; 156 158 … … 164 166 global $wp_query, $Post_Type_Chronosly, $pastformat; 165 167 $pastformat = 0;//para enseñar en formato eventos pasados 168 $wp_queryold = $wp_query; 166 169 if(isset($_REQUEST["chronosly_event_list_time"]) and $_REQUEST["chronosly_event_list_time"] == "past"){ 167 170 $pastformat = 1; … … 188 191 } 189 192 if($args["exclude"]) { 190 $ q["post__not_in"] = explode(",",$args["exclude"]);193 $_REQUEST["ch_exclude"] = $q["post__not_in"] = explode(",",$args["exclude"]); 191 194 } 192 195 if($args["category"]) { … … 237 240 switch($type){ 238 241 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 240 245 if ( is_user_logged_in() ) new WP_Query("post_type=chronosly_calendar&post_status=publish,private"); 241 246 else $wp_query = new WP_Query("post_type=chronosly_calendar"); … … 427 432 } 428 433 wp_reset_query();//reset the query status 434 $wp_query = $wp_queryold; 429 435 } 430 436 -
chronosly-events-calendar/trunk/classes/chronosly_templates.php
r1316864 r1370252 67 67 68 68 public function set_front_css(){ 69 69 70 if($handle = opendir(CHRONOSLY_TEMPLATES_PATH.DIRECTORY_SEPARATOR."css".DIRECTORY_SEPARATOR)) { 70 71 while (false !== ($entry = readdir($handle))) { … … 92 93 //load de json with tmplate info 93 94 public function load_template_settings($templates, $array = 0){ 95 94 96 $return = ""; 95 97 foreach($templates as $t){ … … 268 270 269 271 public function get_tipo_template($id, $vista){ 272 // echo "$id, $vista"; 270 273 $vars = unserialize(get_option("chronosly-settings")); 271 274 if($vista != "dad11" and $vista != "dad12") $template = @get_post_meta($id, $vista, true); 272 275 else { 273 276 $template = @get_option('chronosly-taxonomy-'.$vista.'_'.$id); 274 $template = unserialize($template);277 if($template2 = unserialize($template)) $template = $template2; 275 278 if(count($template)) $template = $template[0]; 276 279 } 277 280 if($template) { 281 // echo "entra"; 278 282 if(strlen($template) < 50 and stripos( $template,"template-")!== FALSE) return str_replace("template-", "", $template); 279 283 else return "chbd"; … … 294 298 if(strlen($template) < 50 and stripos( $template,"template-")!== FALSE) return str_replace("template-", "", $template); 295 299 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; 298 305 } 299 306 } … … 632 639 if($template == "chbd"){ 633 640 //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 } 635 645 } 636 646 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 ); 638 648 639 649 } … … 687 697 688 698 //retrieve template vars from file 689 private function get_template_vars($file){699 private function get_template_vars($file){ 690 700 $f = @fopen($file, "r"); 691 701 $content =str_replace(array('\\"', "\\'"), "'",@fread($f, filesize($file))); … … 730 740 if($this->vars->vista != "dad11" and $this->vars->vista != "dad12" ) $this->vars->metas = get_post_meta($this->vars->pid);//assing metas vars 731 741 732 if(isset($this->vars->metas['organizer']) ){742 if(isset($this->vars->metas['organizer']) && $this->vars->metas['organizer'][0]){ 733 743 foreach($this->vars->metas['organizer'] as $orgs){ 734 744 $orgs = unserialize($orgs); … … 751 761 } 752 762 753 if(isset($this->vars->metas['places']) ){763 if(isset($this->vars->metas['places']) && $this->vars->metas['places'][0]){ 754 764 foreach($this->vars->metas['places'] as $orgs){ 755 765 $orgs = unserialize($orgs); … … 815 825 816 826 foreach($this->vars->args as $k => $v){ 827 817 828 switch($k){ 818 829 case "id": … … 822 833 break; 823 834 case "start": 835 // echo $v."<br>"; 824 836 $this->vars->metas['ev-from'][0] = date("Y-m-d",$v); 825 837 //echo date("Y-m-d",$v)." ".$v; -
chronosly-events-calendar/trunk/js/front.js
r1244927 r1370252 203 203 ); 204 204 } 205 onload_calendar();}); 205 onload_calendar(); 206 }); 206 207 207 208 function 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>" ); 209 210 jQuery(".ch_js_loader.id"+id).html("<div class='ch-spinner'></div>" ); 210 211 if(!url) url = translated1.calendarurl; … … 214 215 //jQuery(".ch_js_loader").hide().html( data ).slideDown(3000); 215 216 var content = ""; 216 217 if(jQuery(".ch_js_loader.id"+id+" .chronosly-content-block").length) { 217 if(jQuery(".ch_js_loader.id"+id).length) { 218 218 if(jQuery(data).find(".chronosly-content-block").length) content = jQuery(data).find(".chronosly-content-block"); 219 219 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); 221 222 if(jQuery(".ch_js_loader.id"+id+" .ch-fas-form").length){ 222 223 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 8 8 __("Open map", "chronosly"); 9 9 __("View ", "chronosly"); 10 __("more", "chronosly"); -
chronosly-events-calendar/trunk/metaboxes/chronosly_tickets_metabox.php
r1202016 r1370252 5 5 <span class='edit'><?php _e("edit", "chronosly");?></span><span class='delete'><?php _e("delete", "chonosly");?></span> 6 6 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='c apacity' 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> 8 8 </li> 9 9 </div> … … 13 13 14 14 // 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='c apacity'>".__("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>"; 16 16 17 17 if(isset($vars->tickets)){ … … 31 31 ."<input readonly type='text' class='price' name='price' value='".$ticket["price"]."' />" 32 32 ."<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"]."' />" 33 34 ."<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"]."' />"35 35 // ."<input readonly type='text' class='max-user' name='max-user' value='".$ticket["max-user"]."' />" 36 36 // ."<input readonly type='text' class='sales-start-time' name='start-time' value='".$ticket["start-time"]."' />" … … 48 48 <?php _e("PRICE: Show ticket prices, also change currency and availability", "chronosly");?><br/><br/> 49 49 <?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/> 50 51 <?php _e("SALE: Active sale price", "chronosly");?><br/><br/> 51 52 <?php _e("SOLD OUT: Set ticket sold out", "chronosly");?><br/><br/> -
chronosly-events-calendar/trunk/metaboxes/settings/settings.php
r1202016 r1370252 124 124 <input type="hidden" name="chronosly-base-templates-id" value="<?php echo $vars['chronosly-base-templates-id'] ?>" /> 125 125 <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/> 126 127 <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/> 127 128 <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 891 891 switch($ordertype ){ 892 892 case "date": 893 //se podria añadir el order por order en vez de por time894 893 $pos = $id;//max id = 99999 895 894 // 141773760 00000 896 895 $pos += $time*10000; 897 896 //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 } 899 905 // 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; 902 907 if($pastformat or $_REQUEST["orderdir"] == "DESC") $pos = 10000000000000-$pos; 903 break;908 break; 904 909 case "order": 905 910 if(isset($meta["order"][0]) and $meta["order"][0] != "") $pos += $meta["order"][0]*100000; … … 1047 1052 1048 1053 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 } 1050 1057 $eventos = json_decode($meta["events"][0]); 1051 1058 $find = 0; … … 1376 1383 1377 1384 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 } 1401 1416 1402 1417 … … 2355 2370 } elseif ('ticket' == $metabox['args']['type']) { 2356 2371 $vars = json_decode(@get_post_meta($post->ID, "tickets", true)); 2372 $settings = unserialize(get_option("chronosly-settings")); 2373 $currency = $settings["chronosly_currency"]; 2374 2357 2375 require_once(CHRONOSLY_PATH.DIRECTORY_SEPARATOR."metaboxes".DIRECTORY_SEPARATOR.self::POST_TYPE."_tickets_metabox.php"); 2358 2376 -
chronosly-events-calendar/trunk/post-types/post_type_chronosly_calendar.php
r1329607 r1370252 226 226 }//si no empezamos en el primer dia del año 227 227 else $end = strtotime("31-12-".$year); 228 $end_top = strtotime("31-12-".$year); 228 229 if($settings["chronosly_week_start"] == 1) { 229 230 //$start -= (60*60*24); … … 232 233 233 234 $start_ini = $start; 234 235 $endHours = $end + ($meta["ev-to-h"][0]*60*60) + ($meta["ev-to-m"][0]*60); 235 236 $pos = Post_Type_Chronosly_Calendar::get_event_position_by_hour($meta, get_the_ID()); 236 237 do{ 237 238 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();} 238 239 $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))); 240 241 241 242 //repeats … … 284 285 }//si no acabamos en el ultimo dia del mes 285 286 else $end = $top; 287 $end_top = $top; 286 288 287 289 if($settings["chronosly_week_start"] == 1) { … … 292 294 $start_ini = $start; 293 295 $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); 295 297 do{ 296 298 $elements["days"][date('Y-m-d',$start)][$pos]= get_the_ID(); 297 299 $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)) ); 299 301 300 302 //repeats … … 331 333 }//si no acabamos en el ultimo dia del mes 332 334 else $end = strtotime(date("Y-m-t", strtotime($year."-".$month))); 335 $end_top = strtotime(date("Y-m-t", strtotime($year."-".$month))); 333 336 334 337 if($settings["chronosly_week_start"] == 1) { … … 338 341 339 342 } 343 340 344 $start_ini = $start; 341 345 $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); 343 347 do{ 344 348 $elements["days"][date('Y-m-d',$start)][$pos]= get_the_ID(); 345 349 $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))); 347 351 348 352 //repeats … … 362 366 while ( $query->have_posts() ){ 363 367 $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. 365 369 $meta = get_post_meta(get_the_ID()); 366 370 if(isset($meta["ev-from"][0])){ … … 383 387 while ( $query->have_posts() ){ 384 388 $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. 386 390 $meta = get_post_meta(get_the_ID()); 387 391 … … 397 401 // $end -= (60*60*24); 398 402 } 399 403 // echo get_the_ID()." ".date("d-m-Y ", $start)."<br/>"; 400 404 401 405 //do repeats … … 408 412 while ( $query->have_posts() ){ 409 413 $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. 411 415 412 416 $meta = get_post_meta(get_the_ID()); … … 434 438 435 439 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 436 442 $settings = unserialize(get_option("chronosly-settings")); 437 443 $pos = Post_Type_Chronosly_Calendar::get_event_position_by_hour($meta, $id); … … 455 461 $end_top = strtotime($meta["ev-until"][0]); 456 462 } 463 // echo $end_top; 457 464 // if($settings["chronosly_week_start"] == 1) { 458 465 // // $start_min -= (60*60*24); … … 487 494 $start1 = $start; 488 495 $end = $start+$event_days;//recalculamos el final 496 $endHours = $end + ($meta["ev-to-h"][0]*60*60) + ($meta["ev-to-m"][0]*60); 489 497 --$count; 490 498 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 ); 492 500 $start = strtotime("+ 1 day",$start); 493 501 //echo date('Y-m-d',$start)." ".date('Y-m-d',$end)."<br/>"; … … 501 509 502 510 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; 503 513 $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 504 514 $start1 = $start; 505 515 506 516 $end = $start+$event_days;//recalculamos el final 517 $endHours = $end + ($meta["ev-to-h"][0]*60*60) + ($meta["ev-to-m"][0]*60); 507 518 --$count; 508 519 //echo date('Y-m-d',$start)." ".date('Y-m-d',$end)."<br/>"; 509 520 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 511 524 $start = strtotime("+ 1 day",$start); 512 525 //echo date('Y-m-d',$start)." ".date('Y-m-d',$end)."<br/>"; … … 521 534 $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 522 535 $start1 = $start; 523 536 // echo $event_days; 524 537 $end = $start+$event_days;//recalculamos el final 538 $endHours = $end + ($meta["ev-to-h"][0]*60*60) + ($meta["ev-to-m"][0]*60); 539 525 540 --$count; 526 541 //echo date('Y-m-d',$start)." ".date('Y-m-d',$end)."<br/>"; 527 542 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/>"; 529 545 $start = strtotime("+ 1 day",$start); 530 //echo date('Y-m-d',$start)." ".date('Y-m-d',$end)."<br/>";531 546 } 532 547 $start = strtotime("- 1 day",$start);//restamos un dia porque si no el ultimo dia no se cuenta al salir del bucle … … 541 556 542 557 $end = $start+$event_days;//recalculamos el final 558 $endHours = $end + ($meta["ev-to-h"][0]*60*60) + ($meta["ev-to-m"][0]*60); 543 559 --$count; 544 560 //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 tramo546 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 ); 547 563 $start = strtotime("+ 1 day",$start); 548 564 //echo date('Y-m-d',$start)." ".date('Y-m-d',$end)."<br/>"; … … 868 884 if( $_REQUEST["event_name"]) { 869 885 $args['post_title_like'] =$_REQUEST["event_name"]; 886 } 887 if( $_REQUEST["ch_exclude"]) { 888 $args['post__not_in'] =$_REQUEST["ch_exclude"]; 870 889 } 871 890
Note: See TracChangeset
for help on using the changeset viewer.