Starting with R3-born 0.1.1 there is a version checker for Modules and Blocks This is an ACP feature that allows administrators of R3-born sites to check if newer versions of modules and blocks they have installed are available from the developer.
This tutorial explains how developers can make their blocks and modules version checker compatible. It's very easy to do and will only take a few minutes.
mvVersion Version Check URL
The first thing to do to make a block or module Version Checker compatible is add a URL to mvVerison.php that links to your update file.
Код: |
$mvVersion['version_check'] = 'http://www.yourserver.com/update.txt'; |
The Update File
Next you will need to create an update file on your server. You can call it whatever you want, but I suggest something simple like 'update.txt'.
Update File Format
-
- Each block or module listed in the update file uses a switch like you would find in R3-born .tpls.
- Switches start with <!-- BEGIN something --> and ends with <!-- END something -->.
- Switches should be on separate line.
- The variable names in the switches, 'something' in this example, must be identical for BEGIN and END.
- The name of the switch must match the name of the corresponding block/module.
- Every line of information inside the switches should be on separate line and keys should be in lower case and tab seperated.
Update Keys
There are four keys.
-
- error - Freeform text that is displayed if software cannot be updated or is no longer supported.
- version - current version. if this version is different from the install version it means that an update is available
- update - update url. links to the file if possible
- info - information url. usually a website or page about the software
Example Update File
Код: |
<!-- BEGIN your_module -->
version 0.1.2
update http://www.yourserver.com/your_module.zip
info http://www.yourserver.com/your_module.html
<!-- END your_module -->
<!-- BEGIN another_module -->
version 0.1.1
update http://www.yourserver.com/another_module.zip
info http://www.yourserver.com/another_module.html
<!-- END another_module -->
<!-- BEGIN a_block -->
version 0.1.2
update http://www.yourserver.com/a_block.zip
info http://www.yourserver.com/a_block.html
<!-- END a_block -->
<!-- BEGIN old_block -->
error This block is no longer supported and has been replaced by "a_block"
<!-- END old_block -->
|
As you can see you can list as many blocks and modules as you like in one update file.