diff options
author | Minteck <nekostarfan@gmail.com> | 2021-08-24 15:38:16 +0200 |
---|---|---|
committer | Minteck <nekostarfan@gmail.com> | 2021-08-24 15:38:16 +0200 |
commit | 529ffcbfa97ab51a64a97f6dff08aeb2bc0cc105 (patch) | |
tree | 8a50c30271b9b328cde0d907b1441f2dabdc341b /Neutron-trunk/widgets/views | |
parent | 15e4724761c50b30803df1811a525c85058f70bf (diff) | |
download | electrode-529ffcbfa97ab51a64a97f6dff08aeb2bc0cc105.tar.gz electrode-529ffcbfa97ab51a64a97f6dff08aeb2bc0cc105.tar.bz2 electrode-529ffcbfa97ab51a64a97f6dff08aeb2bc0cc105.zip |
Update
Diffstat (limited to 'Neutron-trunk/widgets/views')
-rw-r--r-- | Neutron-trunk/widgets/views/feature.json | 15 | ||||
-rw-r--r-- | Neutron-trunk/widgets/views/source.php | 25 |
2 files changed, 40 insertions, 0 deletions
diff --git a/Neutron-trunk/widgets/views/feature.json b/Neutron-trunk/widgets/views/feature.json new file mode 100644 index 0000000..a7b3cb7 --- /dev/null +++ b/Neutron-trunk/widgets/views/feature.json @@ -0,0 +1,15 @@ +{ + "name": { + "en": "Views Count", + "fr": "Compteur de visites" + }, + "description": { + "en": "Shows the number of today's site visits in a widget", + "fr": "Affiche un widget avec le nombre de vues du jour" + }, + + "config": null, + "class": null, + + "cache": false +}
\ No newline at end of file diff --git a/Neutron-trunk/widgets/views/source.php b/Neutron-trunk/widgets/views/source.php new file mode 100644 index 0000000..399e616 --- /dev/null +++ b/Neutron-trunk/widgets/views/source.php @@ -0,0 +1,25 @@ +<div id="widget-space" style="text-align: center;"> + <?= $lang["widgets"]["views"]["intro"] ?> <h2 style="margin:0;"><?php + + if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/newstats/" . date('Y') . "/" . date('m') . "/" . date('d'))) { + $file = trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/newstats/" . date("Y") . "/" . date("m") . "/" . date('d'))); + $count = count(explode("\n", $file)); + if ($count < 4) { + if ($count < 3) { + if ($count < 2) { + echo($count . $lang["widgets"]["views"]["ordinals"]["1"]); + } else { + echo($count . $lang["widgets"]["views"]["ordinals"]["2"]); + } + } else { + echo($count . $lang["widgets"]["views"]["ordinals"]["3"]); + } + } else { + echo($count . $lang["widgets"]["views"]["ordinals"]["4"]); + } + } else { + echo("({$lang["widgets"]["views"]["error"]})"); + } + + ?></h2> <?= $lang["widgets"]["views"]["outro"] ?> +</div>
\ No newline at end of file |