From 3ff6b494e8b8652610ef619a5fa25a2ba9a0dc52 Mon Sep 17 00:00:00 2001 From: MatMasIt <34745996+MatMasIt@users.noreply.github.com> Date: Sun, 21 Mar 2021 11:46:26 +0100 Subject: [PATCH] Mixed Updates --- dlib.php | 23 ++++++++++++++--------- index.html | 32 +++++++++++++++++++++----------- lib.php | 18 ++++++++++++++---- main.es6.js | 20 +++++++++++--------- rssBuilder.php | 10 +++++----- view.php | 6 ++++++ 6 files changed, 71 insertions(+), 38 deletions(-) diff --git a/dlib.php b/dlib.php index 9b8d33c..8fb45ea 100644 --- a/dlib.php +++ b/dlib.php @@ -195,7 +195,8 @@ $docs[$i]["UID"]="d".$docs[$i]["ID"]; for($j=0;$j$fbs[$j]["Titolo"],"ID"=>(int)$fbs[$j]["ID"],"UID"=>"f".$fbs[$j]["ID"]]; } - $docs[$i]["tags"]=explode(",",$docs[$i]["Tags"]); + $docs[$i]["tags"]=explode(",",trim($docs[$i]["Tags"])); + if($docs[$i]["tags"]==[""]) $docs[$i]["tags"]=[]; unset($docs[$i]["Tags"]); if(!empty($docs[$i]["URL Firma Digitale"])){ $docs[$i]["signatureUrl"]=$docs[$i]["URL Firma Digitale"]; @@ -209,21 +210,21 @@ $docs[$i]["UID"]="d".$docs[$i]["ID"]; } function listCont($pdo,$id=null){ if(!$id){ - $q=$pdo->prepare('SELECT * FROM "Contabilita" WHERE DATETIME("NOW") >= strftime("%s", "Data di pubblicazione") ORDER BY "Data di pubblicazione" DESC'); + $q=$pdo->prepare('SELECT * FROM "Contabilita" WHERE DATETIME("NOW") >= strftime("%s", "Data di pubblicazione") ORDER BY "Data di pubblicazione" ASC'); $q->execute(); $docs=$q->fetchAll(PDO::FETCH_ASSOC); } else{ - $q=$pdo->prepare('SELECT * FROM "Contabilita" WHERE DATETIME("NOW") >= strftime("%s", "Data di pubblicazione") AND ID=:id ORDER BY "Data di pubblicazione" DESC'); + $q=$pdo->prepare('SELECT * FROM "Contabilita" WHERE DATETIME("NOW") >= strftime("%s", "Data di pubblicazione") AND ID=:id ORDER BY "Data di pubblicazione" ASC'); $q->execute([":id"=>$id]); $docs=$q->fetchAll(PDO::FETCH_ASSOC); } $docs=aritenWrap($docs); - $t=$pdo->prepare('SELECT * FROM "Feedbacks" WHERE "Data di pubblicazione" < DATETIME("NOW") ORDER BY "Data di pubblicazione" DESC'); + $t=$pdo->prepare('SELECT * FROM "Feedbacks" WHERE "Data di pubblicazione" < DATETIME("NOW") ORDER BY "Data di pubblicazione" ASC'); $t->execute(); $fbs=$t->fetchAll(PDO::FETCH_ASSOC); - $t=$pdo->prepare('SELECT * FROM "Domande" WHERE DATETIME("NOW") >= strftime("%s", "Data di pubblicazione") ORDER BY "Data di pubblicazione" DESC'); + $t=$pdo->prepare('SELECT * FROM "Domande" WHERE DATETIME("NOW") >= strftime("%s", "Data di pubblicazione") ORDER BY "Data di pubblicazione" ASC'); $t->execute(); $qts=$t->fetchAll(PDO::FETCH_ASSOC); @@ -248,7 +249,8 @@ $docs[$i]["amount"]=(float)$docs[$i]["amount"]; } if(count($ta)) $docs[$i]["links"]["to"]["documents"]=$ta; - $docs[$i]["tags"]=explode(",",$docs[$i]["Tags"]); + $docs[$i]["tags"]=explode(",",trim($docs[$i]["Tags"])); + if($docs[$i]["tags"]==[""]) $docs[$i]["tags"]=[]; unset($docs[$i]["Tags"]); unset($docs[$i]["Documenti collegati"]); } @@ -300,6 +302,7 @@ function listEvents($pdo,$id=null){ } if(count($ta)) $docs[$i]["links"]["to"]["documents"]=$ta; $docs[$i]["tags"]=explode(",",$docs[$i]["Tags"]); + if($docs[$i]["tags"]==[""]) $docs[$i]["tags"]=[]; unset($docs[$i]["Tags"]); unset($docs[$i]["Documenti collegati"]); } @@ -324,7 +327,8 @@ function listDomande($pdo,$id=null){ for($i=0;$iprepare('SELECT * FROM "Eventi" WHERE DATETIME("NOW") >= strftime("%s", "Data di pubblicazione") AND ID=:id ORDER BY "Data di pubblicazione" DESC'); $t->execute([":id"=>$d]); $tu=$t->fetch(PDO::FETCH_ASSOC); - if($tu) $ta[]=["ID"=>(int)$d,"title"=>$tu["Titolo"],"UID"=>"q".$d]; + if($tu) $ta[]=["ID"=>(int)$d,"title"=>$tu["Titolo"],"UID"=>"e".$d]; } if(count($ta)) $docs[$i]["links"]["to"]["events"]=$ta; unset($docs[$i]["Eventi collegati"]); @@ -434,7 +438,8 @@ $docs[$i]["UID"]="f".$docs[$i]["ID"]; unset($docs[$i]["Contabilita collegata"]); - $docs[$i]["tags"]=explode(",",$docs[$i]["Tags"]); + $docs[$i]["tags"]=explode(",",trim($docs[$i]["Tags"])); + if($docs[$i]["tags"]==[""]) $docs[$i]["tags"]=[]; unset($docs[$i]["Tags"]); } return $docs; diff --git a/index.html b/index.html index b01d916..1d7fb34 100644 --- a/index.html +++ b/index.html @@ -9,8 +9,18 @@ - + + + + + @@ -185,14 +195,14 @@
-
-

Lens - © 2020, Mattia Mascarello

-

Licenza Creative Commons
Quest'opera è distribuita con Licenza Creative Commons Attribuzione - Condividi allo stesso modo 4.0 Internazionale.

- REST API - Chiave pubblica PGP per le firme digitali - Feed RSS - Github Repo -
+
+

Lens - © 2020, Mattia Mascarello

+

Licenza Creative Commons
Quest'opera è distribuita con Licenza Creative Commons Attribuzione - Condividi allo stesso modo 4.0 Internazionale.

+ REST API + Chiave pubblica PGP per le firme digitali + Feed RSS + Github Repo +
      @@ -217,7 +227,7 @@

Licenza Creative Commons
Quest'opera è distribuita con Licenza Creative Commons Attribuzione - Condividi allo stesso modo 4.0 Internazionale.

REST APIChiave pubblica PGP per le firme digitali - Feed RSS/ + Feed RSSGithub Repo @@ -265,4 +275,4 @@ - + \ No newline at end of file diff --git a/lib.php b/lib.php index f6b0d64..56a1f14 100644 --- a/lib.php +++ b/lib.php @@ -87,7 +87,7 @@ function humanFileSize($size,$unit="") { function linkM($link,$text){ if(empty($link) || empty($text)) return ""; - return ''.htmlentities($text).''; + return ''.htmlentities($text).''; } function titlePrn($title,$val,$head="h3"){ if(empty($title) || empty($val)) return ""; @@ -374,6 +374,16 @@ function pageBuild($title,$body){ + + + + @@ -412,7 +422,7 @@ function renderTag($data,$tag){ $i=0; foreach($data["usage"]["categories"][$k] as $r){ if(!$r["title"]) continue; - $res.=''.htmlentities($r["title"]).''; + $res.=''.htmlentities($r["title"]).''; $i++; } if($i==0) $res.="Dati mancanti"; @@ -424,11 +434,11 @@ function renderTag($data,$tag){ $res.="

".htmlentities(ITDate(strtotime($k)))."

"; foreach($data["usage"]["timePoints"][$k] as $r){ if(!$r["title"]) continue; - $res.=''.htmlentities($r["title"]).''; + $res.=''.htmlentities($r["title"]).''; $i++; } if($i==0) $res.="Dati mancanti"; } return pageBuild("Tag: ".$tag,$res); -} \ No newline at end of file +} diff --git a/main.es6.js b/main.es6.js index 6de9be6..5536ab0 100644 --- a/main.es6.js +++ b/main.es6.js @@ -29,34 +29,36 @@ class NodeLinks{ } ks.forEach(category => { list=dict[category]; - this.html+="

"+this.lookup[category]+"

"; + this.html+="

"+this.lookup[category]+"

"; list.forEach(obj => { this.html+='

'; }); this.html+="
"; }); - if(ks.length>0&&!flag){ + if(ks.length>0&&flag){ this.html+="
"; } } flag=false; + list=[]; dict=this.elLinks["from"] if(dict!=null){ ks=Object.keys(dict); if(ks.length>0&&!flag){ - this.html+='Fanno riferimento a questa risorsa:
'; + this.html+='Fanno riferimento a questa risorsa:
'; flag=true; } ks.forEach(category => { list=dict[category]; - this.html+="

"+this.lookup[category]+"

"; + this.html+="

"+this.lookup[category]+"

"; list.forEach(obj => { - this.html+='

"; }); - if(ks.length>0&&!flag){ + if(ks.length>0&&flag){ this.html+="
"; } } @@ -64,6 +66,7 @@ class NodeLinks{ this.html+="
"; + // alert(this.html); return this.html; } } @@ -73,7 +76,7 @@ class Tags{ } computeHTML(){ if(this.tags!=null&&this.tags.length>0){ - this.html+="

Tag

"; + this.html+="

Tag

"; this.tags.forEach(element => { this.html+='

'+htmlEntities(element)+'

'; }); @@ -356,7 +359,6 @@ class ElementPreviewList{ tLihtml+="
"; tLihtml+=""; - tLihtml+=""; t=this.itLookupPairDict(element,"shortDescription"); @@ -534,4 +536,4 @@ function onKonamiCode(cb) { }); } - onKonamiCode(function () { window.open('https://www.youtube.com/watch?v=9YG9INjO91Y', '_blank'); }); \ No newline at end of file + onKonamiCode(function () { window.open('https://www.youtube.com/watch?v=9YG9INjO91Y', '_blank'); }); diff --git a/rssBuilder.php b/rssBuilder.php index a366a99..394c5eb 100644 --- a/rssBuilder.php +++ b/rssBuilder.php @@ -17,10 +17,10 @@ function rss($a) "; - echo "\n".htmlentities($e["title"])."\n"; - echo "".htmlentities($e["shortDescription"])."\n"; - echo "https://www.innovationplaylist.eu/lens/app/api/view/UID/".htmlentities($e["UID"])."/render\n"; - echo "".htmlentities($e["publishedDate"]).""; + echo "\n<![CDATA[".($e["title"])."]]>\n"; + echo "\n"; + echo "https://www.innovationplaylist.eu/lens/app/api/view/UID/".($e["UID"])."/render\n"; + echo "".($e["publishedDate"]).""; echo ""; } ?> @@ -28,4 +28,4 @@ function rss($a) \ No newline at end of file +?> diff --git a/view.php b/view.php index 54ff4c6..d0414cd 100644 --- a/view.php +++ b/view.php @@ -28,6 +28,12 @@ switch($al[0]){ if($al[2]=="rss"){ $el=adjustFlow($o); include("rssBuilder.php"); + for($i=0;$i
"+this.textGen(" ",(new TimeFormatter(t["value"])).compute("LLLL") )+""+eurS(element["amount"])+" "+this.textGen(" ",t["value"])+"