Hallo,
Das Plugin ical4wp zeigt die Zeit nicht an, es wird nur das Start - und Enddatum, jedoch ohne Zeitangabe angezeigt. Leider erhalte ich auch im Forum des Programmierers keine Antwort.
Habe zwar kaum Ahnung von Programmieren, aber ev. könnte der Fehler in folgendem Code liegen: (Dies ist nur ein Ausschnitt, die ganze Datei ist angehängt.
ZitatAlles anzeigenfunction ical_list_events($EventsCount = null)
{
global $wpdb; //,$tableposts,$tablepost2cat,$tableusers,$wp_version;
$query = "SELECT posts.*
FROM $wpdb->posts posts, $wpdb->postmeta postmeta
WHERE posts.ID = postmeta.post_ID
AND posts.post_status = 'publish'
AND postmeta.meta_key = '$this->_name'";
$posts = $wpdb->get_results($query,OBJECT);$changed_date = 0;
$current_start_date = 0;
$current_end_date = 0;
if (is_null($EventsCount)) {
$EventsCount = $this->_options['nbEventsInSidebar'];
}
$counter = 1;
if ($posts) {
echo "<ul class='ical_list_events'>\n";
// create a new array with ordered events
foreach ($posts as $post) {
$meta = get_post_meta($post->ID,'iCal',true);
$indexed_posts[$post->ID] = array('title'=>$post->post_title,'start_date'=>$meta['start_date'], 'end_date'=>$meta['end_date']);
$ordered_posts[$post->ID] = $meta['start_date'];
}
// sort $temp
asort($ordered_posts);// add title and end_date
foreach($ordered_posts as $id => $post) {
$ordered_posts[$id] = array();
$ordered_posts[$id]['title'] = $indexed_posts[$id]['title'];
$ordered_posts[$id]['end_date'] = $indexed_posts[$id]['end_date'];
$ordered_posts[$id]['start_date'] = $indexed_posts[$id]['start_date'];
}// create the output
foreach ($ordered_posts as $id => $post) {
if (strtotime($post['end_date']) >= strtotime("now")) {
if ($post['start_date'] != $current_start_date || $post['end_date'] != $current_end_date) {
$current_start_date = $post['start_date'];
$current_end_date = $post['end_date'];
$changed_date = 1;
} else {
$changed_date = 0;
}
$post_link = '<a href="' . get_permalink($id) . '" class="ical_event_title">' . $post['title'] . '</a>';
if ($changed_date) $text = '<li>' . mysql2date("D M j",$current_start_date). (($current_start_date != $current_end_date)?' - ' . mysql2date("D M j",$current_end_date):'') . ':<br/>' . $post_link . '</li>';
else $text = '<li>' . $post_link . '</li>'; //'<a href="">' . $post->post_title . '</a><br/>';;
echo $text."\n";
if($EventsCount!=0 && $EventsCount<=$counter) break;
$counter++;
}}
echo '</ul>';
}
}function ical_list_events_title(){
return $this->_options['titleInSidebar'];
}function ical_list_calendars_title(){
return $this->_options['titleListCalendarInSidebar'];
Kann da jemand weiter helfen.
Vielen Dank für Deine Hilfe
Andy