內容目錄
內容簡介
現在您可以在 WordPress 中創建事件。使用此外掛程式,您可以創建和操作事件,就像在 Google 日曆上一樣。創建即時事件,創建事件議程。 議程支援重複事件的真實代碼,讓您滿意。
使用 the_agenda_loop(),您可以生成一個包含有關事件的所有屬性的 $the_event 對象。與 Agenda::next_events() 或 Agenda::events_on() 結合使用
您還可以在模板中使用 agenda_compromissos()、agenda_list() 和 agenda_events() 函數。這些函數可生成用於模板的 HTML 代碼
議程列表
生成選中議程中的下一個事件列表
您可以按照 wp_string 或分配的數組傳遞參數:
agenda_list('next=5&only_destak=1')
與:
agenda_list(array('next'=>5,'only_destak'=>true))
參數:
(int) next :要顯示的下一個事件數量 (default: 5)
(bool) only_destak :如果為 true,僅顯示突出顯示的事件 (default: true)
(bool) show_date :如果為 true,顯示每個事件的日期 (default: true)
(string) before :放在每個事件之前 (default: <li>)
(string) after :放在每個事件之後 (default: </li>)
(bool) print :印出輸出 (default: true)
默認情況下,該函數會印出生成的字符串,但是您可以將其靜音並操作相同的字符串。它將返回。
因此,要使用 agenda_list() 印刷包含下一個 5 個事件的列表。而
agenda_list(‘print=0’) 不會打印,但會將生成的字符串返回給您手動操作
議程 compromissos
agenda_compromissos() 可在您的頁面上使用。
它生成按日期分隔的事件列表
參數:agenda_compromissos ($next, $title_tag, $print):
$next 需要顯示的事件數量。預設:25
$title_tag 顯示日期標記名。預設:h3
$print 如果符合 true,則會印出結果,如果不符合,它只會返回字符串供以後操作使用。
議程事件
函數 agenda_events() 可在您的頁面上使用,將事件列在年度或月份中
默認用法:
$defaults = array(
'month' => date('m'),
'year' => date('Y'),
'title_tag' => 'h3',
'print' => '1'
);
參數:
month – 如果傳遞,則選擇要顯示的月份(默認值:date(‘m’))
year – 選擇要顯示的年份(默認值:date(‘Y’) )
title_tag – 在您的標題/日期標記中使用的標記 (默認值:<h3>)
print – 印出結果。(預設:true)
僅顯示 2009 年 5 月的事件
<?php agenda_events('month=5&year=2009') ?>
以下示例僅顯示與 2009 年 5 月匹配的事件。
僅顯示 2008 年的事件
<?php agenda_events('month=false&year=2008') ?>
以下示例僅顯示在整個 2008 年中匹配的事件
更改日期事件的標記
<?php agenda_events('title_tag=h5') ?>
外掛標籤
開發者團隊
原文外掛簡介
Now you can create events for your wordpress. Whit this plugin you can create and manipulate events like
you do on Google Calendar. Generate events on the fly creating an agenda of events. The agenda suports a realy
code for repeat events for your satisfaction.
Using the_agenda_loop() you generates a $the_event object that have all atributes about the event
Use it in combination to Agenda::next_events() or Agenda::events_on()
You can also use function agenda_compromissos(), agenda_list() and agenda_events() on your templates. These functions
generate html codes to be used on your tamplate.
Agenda list
Generates a list of next events marked in your agenda
Pass your params as wp_string or assigned array:
agenda_list('next=5&only_destak=1')
is the same as:
agenda_list(array('next'=>5,'only_destak'=>true))
Params:
(int) next : Number of next events to show (default: 5)
(bool) only_destak : If true, show only highlighted events (default: true)
(bool) show_date : If true, show the date of each event (default: true)
(string) before : Put it before each event (default:
(string) after : Put it after each event (default:
)
(bool) print : Prints the output (default: true)
By default, the function prints the generated string, but you can silencity it and
manipulate the same string. It is returned.
So for use the agenda_list () prints a list contain the next 5 events. While
agenda_list (‘print=0’) does not print, but returns the generated string to your manual manipulation
Agenda compromissos
agenda_compromissos()` can be used on your tamplate’s page.
It generates a events list separated by date.
Params: agenda_compromissos ($next, $title_tag, $print):
$next Number of events that must be showed.default: 25
$title_tag show date tag’s name . defaut: h3
$print if matched as true prints the result, if it is not matched only returns the string for future manipulations.
Agenda Events
The function agenda_events() can be used in your page, listing the events in a year or month.
Default usage:
$defaults = array(
'month' => date('m'),
'year' => date('Y'),
'title_tag' => 'h3',
'print' => '1'
);
Parameters:
month – if passed, selects a month to show ( default: date(‘m’) )
year – selects a yea to show ( default: date(‘Y’) )
title_tag – the tag to be used on your title/date tag (default:
<
h3>)
1. print – prints the result. (default: true)
Show only events on may 2009
The following example shows only events that matches may of 2009.
Show only events on 2008
The following example shows only events that matches in all 2008.
Changing the tag of date events
The following example show events that matches the curent month, changing the tag of title/date by h5.
The output will be:
09-12-2008
11-12-2008
Note that the function generates a even odd class of each day of events
The Agenda Loop
Using the_agenda_loop you generates a $the_event object that have all atributes about the event
Use it in combination to Agenda::next_events(); or Agenda::events_on();
Agenda::events_on('month=5,year=2008');
while (the_agenda_loop()) {
print "
{$the_event->what}
";
}
The global object $the_event is an standard object like this:
stdClass Object (
[event_id] => 36
[content] => Um exemplo de evento simples com a marcacao necessaria.
[repeat] => daily
[repeat_daily] => daily
[repeat_daily_every] => 3
[range] => never
[what] => Meu simples evento
[excerpt] => Meu excerpt, caso seja necessario.
[author] => 1
[pings] => open
[comments] => open
[calendar] => Array()
[where] =>
[destak] => 0
[when_start_date] => 2008-09-15
[when_start_time] => 00:00
[when_end_date] => 2008-09-16
[when_end_time] => 00:00
[all_day] => 1
[tags] => e mais tag,tag
[range_ends_until] =>
)
