From fca462f3b478ad150d62b86e36970958189afeaf Mon Sep 17 00:00:00 2001 From: Olivier Berten Date: Wed, 27 Mar 2013 14:30:38 +0100 Subject: [PATCH] Display updates --- scores.php | 20 ++++++++++++++++++++ style.css | 15 ++++++++++++++- updates.php | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 updates.php diff --git a/scores.php b/scores.php index 723f8c1..f6995cc 100644 --- a/scores.php +++ b/scores.php @@ -43,6 +43,26 @@ if($req1->num_rows > 0) { echo "
  • No source
  • \n"; } echo "\n"; +echo '

    Latest updates

    '."\n"; +$sql1 = 'SELECT * FROM '.db('changesets').' ORDER BY `time` DESC LIMIT 10'; +$req1 = $mysqli->query($sql1) or die('Erreur SQL !
    '.$sql1.'
    '.$mysqli->error); +$mod = array(); +while($m = $req1->fetch_assoc()) { + $d = date("Y-m-d",$m['time']); + if(!array_key_exists($d,$mod)) $mod[$d] = array(); + $mod[$d][] = $m; +} +foreach($mod as $d => $ml) { + echo $d; + echo "
    \n"; +} +echo "
    "; include('include/footer.php'); ?> diff --git a/style.css b/style.css index 132e09e..d1225b1 100644 --- a/style.css +++ b/style.css @@ -60,7 +60,7 @@ td ul { margin-bottom: 0px; } -h4 + ul { +ul { margin-top: 0px; margin-bottom: 0px; } @@ -137,6 +137,19 @@ h4 { padding-left: 20px; } +#updates { + position: absolute; + top: 15px; + right:15px; + width: 240px; + border: solid 1px #e6e6e6; + padding: 15px; +} + +#updates h4 { + margin-top: 0px; +} + .version { color: #999; font-size: 8pt; diff --git a/updates.php b/updates.php new file mode 100644 index 0000000..3168d04 --- /dev/null +++ b/updates.php @@ -0,0 +1,32 @@ +$title\n"; +$sql1 = 'SELECT * FROM '.db('changesets').' WHERE `time` > '.(time() - ($l*24*60*60)).' ORDER BY `time` DESC'; +$req1 = $mysqli->query($sql1) or die('Erreur SQL !
    '.$sql1.'
    '.$mysqli->error); +$mod = array(); +while($m = $req1->fetch_assoc()) { + $d = date("Y-m-d",$m['time']); + if(!array_key_exists($d,$mod)) $mod[$d] = array(); + $mod[$d][] = $m; +} +foreach($mod as $d => $ml) { + echo "

    ".$d."

    \n"; + echo "\n"; +} +include('include/footer.php'); +?>