Fullscreen
[Show/Hide Right Column]

Display the number of hits for certain objects

Plugin Object Hits

This Wiki Plugin will display the number of hits for a wiki page, article, image gallery, file gallery and individual images or files in a gallery. The total number of hits can be displayed or the number of hits over the past x number of days.



Usage and Parameters

To use this plugin in a wiki page, use the syntax:
Syntax for the OBJECTHITS plugin
{OBJECTHITS(object=> ,type=> ,days=> ) /}


Parameter Accepted values Default Effect Required? Since
object for a wiki page:
the page name
for all others (see type parameter and note about file galleries below):
ID number + ? + object title
the wiki page where the plugin is used Identifies the object that the hits relate to n
type wiki, article, image, file, image gallery, file gallery wiki Identifies the type of object n
days numeric 0 The default is to show total hits for the object since it was created. Setting this parameter above 0 will cause the number of hits for that number of past days to be shown. For example, if set to 4, the total of the hits over the last 4 days for the object will be displayed. n


noteNote about file galleries
The plugin works differently for file galleries than described above:
  • Prior to version 3.0
    • The ID number that will work in the object parameter may be different than the actual ID number for a file gallery (sometimes it's "-1"). You would need to look in the tiki_stats MySQL database table on the server where TikiWiki is installed to see what number to use.
  • With version 3.0
    • Only the hits for the top level File Galleries can be displayed, and this is done by setting the object parameter to "0?" and the type parameter to "file gallery" (both without the quotes). The result is essentially the number of hits for the List Galleries page.

Examples


This code,
Example with no parameters set
{objecthits object="Documentation" days="30"}


arrow-right.png


Would produce on this site (total hits for this page):

6613

This code,
Another wiki page and days used
{OBJECTHITS(object=Documentation, days=30) /}


arrow-right.png


Would produce on this site (hits on the Documentation page - home page for this site - for the past 30 days):

8009

This code,
Hits for an article
{OBJECTHITS(object=19?News from doc.tw.o!, type=article) /}


arrow-right.png


Would produce on this site (total hits on article ID 19, titled News from doc.tw.o!):

2977




Contributors to this page: lindon137 points  .
Page last modified on Tuesday 10 January, 2012 04:33:18 UTC by lindon137 points .
The content on this page is licensed under the terms of the Creative Commons Attribution-ShareAlike License.

Site Language

Reference Guide

Keywords

These keywords serve as "hubs" for navigation within the Tiki documentation. They correspond to development keywords (bug reports and feature requests):



Tiki Newsletter

Delivered fresh to your email inbox!
Newsletter subscribe icon
Don't miss major announcements and other news!
Contribute to Tiki