Warning: Creating default object from empty value in /home/design/public_html/wp-content/plugins/paged-comments/paged-comments.php on line 31
Retrieve Data Plugin for WordPress · Dagon Design

Welcome to Dagon Design. In addition to free scripts, WordPress plugins, and articles, we offer a variety of services including custom theme design, plugin creation, and PHP scripting. Contact me for more information.

Version 1.0   Updated Sunday, February 22nd, 2009 at 5:17pm

Retrieve Data Plugin for WordPress

This plugin provides a simple way to include the contents of data files into your posts or pages. The data files can be local to your server, or on remote servers (if your PHP configuration allows it). In the options page for the plugin, just define the trigger text and the file the data will be retrieved from. When that trigger text appears in a post or page, the contents of the specified data file will be shown.

Download

  If you have found this page useful, please consider donating. Thanks!

Installation

  • Download the above file, rename it from .txt to .php, and upload it to your plugins directory
  • Enable the plugin
  • Configure the plugin under the DDRetrieveData options page

Requirements

This plugin uses the file_get_contents function in PHP. While this function supports the reading of files on remote servers, the allow_url_fopen option must be enabled in PHP. Additionally, firewall software on the server may block remote access.

Change Log

  • 12-27-08 Version 1.0 – First release.

Usage Notes

From the plugin’s options page (DDRetrieveData), simply enter the trigger text and the path to the data file for each set of data you would like to use. If you need more fields, just click ‘Update Options’ to save your changes, and more fields will appear. There is no limit to how many fields you can have.

If using a local file, the path is relative to the WordPress installation directory. Examples:

file.txt
path/to/data/file.txt

If using a remote file, be sure to include the full path. Examples:

http://example.com/file.txt
ftp://example.com/file.txt
ftp://user:pass@example.com/file.txt

The default options show an example of each type. Just clear them out to use your own.

The trigger text can be anything you like. The default options show the trigger text being wrapped inside html comment tags. This is optional, but it prevents the trigger text from being shown if the plugin is disabled (as it will just be treated as a comment).

Note: Make sure you add this to your posts/pages using the html/code editor in WordPress, not the visual editor. In new versions of WordPress, just click the ‘html’ button above the edit box. If you use the visual editor it will not work, as the actual code you entered will be seen on the page, instead of being processed by the script.

Data Output

Currently the output of the data is rather simple. It can be seen in this function:

function ddrd_fetch_data($url) {
  return htmlspecialchars(file_get_contents($url));
}

As you can see, the htmlspecialchars function is used to force the data to show up exactly like it does in the file. If you would rather have html processed, remove that function. If you want to modify the way that the script retrives data (to use CURL for example), this is the function you need to change. The function is given the $url parameter, and returns the contents of the file.

Possible Future Updates

Currently there is no local caching of remote files. This may be added in the future. Other options may be added as well.

Pages: [7] 6 5 4 3 2 1 » Show All

  1. nice.. :)

  2. please make sure you have read the entire article. oto cam , sineklik

  3. thanks for the information http://www.feliznatal2016.org

  4. thanks for the informationFeliz Natal

  5. nice post bro!

  6. please make sure you have read the entire article. Also, please read through the comments because most common issues have already been discussed many times. Thanks. dfx audio enhancer | Download QQ player | Photo DVD Maker \ movie maker | download windows movie maker | Download Folder Lock | goegypt
    Skype | Download GoldWave | Download Photoshop \ Format Converter | Format Factory | Download Best Video Player | mamystyle
    ultraiso | poweriso | utorrent \ recover myfiles | download video converter | after effects | need for speed

  7. you are having an issue with a script, please make sure you have read the entire article. Also, please read through the comments because most common issues have already been discussed many times. Thanks. qq player | avira | photoscape \ video edit magic | download recuva | recuva | audio recorder
    driver pack | fun face master \ photography video games | winrar | super copier | nero
    avant browser | teamviewer | gom player \ sound chapter music | skype | download avs audio recorder | netcut

Pages: [7] 6 5 4 3 2 1 » Show All

Leave a Comment

Before you comment: If you are having an issue with a script, please make sure you have read the entire article. Also, please read through the comments because most common issues have already been discussed many times. Thanks.


Be sure to wrap all code in <code></code> tags.