Loading...
 
Features / Usability

Features / Usability


Re: DiSplaying most popular pages in last 7 days

posts: 80 Austria

Q&D solution is to modify in lib/tikilib.php around line 2878:

function get_top_pages($limit) { $query = "select `pageName` , `hits` from `tiki_pages` order by `hits` desc";

to

function get_top_pages($limit,$Days) { if (isset($Days)) { $query = "select `pageName` , `hits` from `tiki_pages` where `lastModif` > (unix_timestamp(now()) -(86400 * $Days)) order by `lastModif` desc"; } else { $query = "select `pageName` , `hits` from `tiki_pages` order by `hits` desc"; }

and change line 9 in modules/mod-top_pages.php

$ranking = $tikilib->get_top_pages($module_rows, $module_params["maxdays"]);

Then you can call the module with

{MODULE(module=>top_pages,maxdays=>7,max=>20)}{MODULE}