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
- Textpattern 4.0.3+
- PHP4.3+ with gzencode, chunk_split and serialize.
Recommended:
- Textpattern 4.0.7+
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:
Code: <txp:rah_plugin_download name="xxx_myplugin" />
Returns: http://www.mysite.com/?rah_plugin_download=xxx_myplugin
Example #2:
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>
Example #3:
If you post articles to notify users about the plugin, related to Example numer #3, you could do download list simply by:
Code: <txp:article_custom form="my_form" limit="999" />
And inside my_form: <a href="<txp:site_url />?rah_plugin_download=<txp:title />"><txp:title /> [Click to download]</a>
Example #4:
Output download count:
<txp:rah_plugin_download name="xxx_myplugin" type="count" />
Changelog
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