- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
Class ::xowiki::includelet::most-popular
::xowiki::includelet::most-popular create ... \Display most popular pages of this wiki instance.
[ -parameter_declaration (default " {-max_entries:integer "10"} {-interval} ") ] \
[ -title (default "#xowiki.most_popular_pages#") ]
Defined in /var/www/openacs.org/packages/xowiki/tcl/includelet-procs.tcl
Class Relations
::xowiki::IncludeletClass create ::xowiki::includelet::most-popular \ -superclass ::xowiki::IncludeletMethods (to be applied on instances)
parameter_declaration (setter)
render (scripted)
:get_parameters ::xo::Page requireCSS "/resources/acs-templating/lists.css" if {[info exists interval]} { # # If we have and interval, we cannot get report the number of visits # for that interval, since we have only the aggregated values in # the database. # append :title " in last $interval" [:tableWidget] create t1 -volatile -columns { AnchorField create title -label [::xowiki::Page::slot::title set pretty_name] Field create users -label [_ xowiki.includelet-visitors] -html { align right } } set since_condition [::xo::dc since_interval_condition time $interval] xo::dc foreach get_pages [::xo::dc select -vars "count(x.user_id) as nr_different_users, r.title, i.name, i.parent_id" -from "xowiki_last_visited x, cr_items i, cr_revisions r" -where "x.package_id = :package_id and x.page_id = i.item_id and i.publish_status <> 'production' and i.live_revision = r.revision_id and $since_condition" -groupby "x.page_id, r.title, i.name, i.parent_id" -orderby "nr_different_users desc" -limit $max_entries ] { t1 add -title $title -title.href [::$package_id pretty_link -parent_id $parent_id $name] -users $nr_different_users } } else { [:tableWidget] create t1 -volatile -columns { AnchorField create title -label [::xowiki::Page::slot::title set pretty_name] Field create count -label [_ xowiki.includelets-visits] -html { align right } Field create users -label [_ xowiki.includelet-visitors] -html { align right } } xo::dc foreach get_pages [::xo::dc select -vars "sum(x.count) as sum, count(x.user_id) as nr_different_users, r.title,i.name, i.parent_id" -from "xowiki_last_visited x, cr_items i, cr_revisions r" -where "x.package_id = :package_id and x.page_id = i.item_id and i.publish_status <> 'production' and i.live_revision = r.revision_id" -groupby "x.page_id, r.title, i.name, i.parent_id" -orderby "sum desc" -limit $max_entries] { t1 add -title $title -title.href [::$package_id pretty_link -parent_id $parent_id $name] -users $nr_different_users -count $sum } } return [t1 asHTML]title (setter)
- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables