fix list of wiki pages

This commit is contained in:
mose 2019-08-23 08:43:52 +08:00
parent cc3f3e0430
commit 9556a9dc5b
2 changed files with 9 additions and 4 deletions

View file

@ -1,7 +1,5 @@
#!/bin/sh
pip3 install -r ./scripts/requirements.txt
# idees
wget -O ./site/data/idees.json https://idees.crapaud-fou.org/stats.php
@ -12,4 +10,5 @@ wget -O ./site/data/wiki.json https://wiki.crapaud-fou.org/stats.php
wget -O ./site/data/tube.json https://tube.crapaud-fou.org/feeds/videos.json?sort=-publishedAt&filter=local
# chat
pip3 install -r ./scripts/requirements.txt
python3 ./scripts/generate_chat_info.py

View file

@ -1,3 +1,4 @@
<?php
# copy this at the root of tiki
@ -50,11 +51,16 @@ $data['crapauds']['recent'] = getone("select count(*) from users_users where cur
$data['pages']['total'] = getone("select count(*) from tiki_pages");
$data['pages']['recent'] = getone("select count(*) from tiki_pages where lastModif > $interval");
$data['pages']['liste'] = getlist("select pageSlug, pageName from tiki_pages order by lastModif desc limit 10");
$data['photos']['total'] = getone("select count(*) from tiki_files");
$data['photos']['recent'] = getone("select count(*) from tiki_files where created > $interval");
require_once('tiki-setup_base.php');
$pages = $tikilib->list_pages(0, 10, 'lastModif_desc');
foreach ($pages["data"] as $page) {
$data['pages']['liste'][$page["pageSlug"]] = $page["pageName"];
}
header('Content-Type: application/json');
$json = json_encode( (object) $data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
@ -62,4 +68,4 @@ if ($json === false) {
$json = json_encode(array("jsonError", json_last_error_msg()));
}
echo $json;
echo $json;