[Show/Hide Right Column]

Displays number of hits for certain objects
Print
Tags: plugin

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() /}


arrow-right.png


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

2925

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


arrow-right.png


Would produce on this site (hits on HomePage for the past 30 days):

40692

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!):

1883


Contributors to this page: lindon2331 points  .
Page last modified on Saturday 03 July, 2010 23:17:55 UTC by lindon2331 points .

Find by Page Name

Exact match

Keywords

The following is a list of keywords that should serve as hubs for navigation within the Tiki documentation and should correspond to development keywords (bug reports and feature requests):