[WordPress] 外掛分享: Event Organiser CSV

首頁外掛目錄 › Event Organiser CSV
700+
安裝啟用
★★★☆☆
3.8/5 分(5 則評價)
3951 天前
最後更新
問題解決
WordPress 3.5.1+ v0.3.2 上架:2014-01-05

內容簡介

這個外掛程式可以將 CSV 檔案中的活動匯入到 Event Organiser 中,也可以將 Event Organiser 中的活動匯出到 CSV 檔案中。

請注意,此外掛程式目前仍處於 beta 測試中。我歡迎使用者提供回饋、問題和 pull-requests。

目的

讓使用者可以在各種行事曆應用程式之間以 CSV 格式匯出/匯入活動,並以彈性的方式進行操作,減少讀取檔案前必須滿足的要求數量。同時也讓使用者可以將活動從 Event Organiser 的不同安裝中移動,同時保留 iCal 不支援的資料。

基於彈性的考量,CSV 檔案中的欄位可以按任意順序排列:在匯入檔案後,您可以告訴外掛程式哪些欄位屬於哪些資料(例如,開始日期、結束日期等)。

如何使用這個外掛程式

安裝完成後,請前往「工具」>「匯入活動」。在此,您可以匯出 CSV 檔案,或選擇要匯入的檔案。若要匯入檔案,

請先點選「瀏覽並選擇檔案」,選取檔案後點選「上傳檔案並匯入」;
若預覽看起來不對,請嘗試在頂部選擇不同的分隔符號類型(逗號、標籤或空格);
若 CSV 檔案的第一列是標題,請選擇提示這點的選項,外掛程式將忽略第一列;
在每個欄位的底部,選擇該欄位表示的內容。這些選項包括(並非所有選項皆必需)

標題
開始(格式為 Y-m-d,如果活動非全天活動,則還需說明具體的時間)
結束(與開始日期格式相同)
重複直到(若活動重複發生,請說明最後一次發生的日期)
循環時間表(如果活動重複發生,則說明它是每天 | 每週 | 每月 | 每年 | 自訂循環等)
循環頻率(如果活動重複發生,以整數表示發生頻率)
時間表 Meta(見 eo_insert_post() 的文件,例如:「MO、TU、THR」(每週)、「BYDAY=2MO」或「BYMONTHDAY=16」(每月)
內容(HTML 文章內容)
地點(地點 slug)
分類(以逗號區隔的分類 slug 列表)
標籤(以逗號區隔的標籤 slug 列表)
[所註冊的任何自訂事件分類](逗號區隔的 slug 列表)
包括日期(以逗號分隔的 Y-m-d 日期列表,包含在活動日程表中的日期)
排除日期(與上述相同,但添加到活動日程表中)
文章 Meta(將出現選項以提供 meta-key)
點選匯入

匯入新的地點、分類和標籤

預設情況下,外掛程式僅會匯入已存在的地點、分類和標籤。
如果要允許外掛程式建立新的地點、分類和標籤,您可以在另一個外掛程式或您的佈景主題的 functions.php 中加入以下程式碼:

function my_set_import_imports( $args, $file ){
$args['import_new_event-category'] = true; //如果分類不存在,創建新的分類。
$args['import_new_event-venue'] = true; //如果地點不存在,創建新的地點。
$args['import_new_event-tag'] = true; //如果標籤不存在,創建新的標籤。

return $args;
}
add_filter( 'eventorganiser_csv_import_args', 'my_set_import_imports', 10, 2 );

請注意,在匯入地點方面存在一些限制,這些限制將在下文中介紹。

限制

目前存在一些限制。有關詳情,請參閱英文原文。

外掛標籤

開發者團隊

⬇ 下載最新版 (v0.3.2) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Event Organiser CSV」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

This plug-in allows to import events from a CSV file into Event Organiser. You can also export events from
Event Organiser into a CSV file.
Please note that this plug-in still in beta. I welcome feedback, issues and pull-requests.
Aim
To allow users to export / import events in CSV format between various calendar applications, and to do this flexiably
so as to limit the number of requirements on the CSV file before it can be read correctly. To allow users to move events
between installations of Event Organiser while preserving data that is not suported by iCal.
In the vein of flexibility columns do not have to be in any prescribed order: you tell the plug-in which columns pertain to what (start date, end date etc)
after importing the file.
How to use this plug-in
Once installed, go to Tools > Import Events. Here you can export a CSV file or select a file to import one. To import an file:

Select browse and select the file, click “Upload file and import”
All being well you should now see a preview of the CSV file, along with a drop-down option at the base of each column. If the preview looks wrong, try
selecting a different delimiter type (comma, tab, space) at the top.
If the first row of the CSV file is a header, select the option indicating this. The first row will then be ignored.
At the bottom of each column select what the column represents. The options are (not all are required):

Title
Start (formatted in Y-m-d format, and also indicating time only if the event is not all-day)
End (formatted as above)
Recur until (if the event recurs, the date of its last occurrence)
Recurrence Schedule (if the event recurs, how it repeats: once|daily|weekly|monthly|yearly|custom).
Recurrence Frequency (if the event recurs, an integer indicating with what frequency)
Schedule Meta (See documentation for eo_insert_post(), e.g. “MO,TU,THR” (weekly), “BYDAY=2MO” or “BYMONTHDAY=16” (monthly)
Content (HTML post content)
Venue (Venue slug)
Categories (comma seperated list of category slugs)
Tags (comma seperated list of tag slugs)
[Any custom event taxonomies registered] (comma seperated list of slugs)
Include dates (comma seperated list of Y-m-d dates to include from the event’s schedule)
Exclude dates (as above, but added to the event’s schedule)
Post Meta (an option will appear to provide the meta-key)
Click import.

Importing new venues, categories and tags
By default the plug-in will only import venues, categories and tags that already exist.
To allow the plug-in to create new venues, categories and tags you can add the following
code (to a seperate plug-in or your theme’s functions.php).
function my_set_import_imports( $args, $file ){
$args['import_new_event-category'] = true; //create category if it doesn't exist
$args['import_new_event-venue'] = true; //create venue if it doesn't exist.
$args['import_new_event-tag'] = true; //create tag if it doesn't exist.

return $args;
}
add_filter( 'eventorganiser_csv_import_args', 'my_set_import_imports', 10, 2 );

Please note the limitations on importing venues discussed below.
Limitations
Current limitations apply. See the examples folder for an archetypal CSV file

All dates are read using PHP’s DateTime. While various formats are supported, Y-m-d (e.g. 2013-12-31) formats are strongly recommended
Starts dates must be provided in Y-m-d (e.g. 2013-12-31) for all day events and also include a time-component (e.g. 2013-12-31 11:30pm) for non-all-day events. There is no
prescribed format for the time but 24-hour time is recommended. You do not need to specify seconds.
Include/exclude dates should be given as comma-seperated list of dates in Y-m-d format.
Categories and tags must be given as comma-seperated list of names
It does not support venue meta-data (yet)

Please note that in theory all dates (other than the start date) can be given in any format, however, to
ensure dates are interpreted correctly it is strongly recommended to give dates in Y-m-d (or Y-m-d H:i for non-all day events) format. The start
date must be in that format so that the importer can differentriate between all-day and non-all-day events.
Future Features

An “import preview” or “dry-run” so users can view how events will be imported.
Support venue meta data
Support category colours
Add filters for developers
Add support for UID to prevent importing an event twice (perhaps, update the event?)
Add support ‘maps’ for importing from other applications (where format of exported CSV file is prescribed).
Support generic date formatting (try to ‘guess’ / ask for format )

延伸相關外掛

文章
Filter
Apply Filters
Mastodon