[WordPress] 外掛分享: CNN News

首頁外掛目錄 › CNN News
⚠ 此外掛已下架 — 不再更新維護,建議勿安裝。
30+
安裝啟用
★★★☆☆
3/5 分(1 則評價)
5547 天前
最後更新
問題解決
WordPress 2.3.3+ v2.6 上架:2008-04-03

內容簡介

CNN提供了多個主題的最新新聞RSS提要,此外掛允許WP管理員選擇顯示哪個提要,顯示幾個項目,並可選擇設置窗口小部件標題。如果未選標題,則使用提要名稱。每次查看都從提要獲取,因此用戶可以得到最新信息。沒有本地存儲提要的內容。當然,單擊新聞項目會直接導航到CNN上相應的文章,遵循CNN的使用條款。 此插件作為小部件、內聯內容替換兩種方式工作,可從主題中調用。允許任意數量的內聯替換或主題調用,但此釋放版本僅支持一個小部件實例。 對於小部件用法,只需像使用其他小部件一樣,在選擇要顯示的提要後使用它。對於內聯內容替換,插入以下一個或多個字符串之一到內容中,它們將被相應的新聞提要替換:對於主題用法,在主題中添加下面描述的do_action函式調用。 如果您使用的是WordPress 2.5或更高版本,则可以使用短碼,此時也提供這些替換方法。 對於默認提要,使用[cnn-news];對於名稱為“feedname”的提要,使用[cnn-news name="feedname"]。 使用WP do_action()系統從主題中調用插件。如果插件被禁用或刪除,它將優雅回退並不會產生錯誤或輸出。啟用插件,轉到儀表板->設置下的CNN新聞頁面並閱讀初始信息。 然後轉到儀表板->管理下的CNN新聞頁面,並配置一個或多個提要。然後使用小部件或在內容或主題中插入相關字符串。 其他信息:可用選項如下。 名稱:可選提要名稱,可在內聯替換字符串或小部件中使用以引用特定提要。如果沒有名稱的提要,則視為默認提要,如果替換字符串未引用特定提要,則使用默認提要。如果有多個具有相同名稱的提要,每次使用時都會從其中隨機選擇一個。這也適用於默認提要。 標題:可選標題,如果設置,則在窗口小部件標題或內嵌時作為新聞項目上方的標題使用。如果標題為空,則使用默認標題“CNN News:地區:提要類型”。請注意,根據CNN的服務條款,必須聲明新聞來自CNN。 提要:CNN提供的當前提要的下拉列表。此列表已經硬編碼到插件中,CNN可能不會經常更改該列表。提要名稱之後的[INTL]、[MONEY]和[SI]表示該提要來自CNN International、CNN Money或Sports Illustrated。 新聞項目長度:短或長。短版本實際上只是新聞項目標題作為一行,但可能是WP管理員使用的版本。長版本是標題後跟3-4行簡介。對於短版本,長

外掛標籤

開發者團隊

⬇ 下載最新版 (v2.6) 或搜尋安裝

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

原文外掛簡介

CNN has a number of RSS feeds with current news available, on a
number of topics. This widget allows the WP admin to select which
feed, how many items to show from that feed and optionally set a
widget title. If no title is selected, the name of the feed is
used. The feed is fetched for every view, so users are guaranteed
up to date information. No local storage of feed is done.
Clicking on a news item will of course take you straight to the
relevant article at CNN, as per CNN Terms of Use.
This plugin works both as a widget, as inline content
replacement and can be called from themes. Any number of
inline replacements or theme calls allowed, but only one
widget instance is supported in this release.
For widget use, simply use the widget as any other after
selecting which feed it should display. For inline content
replacement, insert the one or more of the following strings in
your content and they will be replaced by the relevant news feed.
For theme use, add the do_action function call described below.

for the default feed

Shortcodes can be used if you have WordPress 2.5 or above,
in which case these replacement methods are also available.

[cnn-news] for the default feed
[cnn-news name="feedname"]

Calling the plugin from a theme is done with the WP do_action()
system. This will degrade gracefully and not produce errors
or output if plugin is disabled or removed.

for the default feed

Enable plugin, go to the CNN News page under
Dashboard->Settings and read the initial information. Then
go to the CNN News page under Dashboard->Manage and
configure one or more feeds. Then use a widget or insert
relevant strings in your content or theme.
Additional information:
The available options are as follows.
Name: Optional feed name, that can be used in the
widget or the inline replacement string to reference
a specific feed. Any feed without a name is considered
“default” and will be used if the replacement strings do
not reference a specific feed. If there are more than
one feed with the same name, a random of these is picked
every time it is used. This also applies to the default
feed(s).
Title: Optional, which when set will be used in the
widget title or as a header above the news items when
inline. If the title is empty, then a default title
of “CNN News : : ” is used. Note
that as per CNN Terms of Service it is a requirement
to state that the news come from CNN.
Feed: A dropdown list of the current feeds provided
by CNN. This list is hard coded into the plugin, presumably
CNN does not change the list too often. The [INTL], [MONEY]
and [SI] after the feed name indicate that the feed is from
CNN International, CNN Money or Sports Illustrated respectively.
News item length: Short or long. The short version is really just
the news item title as a one liner but probably the one most
WP admins will use. The long version is the title followed by
a 3-4 line teaser. For the short version, the long text is
available as a mouse rollover/tooltip.
Max items to show: As the title says, if the feed has
sufficient entries to fulfil the request.
Cache time: The feeds are now fetched using WordPress
builtin MagpieRSS system, which allows for caching of feeds
a specific number of seconds. Cached feeds are stored in
the backend database.
Clicking on a news item will of course take you to the
relevant article at CNN, as per CNN Terms of Use.
If you want to change the look&feel, the inline table is
wrapped in a div with the id “cnn-news-inline” and the
widget is wrapped in an li with id “cnn-news”. Let me
know if you need more to properly skin it.
Note that if you get the message “CNN News unavailable” then
the WordPress internal RSS feed fetcher failed to get the
feed. Reasons for this are firewalls blocking outbound traffic,
CNN RSS being down or feed missing/wrong URL. Try again with
a different feed to see if that helps.
Download now!
Support
Donate

延伸相關外掛

文章
Filter
Apply Filters
Mastodon