[WordPress] 外掛分享: Flickr API

前言介紹

  • 這款 WordPress 外掛「Flickr API」是 2011-10-13 上架。
  • 目前有 20 個安裝啟用數。
  • 上一次更新是 2014-07-24,距離現在已有 3935 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 3.0 以上版本才可以安裝。
  • 有 2 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

sanchothefat |

外掛標籤

flickr | images | photos | gallery | galleries |

內容簡介

這個 Flickr API 外掛程式提供工具,讓您可以使用簡碼在文章和頁面中顯示您的 Flickr 相簿、集、相片串流或收藏等,或者作為小工具使用。您可以選擇所需的圖像大小,是否要將其連結到另一個圖像大小或回到 Flickr,或者完全不連結,還可以決定要顯示多少圖像,以及更多的選項...

此外插件還內建了一些選項,可以讓您選擇要將圖像顯示為簡單的幻燈片或使用 Galleria jquery 外掛。或者,您也可以選擇樣式化輸出,並使用自己的 JavaScript。

對於開發人員,此外掛還提供了一種在 PHP 和 JavaScript 中調用和快取 API 響應的簡單方法,並且提供了許多有用的工具來處理這些響應。

用法

您需要從 Flickr 獲取 API 金鑰才能使用此外掛。在「您」菜單下尋找「您的應用程式」。點擊獲取金鑰,然後轉到媒體設置畫面,添加您的 API 金鑰和使用者名稱。該外掛會自動確定您的 NSID,因此您無需自己查找。

要使用外掛,請使用媒體上傳/插入按鈕生成簡碼,然後選擇要取得的項目,或使用提供的 Flickr 小工具。

面向開發人員

此外掛公開其方法供主題使用,但您可能會發現最有用的是 flickr_api()。這是一個通用函數,用於調用指定參數的任何 API 方法。

$response = json_decode( flickr_api( $method, $params, $cache ) );
?>

所有響應均以 JSON 格式提供,因此您需要使用 json_decode() 在 PHP 中使用響應。

@param $method: (string) 要調用的 API 方法
@param $params: (array) 要傳遞到呼叫中的其他參數,如 user_id、photoset_id、gallery_id、text、tags 等
@param $cache : (bool) 是否根據傳遞的參數來快取響應

您也可以使用 JavaScript 來通過 API:

NSID 查詢:

$nsid = flickr_get_user_nsid( $username );
?>

只需傳遞 Flickr 使用者名稱即可獲取 NSID。

過濾器/Hooks

flickr_galleria_themes

您可以通過擴展主題數組,啟用自訂或已購買的 galleria 主題選擇。如果您希望您的主題除了「經典」樣式外還有選擇 galleria 主題的選擇,這非常有用。

add_filter( 'flickr_galleria_themes', 'my_galleria_themes' );
function my_galleria_themes( $themes ) {
$themes[ /* 完整或相對 URL 到主題 JS 檔案 */ ] = __( '主題名稱' );
return $themes;
}
?>

原文外掛簡介

The Flickr API plugin provides tools for displaying your flickr galleries, sets, photostream or favourites and more using a shortcode in posts and pages or as a widget. You can choose the size of image you want, whether it should be linked to another image size or back to flickr or not linked at all, how many images to show and more…
There are some built in options for displaying your images as a simple slideshow or using the Galleria jquery plugin. Alternatively you can choose to style the output yourself and use your own javascript.
For developers the plugin also gives you an easy method for calling and caching API responses both in PHP and javascript, and lots of useful tools for working with those responses.
Usage
You will need to get an API key from flickr to use this plugin. Under the ‘You’ menu look for ‘Your Apps’. Click to get a key and then go to the media settings screen to add your API key and user name. The plugin will automatically determine your NSID so you never need to look this up.
To use the plugin either generate a shortcode using the media upload/insert button and selecting what you want to get or use the Flickr widget provided.
For developers
The plugin exposes its methods for your use in themes as template tags but the main one you may find useful is flickr_api(). This is a general function for calling any API method with the parameters you specify.

All responses are in JSON format so you will need to use json_decode() to use the response in PHP.
@param $method: (string) This is the API method to call
@param $params: (array) Additional arguments to pass into the call such as user_id, photoset_id, gallery_id, text, tags etc...
@param $cache : (bool) Whether or not to cache the response based on the arguments passed in

You can use the API via javascript as well:

NSID lookup:

Just pass in the Flickr username of the person to get the NSID for.
Filters/Hooks
flickr_galleria_themes
You can enable the choice of custom or purchased galleria themes by extending the themes array. Useful if you want your theme to have a choice of galleria theme beyond the ‘classic’ style.

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Flickr API」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


0.1.2 | 0.1.3 | 0.1.4 | 0.1.5 | 0.1.6 | 0.1.7 | 0.1.8 | 0.1.9 | trunk |

延伸相關外掛(你可能也想知道)

  • Responsive Lightbox & Gallery 》提供完整的 WordPress 相簿外掛所需一切, Responsive Lightbox and Gallery 外掛是一個全功能的 WordPress 相簿外掛,擁有強大的拖放相簿生成器和 Lightbox ...。
  • Lightbox Gallery 》重要性:, 從 0.7.1 版本開始,插件目錄的版權規定導致默認顯示方式更改為 Colorbox。如果您希望使用 Lightbox 取代 Colorbox,您需要從設置頁面獲取腳本。, ...。
  • Easy Image Gallery 》這個外掛允許你在任何文章、頁面或自定義文章類型中輕鬆地創建圖片展廊。, 可以從 metabox 中添加和預覽圖像,並可以通過拖放重新排序圖像。, 關於:, 當你需...。
  • Featured Galleries 》開發 Hello 佈景主題的開發人員們,您好!, 您是否曾經想要為一篇文章新增多個特色圖片呢?現在透過「Featured Galleries」外掛,您就可以這麼做了!這個外掛...。
  • Gallery Manager 》Gallery Manager 是最具創新的現代化 WordPress 圖庫管理工具,讓你輕鬆地在 WordPress 後端組織圖庫。此外,這個圖庫外掛會在你網站上所有指向圖片的連結上...。
  • File Gallery 》「File Gallery」擴展了WordPress的媒體(附件)能力,通過添加一個新的圖庫短代碼處理程序,支持模板,為編輯文章時的附件處理添加新界面等等…以下是功能列...。
  • Responsive Media Gallery Plugin for WordPress – Everest Gallery Lite 》示範|文檔|支援, Everest Gallery Lite 是一款功能強大的圖庫外掛程式,提供多種選項和無瑕功能。您可以隨意添加多個圖庫項目,快速編輯和管理它們。此外,...。
  • Photo Galleria 》「Photo Galleria」是一個簡單而優雅的 WordPress 外掛,適合攝影師和設計師使用,能夠美化和簡化 WordPress 照片庫。該外掛會篩選預設的 WordPress 照片庫短...。
  • Flickr – Pick a Picture 》此外掛允許您在 WordPress 安裝的任何位置挑選 Flickr 的創用 CC 授權圖片,該外掛將保留原始 Flickr 作者的歸屬,以遵守 CC 歸屬授權條款。, 此外掛利用最新...。
  • FancyBox Gallery 》FancyBox Gallery將FancyBox jQuery外掛整合到WordPress圖庫功能中。只需使用圖庫短代碼在文章中顯示縮略圖,並選擇直接連結圖片(而不是附件模板),該外掛...。
  • Remote Images Grabber 》這個外掛可以讓你不必費時地從網路上下載圖片再上傳到你的部落格,取而代之的是直接抓取網路上的圖片。當你需要將舊的非 WordPress 網站轉移到基於 WordPress...。
  • PiwigoPress 》PiwigoPress 是一個 WordPress 的側邊欄小工具,可以連結到 Piwigo 庫中公開的某些圖片,因此,需要有一個包含多張公開圖片的 Piwigo 庫才能使用。即便你還沒...。
  • Metaphor Galleries 》此外掛創建了自訂的相簿文章類型,可用於顯示你的相片和影片。, 更多詳細資訊和設定即將推出,敬請期待。。
  • Modal Portfolio 》英文說明, Modal Portfolio 可以用於英文和法文的網站。使用短代碼 [modal-portfolio](可以選擇加入或不加入選項)來在模態窗中顯示圖片庫(可選擇加入影片...。
  • Image Wall 》這個 WordPress 外掛允許訪客通過在無限滾動的圖片牆上隨機展示的圖片瀏覽文章或頁面。圖片返回它們所附屬的文章或頁面。, 圖片是非常強大的,它們能夠引起我...。

文章
Filter
Apply Filters
Mastodon