1
0
Fork 0

Modifichine varie

This commit is contained in:
pezcurrel 2019-12-03 21:35:02 +01:00
parent 1fd4e05685
commit d2975c46f8
8 changed files with 47 additions and 40 deletions

View file

@ -1,6 +0,0 @@
excludeafter=2592000
sistersfp=istanzesorelle
dontloadbl=0
timeout=5
biglistfp=listona.json
prodlistfp=listina.json

View file

@ -95,14 +95,14 @@ if (file_exists($inifp)) {
echo('Attenzione: non ho potuto leggere la configurazione dal file "'.$inifp.'", potrebbe essere non leggibile o corrotto.'.N); echo('Attenzione: non ho potuto leggere la configurazione dal file "'.$inifp.'", potrebbe essere non leggibile o corrotto.'.N);
} }
} }
$f=@fopen($inifp,'w'); /*$f=@fopen($inifp,'w');
if ($f!==false) { if ($f!==false) {
foreach ($opts as $key=>$val) foreach ($opts as $key=>$val)
fwrite($f,$key.'='.$val.N); fwrite($f,$key.'='.$val.N);
fclose($f); fclose($f);
} else { } else {
echo('Attenzione: non ho potuto salvare la configurazione nel file "'.$inifp.'".'.N); echo('Attenzione: non ho potuto salvare la configurazione nel file "'.$inifp.'".'.N);
} }*/
for ($i=1; $i<$argc; $i++) { for ($i=1; $i<$argc; $i++) {
if (substr($argv[$i],0,1)=='-') { if (substr($argv[$i],0,1)=='-') {
@ -170,7 +170,7 @@ if ($buf!==false) {
echo('OK :-)'.N); echo('OK :-)'.N);
$buf=explode(N,$buf); $buf=explode(N,$buf);
foreach ($buf as $val) { foreach ($buf as $val) {
if ($val!='' && $val{0}!='#') { if ($val!='' && $val[0]!='#') {
$kv=explode('|',$val); $kv=explode('|',$val);
if ($kv[1]=='') $kv[1]=NULL; if ($kv[1]=='') $kv[1]=NULL;
$sisters[$kv[0]]=$kv[1]; $sisters[$kv[0]]=$kv[1];
@ -223,6 +223,7 @@ foreach ($sisters as $dom=>$bluri) {
} }
} }
ksort($blinstances); ksort($blinstances);
echo(count($blinstances).' istanze bloccate.'.N);
foreach ($sisters as $dom=>$bluri) { foreach ($sisters as $dom=>$bluri) {
echo('Recupero la lista delle istanze note a "'.$dom.'" ... '); echo('Recupero la lista delle istanze note a "'.$dom.'" ... ');
@ -242,6 +243,7 @@ foreach ($sisters as $dom=>$bluri) {
ksort($biglist); ksort($biglist);
$prodlist=array(); $prodlist=array();
$newbiglist=array();
$i=0; $i=0;
$qinst=count($biglist); $qinst=count($biglist);
foreach ($biglist as $dom=>$oinfo) { foreach ($biglist as $dom=>$oinfo) {
@ -250,20 +252,23 @@ foreach ($biglist as $dom=>$oinfo) {
if ($buf!==false) { if ($buf!==false) {
echo('OK :-)'.N); echo('OK :-)'.N);
$info=json_decode($buf,true); $info=json_decode($buf,true);
$info['cr-last_checked']=time(); if (!is_null($oinfo) && array_key_exists('cr-checks',$oinfo))
$info['cr-was_ok']=true; $info['cr-checks']=$oinfo['cr-checks'];
$biglist[$dom]=$info; $info['cr-checks'][]=array('time'=>time(),'ok'=>true);
if (!array_key_exists('registrations',$info) || $info['registrations']==true) { $newbiglist[$dom]=$info;
if (array_key_exists('registrations',$info) && $info['registrations']==true
&& array_key_exists('stats',$info) && array_key_exists('user_count',$info['stats'] && $info['stats']['user_count']>10 && $info['stats']['user_count']<=30000
&& array_key_exists('domain_count',$info['stats'] && $info['stats']['domain_count']>=500
) {
$prodlist[$dom]=$info; $prodlist[$dom]=$info;
echo('"'.$dom.'" aggiunta alla lista delle istanze ok! :-)'.N); echo('"'.$dom.'" aggiunta alla lista delle istanze ok! :-)'.N);
} }
} else { } else {
echo('ERRORE :-( ... '); echo('ERRORE :-( ... ');
if (is_null($oinfo) || time()-$oinfo['cr-last_checked']<=$opts['excludeafter']) { if (is_null($oinfo) || time()-$oinfo['cr-checks'][count($oinfo['cr-checks'])-1]['time']<=$opts['excludeafter']) {
echo('ma riproveremo...'.N); echo('ma riproveremo...'.N);
$oinfo['cr-last_checked']=time(); $oinfo['cr-checks'][]=array('time'=>time(),'ok'=>false);
$oinfo['cr-was_ok']=false; $newbiglist[$dom]=$oinfo;
$biglist[$dom]=$oinfo;
} else { } else {
echo('e non riproveremo...'.N); echo('e non riproveremo...'.N);
} }
@ -271,12 +276,17 @@ foreach ($biglist as $dom=>$oinfo) {
$i++; $i++;
} }
$json=json_encode($biglist,JSON_PRETTY_PRINT); $json=json_encode($newbiglist,JSON_PRETTY_PRINT);
file_put_contents($opts['biglistfp'],$json); file_put_contents($opts['biglistfp'],$json);
$json=json_encode($prodlist,JSON_PRETTY_PRINT); $json=json_encode($prodlist,JSON_PRETTY_PRINT);
file_put_contents($opts['prodlistfp'],$json); file_put_contents($opts['prodlistfp'],$json);
echo('Totale istanze nella listona: '.count($biglist).N); $diff=count($newbiglist)-count($biglist);
if ($diff<0)
$diff='-'.$diff;
else
$diff='+'.$diff;
echo('Totale istanze nella listona: '.count($newbiglist).' ('.$diff.' rispetto all\'ultima volta)'.N);
echo('Totale istanze nella listina di quelle occhei: '.count($prodlist).N); echo('Totale istanze nella listina di quelle occhei: '.count($prodlist).N);
?> ?>

View file

@ -3,6 +3,7 @@
<div id="hmenu"> <div id="hmenu">
<ul> <ul>
<?php echo($menuout); ?> <?php echo($menuout); ?>
</ul>
</div> </div>
</nav> </nav>
<div class="scrwide"> <div class="scrwide">
@ -13,7 +14,7 @@
<p>Here are some contacts of those involved</p> <p>Here are some contacts of those involved</p>
<ul> <ul>
<li>Ca_Gi: <a href="https://mastodon.bida.im/@Ca_Gi">@Ca_Gi@mastodon.bida.im</a></li> <li>Ca_Gi: <a href="https://mastodon.bida.im/@Ca_Gi">@Ca_Gi@mastodon.bida.im</a></li>
<li>Pongrèbio: <a href="https://mastodon.bida.im/@pongrebio">@pongrebio@mastodon.bida.im</a></li> <li>Pongrèbio: <a href="https://mastodon.bida.im/@pongrebio" style="letter-spacing:-0.3px;">@pongrebio@mastodon.bida.im</a></li>
</ul> </ul>
<p>Except where otherwise noted, content on this site is licensed under a <a href="https://creativecommons.org/licenses/by/4.0">Creative Commons Attribution 4.0 International license</a>.</p> <p>Except where otherwise noted, content on this site is licensed under a <a href="https://creativecommons.org/licenses/by/4.0">Creative Commons Attribution 4.0 International license</a>.</p>
</section> </section>

View file

@ -3,6 +3,7 @@
<div id="hmenu"> <div id="hmenu">
<ul> <ul>
<?php echo($menuout); ?> <?php echo($menuout); ?>
</ul>
</div> </div>
</nav> </nav>
<div class="scrwide"> <div class="scrwide">
@ -13,7 +14,7 @@
<p>Ecco alcuni contatti</p> <p>Ecco alcuni contatti</p>
<ul> <ul>
<li>Ca_Gi: <a href="https://mastodon.bida.im/@Ca_Gi">@Ca_Gi@mastodon.bida.im</a></li> <li>Ca_Gi: <a href="https://mastodon.bida.im/@Ca_Gi">@Ca_Gi@mastodon.bida.im</a></li>
<li>Pongrèbio: <a href="https://mastodon.bida.im/@pongrebio">@pongrebio@mastodon.bida.im</a></li> <li>Pongrèbio: <a href="https://mastodon.bida.im/@pongrebio" style="letter-spacing:-0.3px;">@pongrebio@mastodon.bida.im</a></li>
</ul> </ul>
<p>Eccetto dove diversamente specificato, i contenuti di questo sito sono rilasciati sotto <a href="https://creativecommons.org/licenses/by/4.0">Licenza Creative Commons Attribuzione 4.0 Internazionale</a>.</p> <p>Eccetto dove diversamente specificato, i contenuti di questo sito sono rilasciati sotto <a href="https://creativecommons.org/licenses/by/4.0">Licenza Creative Commons Attribuzione 4.0 Internazionale</a>.</p>
</section> </section>

View file

@ -1,7 +1,6 @@
<body onscroll="scrolltrack()"> <body onscroll="scrolltrack()">
<nav> <nav>
<div id="hmenu"> <div id="hmenu">
<ul> <ul>
<?php echo($menuout); ?> <?php echo($menuout); ?>
</ul> </ul>

View file

@ -3,6 +3,7 @@
<div id="hmenu"> <div id="hmenu">
<ul> <ul>
<?php echo($menuout); ?> <?php echo($menuout); ?>
</ul>
</div> </div>
</nav> </nav>
<div class="scrwide"> <div class="scrwide">

View file

@ -10,12 +10,12 @@ for ($i=0; $i<$ndir; $i++)
$prepath.='../'; $prepath.='../';
$menu=array( $menu=array(
'guide'=>array('lijs'=>null, 'href'=>$instpath, 'title'=>'Guide', 'selected'=>false, 'submenu'=>null), 'guide'=>array('liadd'=>null, 'href'=>$instpath, 'title'=>'Guide', 'selected'=>false, 'submenu'=>null),
'instances'=>array('lijs'=>null, 'href'=>$instpath.'/instances', 'title'=>'Instances', 'selected'=>false, 'submenu'=>null), 'instances'=>array('liadd'=>null, 'href'=>$instpath.'/instances', 'title'=>'Instances', 'selected'=>false, 'submenu'=>null),
'about'=>array('lijs'=>null, 'href'=>$instpath.'/about', 'title'=>'About', 'selected'=>false, 'submenu'=>null), 'about'=>array('liadd'=>null, 'href'=>$instpath.'/about', 'title'=>'About', 'selected'=>false, 'submenu'=>null),
'language'=>array('lijs'=>null, 'href'=>null, 'title'=>'Language', 'selected'=>false, 'submenu'=>array( 'language'=>array('liadd'=>null, 'href'=>null, 'title'=>'Language', 'selected'=>false, 'submenu'=>array(
'inglese'=>array('lijs'=>'onclick=golang("en")', 'href'=>null, 'title'=>'English', 'selected'=>false, 'submenu'=>null), 'inglese'=>array('liadd'=>'onclick="golang(\'en\')" onmouseover="this.style.cursor=\'pointer\'"', 'href'=>null, 'title'=>'English', 'selected'=>false, 'submenu'=>null),
'italiano'=>array('lijs'=>'onclick=golang("it")', 'href'=>null, 'title'=>'Italiano', 'selected'=>false, 'submenu'=>null) 'italiano'=>array('liadd'=>'onclick="golang(\'it\')" onmouseover="this.style.cursor=\'pointer\'"', 'href'=>null, 'title'=>'Italiano', 'selected'=>false, 'submenu'=>null)
) )
) )
); );
@ -44,10 +44,10 @@ switch($path) {
'atit'=>' - Guide', 'atit'=>' - Guide',
'js'=>array('shsum','guideanchors','scrolltrack') 'js'=>array('shsum','guideanchors','scrolltrack')
); );
$menu['guide']['lijs']='onclick="shsum()" onmouseover="this.style.cursor=\'pointer\'"'; $menu['guide']['liadd']='onclick="shsum()" onmouseover="this.style.cursor=\'pointer\'"';
$menu['guide']['href']=null; $menu['guide']['href']=null;
$menu['guide']['selected']=true; $menu['guide']['selected']=true;
$menu['language']['submenu']['inglese']['lijs']=null; $menu['language']['submenu']['inglese']['liadd']=null;
$menu['language']['submenu']['inglese']['selected']=true; $menu['language']['submenu']['inglese']['selected']=true;
break; break;
@ -59,10 +59,10 @@ switch($path) {
'js'=>array('shsum','guideanchors','scrolltrack') 'js'=>array('shsum','guideanchors','scrolltrack')
); );
tradmenu('it'); tradmenu('it');
$menu['guide']['lijs']='onclick="shsum()" onmouseover="this.style.cursor=\'pointer\'"'; $menu['guide']['liadd']='onclick="shsum()" onmouseover="this.style.cursor=\'pointer\'"';
$menu['guide']['href']=null; $menu['guide']['href']=null;
$menu['guide']['selected']=true; $menu['guide']['selected']=true;
$menu['language']['submenu']['italiano']['lijs']=null; $menu['language']['submenu']['italiano']['liadd']=null;
$menu['language']['submenu']['italiano']['selected']=true; $menu['language']['submenu']['italiano']['selected']=true;
break; break;
@ -75,7 +75,7 @@ switch($path) {
); );
$menu['instances']['href']=null; $menu['instances']['href']=null;
$menu['instances']['selected']=true; $menu['instances']['selected']=true;
$menu['language']['submenu']['inglese']['lijs']=null; $menu['language']['submenu']['inglese']['liadd']=null;
$menu['language']['submenu']['inglese']['selected']=true; $menu['language']['submenu']['inglese']['selected']=true;
break; break;
@ -89,7 +89,7 @@ switch($path) {
tradmenu('it'); tradmenu('it');
$menu['instances']['href']=null; $menu['instances']['href']=null;
$menu['instances']['selected']=true; $menu['instances']['selected']=true;
$menu['language']['submenu']['italiano']['lijs']=null; $menu['language']['submenu']['italiano']['liadd']=null;
$menu['language']['submenu']['italiano']['selected']=true; $menu['language']['submenu']['italiano']['selected']=true;
break; break;
@ -102,7 +102,7 @@ switch($path) {
); );
$menu['about']['href']=null; $menu['about']['href']=null;
$menu['about']['selected']=true; $menu['about']['selected']=true;
$menu['language']['submenu']['inglese']['lijs']=null; $menu['language']['submenu']['inglese']['liadd']=null;
$menu['language']['submenu']['inglese']['selected']=true; $menu['language']['submenu']['inglese']['selected']=true;
break; break;
@ -116,7 +116,7 @@ switch($path) {
tradmenu('it'); tradmenu('it');
$menu['about']['href']=null; $menu['about']['href']=null;
$menu['about']['selected']=true; $menu['about']['selected']=true;
$menu['language']['submenu']['italiano']['lijs']=null; $menu['language']['submenu']['italiano']['liadd']=null;
$menu['language']['submenu']['italiano']['selected']=true; $menu['language']['submenu']['italiano']['selected']=true;
break; break;
@ -148,7 +148,7 @@ function buildmenu($menu) {
global $menuout; global $menuout;
foreach ($menu as $key=>$arr) { foreach ($menu as $key=>$arr) {
$menuout.='<li'; $menuout.='<li';
if (!is_null($arr['lijs'])) $menuout.=' '.$arr['lijs']; if (!is_null($arr['liadd'])) $menuout.=' '.$arr['liadd'];
if (!is_null($arr['submenu'])) $menuout.=' onmouseover="chulsh(this,true)" onmouseout="chulsh(this,false)"'; if (!is_null($arr['submenu'])) $menuout.=' onmouseover="chulsh(this,true)" onmouseout="chulsh(this,false)"';
if ($arr['selected']) $menuout.=' class="hil"'; if ($arr['selected']) $menuout.=' class="hil"';
$menuout.='>'; $menuout.='>';

View file

@ -92,7 +92,7 @@ section, #header {
font-weight: bold; font-weight: bold;
} }
ul { ul {
padding-left: 20pt; padding-left: 15pt;
} }
ul li { ul li {
padding-left: 0; padding-left: 0;
@ -129,6 +129,7 @@ a:active {
height: 40px; height: 40px;
margin: 0; margin: 0;
padding: 0; padding: 0;
/*box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.4);*/
/*padding-left: 40px;*/ /*padding-left: 40px;*/
z-index: 2; z-index: 2;
/*display: none;*/ /*display: none;*/
@ -149,7 +150,7 @@ a:active {
} }
#hmenu ul li:hover { #hmenu ul li:hover {
background-color: rgba(255,255,255,0.10); background-color: rgba(255,255,255,0.10);
cursor: pointer; cursor: default;
} }
#hmenu .hil { #hmenu .hil {
background-color: rgba(255,255,255,0.10); background-color: rgba(255,255,255,0.10);
@ -286,7 +287,7 @@ a:active {
.sectcont { .sectcont {
padding: 20pt; padding: 20pt;
} }
#content { #content, .sectcont {
text-align: left; text-align: left;
-webkit-hyphens: none; -webkit-hyphens: none;
-ms-hyphens: none; -ms-hyphens: none;