docs.roxen.comView this page in a printer friendly mode
DocsRoxenWebServer 5.1Web Developer ManualInformation Tags
Copyright © 2013, Roxen Internet Software
Suggestions, comments & compliments




Provided by module: Tags: Accessed counter

Generates an access counter that shows how many times the page has been accessed. A file, AccessedDB, in the logs directory is used to store the number of accesses to each page. By default the access count is only kept for files that actually contain an accessed-tag, but can also be configured to count all files of a certain type.




Increments the number of accesses with this number instead of one, each time the page is accessed.


Prints the real number of accesses as an HTML comment. Useful if you use the cheat attribute and still want to keep track of the real number of accesses.

case="{upper, lower, capitalize}"

Sets the result to upper case, lower case or with the first letter capitalized.


Adds this number of accesses to the actual number of accesses before printing the result. If your page has been accessed 72 times and you add <accessed cheat='100'> the result will be 172.


Works like the since attribute, but counts from the day the first entry in the entire accessed database was made.


Multiplies the actual number of accesses by the factor. E.g. <accessed factor='50'> displays half the actual value.


Shows the number of times the page filename has been accessed instead of how many times the current page has been accessed. If the filename does not begin with "/", it is assumed to be a URL relative to the directory containing the page with the accessed tag. Note, that you have to type in the full name of the file. If there is a file named tmp/index.html, you cannot shorten the name to tmp/, even if you've set Roxen up to use index.html as a default page. The filename refers to the virtual filesystem.

One limitation is that you cannot reference a file that does not have its own <accessed> tag. You can use <accessed silent='1'> on a page if you want it to be possible to count accesses to it, but don't want an access counter to show on the page itself.


Will print the result as words in the chosen language if used together with type=string.

<accessed type="string"/>
<accessed type="string" lang="sv"/>

per="{second, minute, hour, day, week, month, year}"

Shows the number of accesses per unit of time.

<accessed per="week"/>


Rounds the number of accesses to this number of significant digits. If prec=2 show 12000 instead of 12148.


Resets the counter. This should probably only be done under very special conditions, maybe within an <if> statement. This can be used together with the file argument, but it is limited to files in the current- and sub-directories.


Print nothing. The access count will be updated but not printed. This option is useful because the access count is normally only kept for pages with actual <access> on them. <accessed file='filename'> can then be used to get the access count for the page with the silent counter.


Inserts the date that the access count started. The language will depend on the lang attribute, default is English. All normal date related attributes can be used. Also see: <date>.

<accessed since="1"/>
January 2009

type="{number, string, roman, iso, discordian, stardate, mcdonalds, linus, ordered}"

Specifies how the count are to be presented. Some of these are only useful together with the since attribute.

<accessed type="roman"/>
<accessed since="1" type="iso"/>
<accessed since="1" type="discordian"/>
Pungenday, the 28th day of Chaos
<accessed since="1" type="stardate"/>
<accessed type="mcdonalds"/>
More than sixty served.
<accessed type="linus"/>
62 since Wed Jan 28 18:13:11 2009
<accessed type="ordered"/>


Defines a minimum length the the resulting string should have. If it is shorter it is padded from the left with the padding value. Only values between 2 and 10 are valid.

padding="character" (0)

The padding that the minlength function should use.