diff --git a/web/clitools/getinstinfo.php b/web/clitools/getinstinfo.php index 65b82b3..5233f1a 100755 --- a/web/clitools/getinstinfo.php +++ b/web/clitools/getinstinfo.php @@ -529,17 +529,24 @@ if (!is_null($idata['IsMastodon'])) $idata['IsMastodon']=b2i($idata['IsMastodon' if (is_null($oidata)) { $query='INSERT INTO Instances SET '; $idata['InsertTS']=$now; + $idata['TotChecks']=1; if ($instanswered) { $idata['FirstSeen']=$now; $idata['LastOkCheckTS']=$now; + $idata['OkChecks']=1; } else { $idata['Thumb']='unavailable'; $idata['AdmAvatar']='unavailable'; + $idata['OkChecks']=0; } } else { $query='UPDATE Instances SET '; + ($instanswered && is_null($oidata['FirstSeen'])) ? $idata['FirstSeen']=$now : $idata['FirstSeen']=$oidata['FirstSeen']; ($instanswered) ? $idata['LastOkCheckTS']=$now : $idata['LastOkCheckTS']=$oidata['LastOkCheckTS']; + $idata['TotChecks']=$oidata['TotChecks']+1; + $idata['OkChecks']=$oidata['OkChecks']; + if ($instanswered) $idata['OkChecks']++; $idata['Priority']=$oidata['Priority']; $idata['Visible']=$oidata['Visible']; $idata['Noxious']=$oidata['Noxious'];