Title: Reddit Widget
Author: sk33t
Published: <strong>2008 年 3 月 21 日</strong>
Last modified: 2009 年 1 月 6 日

---

搜尋外掛

這個外掛**並未在最新的 3 個 WordPress 主要版本上進行測試**。開發者可能不再對這個
外掛進行維護或提供技術支援，並可能會與更新版本的 WordPress 產生使用上的相容性問題。

![](https://s.w.org/plugins/geopattern-icon/reddit-widget.svg)

# Reddit Widget

 由 [sk33t](https://profiles.wordpress.org/sk33t/) 開發

[下載](https://downloads.wordpress.org/plugin/reddit-widget.zip)

 * [詳細資料](https://tw.wordpress.org/plugins/reddit-widget/#description)
 * [使用者評論](https://tw.wordpress.org/plugins/reddit-widget/#reviews)
 *  [安裝方式](https://tw.wordpress.org/plugins/reddit-widget/#installation)
 * [開發資訊](https://tw.wordpress.org/plugins/reddit-widget/#developers)

 [技術支援](https://wordpress.org/support/plugin/reddit-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)

#### Features

 * Displays your latest liked items (on reddit.com)
 * Completely customizable display
 * Caching for large traffic sites

### Formatting

There are 3 parts needed to format the output.

The first part, called items start in the admin panel, is the first part of the 
widget after the title. For the default formatting, this is just <ul>.

The second part, called items end, is the ending of the widget. By default, this
is:
 </ul> <a href=”%profile%” style=”float:right;”>%username%</a>

The third part is what is called for each item. By default, this is:
 <li style=”
list-style-type: none;”><a href=”%link%”>%title%</a> (<a href=”%more%”>more</a>)
</li>

The premise of calling each value is this:

 1. start
 2. item
 3. item
 4. …
 5. item
 6. end

The formatting for items is:

 * %title% – Title of the item
 * %link% – Link to the item
 * %desc% – Description of the item – Just [link] [more] links
 * %date% – Date the item was submitted (ISO)
 * %more% – More link – The link to the comments
 * %number% – The number of the current item

The formatting for start and end is:

 * %username% – Your username
 * %profile% – Link to your profile
 * %rss% – Link to your profile’s RSS feed
 * %count% – Number of items shown

## 螢幕擷圖

 * [[
 * Default Display
 * [[
 * Admin Panel

## 安裝方式

 1. Download reddit-widget.zip
 2. Extract and upload reddit.php to the plugins/ directory
 3. Enable reddit Widget in the Plugin admin panel
 4. In widget admin panel, place reddit in the sidebar, and edit it to enter your username

## 常見問題集

  Nothing shows up when I try it or I get an error that file_get_contents doesn’t
exist

This script relies on the function file_get_contents to fetch the RSS feed. If your
host doesn’t allow the use of it, but allows the use of curl, you can replace

    ```
    $stories = file_get_contents($uri);
    ```

with

    ```
    $ch = curl_init();
    $timeout = 5; // set to zero for no timeout
    curl_setopt ($ch, CURLOPT_URL, $uri);
    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
    $stories = curl_exec($ch);
    curl_close($ch);
    ```

  What does cache time mean?

It’s the number of seconds before the content will be requested again. You can set
this to be 0 or -1 to not use the caching system. If you edit any of the widgets
in the widget admin panel, the cache is cleared.

## 使用者評論

這個外掛目前沒有任何使用者評論。

## 參與者及開發者

以下人員參與了開源軟體〈Reddit Widget〉的開發相關工作。

參與者

 *   [ sk33t ](https://profiles.wordpress.org/sk33t/)

[將〈Reddit Widget〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/reddit-widget)

### 對開發相關資訊感興趣？

任何人均可[瀏覽程式碼](https://plugins.trac.wordpress.org/browser/reddit-widget/)、
查看 [SVN 存放庫](https://plugins.svn.wordpress.org/reddit-widget/)，或透過 [RSS](https://plugins.trac.wordpress.org/log/reddit-widget/?limit=100&mode=stop_on_copy&format=rss)
訂閱[開發記錄](https://plugins.trac.wordpress.org/log/reddit-widget/)。

## 中繼資料

 *  版本 **1.2**
 *  最後更新 **17 年前**
 *  啟用安裝數 **10+**
 *  WordPress 版本需求 ** 2.0.2 或更新版本 **
 *  已測試相容的 WordPress 版本 **2.7**
 *  語言
 * [English (US)](https://wordpress.org/plugins/reddit-widget/)
 * 標籤:
 * [reddit](https://tw.wordpress.org/plugins/tags/reddit/)[widget](https://tw.wordpress.org/plugins/tags/widget/)
 *  [進階檢視](https://tw.wordpress.org/plugins/reddit-widget/advanced/)

## 評分

這個項目尚無任何評論記錄。

[Your review](https://wordpress.org/support/plugin/reddit-widget/reviews/#new-post)

[查看全部使用者評論](https://wordpress.org/support/plugin/reddit-widget/reviews/)

## 參與者

 *   [ sk33t ](https://profiles.wordpress.org/sk33t/)

## 技術支援

使用者可在技術支援論壇提出意見反應或使用問題。

 [檢視技術支援論壇](https://wordpress.org/support/plugin/reddit-widget/)

## 贊助

想要支援這個外掛的發展嗎？

 [ 贊助這個外掛 ](http://ja.meswilson.com/blog/)