Changeset 1286972
- Timestamp:
- 11/16/2015 08:51:03 AM (10 years ago)
- Location:
- chronosly-events-calendar
- Files:
-
- 10 edited
- 6 copied
-
tags/2.2.7 (copied) (copied from chronosly-events-calendar/trunk)
-
tags/2.2.7/README.txt (copied) (copied from chronosly-events-calendar/trunk/README.txt) (1 diff)
-
tags/2.2.7/README.txt~ (copied) (copied from chronosly-events-calendar/trunk/README.txt~)
-
tags/2.2.7/chronosly.php (copied) (copied from chronosly-events-calendar/trunk/chronosly.php) (2 diffs)
-
tags/2.2.7/classes/chronosly_dad_elements.php (modified) (7 diffs)
-
tags/2.2.7/classes/chronosly_extend.php (copied) (copied from chronosly-events-calendar/trunk/classes/chronosly_extend.php) (1 diff)
-
tags/2.2.7/classes/chronosly_shortcode.php (copied) (copied from chronosly-events-calendar/trunk/classes/chronosly_shortcode.php) (1 diff)
-
tags/2.2.7/classes/chronosly_templates.php (modified) (53 diffs)
-
tags/2.2.7/post-types/post_type_chronosly.php (modified) (2 diffs)
-
trunk/README.txt (modified) (1 diff)
-
trunk/chronosly.php (modified) (2 diffs)
-
trunk/classes/chronosly_dad_elements.php (modified) (7 diffs)
-
trunk/classes/chronosly_extend.php (modified) (1 diff)
-
trunk/classes/chronosly_shortcode.php (modified) (1 diff)
-
trunk/classes/chronosly_templates.php (modified) (53 diffs)
-
trunk/post-types/post_type_chronosly.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
chronosly-events-calendar/tags/2.2.7/README.txt
r1284685 r1286972 6 6 Requires at least: 3.1 7 7 Tested up to: 4.3.1 8 Stable tag: 2.2. 68 Stable tag: 2.2.7 9 9 License: GPLv2 10 10 -
chronosly-events-calendar/tags/2.2.7/chronosly.php
r1284685 r1286972 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.2. 66 * Version: 2.2.7 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.2. 6"); //debug mode28 define('CHRONOSLY_VERSION', "2.2.7"); //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 -
chronosly-events-calendar/tags/2.2.7/classes/chronosly_dad_elements.php
r1272735 r1286972 1241 1241 1242 1242 // print_r($vars->metas["ev-from"]); 1243 1244 1243 $lorem = 0; 1244 1245 1245 switch ($extra) { 1246 1246 case "full_datetime": … … 1303 1303 1304 1304 case "full_time": 1305 1306 1305 if ($html) { 1307 1306 $cont = str_replace("}}", " | time_format $value}}", $cont); 1308 1307 } 1309 1308 else { 1309 1310 1310 if (!$value) $value = $settings["chronosly_format_time"]; 1311 1311 if(!isset($vars->metas["events"][0]) or $vars->metas["events"][0] == "") { … … 1331 1331 if (!$cont) $cont = __("All day long", "chronosly"); 1332 1332 } else { 1333 $tickets = unserialize(get_option("chronosly_settings_tickets_and_repeats_extended")); 1334 if(stripos($vars->metas["ev-from-h"][0], ",")) $cont = __($tickets["event_repeats_seasons_name"], "chronosly")." "; 1335 $s = json_decode($vars->metas["ev-from-h"][0]); 1336 foreach($s as $id=>$s1) if($s1 == ":") $s[$id] = __("All day long", "chronosly"); 1337 if(is_array($s)) $cont .= implode(", ", $s); 1338 else $cont .= $s; 1333 1334 $sets = unserialize(get_option("chronosly_settings_tickets_and_repeats_extended")); 1335 1336 if(!$sets["seasons_normal_display"]){ 1337 $tickets = unserialize(get_option("chronosly_settings_tickets_and_repeats_extended")); 1338 if(stripos($vars->metas["ev-from-h"][0], ",")) $cont = __($tickets["event_repeats_seasons_name"], "chronosly")." "; 1339 $s = json_decode($vars->metas["ev-from-h"][0]); 1340 foreach($s as $id=>$s1) if($s1 == ":") $s[$id] = __("All day long", "chronosly"); 1341 if(is_array($s)) $cont .= implode(", ", $s); 1342 else $cont .= $s; 1343 } else { 1344 1345 $date1 = $vars->metas["ev-from"][0] . " " . $vars->metas["ev-from-h"][0] . ":" . $vars->metas["ev-from-m"][0]; 1346 1347 if($_REQUEST["repeat"]){ 1348 $ses = explode("_", $_REQUEST["repeat"]); 1349 if(count($ses) == 4) $date1 = $vars->metas["ev-from"][0] . " " . $ses[2] . ":" . $ses[3]; 1350 }else { 1351 1352 $date1 = $vars->metas["ev-from"][0] . " " . $vars->metas["ev-from-h"][0] . ":" . $vars->metas["ev-from-m"][0]; 1353 } 1354 $date1 = str_replace("<span class='lorem'></span>", "", $date1, $lorem); 1355 if (stripos($vars->metas["ev-from-h"][0], "'lorem'") === FALSE) $lorem = 0; 1356 $date1o = strtotime($date1); 1357 if (stripos($value, "%") === FALSE) $cont.= date_i18n($value, $date1o); 1358 else $cont.= strftime($value, $date1o); 1359 } 1360 1339 1361 } 1340 1362 } … … 1357 1379 else $cont.= strftime($value, $date1o); 1358 1380 } else { 1359 $tickets = unserialize(get_option("chronosly_settings_tickets_and_repeats_extended")); 1360 if(stripos($vars->metas["ev-from-h"][0], ",")) $cont = __($tickets["event_repeats_seasons_name"], "chronosly")." "; 1361 1362 $s = json_decode($vars->metas["ev-from-h"][0]); 1363 if(is_array($s)) $cont .= implode(", ", $s); 1364 else $cont .= $s; 1381 $sets = unserialize(get_option("chronosly_settings_tickets_and_repeats_extended")); 1382 1383 if(!$sets["seasons_normal_display"]){ 1384 $tickets = unserialize(get_option("chronosly_settings_tickets_and_repeats_extended")); 1385 if(stripos($vars->metas["ev-from-h"][0], ",")) $cont = __($tickets["event_repeats_seasons_name"], "chronosly")." "; 1386 1387 $s = json_decode($vars->metas["ev-from-h"][0]); 1388 if(is_array($s)) $cont .= implode(", ", $s); 1389 else $cont .= $s; 1390 } else { 1391 $date1 = $vars->metas["ev-from"][0] . " " . $vars->metas["ev-from-h"][0] . ":" . $vars->metas["ev-from-m"][0]; 1392 $date1 = str_replace("<span class='lorem'></span>", "", $date1, $lorem); 1393 if (stripos($vars->metas["ev-from-h"][0], "'lorem'") === FALSE) $lorem = 0; 1394 $date1o = strtotime($date1); 1395 if (stripos($value, "%") === FALSE) $cont.= date_i18n($value, $date1o); 1396 else $cont.= strftime($value, $date1o); 1397 } 1365 1398 } 1366 1399 } … … 1390 1423 } 1391 1424 else { 1392 1393 1425 if (!$value) $value = $settings["chronosly_format_date"]; 1394 1426 $date1 = $vars->metas["ev-from"][0]; 1427 // echo "<pre>";print_r($vars->metas); 1395 1428 if(!isset($vars->metas["events"][0]) or $vars->metas["events"][0] == "") $date1 .= " " . $vars->metas["ev-from-h"][0] . ":" . $vars->metas["ev-from-m"][0]; 1396 1429 $date1 = str_replace("<span class='lorem'></span>", "", $date1, $lorem); … … 1398 1431 $date1o = strtotime($date1); 1399 1432 if (stripos($value, "%") === FALSE) $cont.= date_i18n($value, $date1o); 1433 1400 1434 else $cont.= strftime($value, $date1o); 1401 1435 } … … 1435 1469 } else { 1436 1470 1437 $tickets = unserialize(get_option("chronosly_settings_tickets_and_repeats_extended")); 1438 if(stripos($vars->metas["ev-from-h"][0], ",")) $cont = __($tickets["event_repeats_seasons_name"], "chronosly")." "; 1439 ; 1440 1441 $s = json_decode($vars->metas["ev-from-h"][0]); 1442 1443 // $m = json_decode($vars->metas["ev-from-m"][0]); 1444 if(is_array($s)) { 1445 foreach ($s as $v) { 1446 if($v == ":") $cont .= __("All day long", "chronosly").", "; 1447 else $cont .= $v.", "; 1471 $sets = unserialize(get_option("chronosly_settings_tickets_and_repeats_extended")); 1472 1473 if(!$sets["seasons_normal_display"]){ 1474 $tickets = unserialize(get_option("chronosly_settings_tickets_and_repeats_extended")); 1475 if(stripos($vars->metas["ev-from-h"][0], ",")) $cont = __($tickets["event_repeats_seasons_name"], "chronosly")." "; 1476 1477 1478 $s = json_decode($vars->metas["ev-from-h"][0]); 1479 1480 // $m = json_decode($vars->metas["ev-from-m"][0]); 1481 if(is_array($s)) { 1482 foreach ($s as $v) { 1483 if($v == ":") $cont .= __("All day long", "chronosly").", "; 1484 else $cont .= $v.", "; 1485 } 1486 $cont = substr($cont, 0,-2); 1448 1487 } 1449 $cont = substr($cont, 0,-2); 1450 } 1451 else { 1452 if($s == ":") $cont .= __("All day long", "chronosly"); 1453 else $cont .= $s; 1488 else { 1489 if($s == ":") $cont .= __("All day long", "chronosly"); 1490 else $cont .= $s; 1491 } 1492 } else { 1493 $date1 = $vars->metas["ev-from"][0] . " " . $vars->metas["ev-from-h"][0] . ":" . $vars->metas["ev-from-m"][0]; 1494 $date1 = str_replace("<span class='lorem'></span>", "", $date1, $lorem); 1495 if (stripos($vars->metas["ev-from-h"][0], "'lorem'") === FALSE) $lorem = 0; 1496 $date1o = strtotime($date1); 1497 if (stripos($value, "%") === FALSE) $cont.= date_i18n($value, $date1o); 1498 else $cont.= strftime($value, $date1o); 1454 1499 } 1455 1500 // print_r($vars->metas["ev-from-h"][0]); -
chronosly-events-calendar/tags/2.2.7/classes/chronosly_extend.php
r1284685 r1286972 623 623 624 624 625 -
chronosly-events-calendar/tags/2.2.7/classes/chronosly_shortcode.php
r1284685 r1286972 480 480 } // END 481 481 482 -
chronosly-events-calendar/tags/2.2.7/classes/chronosly_templates.php
r1272735 r1286972 1 1 <?php 2 //javascript call3 2 4 3 … … 27 26 add_action( 'wp_ajax_chronosly_get_tipo_template', array(&$this, 'js_get_tipo_template' )); 28 27 add_action( 'wp_ajax_chronosly_clear_cache', array(&$this, 'js_clear_cache' )); 28 add_action( 'wp_ajax_chronosly_save_all_html_templates', array(&$this, 'save_all_html_templates' )); 29 29 //add_filter( 'heartbeat_received', array(&$this, 'js_preview_theme' ), 10, 3 ); 30 30 //load init vars for templates … … 33 33 34 34 } 35 36 37 35 38 36 add_filter("chronosly_dad_tabs", array("Chronosly_Templates", "chronosly_get_default_dad_tabs"), 5, 3);//get de default tabs for dad … … 85 83 } 86 84 87 public function set_shortcode_template_css($template="default"){85 public function set_shortcode_template_css($template="default"){ 88 86 wp_register_style( "chronosly_$template", CHRONOSLY_TEMPLATES_URL.'/css/'.$template.'.css'); 89 87 wp_print_styles("chronosly_$template"); … … 123 121 } 124 122 } 125 126 123 127 124 … … 180 177 fwrite( $f , $html); 181 178 fclose($f); 182 179 // echo "hola"; 183 180 $this->template_2_html($name, $tid); 184 181 /* … … 316 313 while (false !== ($entry = readdir($handle))) { 317 314 if($entry != "." and $entry != ".." and !stripos($entry, ".html") ) 318 319 $custom_templates[] = str_replace(array(".php","_"), array("", " "),$entry); 315 $custom_templates[] = str_replace(array(".php","_"), array("", " "),$entry); 320 316 321 317 } … … 510 506 } 511 507 //faltan los calendars 512 513 508 return $return; 514 509 } … … 605 600 $this->vars->args = $args; 606 601 $itid = $id; 607 if( isset($args["start"]) and isset($args["end"])) $itid .= "_{$args["start"]}_{$args["end"]}";602 if($args["start"] and $args["end"]) $itid .= "_{$args["start"]}_{$args["end"]}"; 608 603 if($args["h"] and $args["m"]) $itid .= "_{$args["h"]}_{$args["m"]}"; 609 //si lo tenemos en la cache lo pintamos, si no lo generamos y lo guardamos 604 605 //controlamos para hacerlo por html o por json 610 606 611 607 $path = CHRONOSLY_TEMPLATES_PATH.DIRECTORY_SEPARATOR; 612 608 if(isset($vars['chronosly_template_default_active']) and $vars['chronosly_template_default_active'] and stripos($_SERVER['HTTP_REFERER'], "chronosly_edit_templates") === FALSE ) $template = $vars['chronosly_template_default']; 613 if( isset($_REQUEST["force_template"])) $template = $_REQUEST["force_template"];609 if($_REQUEST["force_template"]) $template = $_REQUEST["force_template"]; 614 610 615 611 if(!$template) $template = $this->get_tipo_template($id, $vista); … … 619 615 return $this->print_template_html($id, $vista, $draganddropels, $template, $style, $args, $html2); 620 616 } 621 622 617 // echo $path.$vista.DIRECTORY_SEPARATOR.$template.".html"; 618 619 //si lo tenemos en la cache lo pintamos, si no lo generamos y lo guardamos 623 620 if($style == "front" and $id != 1 and $html = Chronosly_Cache::load_item($itid, $vista)) { 624 621 echo $html; 625 622 } 626 623 else { 624 627 625 ob_start(); 628 626 … … 638 636 639 637 $this->render_template($template, $style, $vista, json_decode($data), $draganddropels, $html2 ); 638 640 639 } 641 640 $cont= str_replace("{{notprev}}", "",ob_get_clean()); 642 641 echo $cont; 642 643 643 if($style == "front") Chronosly_Cache::save_item($itid, $vista, $cont); 644 644 } … … 654 654 $path = CHRONOSLY_TEMPLATES_PATH;//ruta hacia los templates del user 655 655 $vars = $this->get_template_vars($path.DIRECTORY_SEPARATOR.$vista.DIRECTORY_SEPARATOR.$template.".php");//ruta hacia el dad que toca 656 656 657 } 657 658 if(($style == "back-addon" or $style == "back-addon-js") and isset($_REQUEST['addon']) and has_filter("chronosly_update_template_".$_REQUEST['addon'])) { … … 664 665 $args = $this->vars->args; 665 666 if($vars) $this->vars = $vars; 666 667 667 if($dadcats) $this->dadcats = $dadcats; 668 668 $this->vars->pid = $id; … … 675 675 } 676 676 else if ($style == "front"){ 677 677 678 $this->build_front_template($vista,$template, $html2); 678 679 … … 682 683 683 684 } 685 684 686 } 685 687 … … 696 698 //cargamos las variables necesarias para pintar el template, las metas de organizer, place, etc.. 697 699 private function get_all_vars($style){ 700 698 701 global $pastformat; 699 702 if(isset($this->vars->args["id"]) and $this->vars->args["id"]) { … … 717 720 if((!isset($this->vars->post) or !is_object($this->vars->post)) and isset($post[0])) $this->vars->post = $post[0]; 718 721 if(!isset($this->vars->pid) and isset($post[0])) $this->vars->pid = $post[0]->ID; 722 719 723 if($this->vars->vista != "dad11" and $this->vars->vista != "dad12" ) $this->vars->metas = get_post_meta($this->vars->pid);//assing metas vars 720 724 721 725 if(isset($this->vars->metas['organizer'])){ 722 726 foreach($this->vars->metas['organizer'] as $orgs){ 723 724 727 $orgs = unserialize($orgs); 725 728 … … 740 743 $this->vars->metas['organizer_vars'][] = array("post" => (isset($this->vars->post)?$this->vars->post:""), "metas" => $this->vars->metas); 741 744 } 745 742 746 if(isset($this->vars->metas['places'])){ 743 747 foreach($this->vars->metas['places'] as $orgs){ … … 746 750 foreach($orgs as $org){ 747 751 if(function_exists("icl_object_id")) $org = icl_object_id($org, "chronosly_places"); 748 749 752 $post = get_posts('post_type=chronosly_places&p='.$org); 750 753 $this->vars->metas['places_vars'][] = array("post" => $post[0], "metas" => get_post_meta($org)); … … 770 773 $this->vars->metas['cats_vars'][0]->metas = $this->vars->metas;//assing metas vars 771 774 } 775 772 776 //ordenamos segun orden 773 777 if(isset($this->vars->metas['cats_vars'])) usort($this->vars->metas['cats_vars'], array("Chronosly_Templates", "ordenar_cats")); 778 774 779 if($this->vars->vista != "dad11" and $this->vars->vista != "dad12" ){ 780 775 781 $tags = wp_get_object_terms($this->vars->pid, "chronosly_tag"); 776 782 foreach($tags as $tag){ … … 778 784 //faltan los metas 779 785 } 786 780 787 $vars = ""; 781 788 if(isset($this->vars->metas['tickets'])) $vars = json_decode($this->vars->metas['tickets'][0]); 789 782 790 if(isset($vars->tickets) and count($vars->tickets)){ 783 791 for($i = 1; $i < count($vars->tickets);++$i){ … … 788 796 789 797 } 798 790 799 } 800 791 801 $this->vars->link = get_post_permalink($this->vars->pid); 802 792 803 } 793 804 … … 798 809 foreach($this->vars->args as $k => $v){ 799 810 switch($k){ 800 case "id":811 case "id": 801 812 $this->vars->pid = $v; 802 813 if(!isset($this->vars->post)) $this->vars->post = new stdClass(); … … 828 839 829 840 break; 830 case "eh":841 case "eh": 831 842 $this->vars->metas['ev-to-h'][0] = $v; 832 843 833 844 834 845 break; 835 846 case "em": 836 847 $this->vars->metas['ev-to-m'][0] = $v; 837 848 838 849 839 850 break; 840 851 841 842 852 } 843 853 … … 846 856 847 857 //cargariamos el hook de data_field 848 // print_r($this->vars); 858 849 859 $this->set_default_text($style); 850 860 … … 945 955 $this->vars->metas["tickets_vars"][1]["title"] = "<span class='lorem'></span>Ticket lorem ipsum"; 946 956 $this->vars->metas["tickets_vars"][1]["price"] = "<span class='lorem'></span>49"; 947 $this->vars->metas["tickets_vars"][1]["capacity"] = "<span class='lorem'></span>100";948 957 $this->vars->metas["tickets_vars"][1]["sale-price"] = "<span class='lorem'></span>39"; 949 958 $this->vars->metas["tickets_vars"][1]["capacity"] = "<span class='lorem'></span>100"; 950 959 // $this->vars->metas["tickets_vars"][1]["min-user"] = "<span class='lorem'></span>1"; 951 960 // $this->vars->metas["tickets_vars"][1]["max-user"] = "<span class='lorem'></span>5"; … … 954 963 $this->vars->metas["tickets_vars"][1]["link"] = "<span class='lorem'></span>link.com"; 955 964 $this->vars->metas["tickets_vars"][1]["soldout"] = ""; 956 $this->vars->metas["tickets_vars"][1]["sale"] = "";965 $this->vars->metas["tickets_vars"][1]["sale"] = ""; 957 966 $this->vars->metas["tickets_vars"][1]["notes"] = "<span class='lorem'></span>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ultrices, ante commodo elementum posuere, velit justo fermentum enim, placerat tincidunt massa leo convallis purus. Praesent cursus arcu non tortor iaculis, eleifend lacinia enim euismod. Etiam consequat porttitor sapien, vitae feugiat nunc accumsan at. Mauris ultrices pretium lacus, vitae dapibus enim pharetra ut. Curabitur gravida vel lorem quis sollicitudin. Fusce commodo, mi et bibendum elementum, eros enim dapibus arcu, gravida rhoncus felis nulla ut eros. Suspendisse consequat ligula rhoncus erat gravida, et mollis quam placerat. Morbi in diam vestibulum, tempus ante molestie, pharetra nibh. Etiam nulla risus, imperdiet eu tincidunt a, hendrerit a elit. Nullam ut tincidunt augue. Aenean vehicula nulla sed ipsum bibendum, non congue risus mollis. Etiam dolor diam, semper nec sem et, convallis gravida urna."; 958 967 … … 1062 1071 1063 1072 //pintamos el template del admin 1064 private function build_admin_template($vista,$template, $variant= "back", $html= 0){1073 private function build_admin_template($vista,$template, $variant= "back", $html= 0){ 1065 1074 1066 1075 … … 1068 1077 $st = $variant; 1069 1078 $this->get_all_vars($st); 1070 1071 1079 if($variant == "back-js") { 1072 1080 $this->templates_tabs($vista, 1); … … 1076 1084 //else if($variant == "back-addon" or $variant == "back-addon-js") $this->templates_tabs($vista, 2); 1077 1085 $temp = $this->vars; 1078 if($template == "chbd") $template = isset($temp->base)?$temp->base:"";1086 if($template == "chbd") $template = $temp->base; 1079 1087 include(CHRONOSLY_PATH.DIRECTORY_SEPARATOR."metaboxes".DIRECTORY_SEPARATOR."chronosly_dad_framework_metabox.php"); 1080 1088 … … 1086 1094 $st = "front"; 1087 1095 $this->get_all_vars($st); 1096 1088 1097 $temp = $this->vars; 1089 if($template == "chbd") $template = isset($temp->base)?$temp->base:""; 1098 // echo "<pre>";print_r($temp);echo "</pre>"; 1099 if($template == "chbd") $template = $temp->base; 1100 1090 1101 include(CHRONOSLY_PATH.DIRECTORY_SEPARATOR."metaboxes".DIRECTORY_SEPARATOR."chronosly_dad_framework_metabox.php"); 1091 1102 … … 1099 1110 $out1 = $out2 = ""; 1100 1111 $dadcats = apply_filters("chronosly_dad_tabs",$dadcats, $vista, $this->vars);//llamamos para generar el array de tabs 1101 foreach($dadcats as $id=>$name){ 1102 $out1 .='<li><a href="#'.$id.'">'.__($name, "chronosly").'</a></li>'; 1103 $out2 .='<ul id="'.$id.'">'; 1104 1105 $ret = ""; 1106 $out2.= apply_filters("chronosly_dad_tabs_content_$id", $ret, "dad1", $this->vars); 1107 $out2 .="</ul>"; 1108 } 1109 if(!$frontend or $frontend == 2){ 1110 if(!$frontend) echo "<ul>$out1</ul>$out2"; 1111 1112 //registramos el js para crear los addons en el dad del backend 1113 wp_register_script( 'chronosly-admin-elements', CHRONOSLY_URL.'/js/admin-elements.js', array( 'jquery' )); 1114 $translation_array = array( 1115 1116 "bubble_create_js_code" => json_encode($ch_bubble_create_js_code), 1117 "bubble_modify_js_code" => json_encode($ch_bubble_modify_js_code), 1118 "field_create_js_code" => json_encode($ch_field_create_js_code), 1119 "field_modify_js_code" => json_encode($ch_field_modify_js_code), 1120 "style_fields" => json_encode($ch_js_style_fields) 1121 ); 1122 wp_localize_script( 'chronosly-admin-elements', 'translated', $translation_array ); 1123 1124 wp_enqueue_script('chronosly-admin-elements'); 1125 } 1112 foreach($dadcats as $id=>$name){ 1113 $out1 .='<li><a href="#'.$id.'">'.__($name, "chronosly").'</a></li>'; 1114 $out2 .='<ul id="'.$id.'">'; 1115 1116 $ret = ""; 1117 // echo "chronosly_dad_tabs_content_$id"; 1118 $out2.= apply_filters("chronosly_dad_tabs_content_$id", $ret, "dad1", $this->vars); 1119 $out2 .="</ul>"; 1120 } 1121 if(!$frontend or $frontend == 2){ 1122 if(!$frontend) echo "<ul>$out1</ul>$out2"; 1123 1124 //registramos el js para crear los addons en el dad del backend 1125 wp_register_script( 'chronosly-admin-elements', CHRONOSLY_URL.'/js/admin-elements.js', array( 'jquery' )); 1126 $translation_array = array( 1127 1128 "bubble_create_js_code" => json_encode($ch_bubble_create_js_code), 1129 "bubble_modify_js_code" => json_encode($ch_bubble_modify_js_code), 1130 "field_create_js_code" => json_encode($ch_field_create_js_code), 1131 "field_modify_js_code" => json_encode($ch_field_modify_js_code), 1132 "style_fields" => json_encode($ch_js_style_fields) 1133 ); 1134 wp_localize_script( 'chronosly-admin-elements', 'translated', $translation_array ); 1135 1136 wp_enqueue_script('chronosly-admin-elements'); 1137 } 1126 1138 } 1127 1139 … … 1155 1167 add_filter("chronosly_field_tickets_note_check", array("Chronosly_Dad_Elements", "tickets_note_check_field"), 25, 1); 1156 1168 1169 1157 1170 $ret= array( 1158 1171 "event" => __("Event","chronosly"), … … 1231 1244 $i = 1; 1232 1245 add_filter("chronosly_bubble_ticket_list", array("Chronosly_Dad_Elements","set_new_bubble_ticket_list"), 10, 3); 1246 1233 1247 add_filter("chronosly_bubble_ticket_name", array("Chronosly_Dad_Elements","set_new_bubble_ticket_name"), 10, 3); 1234 1248 add_filter("chronosly_bubble_ticket_price", array("Chronosly_Dad_Elements","set_new_bubble_ticket_price"), 10, 3); 1235 1249 add_filter("chronosly_bubble_ticket_capacity", array("Chronosly_Dad_Elements","set_new_bubble_ticket_capacity"), 10, 3); 1250 add_filter("chronosly_bubble_ticket_link", array("Chronosly_Dad_Elements","set_new_bubble_ticket_link"), 10, 3); 1251 $return .= apply_filters("chronosly_bubble_ticket_list", 0, "", ""); 1236 1252 // add_filter("chronosly_bubble_ticket_min_per_user", array("Chronosly_Dad_Elements","set_new_bubble_ticket_min_per_user"), 10, 3); 1237 1253 // add_filter("chronosly_bubble_ticket_max_per_user", array("Chronosly_Dad_Elements","set_new_bubble_ticket_max_per_user"), 10, 3); 1238 1254 // add_filter("chronosly_bubble_ticket_start", array("Chronosly_Dad_Elements","set_new_bubble_ticket_start"), 10, 3); 1239 1255 // add_filter("chronosly_bubble_ticket_end", array("Chronosly_Dad_Elements","set_new_bubble_ticket_end"), 10, 3); 1240 add_filter("chronosly_bubble_ticket_notes", array("Chronosly_Dad_Elements","set_new_bubble_ticket_notes"), 10, 3); 1241 add_filter("chronosly_bubble_ticket_link", array("Chronosly_Dad_Elements","set_new_bubble_ticket_link"), 10, 3); 1242 $return .= apply_filters("chronosly_bubble_ticket_list", 0, "", ""); 1256 // add_filter("chronosly_bubble_ticket_notes", array("Chronosly_Dad_Elements","set_new_bubble_ticket_notes"), 10, 3); 1243 1257 //mirar el order 1244 1258 if(isset($vars->metas["tickets_vars"])){ … … 1445 1459 1446 1460 1447 public function parse_style($style , $html2=0){1461 public function parse_style($style){ 1448 1462 $s =array(); 1449 1463 $ex = explode(";", $style); … … 1483 1497 $color = $this->settings["chronosly_category_color"]; 1484 1498 } 1485 if(!$this->settings["chronosly_sale_color"]){1499 if(!$this->settings["chronosly_sale_color"]){ 1486 1500 $color2 = "#ff9711"; 1487 1501 } else $color2 = $this->settings["chronosly_sale_color"]; 1502 1488 1503 if($html2) $val = $value; 1489 1504 else $val = str_replace(array("#cat-color", "#sale-color", "#feat-image"), array($color,$color2, $featimg), $value); … … 1564 1579 1565 1580 public function print_item_box($item, $temp, $st, $html2=0){ 1566 global $tabs ;1581 global $tabs, $timestamp; 1567 1582 $out1 = $out2 = $out3 = $out11= $out111= ""; 1568 1583 $es = $this->parse_style($item->style); … … 1633 1648 } 1634 1649 //echo "chronosly_field_render_$type2<br/>"; 1635 if(($type2 == "custom_code" || $type2 == "custom_text") && $st == "back") $cont = " ".$value;1650 if(($type2 == "custom_code" || $type2 == "custom_text") && stripos($st,"back")!== FALSE) $cont = " ".$value; 1636 1651 else $cont = " ".apply_filters("chronosly_field_render_$type2", $cont,$value, $vars, $html2); 1637 1652 } … … 1641 1656 $width = "100%"; 1642 1657 $height = "200"; 1643 if($html2) $cont = "$tabs <div id='gmap{{id}}{{timestamp}}' class='ev-data $type' style='width:$width; height:{$height}px;#data_style'>\n$tabs $cont\n$tabs</div>";1658 if($html2) $cont = "$tabs <div id='gmap{{id}}{{timestamp}}' class='ev-data $type' style='width:$width; height:{$height}px;#data_style'>\n$tabs $cont\n$tabs</div>"; 1644 1659 else { 1645 1660 $cont = " $tabs<div id='gmap{$vars->pid}".$timestamp."' class='ev-data $type' style='width:$width; height:{$height}px;#data_style'>\n$tabs $cont\n$tabs </div>"; … … 1764 1779 public function print_template_html($id, $vista, $draganddropels="", $template ="", $style="back", $args = array()){ 1765 1780 global $timestamp; 1781 $timestamp = $timestamp+1; 1766 1782 $vars = $this->settings; 1767 1783 $data = ""; … … 1777 1793 // foreach($dads as $tid){ 1778 1794 $template = str_replace(" ", "_",$template); 1779 if( isset($args["start"]) and isset($args["end"]) and $args["start"] and $args["start"]) $itid .= "_{$args["start"]}_{$args["end"]}";1795 if($args["start"] and $args["end"]) $itid .= "_{$args["start"]}_{$args["end"]}"; 1780 1796 1781 1797 // if($style == "front" and $id =! 1 and $html = Chronosly_Cache::load_item($itid, $vista)) { … … 1786 1802 1787 1803 if(isset($vars['chronosly_template_default_active']) and $vars['chronosly_template_default_active'] and stripos($_SERVER['HTTP_REFERER'], "chronosly_edit_templates") === FALSE ) $template = $vars['chronosly_template_default']; 1788 if( isset($_REQUEST["force_template"])) $template = $_REQUEST["force_template"];1804 if($_REQUEST["force_template"]) $template = $_REQUEST["force_template"]; 1789 1805 1790 1806 if(!$template) $template = $this->get_tipo_template($id, $vista); 1791 1807 if(!$template) $template = $vars['chronosly_template_default']; 1792 if( isset($this->vars->metas["featured"][0]) and$this->vars->metas["featured"][0] and file_exists($path.$vista.DIRECTORY_SEPARATOR.$template."_featured.html")){1808 if($this->vars->metas["featured"][0] and file_exists($path.$vista.DIRECTORY_SEPARATOR.$template."_featured.html")){ 1793 1809 $f = fopen($path.$vista.DIRECTORY_SEPARATOR.$template."_featured.html", "r"); 1794 1810 $content = @fread($f, filesize($path.$vista.DIRECTORY_SEPARATOR.$template."_featured.html")); … … 1816 1832 $featimg = wp_get_attachment_url( get_post_thumbnail_id($pid) ); 1817 1833 } 1834 1818 1835 if(!$color){ 1819 1836 $color = $this->settings["chronosly_category_color"]; … … 1824 1841 1825 1842 $content = str_replace(array("#cat-color", "#sale-color", "#feat-image"), array($color,$color2, $featimg), $content); 1843 1826 1844 echo $content; 1827 1845 // if($style == "front") Chronosly_Cache::save_item($itid, $vista, $content); … … 1914 1932 $f = explode(" ", trim($rep), 2); 1915 1933 $func = $f[0]; 1916 $arg = isset($f[1])?$f[1]:"";1934 $arg = $f[1]; 1917 1935 $ret = $this->run_html_var_function($ret, $func, $arg); 1918 1936 } … … 1933 1951 1934 1952 $func = $f[0]; 1935 $arg = isset($f[1])?$f[1]:"";1953 $arg = $f[1]; 1936 1954 $ret = $this->run_html_var_function($ret, $func, $arg); 1937 1955 … … 2005 2023 return Chronosly_dad_elements::chronosly_create_tags("", $vars); 2006 2024 break; 2025 case "tickets_list": 2026 return Chronosly_dad_elements::chronosly_create_ticket_list("", $vars); 2027 break; 2007 2028 case "seasons_list 1": 2008 2029 if(class_exists("Chronosly_Tickets_and_Repeats_Extended")){ … … 2017 2038 } else return ""; 2018 2039 break; 2019 case "seasons_list": 2020 if(class_exists("Chronosly_Tickets_and_Repeats_Extended")){ 2021 // echo "HOLA"; 2022 return Chronosly_Tickets_and_Repeats_Extended::chronosly_create_seasons_item(0, $vars); 2023 } else return ""; 2024 break; 2025 2040 2026 2041 case "full_date": 2027 2042 case "full_time": … … 2072 2087 case "ticket_notes": 2073 2088 case "share_box": 2074 2089 2075 2090 return trim($var); 2076 2091 … … 2099 2114 do_shortcode(__($func." ".$arg, "chronosly")); 2100 2115 $ret = ob_get_contents(); 2116 if(!$ret){ 2117 echo do_shortcode(__($func." ".$arg, "chronosly")); 2118 $ret = ob_get_contents(); 2119 } 2101 2120 ob_end_clean(); 2102 2121 return $ret; … … 2153 2172 return Chronosly_dad_elements::create_ticket_note($cont, $arg, $vars); 2154 2173 break; 2155 2156 case "seasons_calendar":2174 2175 case "seasons_calendar": 2157 2176 if(class_exists("Chronosly_Tickets_and_Repeats_Extended")){ 2158 2177 return Chronosly_Tickets_and_Repeats_Extended::chronosly_create_seasons_calendar_item($cont, $arg, $vars); … … 2373 2392 echo "not recognized function $func<br>"; 2374 2393 } 2394 2375 2395 }//End class 2376 2396 … … 2379 2399 public $post = ""; 2380 2400 public $vista = ""; 2381 public $base = "";2382 public $style = "";2383 public $boxes = "";2384 2401 public $args = array(); 2385 2402 public $metas = array(); -
chronosly-events-calendar/tags/2.2.7/post-types/post_type_chronosly.php
r1277154 r1286972 858 858 859 859 //devolvemos la posicion en la que deberia ir segun los settings 860 public static function get_event_position($name, $meta, $id, $time ){860 public static function get_event_position($name, $meta, $id, $time, $h=-1, $m=-1){ 861 861 global $pastformat; 862 862 $settings = unserialize(get_option("chronosly-settings")); … … 1021 1021 $start = strtotime($meta["ev-from"][0]); 1022 1022 1023 if(class_exists("Chronosly_Tickets_and_Repeats_Extended") and isset($meta["events"][0])){1023 if(class_exists("Chronosly_Tickets_and_Repeats_Extended") and isset($meta["events"][0])){ 1024 1024 $eventos = json_decode($meta["events"][0]); 1025 1025 $find = 0; 1026 $sets = unserialize(get_option("chronosly_settings_tickets_and_repeats_extended")); 1026 1027 // echo $from." 00:00"; 1027 1028 // echo $to." 23:59"; 1028 1029 // echo "<pre>";print_r($eventos); 1029 foreach ($eventos as $ev) { 1030 if(strtotime($ev->start) >= strtotime($from." 00:00") 1031 and strtotime($ev->start) <= strtotime($to." 23:59")){ 1032 $find = 1; 1030 if(!$sets["seasons_normal_display"]){ 1031 foreach ($eventos as $ev) { 1032 if(strtotime($ev->start) >= strtotime($from." 00:00") 1033 and strtotime($ev->start) <= strtotime($to." 23:59")){ 1034 $find = 1; 1035 } 1036 } 1037 if(!$find) continue; 1038 $pos = Post_Type_Chronosly::get_event_position(get_the_title(),$meta, get_the_ID(), $start); 1039 if(Post_Type_Chronosly::filter(get_the_ID())) { 1040 $elements[$pos] = get_the_ID(); 1041 } 1042 } else { 1043 $tickets = array(); 1044 if( isset($meta["tickets"][0])) $tickets = json_decode($meta["tickets"][0]); 1045 if(Post_Type_Chronosly::filter(get_the_ID())) Post_Type_Chronosly::seasons($eventos, strtotime($from), strtotime($to),$meta, $name, get_the_ID(), $elements, $tickets); 1046 } 1047 } 1048 else { 1049 $pos = Post_Type_Chronosly::get_event_position(get_the_title(),$meta, get_the_ID(), $start); 1050 if(Post_Type_Chronosly::filter(get_the_ID())) { 1051 $elements[$pos] = get_the_ID(); 1052 } 1053 } 1054 1055 1056 } 1057 1058 } 1059 return $elements; 1060 1061 } 1062 1063 public static function seasons($eventos, $start, $end ,$meta, $name, $id, &$elements, $tickets){ 1064 $end = strtotime(date("Y-m-d", $end)." 23:59"); 1065 $settings = unserialize(get_option("chronosly-settings")); 1066 1067 // echo "<pre>";print_r($eventos); 1068 foreach($eventos as $evento){ 1069 $from = strtotime(substr($evento->start, 0, stripos($evento->start, "+")-1)); 1070 $to = strtotime(substr($evento->end, 0, stripos( $evento->end, "+")-1)); 1071 if($_REQUEST["ch-price-min"]){ 1072 if(!isset($evento->tickets)) continue; 1073 $tick = 0; 1074 //faltaria los sales que no los he podido controlar bien 1075 foreach ($evento->tickets as $t) { 1076 if($t->id && isset($tickets->tickets[$t->id])){ 1077 foreach ($tickets->tickets[$t->id] as $t1) { 1078 if($t1->name == "price" && $t1->value >= $_REQUEST["ch-price-min"]){ 1079 $tick = 1; 1080 } else if($t->sale && $t1->name == "sales-price" && $t1->value >= $_REQUEST["ch-price-min"]){ 1081 $tick = 1; 1033 1082 } 1034 } 1035 if(!$find) continue; 1036 } 1037 1038 $pos = Post_Type_Chronosly::get_event_position(get_the_title(),$meta, get_the_ID(), $start); 1039 if(Post_Type_Chronosly::filter(get_the_ID())) { 1040 $elements[$pos] = get_the_ID(); 1041 } 1042 1043 1044 } 1045 1046 } 1083 } 1084 1085 } 1086 } 1087 if(!$tick) continue; 1088 } 1089 if($_REQUEST["ch-price-max"]){ 1090 $tick = 0; 1091 //faltaria los sales que no los he podido controlar bien 1092 foreach ($evento->tickets as $t) { 1093 if($t->id && isset($tickets->tickets[$t->id])){ 1094 foreach ( $tickets->tickets[$t->id] as $t1) { 1095 if($t1->name == "price" && $t1->value <= $_REQUEST["ch-price-max"]){ 1096 $tick = 1; 1097 } else if($t->sale && $t1->name == "sales-price" && $t1->value <= $_REQUEST["ch-price-max"]){ 1098 $tick = 1; 1099 } 1100 } 1101 1102 } 1103 } 1104 if(!$tick) continue; 1105 } 1106 // print_r($evento); 1107 if(date('Y-m-d',$from) != date('Y-m-d',$to)) $to -= 60*60*24; 1108 1109 if($to >= $start and $from <= $end){ 1110 1111 1112 if($settings["chronosly_show_past_events"] != 1 or $from >= strtotime(date("Y-m-d"))) { 1113 $pos = Post_Type_Chronosly::get_event_position($name,$meta, $id, $from, date("H", $from), date("i", $from)); 1114 // echo $pos." "; 1115 $elements[$pos]= array("id" => $id,"start" => $from, "end" => $to , "h" => date("H", $from), "m"=> date("i", $from), "eh" => date("H", $to), "em"=> date("i", $to)); 1116 } 1117 1118 } 1119 } 1120 1047 1121 return $elements; 1048 1122 1049 1123 } 1050 1124 -
chronosly-events-calendar/trunk/README.txt
r1284685 r1286972 6 6 Requires at least: 3.1 7 7 Tested up to: 4.3.1 8 Stable tag: 2.2. 68 Stable tag: 2.2.7 9 9 License: GPLv2 10 10 -
chronosly-events-calendar/trunk/chronosly.php
r1284685 r1286972 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.2. 66 * Version: 2.2.7 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.2. 6"); //debug mode28 define('CHRONOSLY_VERSION', "2.2.7"); //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 -
chronosly-events-calendar/trunk/classes/chronosly_dad_elements.php
r1272735 r1286972 1241 1241 1242 1242 // print_r($vars->metas["ev-from"]); 1243 1244 1243 $lorem = 0; 1244 1245 1245 switch ($extra) { 1246 1246 case "full_datetime": … … 1303 1303 1304 1304 case "full_time": 1305 1306 1305 if ($html) { 1307 1306 $cont = str_replace("}}", " | time_format $value}}", $cont); 1308 1307 } 1309 1308 else { 1309 1310 1310 if (!$value) $value = $settings["chronosly_format_time"]; 1311 1311 if(!isset($vars->metas["events"][0]) or $vars->metas["events"][0] == "") { … … 1331 1331 if (!$cont) $cont = __("All day long", "chronosly"); 1332 1332 } else { 1333 $tickets = unserialize(get_option("chronosly_settings_tickets_and_repeats_extended")); 1334 if(stripos($vars->metas["ev-from-h"][0], ",")) $cont = __($tickets["event_repeats_seasons_name"], "chronosly")." "; 1335 $s = json_decode($vars->metas["ev-from-h"][0]); 1336 foreach($s as $id=>$s1) if($s1 == ":") $s[$id] = __("All day long", "chronosly"); 1337 if(is_array($s)) $cont .= implode(", ", $s); 1338 else $cont .= $s; 1333 1334 $sets = unserialize(get_option("chronosly_settings_tickets_and_repeats_extended")); 1335 1336 if(!$sets["seasons_normal_display"]){ 1337 $tickets = unserialize(get_option("chronosly_settings_tickets_and_repeats_extended")); 1338 if(stripos($vars->metas["ev-from-h"][0], ",")) $cont = __($tickets["event_repeats_seasons_name"], "chronosly")." "; 1339 $s = json_decode($vars->metas["ev-from-h"][0]); 1340 foreach($s as $id=>$s1) if($s1 == ":") $s[$id] = __("All day long", "chronosly"); 1341 if(is_array($s)) $cont .= implode(", ", $s); 1342 else $cont .= $s; 1343 } else { 1344 1345 $date1 = $vars->metas["ev-from"][0] . " " . $vars->metas["ev-from-h"][0] . ":" . $vars->metas["ev-from-m"][0]; 1346 1347 if($_REQUEST["repeat"]){ 1348 $ses = explode("_", $_REQUEST["repeat"]); 1349 if(count($ses) == 4) $date1 = $vars->metas["ev-from"][0] . " " . $ses[2] . ":" . $ses[3]; 1350 }else { 1351 1352 $date1 = $vars->metas["ev-from"][0] . " " . $vars->metas["ev-from-h"][0] . ":" . $vars->metas["ev-from-m"][0]; 1353 } 1354 $date1 = str_replace("<span class='lorem'></span>", "", $date1, $lorem); 1355 if (stripos($vars->metas["ev-from-h"][0], "'lorem'") === FALSE) $lorem = 0; 1356 $date1o = strtotime($date1); 1357 if (stripos($value, "%") === FALSE) $cont.= date_i18n($value, $date1o); 1358 else $cont.= strftime($value, $date1o); 1359 } 1360 1339 1361 } 1340 1362 } … … 1357 1379 else $cont.= strftime($value, $date1o); 1358 1380 } else { 1359 $tickets = unserialize(get_option("chronosly_settings_tickets_and_repeats_extended")); 1360 if(stripos($vars->metas["ev-from-h"][0], ",")) $cont = __($tickets["event_repeats_seasons_name"], "chronosly")." "; 1361 1362 $s = json_decode($vars->metas["ev-from-h"][0]); 1363 if(is_array($s)) $cont .= implode(", ", $s); 1364 else $cont .= $s; 1381 $sets = unserialize(get_option("chronosly_settings_tickets_and_repeats_extended")); 1382 1383 if(!$sets["seasons_normal_display"]){ 1384 $tickets = unserialize(get_option("chronosly_settings_tickets_and_repeats_extended")); 1385 if(stripos($vars->metas["ev-from-h"][0], ",")) $cont = __($tickets["event_repeats_seasons_name"], "chronosly")." "; 1386 1387 $s = json_decode($vars->metas["ev-from-h"][0]); 1388 if(is_array($s)) $cont .= implode(", ", $s); 1389 else $cont .= $s; 1390 } else { 1391 $date1 = $vars->metas["ev-from"][0] . " " . $vars->metas["ev-from-h"][0] . ":" . $vars->metas["ev-from-m"][0]; 1392 $date1 = str_replace("<span class='lorem'></span>", "", $date1, $lorem); 1393 if (stripos($vars->metas["ev-from-h"][0], "'lorem'") === FALSE) $lorem = 0; 1394 $date1o = strtotime($date1); 1395 if (stripos($value, "%") === FALSE) $cont.= date_i18n($value, $date1o); 1396 else $cont.= strftime($value, $date1o); 1397 } 1365 1398 } 1366 1399 } … … 1390 1423 } 1391 1424 else { 1392 1393 1425 if (!$value) $value = $settings["chronosly_format_date"]; 1394 1426 $date1 = $vars->metas["ev-from"][0]; 1427 // echo "<pre>";print_r($vars->metas); 1395 1428 if(!isset($vars->metas["events"][0]) or $vars->metas["events"][0] == "") $date1 .= " " . $vars->metas["ev-from-h"][0] . ":" . $vars->metas["ev-from-m"][0]; 1396 1429 $date1 = str_replace("<span class='lorem'></span>", "", $date1, $lorem); … … 1398 1431 $date1o = strtotime($date1); 1399 1432 if (stripos($value, "%") === FALSE) $cont.= date_i18n($value, $date1o); 1433 1400 1434 else $cont.= strftime($value, $date1o); 1401 1435 } … … 1435 1469 } else { 1436 1470 1437 $tickets = unserialize(get_option("chronosly_settings_tickets_and_repeats_extended")); 1438 if(stripos($vars->metas["ev-from-h"][0], ",")) $cont = __($tickets["event_repeats_seasons_name"], "chronosly")." "; 1439 ; 1440 1441 $s = json_decode($vars->metas["ev-from-h"][0]); 1442 1443 // $m = json_decode($vars->metas["ev-from-m"][0]); 1444 if(is_array($s)) { 1445 foreach ($s as $v) { 1446 if($v == ":") $cont .= __("All day long", "chronosly").", "; 1447 else $cont .= $v.", "; 1471 $sets = unserialize(get_option("chronosly_settings_tickets_and_repeats_extended")); 1472 1473 if(!$sets["seasons_normal_display"]){ 1474 $tickets = unserialize(get_option("chronosly_settings_tickets_and_repeats_extended")); 1475 if(stripos($vars->metas["ev-from-h"][0], ",")) $cont = __($tickets["event_repeats_seasons_name"], "chronosly")." "; 1476 1477 1478 $s = json_decode($vars->metas["ev-from-h"][0]); 1479 1480 // $m = json_decode($vars->metas["ev-from-m"][0]); 1481 if(is_array($s)) { 1482 foreach ($s as $v) { 1483 if($v == ":") $cont .= __("All day long", "chronosly").", "; 1484 else $cont .= $v.", "; 1485 } 1486 $cont = substr($cont, 0,-2); 1448 1487 } 1449 $cont = substr($cont, 0,-2); 1450 } 1451 else { 1452 if($s == ":") $cont .= __("All day long", "chronosly"); 1453 else $cont .= $s; 1488 else { 1489 if($s == ":") $cont .= __("All day long", "chronosly"); 1490 else $cont .= $s; 1491 } 1492 } else { 1493 $date1 = $vars->metas["ev-from"][0] . " " . $vars->metas["ev-from-h"][0] . ":" . $vars->metas["ev-from-m"][0]; 1494 $date1 = str_replace("<span class='lorem'></span>", "", $date1, $lorem); 1495 if (stripos($vars->metas["ev-from-h"][0], "'lorem'") === FALSE) $lorem = 0; 1496 $date1o = strtotime($date1); 1497 if (stripos($value, "%") === FALSE) $cont.= date_i18n($value, $date1o); 1498 else $cont.= strftime($value, $date1o); 1454 1499 } 1455 1500 // print_r($vars->metas["ev-from-h"][0]); -
chronosly-events-calendar/trunk/classes/chronosly_extend.php
r1284685 r1286972 623 623 624 624 625 -
chronosly-events-calendar/trunk/classes/chronosly_shortcode.php
r1284685 r1286972 480 480 } // END 481 481 482 -
chronosly-events-calendar/trunk/classes/chronosly_templates.php
r1272735 r1286972 1 1 <?php 2 //javascript call3 2 4 3 … … 27 26 add_action( 'wp_ajax_chronosly_get_tipo_template', array(&$this, 'js_get_tipo_template' )); 28 27 add_action( 'wp_ajax_chronosly_clear_cache', array(&$this, 'js_clear_cache' )); 28 add_action( 'wp_ajax_chronosly_save_all_html_templates', array(&$this, 'save_all_html_templates' )); 29 29 //add_filter( 'heartbeat_received', array(&$this, 'js_preview_theme' ), 10, 3 ); 30 30 //load init vars for templates … … 33 33 34 34 } 35 36 37 35 38 36 add_filter("chronosly_dad_tabs", array("Chronosly_Templates", "chronosly_get_default_dad_tabs"), 5, 3);//get de default tabs for dad … … 85 83 } 86 84 87 public function set_shortcode_template_css($template="default"){85 public function set_shortcode_template_css($template="default"){ 88 86 wp_register_style( "chronosly_$template", CHRONOSLY_TEMPLATES_URL.'/css/'.$template.'.css'); 89 87 wp_print_styles("chronosly_$template"); … … 123 121 } 124 122 } 125 126 123 127 124 … … 180 177 fwrite( $f , $html); 181 178 fclose($f); 182 179 // echo "hola"; 183 180 $this->template_2_html($name, $tid); 184 181 /* … … 316 313 while (false !== ($entry = readdir($handle))) { 317 314 if($entry != "." and $entry != ".." and !stripos($entry, ".html") ) 318 319 $custom_templates[] = str_replace(array(".php","_"), array("", " "),$entry); 315 $custom_templates[] = str_replace(array(".php","_"), array("", " "),$entry); 320 316 321 317 } … … 510 506 } 511 507 //faltan los calendars 512 513 508 return $return; 514 509 } … … 605 600 $this->vars->args = $args; 606 601 $itid = $id; 607 if( isset($args["start"]) and isset($args["end"])) $itid .= "_{$args["start"]}_{$args["end"]}";602 if($args["start"] and $args["end"]) $itid .= "_{$args["start"]}_{$args["end"]}"; 608 603 if($args["h"] and $args["m"]) $itid .= "_{$args["h"]}_{$args["m"]}"; 609 //si lo tenemos en la cache lo pintamos, si no lo generamos y lo guardamos 604 605 //controlamos para hacerlo por html o por json 610 606 611 607 $path = CHRONOSLY_TEMPLATES_PATH.DIRECTORY_SEPARATOR; 612 608 if(isset($vars['chronosly_template_default_active']) and $vars['chronosly_template_default_active'] and stripos($_SERVER['HTTP_REFERER'], "chronosly_edit_templates") === FALSE ) $template = $vars['chronosly_template_default']; 613 if( isset($_REQUEST["force_template"])) $template = $_REQUEST["force_template"];609 if($_REQUEST["force_template"]) $template = $_REQUEST["force_template"]; 614 610 615 611 if(!$template) $template = $this->get_tipo_template($id, $vista); … … 619 615 return $this->print_template_html($id, $vista, $draganddropels, $template, $style, $args, $html2); 620 616 } 621 622 617 // echo $path.$vista.DIRECTORY_SEPARATOR.$template.".html"; 618 619 //si lo tenemos en la cache lo pintamos, si no lo generamos y lo guardamos 623 620 if($style == "front" and $id != 1 and $html = Chronosly_Cache::load_item($itid, $vista)) { 624 621 echo $html; 625 622 } 626 623 else { 624 627 625 ob_start(); 628 626 … … 638 636 639 637 $this->render_template($template, $style, $vista, json_decode($data), $draganddropels, $html2 ); 638 640 639 } 641 640 $cont= str_replace("{{notprev}}", "",ob_get_clean()); 642 641 echo $cont; 642 643 643 if($style == "front") Chronosly_Cache::save_item($itid, $vista, $cont); 644 644 } … … 654 654 $path = CHRONOSLY_TEMPLATES_PATH;//ruta hacia los templates del user 655 655 $vars = $this->get_template_vars($path.DIRECTORY_SEPARATOR.$vista.DIRECTORY_SEPARATOR.$template.".php");//ruta hacia el dad que toca 656 656 657 } 657 658 if(($style == "back-addon" or $style == "back-addon-js") and isset($_REQUEST['addon']) and has_filter("chronosly_update_template_".$_REQUEST['addon'])) { … … 664 665 $args = $this->vars->args; 665 666 if($vars) $this->vars = $vars; 666 667 667 if($dadcats) $this->dadcats = $dadcats; 668 668 $this->vars->pid = $id; … … 675 675 } 676 676 else if ($style == "front"){ 677 677 678 $this->build_front_template($vista,$template, $html2); 678 679 … … 682 683 683 684 } 685 684 686 } 685 687 … … 696 698 //cargamos las variables necesarias para pintar el template, las metas de organizer, place, etc.. 697 699 private function get_all_vars($style){ 700 698 701 global $pastformat; 699 702 if(isset($this->vars->args["id"]) and $this->vars->args["id"]) { … … 717 720 if((!isset($this->vars->post) or !is_object($this->vars->post)) and isset($post[0])) $this->vars->post = $post[0]; 718 721 if(!isset($this->vars->pid) and isset($post[0])) $this->vars->pid = $post[0]->ID; 722 719 723 if($this->vars->vista != "dad11" and $this->vars->vista != "dad12" ) $this->vars->metas = get_post_meta($this->vars->pid);//assing metas vars 720 724 721 725 if(isset($this->vars->metas['organizer'])){ 722 726 foreach($this->vars->metas['organizer'] as $orgs){ 723 724 727 $orgs = unserialize($orgs); 725 728 … … 740 743 $this->vars->metas['organizer_vars'][] = array("post" => (isset($this->vars->post)?$this->vars->post:""), "metas" => $this->vars->metas); 741 744 } 745 742 746 if(isset($this->vars->metas['places'])){ 743 747 foreach($this->vars->metas['places'] as $orgs){ … … 746 750 foreach($orgs as $org){ 747 751 if(function_exists("icl_object_id")) $org = icl_object_id($org, "chronosly_places"); 748 749 752 $post = get_posts('post_type=chronosly_places&p='.$org); 750 753 $this->vars->metas['places_vars'][] = array("post" => $post[0], "metas" => get_post_meta($org)); … … 770 773 $this->vars->metas['cats_vars'][0]->metas = $this->vars->metas;//assing metas vars 771 774 } 775 772 776 //ordenamos segun orden 773 777 if(isset($this->vars->metas['cats_vars'])) usort($this->vars->metas['cats_vars'], array("Chronosly_Templates", "ordenar_cats")); 778 774 779 if($this->vars->vista != "dad11" and $this->vars->vista != "dad12" ){ 780 775 781 $tags = wp_get_object_terms($this->vars->pid, "chronosly_tag"); 776 782 foreach($tags as $tag){ … … 778 784 //faltan los metas 779 785 } 786 780 787 $vars = ""; 781 788 if(isset($this->vars->metas['tickets'])) $vars = json_decode($this->vars->metas['tickets'][0]); 789 782 790 if(isset($vars->tickets) and count($vars->tickets)){ 783 791 for($i = 1; $i < count($vars->tickets);++$i){ … … 788 796 789 797 } 798 790 799 } 800 791 801 $this->vars->link = get_post_permalink($this->vars->pid); 802 792 803 } 793 804 … … 798 809 foreach($this->vars->args as $k => $v){ 799 810 switch($k){ 800 case "id":811 case "id": 801 812 $this->vars->pid = $v; 802 813 if(!isset($this->vars->post)) $this->vars->post = new stdClass(); … … 828 839 829 840 break; 830 case "eh":841 case "eh": 831 842 $this->vars->metas['ev-to-h'][0] = $v; 832 843 833 844 834 845 break; 835 846 case "em": 836 847 $this->vars->metas['ev-to-m'][0] = $v; 837 848 838 849 839 850 break; 840 851 841 842 852 } 843 853 … … 846 856 847 857 //cargariamos el hook de data_field 848 // print_r($this->vars); 858 849 859 $this->set_default_text($style); 850 860 … … 945 955 $this->vars->metas["tickets_vars"][1]["title"] = "<span class='lorem'></span>Ticket lorem ipsum"; 946 956 $this->vars->metas["tickets_vars"][1]["price"] = "<span class='lorem'></span>49"; 947 $this->vars->metas["tickets_vars"][1]["capacity"] = "<span class='lorem'></span>100";948 957 $this->vars->metas["tickets_vars"][1]["sale-price"] = "<span class='lorem'></span>39"; 949 958 $this->vars->metas["tickets_vars"][1]["capacity"] = "<span class='lorem'></span>100"; 950 959 // $this->vars->metas["tickets_vars"][1]["min-user"] = "<span class='lorem'></span>1"; 951 960 // $this->vars->metas["tickets_vars"][1]["max-user"] = "<span class='lorem'></span>5"; … … 954 963 $this->vars->metas["tickets_vars"][1]["link"] = "<span class='lorem'></span>link.com"; 955 964 $this->vars->metas["tickets_vars"][1]["soldout"] = ""; 956 $this->vars->metas["tickets_vars"][1]["sale"] = "";965 $this->vars->metas["tickets_vars"][1]["sale"] = ""; 957 966 $this->vars->metas["tickets_vars"][1]["notes"] = "<span class='lorem'></span>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ultrices, ante commodo elementum posuere, velit justo fermentum enim, placerat tincidunt massa leo convallis purus. Praesent cursus arcu non tortor iaculis, eleifend lacinia enim euismod. Etiam consequat porttitor sapien, vitae feugiat nunc accumsan at. Mauris ultrices pretium lacus, vitae dapibus enim pharetra ut. Curabitur gravida vel lorem quis sollicitudin. Fusce commodo, mi et bibendum elementum, eros enim dapibus arcu, gravida rhoncus felis nulla ut eros. Suspendisse consequat ligula rhoncus erat gravida, et mollis quam placerat. Morbi in diam vestibulum, tempus ante molestie, pharetra nibh. Etiam nulla risus, imperdiet eu tincidunt a, hendrerit a elit. Nullam ut tincidunt augue. Aenean vehicula nulla sed ipsum bibendum, non congue risus mollis. Etiam dolor diam, semper nec sem et, convallis gravida urna."; 958 967 … … 1062 1071 1063 1072 //pintamos el template del admin 1064 private function build_admin_template($vista,$template, $variant= "back", $html= 0){1073 private function build_admin_template($vista,$template, $variant= "back", $html= 0){ 1065 1074 1066 1075 … … 1068 1077 $st = $variant; 1069 1078 $this->get_all_vars($st); 1070 1071 1079 if($variant == "back-js") { 1072 1080 $this->templates_tabs($vista, 1); … … 1076 1084 //else if($variant == "back-addon" or $variant == "back-addon-js") $this->templates_tabs($vista, 2); 1077 1085 $temp = $this->vars; 1078 if($template == "chbd") $template = isset($temp->base)?$temp->base:"";1086 if($template == "chbd") $template = $temp->base; 1079 1087 include(CHRONOSLY_PATH.DIRECTORY_SEPARATOR."metaboxes".DIRECTORY_SEPARATOR."chronosly_dad_framework_metabox.php"); 1080 1088 … … 1086 1094 $st = "front"; 1087 1095 $this->get_all_vars($st); 1096 1088 1097 $temp = $this->vars; 1089 if($template == "chbd") $template = isset($temp->base)?$temp->base:""; 1098 // echo "<pre>";print_r($temp);echo "</pre>"; 1099 if($template == "chbd") $template = $temp->base; 1100 1090 1101 include(CHRONOSLY_PATH.DIRECTORY_SEPARATOR."metaboxes".DIRECTORY_SEPARATOR."chronosly_dad_framework_metabox.php"); 1091 1102 … … 1099 1110 $out1 = $out2 = ""; 1100 1111 $dadcats = apply_filters("chronosly_dad_tabs",$dadcats, $vista, $this->vars);//llamamos para generar el array de tabs 1101 foreach($dadcats as $id=>$name){ 1102 $out1 .='<li><a href="#'.$id.'">'.__($name, "chronosly").'</a></li>'; 1103 $out2 .='<ul id="'.$id.'">'; 1104 1105 $ret = ""; 1106 $out2.= apply_filters("chronosly_dad_tabs_content_$id", $ret, "dad1", $this->vars); 1107 $out2 .="</ul>"; 1108 } 1109 if(!$frontend or $frontend == 2){ 1110 if(!$frontend) echo "<ul>$out1</ul>$out2"; 1111 1112 //registramos el js para crear los addons en el dad del backend 1113 wp_register_script( 'chronosly-admin-elements', CHRONOSLY_URL.'/js/admin-elements.js', array( 'jquery' )); 1114 $translation_array = array( 1115 1116 "bubble_create_js_code" => json_encode($ch_bubble_create_js_code), 1117 "bubble_modify_js_code" => json_encode($ch_bubble_modify_js_code), 1118 "field_create_js_code" => json_encode($ch_field_create_js_code), 1119 "field_modify_js_code" => json_encode($ch_field_modify_js_code), 1120 "style_fields" => json_encode($ch_js_style_fields) 1121 ); 1122 wp_localize_script( 'chronosly-admin-elements', 'translated', $translation_array ); 1123 1124 wp_enqueue_script('chronosly-admin-elements'); 1125 } 1112 foreach($dadcats as $id=>$name){ 1113 $out1 .='<li><a href="#'.$id.'">'.__($name, "chronosly").'</a></li>'; 1114 $out2 .='<ul id="'.$id.'">'; 1115 1116 $ret = ""; 1117 // echo "chronosly_dad_tabs_content_$id"; 1118 $out2.= apply_filters("chronosly_dad_tabs_content_$id", $ret, "dad1", $this->vars); 1119 $out2 .="</ul>"; 1120 } 1121 if(!$frontend or $frontend == 2){ 1122 if(!$frontend) echo "<ul>$out1</ul>$out2"; 1123 1124 //registramos el js para crear los addons en el dad del backend 1125 wp_register_script( 'chronosly-admin-elements', CHRONOSLY_URL.'/js/admin-elements.js', array( 'jquery' )); 1126 $translation_array = array( 1127 1128 "bubble_create_js_code" => json_encode($ch_bubble_create_js_code), 1129 "bubble_modify_js_code" => json_encode($ch_bubble_modify_js_code), 1130 "field_create_js_code" => json_encode($ch_field_create_js_code), 1131 "field_modify_js_code" => json_encode($ch_field_modify_js_code), 1132 "style_fields" => json_encode($ch_js_style_fields) 1133 ); 1134 wp_localize_script( 'chronosly-admin-elements', 'translated', $translation_array ); 1135 1136 wp_enqueue_script('chronosly-admin-elements'); 1137 } 1126 1138 } 1127 1139 … … 1155 1167 add_filter("chronosly_field_tickets_note_check", array("Chronosly_Dad_Elements", "tickets_note_check_field"), 25, 1); 1156 1168 1169 1157 1170 $ret= array( 1158 1171 "event" => __("Event","chronosly"), … … 1231 1244 $i = 1; 1232 1245 add_filter("chronosly_bubble_ticket_list", array("Chronosly_Dad_Elements","set_new_bubble_ticket_list"), 10, 3); 1246 1233 1247 add_filter("chronosly_bubble_ticket_name", array("Chronosly_Dad_Elements","set_new_bubble_ticket_name"), 10, 3); 1234 1248 add_filter("chronosly_bubble_ticket_price", array("Chronosly_Dad_Elements","set_new_bubble_ticket_price"), 10, 3); 1235 1249 add_filter("chronosly_bubble_ticket_capacity", array("Chronosly_Dad_Elements","set_new_bubble_ticket_capacity"), 10, 3); 1250 add_filter("chronosly_bubble_ticket_link", array("Chronosly_Dad_Elements","set_new_bubble_ticket_link"), 10, 3); 1251 $return .= apply_filters("chronosly_bubble_ticket_list", 0, "", ""); 1236 1252 // add_filter("chronosly_bubble_ticket_min_per_user", array("Chronosly_Dad_Elements","set_new_bubble_ticket_min_per_user"), 10, 3); 1237 1253 // add_filter("chronosly_bubble_ticket_max_per_user", array("Chronosly_Dad_Elements","set_new_bubble_ticket_max_per_user"), 10, 3); 1238 1254 // add_filter("chronosly_bubble_ticket_start", array("Chronosly_Dad_Elements","set_new_bubble_ticket_start"), 10, 3); 1239 1255 // add_filter("chronosly_bubble_ticket_end", array("Chronosly_Dad_Elements","set_new_bubble_ticket_end"), 10, 3); 1240 add_filter("chronosly_bubble_ticket_notes", array("Chronosly_Dad_Elements","set_new_bubble_ticket_notes"), 10, 3); 1241 add_filter("chronosly_bubble_ticket_link", array("Chronosly_Dad_Elements","set_new_bubble_ticket_link"), 10, 3); 1242 $return .= apply_filters("chronosly_bubble_ticket_list", 0, "", ""); 1256 // add_filter("chronosly_bubble_ticket_notes", array("Chronosly_Dad_Elements","set_new_bubble_ticket_notes"), 10, 3); 1243 1257 //mirar el order 1244 1258 if(isset($vars->metas["tickets_vars"])){ … … 1445 1459 1446 1460 1447 public function parse_style($style , $html2=0){1461 public function parse_style($style){ 1448 1462 $s =array(); 1449 1463 $ex = explode(";", $style); … … 1483 1497 $color = $this->settings["chronosly_category_color"]; 1484 1498 } 1485 if(!$this->settings["chronosly_sale_color"]){1499 if(!$this->settings["chronosly_sale_color"]){ 1486 1500 $color2 = "#ff9711"; 1487 1501 } else $color2 = $this->settings["chronosly_sale_color"]; 1502 1488 1503 if($html2) $val = $value; 1489 1504 else $val = str_replace(array("#cat-color", "#sale-color", "#feat-image"), array($color,$color2, $featimg), $value); … … 1564 1579 1565 1580 public function print_item_box($item, $temp, $st, $html2=0){ 1566 global $tabs ;1581 global $tabs, $timestamp; 1567 1582 $out1 = $out2 = $out3 = $out11= $out111= ""; 1568 1583 $es = $this->parse_style($item->style); … … 1633 1648 } 1634 1649 //echo "chronosly_field_render_$type2<br/>"; 1635 if(($type2 == "custom_code" || $type2 == "custom_text") && $st == "back") $cont = " ".$value;1650 if(($type2 == "custom_code" || $type2 == "custom_text") && stripos($st,"back")!== FALSE) $cont = " ".$value; 1636 1651 else $cont = " ".apply_filters("chronosly_field_render_$type2", $cont,$value, $vars, $html2); 1637 1652 } … … 1641 1656 $width = "100%"; 1642 1657 $height = "200"; 1643 if($html2) $cont = "$tabs <div id='gmap{{id}}{{timestamp}}' class='ev-data $type' style='width:$width; height:{$height}px;#data_style'>\n$tabs $cont\n$tabs</div>";1658 if($html2) $cont = "$tabs <div id='gmap{{id}}{{timestamp}}' class='ev-data $type' style='width:$width; height:{$height}px;#data_style'>\n$tabs $cont\n$tabs</div>"; 1644 1659 else { 1645 1660 $cont = " $tabs<div id='gmap{$vars->pid}".$timestamp."' class='ev-data $type' style='width:$width; height:{$height}px;#data_style'>\n$tabs $cont\n$tabs </div>"; … … 1764 1779 public function print_template_html($id, $vista, $draganddropels="", $template ="", $style="back", $args = array()){ 1765 1780 global $timestamp; 1781 $timestamp = $timestamp+1; 1766 1782 $vars = $this->settings; 1767 1783 $data = ""; … … 1777 1793 // foreach($dads as $tid){ 1778 1794 $template = str_replace(" ", "_",$template); 1779 if( isset($args["start"]) and isset($args["end"]) and $args["start"] and $args["start"]) $itid .= "_{$args["start"]}_{$args["end"]}";1795 if($args["start"] and $args["end"]) $itid .= "_{$args["start"]}_{$args["end"]}"; 1780 1796 1781 1797 // if($style == "front" and $id =! 1 and $html = Chronosly_Cache::load_item($itid, $vista)) { … … 1786 1802 1787 1803 if(isset($vars['chronosly_template_default_active']) and $vars['chronosly_template_default_active'] and stripos($_SERVER['HTTP_REFERER'], "chronosly_edit_templates") === FALSE ) $template = $vars['chronosly_template_default']; 1788 if( isset($_REQUEST["force_template"])) $template = $_REQUEST["force_template"];1804 if($_REQUEST["force_template"]) $template = $_REQUEST["force_template"]; 1789 1805 1790 1806 if(!$template) $template = $this->get_tipo_template($id, $vista); 1791 1807 if(!$template) $template = $vars['chronosly_template_default']; 1792 if( isset($this->vars->metas["featured"][0]) and$this->vars->metas["featured"][0] and file_exists($path.$vista.DIRECTORY_SEPARATOR.$template."_featured.html")){1808 if($this->vars->metas["featured"][0] and file_exists($path.$vista.DIRECTORY_SEPARATOR.$template."_featured.html")){ 1793 1809 $f = fopen($path.$vista.DIRECTORY_SEPARATOR.$template."_featured.html", "r"); 1794 1810 $content = @fread($f, filesize($path.$vista.DIRECTORY_SEPARATOR.$template."_featured.html")); … … 1816 1832 $featimg = wp_get_attachment_url( get_post_thumbnail_id($pid) ); 1817 1833 } 1834 1818 1835 if(!$color){ 1819 1836 $color = $this->settings["chronosly_category_color"]; … … 1824 1841 1825 1842 $content = str_replace(array("#cat-color", "#sale-color", "#feat-image"), array($color,$color2, $featimg), $content); 1843 1826 1844 echo $content; 1827 1845 // if($style == "front") Chronosly_Cache::save_item($itid, $vista, $content); … … 1914 1932 $f = explode(" ", trim($rep), 2); 1915 1933 $func = $f[0]; 1916 $arg = isset($f[1])?$f[1]:"";1934 $arg = $f[1]; 1917 1935 $ret = $this->run_html_var_function($ret, $func, $arg); 1918 1936 } … … 1933 1951 1934 1952 $func = $f[0]; 1935 $arg = isset($f[1])?$f[1]:"";1953 $arg = $f[1]; 1936 1954 $ret = $this->run_html_var_function($ret, $func, $arg); 1937 1955 … … 2005 2023 return Chronosly_dad_elements::chronosly_create_tags("", $vars); 2006 2024 break; 2025 case "tickets_list": 2026 return Chronosly_dad_elements::chronosly_create_ticket_list("", $vars); 2027 break; 2007 2028 case "seasons_list 1": 2008 2029 if(class_exists("Chronosly_Tickets_and_Repeats_Extended")){ … … 2017 2038 } else return ""; 2018 2039 break; 2019 case "seasons_list": 2020 if(class_exists("Chronosly_Tickets_and_Repeats_Extended")){ 2021 // echo "HOLA"; 2022 return Chronosly_Tickets_and_Repeats_Extended::chronosly_create_seasons_item(0, $vars); 2023 } else return ""; 2024 break; 2025 2040 2026 2041 case "full_date": 2027 2042 case "full_time": … … 2072 2087 case "ticket_notes": 2073 2088 case "share_box": 2074 2089 2075 2090 return trim($var); 2076 2091 … … 2099 2114 do_shortcode(__($func." ".$arg, "chronosly")); 2100 2115 $ret = ob_get_contents(); 2116 if(!$ret){ 2117 echo do_shortcode(__($func." ".$arg, "chronosly")); 2118 $ret = ob_get_contents(); 2119 } 2101 2120 ob_end_clean(); 2102 2121 return $ret; … … 2153 2172 return Chronosly_dad_elements::create_ticket_note($cont, $arg, $vars); 2154 2173 break; 2155 2156 case "seasons_calendar":2174 2175 case "seasons_calendar": 2157 2176 if(class_exists("Chronosly_Tickets_and_Repeats_Extended")){ 2158 2177 return Chronosly_Tickets_and_Repeats_Extended::chronosly_create_seasons_calendar_item($cont, $arg, $vars); … … 2373 2392 echo "not recognized function $func<br>"; 2374 2393 } 2394 2375 2395 }//End class 2376 2396 … … 2379 2399 public $post = ""; 2380 2400 public $vista = ""; 2381 public $base = "";2382 public $style = "";2383 public $boxes = "";2384 2401 public $args = array(); 2385 2402 public $metas = array(); -
chronosly-events-calendar/trunk/post-types/post_type_chronosly.php
r1277154 r1286972 858 858 859 859 //devolvemos la posicion en la que deberia ir segun los settings 860 public static function get_event_position($name, $meta, $id, $time ){860 public static function get_event_position($name, $meta, $id, $time, $h=-1, $m=-1){ 861 861 global $pastformat; 862 862 $settings = unserialize(get_option("chronosly-settings")); … … 1021 1021 $start = strtotime($meta["ev-from"][0]); 1022 1022 1023 if(class_exists("Chronosly_Tickets_and_Repeats_Extended") and isset($meta["events"][0])){1023 if(class_exists("Chronosly_Tickets_and_Repeats_Extended") and isset($meta["events"][0])){ 1024 1024 $eventos = json_decode($meta["events"][0]); 1025 1025 $find = 0; 1026 $sets = unserialize(get_option("chronosly_settings_tickets_and_repeats_extended")); 1026 1027 // echo $from." 00:00"; 1027 1028 // echo $to." 23:59"; 1028 1029 // echo "<pre>";print_r($eventos); 1029 foreach ($eventos as $ev) { 1030 if(strtotime($ev->start) >= strtotime($from." 00:00") 1031 and strtotime($ev->start) <= strtotime($to." 23:59")){ 1032 $find = 1; 1030 if(!$sets["seasons_normal_display"]){ 1031 foreach ($eventos as $ev) { 1032 if(strtotime($ev->start) >= strtotime($from." 00:00") 1033 and strtotime($ev->start) <= strtotime($to." 23:59")){ 1034 $find = 1; 1035 } 1036 } 1037 if(!$find) continue; 1038 $pos = Post_Type_Chronosly::get_event_position(get_the_title(),$meta, get_the_ID(), $start); 1039 if(Post_Type_Chronosly::filter(get_the_ID())) { 1040 $elements[$pos] = get_the_ID(); 1041 } 1042 } else { 1043 $tickets = array(); 1044 if( isset($meta["tickets"][0])) $tickets = json_decode($meta["tickets"][0]); 1045 if(Post_Type_Chronosly::filter(get_the_ID())) Post_Type_Chronosly::seasons($eventos, strtotime($from), strtotime($to),$meta, $name, get_the_ID(), $elements, $tickets); 1046 } 1047 } 1048 else { 1049 $pos = Post_Type_Chronosly::get_event_position(get_the_title(),$meta, get_the_ID(), $start); 1050 if(Post_Type_Chronosly::filter(get_the_ID())) { 1051 $elements[$pos] = get_the_ID(); 1052 } 1053 } 1054 1055 1056 } 1057 1058 } 1059 return $elements; 1060 1061 } 1062 1063 public static function seasons($eventos, $start, $end ,$meta, $name, $id, &$elements, $tickets){ 1064 $end = strtotime(date("Y-m-d", $end)." 23:59"); 1065 $settings = unserialize(get_option("chronosly-settings")); 1066 1067 // echo "<pre>";print_r($eventos); 1068 foreach($eventos as $evento){ 1069 $from = strtotime(substr($evento->start, 0, stripos($evento->start, "+")-1)); 1070 $to = strtotime(substr($evento->end, 0, stripos( $evento->end, "+")-1)); 1071 if($_REQUEST["ch-price-min"]){ 1072 if(!isset($evento->tickets)) continue; 1073 $tick = 0; 1074 //faltaria los sales que no los he podido controlar bien 1075 foreach ($evento->tickets as $t) { 1076 if($t->id && isset($tickets->tickets[$t->id])){ 1077 foreach ($tickets->tickets[$t->id] as $t1) { 1078 if($t1->name == "price" && $t1->value >= $_REQUEST["ch-price-min"]){ 1079 $tick = 1; 1080 } else if($t->sale && $t1->name == "sales-price" && $t1->value >= $_REQUEST["ch-price-min"]){ 1081 $tick = 1; 1033 1082 } 1034 } 1035 if(!$find) continue; 1036 } 1037 1038 $pos = Post_Type_Chronosly::get_event_position(get_the_title(),$meta, get_the_ID(), $start); 1039 if(Post_Type_Chronosly::filter(get_the_ID())) { 1040 $elements[$pos] = get_the_ID(); 1041 } 1042 1043 1044 } 1045 1046 } 1083 } 1084 1085 } 1086 } 1087 if(!$tick) continue; 1088 } 1089 if($_REQUEST["ch-price-max"]){ 1090 $tick = 0; 1091 //faltaria los sales que no los he podido controlar bien 1092 foreach ($evento->tickets as $t) { 1093 if($t->id && isset($tickets->tickets[$t->id])){ 1094 foreach ( $tickets->tickets[$t->id] as $t1) { 1095 if($t1->name == "price" && $t1->value <= $_REQUEST["ch-price-max"]){ 1096 $tick = 1; 1097 } else if($t->sale && $t1->name == "sales-price" && $t1->value <= $_REQUEST["ch-price-max"]){ 1098 $tick = 1; 1099 } 1100 } 1101 1102 } 1103 } 1104 if(!$tick) continue; 1105 } 1106 // print_r($evento); 1107 if(date('Y-m-d',$from) != date('Y-m-d',$to)) $to -= 60*60*24; 1108 1109 if($to >= $start and $from <= $end){ 1110 1111 1112 if($settings["chronosly_show_past_events"] != 1 or $from >= strtotime(date("Y-m-d"))) { 1113 $pos = Post_Type_Chronosly::get_event_position($name,$meta, $id, $from, date("H", $from), date("i", $from)); 1114 // echo $pos." "; 1115 $elements[$pos]= array("id" => $id,"start" => $from, "end" => $to , "h" => date("H", $from), "m"=> date("i", $from), "eh" => date("H", $to), "em"=> date("i", $to)); 1116 } 1117 1118 } 1119 } 1120 1047 1121 return $elements; 1048 1122 1049 1123 } 1050 1124
Note: See TracChangeset
for help on using the changeset viewer.