// the popularity column counts every acess with declining value over time,
// the popularity column counts every acess with declining value over time,
// it halves every year.
// it halves every year.
$stmt=$db->prepare("select customCategory.id, customCategory.created, customCategory.content, t.accessCount, t.popularity, t.lastAccess from customCategory left join (select id, count(id) accessCount, sum(1/((julianday('2023-08-06 00:00:00') - julianday(ts))/365.25 + 1)) popularity, max(ts) lastAccess from customCategoryAccess group by id) t on customCategory.id=t.id order by popularity desc, created desc limit 25");
$stmt=$db->prepare("select customCategory.id, customCategory.created, customCategory.content, t.accessCount, t.popularity, t.lastAccess from customCategory left join (select id, count(id) accessCount, sum(1/((julianday('2023-08-06 00:00:00') - julianday(ts))/365.25 + 1)) popularity, max(ts) lastAccess from customCategoryAccess group by id) t on customCategory.id=t.id order by popularity desc, created desc limit 25");
@ -31,52 +76,35 @@ function ajax_customCategory ($param, $content) {
$stmt->closeCursor();
$stmt->closeCursor();
return$data;
return$data;
}
}
}
if(isset($param['id'])){
$stmt=$db->prepare("select content from customCategory where id=:id");