‘;
echo ‘‘;
echo ‘
echo ‘‘;
echo ‘‘;
echo ‘
// Basic CSS for demo page
echo ‘
‘;
echo ‘‘;
echo ‘
// Header
echo ‘
echo ‘
Chess Events Calendar Demo
‘;
echo ‘
‘;
// Main content
echo ‘
echo ‘
echo ‘
Note: This is a demo page for the Chess Events Calendar plugin. In a real WordPress setup, you would use the shortcode [chess_events_calendar]
in your posts or pages.
‘;
echo ‘
‘;
// Include the plugin file to simulate WordPress environment
// This is just for demo purposes – normally WordPress would load this
include_once ‘chess-events-calendar.php’;
// Create a mock WordPress environment
if (!function_exists(‘add_shortcode’)) {
function add_shortcode($tag, $func) {
$GLOBALS[‘shortcodes’][$tag] = $func;
return true;
}
}
if (!function_exists(‘add_action’)) {
function add_action($tag, $func) {
return true;
}
}
if (!function_exists(‘wp_enqueue_style’)) {
function wp_enqueue_style($handle, $src = ”, $deps = array(), $ver = false, $media = ‘all’) {
echo ‘‘;
}
}
if (!function_exists(‘wp_enqueue_script’)) {
function wp_enqueue_script($handle, $src = ”, $deps = array(), $ver = false, $in_footer = false) {
echo ‘‘;
}
}
if (!function_exists(‘shortcode_atts’)) {
function shortcode_atts($pairs, $atts) {
return $pairs;
}
}
if (!function_exists(‘esc_attr’)) {
function esc_attr($text) {
return htmlspecialchars($text, ENT_QUOTES, ‘UTF-8’);
}
}
if (!function_exists(‘esc_html’)) {
function esc_html($text) {
return htmlspecialchars($text, ENT_QUOTES, ‘UTF-8’);
}
}
if (!function_exists(‘esc_attr_e’)) {
function esc_attr_e($text) {
echo esc_attr($text);
}
}
if (!function_exists(‘esc_html_e’)) {
function esc_html_e($text) {
echo esc_html($text);
}
}
// Initialize the plugin
$chess_events = new Chess_Events_Calendar();
// Output some information about the plugin
echo ‘
Sobre el Plugin
‘;
echo ‘
El Plugin de Chess Events Calendar permite mostrar y gestionar eventos de ajedrez en WordPress de forma sencilla. Algunas características incluyen:
‘;
echo ‘
- ‘;
- Visualización de eventos en formato de tabla
- Filtrado por tipo de evento, fecha, etc.
- Búsqueda en tiempo real
- Exportación a CSV y iCal
- Diseño responsive
- Caché de datos para mejor rendimiento
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
Demo del Calendario
‘;
echo ‘
A continuación se muestra cómo se vería el calendario en un sitio WordPress:
‘;
// Attempt to render the calendar (this will likely show a demo or error message since we’re not in WordPress)
echo ‘
echo ‘
Vista previa del calendario:
‘;
// Try to render calendar
try {
// Sample data for demonstration
$sample_events = [
[
‘id’ => ‘1’,
‘tournament’ => ‘Campeonato Nacional de Ajedrez’,
‘type’ => ‘Nacional’,
‘start_date’ => ‘2025-05-15’,
‘end_date’ => ‘2025-05-20’,
‘duration_display’ => ’15 Mayo – 20 Mayo 2025′,
‘location’ => ‘Bogotá, Colombia’,
‘status’ => ‘upcoming’
],
[
‘id’ => ‘2’,
‘tournament’ => ‘Torneo Internacional Ciudad de Medellín’,
‘type’ => ‘Internacional’,
‘start_date’ => ‘2025-06-10’,
‘end_date’ => ‘2025-06-18’,
‘duration_display’ => ’10 Junio – 18 Junio 2025′,
‘location’ => ‘Medellín, Colombia’,
‘status’ => ‘upcoming’
],
[
‘id’ => ‘3’,
‘tournament’ => ‘Copa Juvenil de Ajedrez’,
‘type’ => ‘Juvenil’,
‘start_date’ => ‘2025-04-05’,
‘end_date’ => ‘2025-04-10’,
‘duration_display’ => ‘5 Abril – 10 Abril 2025’,
‘location’ => ‘Cali, Colombia’,
‘status’ => ‘past’
]
];
// Create a simple table to display sample events
echo ‘
echo ‘
Eventos de Ajedrez (Datos de Ejemplo)
‘;
echo ‘
ID | Torneo | Tipo | Fechas | Ubicación | Estado |
---|---|---|---|---|---|
‘ . $event[‘id’] . ‘ | ‘ . $event[‘tournament’] . ‘ | ‘ . $event[‘type’] . ‘ | ‘ . $event[‘duration_display’] . ‘ | ‘ . $event[‘location’] . ‘ | ‘ . $status_text . ‘ |
‘;
echo ‘
‘;
echo ‘
Nota: Estos son datos de ejemplo. En una instalación real de WordPress, el plugin cargaría los datos desde el JSON configurado.
‘;
} catch (Exception $e) {
echo ‘
Error al renderizar el calendario: ‘ . $e->getMessage() . ‘
‘;
echo ‘
Este demo necesita estar dentro de un entorno WordPress completo para funcionar correctamente.
‘;
}
echo ‘
‘;
// Code example
echo ‘
Uso del Shortcode
‘;
echo ‘
Para integrar el calendario en una página de WordPress, simplemente use el shortcode:
‘;
echo ‘
[chess_events_calendar]
‘;
echo ‘
El shortcode acepta varios parámetros opcionales:
‘;
echo ‘
[chess_events_calendar limit="10" type="Nacional" default_view="upcoming" show_filters="true"]
‘;
echo ‘
‘;
// Footer
echo ‘
‘;
echo ‘
‘;
echo ‘‘;