// compare version numbers of local module.xml and remote module.xml
// returns true if a new version is available
function weatherzip_vercheck() {
$newver = false;
if ( function_exists(xml2array)){
$module_local = xml2array("modules/urihand/module.xml");
$module_remote = xml2array("https://raw.github.com/POSSA/freepbx-weather-by-zip/master/module.xml");
if ( $module_remote[module][version] > $module_local[module][version])
{
$newver = true;
}
return ($newver);
}
}
First line of page.urihand.php is:
if ($foo = weatherzip_vercheck()) {
print "<br>A <b>new version of this module is available</b> from the <a target='_blank' href='http://pbxossa.org'>PBX Open Source Software Alliance</a><br>";
}
Add check for modules updates :
First line of
page.urihand.php
is: