');
} else {
if (!$invcol) {
if (!$nottoobad) {
$p='
';
} else {
$p='
';
}
} else {
$p='
';
}
return($p.$pre.'NO
');
}
}
$cols=array(
'New'=>array('name'=>'Nuova','type'=>'bool'),
'Good'=>array('name'=>'Papabile','type'=>'bool'),
'Chosen'=>array('name'=>'Scelta','type'=>'bool'),
'Visible'=>array('name'=>'Visibile','type'=>'bool'),
'Blacklisted'=>array('name'=>'Blacklistata','type'=>'bool'),
'URI'=>array('name'=>'URI','type'=>'text'),
'Title'=>array('name'=>'Titolo','type'=>'text'),
'ShortDesc'=>array('name'=>'Descrizione breve','type'=>'text'),
'LongDesc'=>array('name'=>'Descrizione lunga','type'=>'text'),
'OurDesc'=>array('name'=>'Descrizione nostra','type'=>'text'),
'PlaceID'=>array('name'=>'Località','type'=>'select'),
'Email'=>array('name'=>'Email di contatto','type'=>'text'),
'Software'=>array('name'=>'Software','type'=>'text'),
'Version'=>array('name'=>'Versione','type'=>'text'),
'UserCount'=>array('name'=>'Utenti','type'=>'int'),
'StatusCount'=>array('name'=>'Stati','type'=>'int'),
'DomainCount'=>array('name'=>'Istanze note','type'=>'int'),
'ActiveUsersMonth'=>array('name'=>'Utenti attivi (mese)','type'=>'int'),
'ActiveUsersHalfYear'=>array('name'=>'Utenti attivi (6 mesi)','type'=>'int'),
'Thumb'=>array('name'=>'Logo','type'=>'text'),
'RegOpen'=>array('name'=>'Registrazioni aperte','type'=>'bool'),
'RegReqApproval'=>array('name'=>'Approvazione registrazioni','type'=>'bool'),
'MaxTootChars'=>array('name'=>'Limite caratteri','type'=>'int'),
'AdmAccount'=>array('name'=>'Account admin','type'=>'text'),
'AdmDisplayName'=>array('name'=>'Nome account admin','type'=>'text'),
'AdmCreatedAt'=>array('name'=>'Data creazione account admin','type'=>'time'),
'AdmURL'=>array('name'=>'Pagina dell’admin','type'=>'text'),
'AdmAvatar'=>array('name'=>'Avatar admin','type'=>'text'),
'AdmNote'=>array('name'=>'Note dell’admin','type'=>'text'),
'InstLangs'=>array('name'=>'Lingue dichiarate','type'=>'select'),
'InstOurLangs'=>array('name'=>'Lingue impostate da noi','type'=>'select'),
'InstFinancing'=>array('name'=>'Modalità di finanziamento','type'=>'select'),
'InstPolicies'=>array('name'=>'Restrizioni sui contenuti','type'=>'select'),
'InstTags'=>array('name'=>'Tags','type'=>'select'),
);
$fieldselopts='';
foreach ($cols as $key=>$val) {
$fieldselopts.='';
}
$res=mysqli_query($link,'SELECT *, Instances.ID AS IID FROM Instances LEFT JOIN Places ON Places.ID=PlaceID ORDER BY URI ASC LIMIT 50')
or muoribene(mysqli_error($link),false);
if (mysqli_num_rows($res)<1) {
$out='
Nessuna istanza da mostrare.
'.N;
} else {
$out='';
while ($row=mysqli_fetch_assoc($res)) {
$out.='
'.N;
// $out.='
Attributi
Info
'.N;
$out.=''.N;
$out.='
'.$row['URI'].'
'.N;
$attr=booly($cols['Blacklisted']['name'].': ',$row['Blacklisted'],false,true).N;
$attr.=booly($cols['New']['name'].': ',$row['New'],true).N;
$attr.=booly($cols['Good']['name'].': ',$row['Good']).N;
$attr.=booly($cols['Chosen']['name'].': ',$row['Chosen']).N;
$attr.=booly($cols['Visible']['name'].': ',$row['Visible']).N;
/* $attr.=booly($cols['RegOpen']['name'].': ',$row['RegOpen']).N;
$attr.=booly($cols['RegReqApproval']['name'].': ',$row['RegReqApproval'],true,true).N;*/
$sres=mysqli_query($link,'SELECT * FROM InstChecks WHERE InstID='.$row['IID'].' ORDER BY Time DESC')
or muoribene(mysqli_error($link),false);
$csres=mysqli_num_rows($sres);
if ($csres>0) {
$bene=0;
while ($srow=mysqli_fetch_assoc($sres)) {
if ($srow['Status']==1)
$bene++;
}
$width=str_replace(',','.',100/$csres*$bene);
$attr.='
Percentuale di risposta ai nostri check: '.round($width,1).'%
'.N;
$sres=mysqli_query($link,'SELECT SUM(Statuses) AS tstatuses, SUM(Logins) AS tlogins, SUM(Registrations) AS tregs FROM InstActivity WHERE InstID='.$row['IID'])
or muoribene(mysqli_error($link),false);
$tot=mysqli_fetch_assoc($sres);
$sres=mysqli_query($link,'SELECT * FROM InstActivity WHERE InstID='.$row['IID'].' ORDER BY Week DESC')
or muoribene(mysqli_error($link),false);
if (mysqli_num_rows($sres)>0) {
$attr.='
'.N;
$sres=mysqli_query($link,'SELECT * FROM InstTrends WHERE InstID='.$row['IID'].' ORDER BY Pos ASC')
or muoribene(mysqli_error($link),false);
if (mysqli_num_rows($sres)>0) {
$attr.='
'.N;
while ($srow=mysqli_fetch_assoc($sres)) {
$attr.='
'.N;
$sres=mysqli_query($link,'SELECT * FROM InstLangs LEFT JOIN Languages ON Languages.ID=LangID WHERE InstID='.$row['IID'].' ORDER BY Pos ASC')
or muoribene(mysqli_error($link),false);
if (mysqli_num_rows($sres)>0) {
$i=0;
$buf=array();
while ($srow=mysqli_fetch_assoc($sres)) {
$i++;
$buf[]=$i.': '.hspech($srow['Code'].' ['.ucfirst(locale_get_display_name($srow['Code'])).']');
}
$out.='
'.N;
}
$sres=mysqli_query($link,'SELECT * FROM InstOurLangs LEFT JOIN Languages ON Languages.ID=LangID WHERE InstID='.$row['IID'].' ORDER BY Pos ASC')
or muoribene(mysqli_error($link),false);
if (mysqli_num_rows($sres)>0) {
$i=0;
$buf=array();
while ($srow=mysqli_fetch_assoc($sres)) {
$i++;
$buf[]=$i.': '.hspech($srow['Code'].' ['.ucfirst(locale_get_display_name($srow['Code'],'it')).']');
}
$out.='
'.N;
}
$sres=mysqli_query($link,'SELECT * FROM InstFinancing LEFT JOIN Financing ON Financing.ID=FinID WHERE InstID='.$row['IID'].' ORDER BY Pos ASC')
or muoribene(mysqli_error($link),false);
if (mysqli_num_rows($sres)>0) {
$i=0;
$buf=array();
while ($srow=mysqli_fetch_assoc($sres)) {
$i++;
$buf[]=$i.': '.hspech($srow['Type']).' ('.hspech($row['Details']).')';
}
$out.='
'.N;
}
$sres=mysqli_query($link,'SELECT * FROM InstPolicies LEFT JOIN Policies ON Policies.ID=PolID WHERE InstID='.$row['IID'].' ORDER BY Pos ASC')
or muoribene(mysqli_error($link),false);
if (mysqli_num_rows($sres)>0) {
$i=0;
$buf=array();
while ($srow=mysqli_fetch_assoc($sres)) {
$i++;
$buf[]=$i.': '.hspech($srow['Name']);
}
$out.='
'.N;
}
$sres=mysqli_query($link,'SELECT * FROM InstTags LEFT JOIN Tags ON Tags.ID=TagID WHERE InstID='.$row['IID'].' ORDER BY Pos ASC')
or muoribene(mysqli_error($link),false);
if (mysqli_num_rows($sres)>0) {
$i=0;
$buf=array();
while ($srow=mysqli_fetch_assoc($sres)) {
$i++;
$buf[]=$i.': '.hspech($srow['Name']);
}
$out.='