1
0
Fork 0
forked from lino/radar-wp

Compare commits

..

4 commits
2.0 ... custom

Author SHA1 Message Date
lino
14abfc0d66 add new description to test update 2024-08-19 04:08:12 +02:00
lino
98c8386a1c update plugin path 2024-08-19 04:06:18 +02:00
lino
a9ef9963af add new description to test update 2024-08-19 03:56:53 +02:00
lino
9d40e375bf add custom functionality 2024-08-19 03:54:41 +02:00
5 changed files with 127 additions and 78 deletions

View file

@ -64,7 +64,7 @@
float: right; float: right;
} }
.squat-radar a.squat-radar-url-more:hover { .squat-radar a.squat-radar-url-more:hover {
color: white !important; color: white;
} }
.squat_radar a.squat-radar-url-more:focus { .squat_radar a.squat-radar-url-more:focus {

View file

@ -1,5 +1,5 @@
{ {
"name": "radar-wp/squat-radar", "name": "radar-wp-custom/squat-radar",
"description": "Wordpress Calendar widget for https://radar.squat.net/ events", "description": "Wordpress Calendar widget for https://radar.squat.net/ events",
"type": "wordpress-plugin", "type": "wordpress-plugin",
"homepage": "https://radar.squat.net", "homepage": "https://radar.squat.net",

View file

@ -209,7 +209,8 @@ class Squat_Radar_Formatter {
private static function field_date_format($time, $start_end, $time_only = FALSE) { private static function field_date_format($time, $start_end, $time_only = FALSE) {
$date_format = get_option('squat_radar_date_format', 'j M Y'); $date_format = get_option('squat_radar_date_format', 'd.m.');
$year_format = get_option('squat_radar_date_format', 'Y');
$time_format = get_option('squat_radar_time_format', 'H:i'); $time_format = get_option('squat_radar_time_format', 'H:i');
// Remove offset to stop time being converted to UTC. // Remove offset to stop time being converted to UTC.
@ -220,6 +221,9 @@ class Squat_Radar_Formatter {
$output .= '<span class="squat-radar-date">'; $output .= '<span class="squat-radar-date">';
$output .= date_i18n($date_format, strtotime($time)); $output .= date_i18n($date_format, strtotime($time));
$output .= '</span> '; $output .= '</span> ';
$output .= '<span class="squat-radar-year">';
$output .= date_i18n($year_format, strtotime($time));
$output .= '</span> ';
} }
$output .= '<span class="squat-radar-time">'; $output .= '<span class="squat-radar-time">';
$output .= date_i18n($time_format, strtotime($time)); $output .= date_i18n($time_format, strtotime($time));
@ -301,11 +305,11 @@ class Squat_Radar_Formatter {
*/ */
static public function field_link_html($value, $original, $field, $context) { static public function field_link_html($value, $original, $field, $context) {
if ( ($field[0] == 'title' || $field[0] == 'title_field') && ! empty($context['event']['url'])) { if ( ($field[0] == 'title' || $field[0] == 'title_field') && ! empty($context['event']['url'])) {
return '<a href="' . esc_url($context['event']['url']) . '" class="squat-radar-url squat-radar-url-title">' . sanitize_text_field( $value ) . '</a>'; return '<a href="' . esc_url($context['event']['url']) . '" class="squat-radar-url squat-radar-url-title" target="_blank">' . sanitize_text_field( $value ) . '</a>';
} }
if ($field[0] == 'url' && count($field) == 1) { if ($field[0] == 'url' && count($field) == 1) {
return '<a href="' . esc_url_raw($value) . '" class="squat-radar-url squat-radar-url-more">' . __('more…', 'squat-radar') . '</a>'; return '<a href="' . esc_url_raw($value) . '" class="squat-radar-url squat-radar-url-more" target="_blank">' . __('more…', 'squat-radar') . '</a>';
} }
elseif ($field[0] == 'url') { elseif ($field[0] == 'url') {
$title = esc_url($value); $title = esc_url($value);

45
plugin-change-README.txt Normal file
View file

@ -0,0 +1,45 @@
PATH: /wp-content/plugins/squat-radar-calendar-integration/includes/squat-radar-formatter.php
In dem Block der Datumsangabe wurde das Tag/Monat und Jahr separiert. (Und deutsche Zeitangaben)
private static function field_date_format($time, $start_end, $time_only = FALSE) {
$date_format = get_option('squat_radar_date_format', 'd.m.');
$year_format = get_option('squat_radar_date_format', 'Y');
$time_format = get_option('squat_radar_time_format', 'H:i');
// Remove offset to stop time being converted to UTC.
$time = substr($time, 0, -6);
$output = '<span class="squat-radar-datetime squat-radar-datetime-' . $start_end .'">';
if ( ! $time_only ) {
$output .= '<span class="squat-radar-date">';
$output .= date_i18n($date_format, strtotime($time));
$output .= '</span> ';
$output .= '<span class="squat-radar-year">';
$output .= date_i18n($year_format, strtotime($time));
$output .= '</span> ';
}
Links werden im anderen Tab geöffnet (target="_blank" hinzufügen)
static public function field_link_html($value, $original, $field, $context) {
if ( ($field[0] == 'title' || $field[0] == 'title_field') && ! empty($context['event']['url'])) {
return '<a href="' . esc_url($context['event']['url']) . '" class="squat-radar-url squat-radar-url-title" target="_blank">' . sanitize_text_field( $value ) . '</a>';
}
if ($field[0] == 'url' && count($field) == 1) {
return '<a href="' . esc_url_raw($value) . '" class="squat-radar-url squat-radar-url-more" target="_blank">' . __('more…', 'squat-radar') . '</a>';
}
css squat-radar.css
important entfernen
.squat-radar a.squat-radar-url-more:hover {
color: white !important;
}

View file

@ -8,9 +8,8 @@
* @package Squat_Radar * @package Squat_Radar
* *
* @wordpress-plugin * @wordpress-plugin
* Plugin Name: Squat Radar calendar integration * Plugin Name: Squat Radar calendar integration custom
* Plugin URI: https://0xacab.org/radar/radar-wp * Plugin URI: https://0xacab.org/radar/radar-wp
* Gitea Plugin URI https://git.systemausfall.org/newyorck/radar-wp-custom
* Description: Provides widget, and shortcode, integration for displaying events from https://radar.squat.net/ agenda. * Description: Provides widget, and shortcode, integration for displaying events from https://radar.squat.net/ agenda.
* Version: 2.0.9 * Version: 2.0.9
* Author: Radar contributors * Author: Radar contributors
@ -18,6 +17,7 @@
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: squat-radar * Text Domain: squat-radar
* Domain Path: /languages * Domain Path: /languages
* Gitea Plugin URI: https://git.systemausfall.org/newyorck/radar-wp-custom
*/ */
if ( ! defined( 'ABSPATH' ) ) { if ( ! defined( 'ABSPATH' ) ) {