rah_plugin_download
Published under current TXP projects
Allows plugin authors serve plugin downloads easily with out saving and uploading files again and again.
Image: rah_plugin_download
Intro and description
A Textpattern plugin used to allow public plugin downloads directly from the database. A tool that plugin developers can use to allow users to download their amazing plugins. For example it can be used alongside with ied_plugin_composer, or you can make the plugin locally and then install it to your public Textpattern install, where rah_plugin_downloads allows the public downloading.
List of features
- Simple tag to generate download URLs and output download count.
- Supports compressed and normal plugin file formats with stannard plugin template block-outlook.
- Textiles help documention if it spots un-textiled h1. in the help.
- Allow just some or all installed plugins to be downloaded by visitors, customizible by prefix or individual plugin name.
- Control panel under Textpattern’s Extensions tab where you can locate plugin download preferences: disallow and allow downloads.
Requirements
Minimum:
- Textpattern 4.x.x+
- PHP 4.3+
Recommended:
- Textpattern 4.0.7+
- PHP with zlib library and
gzencode().
Installation and usage
Plugin mostly used plugin devs. You all know how to install plugin, right. Yes, insert it to the plugin install textarea and run the automatic setup. Then it’s ready.
To add more preferences, in example allow just some plugins to be downloaded, go to Externsion / rah_plugin_download in your Textpattern admin panel.
Attributes
The tag is <txp:rah_plugin_download /> and attributes for it follow. The tag outputs a download URL.
name
The name of plugin to be served. The attribute is required.
Default: name="" Example: name="xxx_myplugin"
type
The type of file served, or set the tag to output download count. Allowed values zip, count or unset. If zip is used, URL points to compressed plugin download. The default value unset (empty) outputs URL to the normal file, and with count, the tag shows download count instead of the download URL.
Default: type="" Example: "zip"
version
Which version’s download count is shown. The attribute is only effective when download count is shown instead of the download link. Allowed values are version number and unset (empty). If leaved empty total download count is shown.
Default: version="" Example: "0.1"
Examples
Example #1: Return plugin download URL
Code:
<txp:rah_plugin_download name="xxx_myplugin" />
Returns:
http://example.com/?rah_plugin_download=xxx_myplugin
Example #2: Container usage
<txp:rah_plugin_download name="xxx_myplugin">
Download the plugin
</txp:rah_plugin_download>
Returns:
<a href="http://example.com/?rah_plugin_download=xxx_myplugin">
Download the plugin
</a>
Example #3: Output link using articles
If you post articles titled by the name of the plugin, you could do the url, plus link, automatically.
Code:
<a href="<txp:site_url />?rah_plugin_download=<txp:title />">Download the plugin</a>
Returns:
<a href="http://example.com/?rah_plugin_download=xxx_myplugin">Download the plugin</a>
Example #4: Article listings using same method as above Example #2
Example uses articles to notify users about your plugins.
Code:
<txp:article_custom limit="999">
<a href="<txp:site_url />?rah_plugin_download=<txp:title />"><txp:title /> [Click to download]</a>
</txp:article_custom>
Example #5: Output download count
Code:
<txp:rah_plugin_download name="xxx_myplugin" type="count" />
Returns:
1
Changelog
Version 1.0
- Now older plugin versions can be downloaded directly from rah_plugin_dev’s version manager. There is setting in the preferences panel to set this feature on. Enabling the feature requires rah_plugin_dev version 0.5 or newer.
Version 0.9
- Warning, please note: This update introduces new preferences system and thus all updaters will lose their old settings. You won’t lose statictics, but you will need to resave your settings. Sorry for inconvenience.
- Added container support to
<txp:rah_plugin_download />. If used as a container, returns the contained statement linked. - Changed download validity check.
- Now list of plugin prefixes is trimmed from whitespace during save.
- Now
rah_plugin_download_textile()won’t includeclassTextile.phpand dopreg_match()for nothing. - Now on the plugin list the plugin name links to the statictics. Tiny zero is bit hard to click.
- Now the plugin list shows the total download count at end of the list.
- Fixed: values in the plugin list are now properly escaped.
Version 0.8
- Fixed: if all plugins were allowed for download, visitor could pull out empty plugin file.
- Changed: compained plugin data queries into one, while preserved backwards compatibility features introduced in 0.4.
- Added support for optional flags.
- Removed initial install call from frontend download call; Define preferences in Extensions panel before using the downloads.
- Removed if installed check from frontend download call; Make sure that you have set rah_plugin_download prefs before trying to download stuff. Provides little performance increase.
Version 0.7
- Added ability to output download count with tags. See
<txp:rah_plugin_download />andtypeattribute’scountoption. - Added attribute
versionfor the download count. - Now
rah_plugin_download_textile()defaults to unset.
Version 0.6
- Added download counter and a statistics viewer.
Version 0.5.3
- Renamed function
rah_plugin_textile()torah_plugin_download_textile()for future plans, and to keep the function names similiar.
Version 0.5.2
- Fixed: added missing comma (
,) to the install script.
Version 0.5
- Cut the amount of code used.
- Only gzips plugin file if gzip functions are enabled on server.
- Small speed and stress improvements.
- Improved the general code layout.
- Re-arranged plugin-to-download queue check.
- Returns Unknown plugin type if plugin type is out of the range of current valid types.
Version 0.4
- Removed useless extra
doSlash(). - Added
load_ordersupport, while preserved backwards compatibility.
Version 0.3
- More advanced admin panel under Extensions.
- Copy and paste
<txp:rah_plugin_download />tags. - Download plugin files via the interface.
- Improved outfit.
- Copy and paste
Version 0.2.1
- Added one missing doSlash to the admin panel code.
Version 0.2
- Added options to alternatively limit downloadable plugins via backend interface.
- Some minor improvements.
Version 0.1
- First release
Thanks to
- net-carver for the idea of making backend interface and limit downloadable plugins
- Jeff Soo for notifying about the missing plugin flags.
- Victor for reporting broken extensions link.
- Stef for reporting loads of stuff.