- Cambios para empezar a mostrar los congresos sin necesidad de usar Event Espresso.

git-svn-id: https://192.168.0.254/svn/Proyectos.FundacionLQDVI_Web/trunk@63 77ab8c26-3d69-2c4d-86f2-786f4ba54905
This commit is contained in:
David Arranz 2016-09-02 16:56:56 +00:00
parent dc538e1bc2
commit 8b8fe18356
6 changed files with 1090 additions and 54 deletions

View File

@ -599,9 +599,9 @@ window.CMB = (function(window, document, $, undefined){
$selector.timePicker({
startTime: "00:00",
endTime: "23:59",
show24Hours: false,
show24Hours: true,
separator: ':',
step: 30
step: 15
});
};
@ -611,7 +611,10 @@ window.CMB = (function(window, document, $, undefined){
}
$selector.datepicker( "destroy" );
$selector.datepicker();
$selector.datepicker({
dateFormat: "yy-mm-dd",
firstDay: 1 // Monday
});
};
cmb.initColorPickers = function( $selector ) {

File diff suppressed because one or more lines are too long

View File

@ -184,8 +184,27 @@ function lqdvi_congresos_metaboxes(array $meta_boxes) {
'name' => __("Fecha del congreso", LQDVI_THEME_NAME),
'desc' => __("Fecha del congreso", LQDVI_THEME_NAME),
'id' => $prefix . 'fecha',
'type' => 'text',
//'type' => 'text',
'type' => 'text_date',
),
array(
'name' => __("Hora de inicio", LQDVI_THEME_NAME),
'desc' => __("Hora de inicio del congreso", LQDVI_THEME_NAME),
'id' => $prefix . 'hora_inicio',
'type' => 'text_time',
),
array(
'name' => __("Hora de finalización", LQDVI_THEME_NAME),
'desc' => __("Hora de finalización del congreso", LQDVI_THEME_NAME),
'id' => $prefix . 'hora_fin',
'type' => 'text_time',
),
array(
'name' => __("Fecha de inicio de inscripciones", LQDVI_THEME_NAME),
'desc' => __("Fecha de inicio de inscripciones", LQDVI_THEME_NAME),
'id' => $prefix . 'fecha_inicio_inscripciones',
'type' => 'text_date',
),
array(
'name' => __("Post ID", LQDVI_THEME_NAME),
'desc' => __("ID del post donde se habla del congreso en el blog", LQDVI_THEME_NAME),
@ -211,8 +230,9 @@ function lqdvi_congresos_metaboxes(array $meta_boxes) {
'desc' => __("Lugar del congreso", LQDVI_THEME_NAME),
'id' => $prefix . 'lugar',
'type' => 'wysiwyg',
'options' => array('textarea_rows' => 5,),
'options' => array('textarea_rows' => 5),
),
array(
'name' => __("Ponentes", LQDVI_THEME_NAME),
'desc' => __("Ponentes del congreso", LQDVI_THEME_NAME),

View File

@ -76,10 +76,12 @@ add_shortcode('lqdvi_congresos', 'lqdvi_congresos_processing');
function lqdvi_congreso_processing($atts, $content = null) {
extract(shortcode_atts(array(
'item' => '',
'item_id' => '',
'item_id' => '',
'speaker_link' => true,
'show_program' => false,
'show_post' => false,
'show_speakers' => true,
'show_post_content' => true,
), $atts));
global $options;
@ -99,7 +101,10 @@ function lqdvi_congreso_processing($atts, $content = null) {
}
foreach ($congresos as $congreso) {
$congresos_texto .= $congreso->post_content;
if ($show_post_content) {
$congresos_texto .= 'divider line_type="Full Width Line" custom_height="10"';
$congresos_texto .= $congreso->post_content;
}
/* Video del congreso */
$video_url = get_post_meta($congreso->ID, 'lqdvi_congreso_video_vimeo', true);
@ -128,54 +133,56 @@ function lqdvi_congreso_processing($atts, $content = null) {
}
/* Ponentes */
$ponentes = get_post_meta($congreso->ID, 'lqdvi_congreso_lista_ponentes', true);
if (!empty($ponentes)) {
$total = count($ponentes);
switch($total) {
case 1:
$class = '1/1'; //'span_12';
break;
case 2:
$class = '1/2'; //'span_6';
break;
case 3:
$class = '1/3'; //'span_4';
break;
case 4:
$class = '1/4'; //'span_3';
break;
case 5:
$class = '1/6'; //'span_2';
break;
default:
$class = '1/6'; //'span_1';
break;
}
$congresos_texto .= '
[vc_row bottom_padding="0"]
[vc_column width="1/1"]
[vc_column_text]
<h2>' . __traducir('Speakers', LQDVI_THEME_NAME) . '</h2>
[/vc_column_text]
[/vc_column]
';
if ($show_speakers) {
$ponentes = get_post_meta($congreso->ID, 'lqdvi_congreso_lista_ponentes', true);
if (!empty($ponentes)) {
$total = count($ponentes);
switch($total) {
case 1:
$class = '1/1'; //'span_12';
break;
case 2:
$class = '1/2'; //'span_6';
break;
case 3:
$class = '1/3'; //'span_4';
break;
case 4:
$class = '1/4'; //'span_3';
break;
case 5:
$class = '1/6'; //'span_2';
break;
default:
$class = '1/6'; //'span_1';
break;
}
$congresos_texto .= '[vc_row_inner]';
$hide_speaker_desc = get_post_meta($congreso->ID, 'lqdvi_congreso_ponentes_no_desc', true);
foreach ($ponentes as $ponente) {
$congresos_texto .= '
[vc_column width="'. $class .'" enable_animation="true" animation="fade-in"]
[vc_column_text]' . lqdvi_shortcode_ponente(array('name' => $ponente, 'with_link' => $speaker_link, 'show_desc' => !$hide_speaker_desc)) . '
[/vc_column_text]
[/vc_column]
[vc_row bottom_padding="0"]
[vc_column width="1/1"]
[vc_column_text]
<h2>' . __traducir('Speakers', LQDVI_THEME_NAME) . '</h2>
[/vc_column_text]
[/vc_column]
';
}
$congresos_texto .= '[/vc_row_inner]';
$congresos_texto .= '[/vc_row]';
$congresos_texto .= '[vc_row_inner]';
$hide_speaker_desc = get_post_meta($congreso->ID, 'lqdvi_congreso_ponentes_no_desc', true);
foreach ($ponentes as $ponente) {
$congresos_texto .= '
[vc_column width="'. $class .'" enable_animation="true" animation="fade-in"]
[vc_column_text]' . lqdvi_shortcode_ponente(array('name' => $ponente, 'with_link' => $speaker_link, 'show_desc' => !$hide_speaker_desc)) . '
[/vc_column_text]
[/vc_column]
';
}
$congresos_texto .= '[/vc_row_inner]';
$congresos_texto .= '[/vc_row]';
}
}
// Fotos del congreso debajo de los ponentes (si NO hay video)
@ -189,7 +196,7 @@ function lqdvi_congreso_processing($atts, $content = null) {
';
}
// Programa del congreso
// Programa del congreso
if ($show_program) {
$congresos_texto .= '[vc_row][vc_column width="1/1"][divider line_type="Full Width Line" custom_height="10"][/vc_column][/vc_row]';
$congresos_texto .= '[vc_row]';
@ -205,7 +212,7 @@ function lqdvi_congreso_processing($atts, $content = null) {
}
/* Programa */
/* Programa */
$programa = get_post_meta($congreso->ID, 'lqdvi_congreso_programa', true);
if (!empty($programa)) {
$programa = force_balance_tags( $programa );

View File

@ -818,6 +818,71 @@ function __traducir($cadena, $contexto = LQDVI_THEME_NAME, $name = '') {
return $result;
}
/*
* Formats a date
* @params date $date
* @params string $format - format for the date
*/
function lqdvi_format_date($date, $format = '') {
$format = $format == '' ? get_option('date_format') : $format;
if (empty($date)) {
$date_display = NULL;
} else {
$date_display = date_i18n($format, strtotime($date)); //Fixed for international use
}
return $date_display;
}
/*
* Creates a Google Map Link
*/
function lqdvi_google_map_link($atts) {
extract(shortcode_atts(array(
'address' => '',
'text' => '',
'type' => 'text',
'map_w' => 400,
'map_h' => 400,
'map_image_class' => '',
), $atts));
extract($atts);
/*$address = "{$address}";
$text = isset($text) ? "{$text}" : "";
$type = isset($type) ? "{$type}" : "";
$map_w = isset($map_w) ? "{$map_w}" : 400;
$map_h = isset($map_h) ? "{$map_h}" : 400;
$map_image_class = isset($map_image_class) ? "{$map_image_class}" : '';*/
//$gaddress = ($address != '' ? $address : '') . ($city != '' ? ',' . $city : '') . ($state != '' ? ',' . $state : '') . ($zip != '' ? ',' . $zip : '') . ($country != '' ? ',' . $country : '');
$google_map = htmlentities2('http://maps.google.com/maps?q=' . urlencode($address));
switch ($type) {
case 'text':
default:
$text = $text == '' ? __traducir('Map and Directions', 'event_espresso') : $text;
break;
case 'url':
$text = $google_map;
break;
case 'map':
$google_map_link = '<a href="' . $google_map . '" target="_blank">' .
'<img id="venue_map_' . $id . '" ' . $map_image_class .
' src="' . htmlentities2('http://maps.googleapis.com/maps/api/staticmap?center=' . urlencode($address) . '&amp;zoom=14&amp;size=' .
$map_w . 'x' . $map_h . '&amp;markers=color:green|label:|' .
urlencode($address) . '&amp;sensor=false') . '" /></a>';
return $google_map_link;
}
$google_map_link = '<a href="' . $google_map . '" target="_blank">' . $text . '</a>';
return $google_map_link;
}
/* * ***********************************************************************************
* Woocommerce
* *********************************************************************************** */

View File

@ -0,0 +1,142 @@
<?php get_header(); ?>
<?php nectar_page_header($post->ID); ?>
<div class="container-wrap">
<div class="container main-content">
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php
$fecha_congreso = get_post_meta($post->ID, 'lqdvi_congreso_fecha', true);
$hora_inicio = get_post_meta($post->ID, 'lqdvi_congreso_hora_inicio', true);
$hora_fin = get_post_meta($post->ID, 'lqdvi_congreso_hora_fin', true);
$fecha_inicio_inscripciones = get_post_meta($post->ID, 'lqdvi_congreso_fecha_inicio_inscripciones', true);
$lugar = get_post_meta($post->ID, 'lqdvi_congreso_lugar', true);
$foto_url = wp_get_attachment_url(get_post_thumbnail_id($congreso->ID));
$congreso_finalizado = (strtotime("now") > strtotime($fecha_congreso));
$inscripciones_han_comenzado = (strtotime("now") >= strtotime($fecha_inicio_inscripciones));
// Información del congreso
$info_txt = '';
$info_txt .= '<h3>' . __traducir('Information', LQDVI_THEME_NAME) . '</h3>';
$info_txt .= '<strong>' . __traducir('Date', LQDVI_THEME_NAME) . ': </strong>' . lqdvi_format_date($fecha_congreso) . '<br/>';
$info_txt .= (!empty($hora_inicio) ? '<strong>' . __traducir('Start time', LQDVI_THEME_NAME) . ': </strong>' . $hora_inicio . 'h.' : '') . '<br/>';
$info_txt .= (!empty($hora_fin) ? '<strong>' . __traducir('End time', LQDVI_THEME_NAME) . ': </strong>' . $hora_fin . 'h.' : '') . '<br/>';
$lugar_txt = '';
$lugar_txt .= '<h3>' . __traducir('Place', LQDVI_THEME_NAME) . '</h3>';
$lugar_txt .= $lugar;
$lugar_txt .= '<br/>' . lqdvi_google_map_link(array('address' => $lugar, 'type' => 'text'));
if (!$inscripciones_han_comenzado && !empty($foto_url)) {
$lugar_txt .= '<br/><br/>[image_with_animation image_url="'. $foto_url .'" alignment="center" animation="Fade In"]';
}
// Sidebar del congreso
$sidebar_txt = '';
if (lqdvi_is_national_congress($post)) {
ob_start();
dynamic_sidebar('national-congresse-sidebar');
$sidebar_txt = ob_get_contents();
ob_end_clean();
} else {
ob_start();
dynamic_sidebar('international-congresse-sidebar');
$sidebar_txt = ob_get_contents();
ob_end_clean();
}
// Formulario de registro
$form_txt = '';
// Descripción del evento
$desc_txt = '';
if (!$inscripciones_han_comenzado) {
$desc_txt .= '<div style="background: #0072cf; text-align: center; padding: 30px 0;"><h4 style="color: #fff !important;">' .
__traducir('You will be able to register starting ', 'event_espresso') . ' ' . lqdvi_format_date($fecha_inicio_inscripciones) .
'</h4></div><br>';
}
$meta_txt = get_post_meta($post->ID, 'lqdvi_congreso_evento_descripcion', true);
if (!empty($meta_txt)) {
$desc_txt .= $meta_txt;
} else {
$desc_txt .= get_the_content();
}
// Contruir la página de registro
$registro_txt = '';
$registro_txt .= '[vc_row type="in_container" text_color="dark" text_align="left"]';
$registro_txt .= '[vc_column width="2/3" animation="Fade In"]';
if (!empty($desc_txt) || !empty($form_txt)) {
$registro_txt .= '[vc_column_text]';
$registro_txt .= $desc_txt;
$registro_txt .= '[/vc_column_text]';
$registro_txt .= '[vc_column_text]';
$registro_txt .= $form_txt;
$registro_txt .= '[/vc_column_text]';
if ($is_active['status'] != 'REGISTRATION_OPEN') {
$registro_txt .= '[vc_column_text]';
$registro_txt .= $sidebar_txt;
$registro_txt .= '[/vc_column_text]';
}
} else {
$registro_txt .= '[vc_column_text]';
$registro_txt .= $info_txt;
$registro_txt .= '[/vc_column_text]';
$registro_txt .= '[vc_column_text]';
$registro_txt .= $sidebar_txt;
$registro_txt .= '[/vc_column_text]';
}
$registro_txt .= '[/vc_column]';
$registro_txt .= '[vc_column width="1/3" animation="Fade In"]';
$registro_txt .= '[vc_column_text]';
if (!empty($desc_txt) || !empty($form_txt)) {
$registro_txt .= $info_txt;
}
$registro_txt .= $lugar_txt;
if ($is_active['status'] == 'REGISTRATION_OPEN') {
$registro_txt .= $sidebar_txt;
}
$registro_txt .= '[/vc_column_text]';
$registro_txt .= '[/vc_column]';
$registro_txt .= '[/vc_row]';
$registro_txt .= '[vc_row][vc_column width="1/1"][/vc_column][/vc_row]';
echo do_shortcode($registro_txt);
?>
<?php echo lqdvi_congreso_processing(array(
//'item' => the_slug(false),
'item_id' => get_the_ID(),
'speaker_link' => ($congreso_finalizado) ? true : false,
'show_program' => ($inscripciones_han_comenzado) ? true : false,
'show_post' => true,
'show_speakers' => ($inscripciones_han_comenzado) ? true : false,
'show_post_content' => false
)); ?>
<?php endwhile; ?>
<?php endif; ?>
</div><!--/row-->
</div><!--/container-->
<?php get_footer(); ?>