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

fmTuner

外掛說明

fmTuner pulls track information from your Last.fm account, including recent tracks, loved tracks, and top tracks. Using built-in options and simple tags, you can fully customize how tracks appear on your site.

Features

  • Choose between recent, loved, and top tracks
  • Limit how many tracks are shown
  • Adjust how often tracks get pulled from Last.fm
  • Customize track appearance using HTML and placeholders

Requirements

  • A Last.fm account to which you “scrobble” (publish) music details
  • WordPress 2.7 or newer
  • PHP 5 or newer

Troubleshooting

Why are no tracks displayed?

  1. Make sure fmTuner is installed and activated by visiting your Manage Plugins page in the WordPress administration area.
  2. Ensure your Last.fm username is set in the fmTuner Settings page, as well as any other necessary options (e.g. Recent Tracks instead of Loved Tracks if you have no Loved Tracks).
  3. Confirm that <?php if(function_exists('fmtuner')) { fmtuner(); } ?> exists somewhere in your current WordPress theme.
  4. Listen to some music, and perhaps mark some tracks as Loved, to make sure you have available music to show.
  5. Finally, try setting a placeholder image address in the fmTuner Settings page, which will be used when tracks have no artwork address.

Why does the number of tracks displayed not match my setting?

Occasionally, you may find that the number of displayed tracks does not match the number you set in the fmTuner Settings page. This is most often attributed to the [::image::] fmTuner tag. Because fmTuner cannot know in advance which tracks don’t have images, it will skip ones without artwork. Alternatively, you can provide a placeholder image address in the fmTuner Settings page which will be used when Last.fm does not provide artwork. Using this, your number of displayed tracks should stay constant.

Why do I get PHP errors?

fmTuner needs certain PHP functions to talk to Last.fm and handle responses, and while it takes precautions to avoid blatant errors, it’s possible your server doesn’t meet the necessary requirements.

  1. Ensure your server is running PHP 5 or later. If using a hosted environment, your provider may be able to do this for you.
  2. fmTuner needs to communicate with Last.fm. Set allow_url_fopen=”On” in your php.ini file, or confirm that the cURL extension is installed. fmTuner will try one method of fetching track listings, and automatically fall back to the other if needed.

Removal

Sorry to see you go! Here’s how to remove fmTuner:

  1. Deactivate the plugin through the ‘Plugins’ menu in WordPress.
  2. Delete the fmtuner directory from your wp-content/plugins/ directory.

Be sure to get in touch if there’s a particular feature you think would make fmTuner better!

螢幕擷圖

  • fmTuner Settings screen.
  • One of many possible display options. You are free to configure fmTuner how you prefer!

安裝方式

Installation of fmTuner is straightforward, however it does require PHP 5 or newer.

  1. Upload fmtuner.php to your /wp-content/plugins/ directory, within a directory like fmtuner.
  2. Ensure /wp-content/plugins/fmtuner/ is writable by your webserver (chmod 755 fmtuner).
  3. Activate the plugin through the ‘Plugins’ page in the WordPress admin.
  4. Set your fmTuner preferences in the “Settings” menu in WordPress.
  5. Place <?php if(function_exists('fmtuner')) { fmtuner(); } ?> in your desired template.

常見問題集

How does fmTuner work?

fmTuner pulls your latest tracks from Last.fm according to the settings page in the WordPress administration area. Tracks get pulled from Last.fm when a visitor comes to your site, and are then cached for future visits. If the cache has expired (that is, the cache’s age has passed the Update Frequency you’ve chosen), it gets pulled again, and your page is updated. Track information is displayed using HTML and fmTuner Tags, also in settings page.

What are fmTuner Tags?

fmTuner tags are simple placeholders that can be sprinkled among HTML to customize the album display format used for each track. Tags can be used more than once, or completely left out, depending on your preferences. A simple example is provided when you install fmTuner, so you won’t be left in the dark if you have even basic HTML knowledge.

  • [::album::] Album name (only available for Recent tracks)
  • [::artist::] Artist name
  • [::image::] Album artwork address (usually around 120×120 pixels in size, but may not be perfectly square)
  • [::number::] Track number within the fmTuner set (for a numbered list)
  • [::title::] Track title
  • [::url::] Last.fm track address

Using CSS and JavaScript, you can do even more, limited only by your skills and imagination. See this tutorial for details on how to make albums look gorgeous with transparent overlay images and a little CSS.

Can I customize the HTML around the displayed tracks?

Absolutely! While the customizable Display Format and fmTuner Tags are used for each track, you can place any additional HTML around the <?php if(function_exists('fmtuner')) { fmtuner(); } ?> call.

How many tracks can I display?

The number of tracks to be displayed can be set in the fmTuner Settings page in the WordPress administration area. Between 1 and 10 is recommended, just to keep things looking sane.

使用者評論

閱讀全部 1 則使用者評論

參與者及開發者

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

參與者

將〈fmTuner〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

變更記錄

1.1

  • Added a placeholder image field to the fmTuner Settings page, which will be substituted when tracks have no artwork.
  • Tested under WordPress 2.9.1.

1.0.9

  • Added a Settings link to the plugin actions list.
  • Tested under WordPress 2.9.

1.0.8

  • Fixed a bug with the [::url::] fmTuner tag that caused Last.fm links to appear incorrectly.

1.0.7

  • Tracks with foreign character sets now display more accurately.

1.0.6

  • You can now display more than 10 Recent Tracks, and you should get fewer tracks without artwork.

1.0.5

  • Track information is now properly escaped to handle $ signs, quotes, and other non-alphanumeric characters.

1.0.4

  • Made minor tweaks for fmTuner Settings page under WordPress 2.7.

1.0.3

  • Added a [::number::] fmTuner tag has been added, which prints a sequential number for each track (starting at 1). This is particularly useful for CSS and JavaScript hooks.

1.0.2

  • Added a cURL-based alternative to file_get_contents to hopefully resolve “URL file-access is disabled” issues. If allow_url_fopen is disabled in your php.ini, cURL will be used to fetch the Last.fm feed instead.

1.0.1

  • Added better failure checking and informational messages, removed development code, and updated instructions.

1.0

  • Initial release.