11 include dirname(dirname(dirname(dirname(__FILE__)))).
'/mainfile.php';
17 $sql =
"SELECT * FROM ".$xoopsDB->prefix(
"modules").
" WHERE isactive=1";
23 while($row = $xoopsDB->fetchArray(
$result)){
24 $mod =
new XoopsModule();
25 $mod->assignVars($row);
27 $info =
$mod->getInfo();
29 if(!isset($info[
'rmversion']))
continue;
30 if(!isset($info[
'updateurl']))
continue;
33 $v = $info[
'rmversion'];
35 if(isset($v[
'major']))
36 $version = $v[
'major'].
'.'.$v[
'minor'].
'.'.($v[
'revision']/10).
'.'.$v[
'stage'];
38 $version = $v[
'number'].
'.'.($v[
'revision']/100).
'.'.$v[
'status'];
40 $urls[
$mod->dirname()] = strpos($info[
'updateurl'],
'?')===
false ? $info[
'updateurl'].
'?version='.$version : $info[
'updateurl'].
'&version='.$version;
49 if(
$ret[
'message']==0)
continue;
50 if(
$ret[
'error']==1)
continue;
52 $ret[
'data'][
'type'] =
'module';
64 $result = $xoopsDB->query(
"SELECT dir FROM ".$xoopsDB->prefix(
"rmc_plugins"));
65 while($row = $xoopsDB->fetchArray(
$result)){
66 $plugin =
$rmFunc->load_plugin($row[
'dir']);
67 if(!$plugin)
continue;
69 $info = $plugin->info();
71 if(!isset($info[
'updateurl']))
continue;
74 $v = $info[
'version'];
79 $version = $v[
'major'].
'.'.$v[
'minor'].
'.'.($v[
'revision']/10).
'.'.$v[
'stage'];
81 $urls[$row[
'dir']] = strpos($info[
'updateurl'],
'?')===
false ? $info[
'updateurl'].
'?version='.$version : $info[
'updateurl'].
'&version='.$version;
88 if(
$ret[
'message']==0)
continue;
89 if(
$ret[
'error']==1)
continue;
91 $ret[
'data'][
'type'] =
'plugin';
99 file_put_contents(XOOPS_CACHE_PATH.
'/updates.chk', base64_encode(serialize(array(
'date'=>time(),
'total'=>
$total,
'updates'=>
$upds))));
101 header(
'Cache-Control: no-cache, must-revalidate');
102 header(
'Expires: Mon, 26 Jul 1997 05:00:00 GMT');
103 header(
'Content-type: application/json');
104 echo json_encode(array(
'total'=>
$total));