[WordPress] 外掛分享: Weather Widget

首頁外掛目錄 › Weather Widget
90+
安裝啟用
尚無評分
6091 天前
最後更新
問題解決
WordPress 2.0.2+ v1.6 上架:2008-03-25

內容簡介

需求

WordPress 2.2或 2.0.x/2.1.x,並且安裝 WordPress Widgets
PHP 4.3.0 或更高版本(需要功能 file_get_contents)

位置

位置可以是美國用戶的郵遞區號或 locid。要找到 locid,您可以使用 http://xoap.weather.com/search/search?where=[search parameters] 這個網址進行搜索。這將返回一個包含搜索結果及其對應的 locid 的 XML 文件。

您也可以在 Weather.com 網站上找到它。在搜索和選擇您的城市後,您將被送到一個類似於 http://www.weather.com/outlook/driving/interstate/local/USTX0617?from=search_city 的URL,其中 USTX0617 是 locid。

圖像託管

我提供了由 weather.com 使用和提供的圖像,您可以在此處下載。如果您要託管自己的圖像,請解壓縮並上傳文件,然後在管理面板中編輯“圖像位置”字段,將其指向您的圖像目錄。請確保有尾隨斜杠。

如果您不使用您自己的圖像,您可以使用我託管的那些位於 http://nothingoutoftheordinary.com/weatherimages/ 的圖像。

格式設定

您可以編輯“小工具格式”以更改顯示信息的方式。要訪問變量,請使用此格式:

%loc% – 位置
%temp% – 當前溫度
%feels% – 像感溫度
%icon% – 指代當前天氣的圖標。這只是一個數字
%iconhref% – 夾雜著您設定的圖像位置的圖像位置
%attribution% – 據稱需要顯示的鏈接。由 weather.com® 提供的天氣數據

默認格式如下:

<img src=”%iconhref%” alt=”%cond%” style=”float:right;” />
%loc%<br />
<span style=”font-size: 150%;”>%temp% °F</span>
(%feels% °F)<br />
<span style=”font-size: 65%; float: right;”>%attribution%</a>

外掛標籤

開發者團隊

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

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Weather Widget」→ 直接安裝(推薦)

原文外掛簡介

Requirements

WordPress 2.2 or 2.0.x/2.1.x with WordPress Widgets
PHP 4.3.0 or greater (needed for function file_get_contents)

Location
The location can either be a zip code for US users or the locid. To find the locid, you can do a search using http://xoap.weather.com/search/search?where=[search parameters].This will return an XML file with search results and their corresponding locid’s.
You can also find it using the Weather.com website. After searching for and selecting your city, you will be sent to a url that will look something like, http://www.weather.com/outlook/driving/interstate/local/USTX0617?from=search_city, where USTX0617 is the locid.
Image Hosting
I’ve provided the images used and provided by weather.com here. If you want to host your own images, extract and upload the files, then, in the admin panel, edit the ‘Image Location’ field to point to your directory of images. Make sure to have the trailing slash.
If you don’t use your own images, you are free to use the ones that I’ve hosted, which are located at http://nothingoutoftheordinary.com/weatherimages/
Formatting
You can edit ‘Widget Formatting’ to change how the info is displayed. To access the variables, use this formatting:

%loc% – Location
%temp% – Current temperature
%feels% – Feels like temperature
%icon% – The icon referring to the current weather. This is just a number
%iconhref% – The location of the image with your set image location at the front
%attribution% – The link supposedly required to be displayed. Weather data provided by weather.com®

The default formatting is:
”%cond%”
%loc%
%temp% °F
(%feels% °F)
%attribution%

延伸相關外掛

文章
Filter
Apply Filters
Mastodon