0
$sidebarEvent = '<h4 class="scheduler_sidebar_link"><a href="{*URL*}#date={*DATE_SQL*},mode=month" target="_blank">{*DATE*}</a></h4>
<div class="scheduler_sidebar_text">{*TEXT*}</div>';
這是我使用的插件的片段。它打印事件日期,然後是描述。我如何修改它以便將所有當天的活動作爲一個列表一起打印?同時顯示當天活動(PHP/MYSQL)
這是在一個單獨的文件中的相關功能:
for ($i = 0; $i < count($events); $i++) {
$event = $sidebarEvent;
$start_date = str_replace("-", "/", $events[$i]->start_date);
$start_date = date_parse($events[$i]->start_date);
$start_date = mktime($start_date['hour'], $start_date['minute'], $start_date['second'], $start_date['month'], $start_date['day'], $start_date['year']);
$start_date = date(get_option('date_format').' '.get_option('time_format'), $start_date);
$event = str_replace("{*URL*}", $url, $event);
$event = str_replace("{*DATE*}", $start_date, $event);
$event = str_replace("{*DATE_SQL*}", $events[$i]->start_date, $event);
$event = str_replace("{*TEXT*}", $events[$i]->text, $event);
$final .= $event;
}
感謝