DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

EXT: cs_counter

Author:Kasper Skårhøj
Created:2002-11-01T00:32:00
Changed by:Carsten Sann
Changed:2006-04-24T20:38:11
Author:Carsten Sann
Email:sann@fred-gmbh.de
Info 3:
Info 4:

EXT: Generic Visitor Counter

Version 0.2

Extension Key: cs_counter

Copyright 2000-2005, Carsten Sann, <sann@fred-gmbh.de>

This document is published under the Open Content License

available from http://www.opencontent.org/opl.shtml

The content of this document is related to TYPO3

- a GNU/GPL CMS/Framework available from www.typo3.com

Table of Contents

EXT: Generic Visitor Counter 1

Introduction 1

What is cs_counter? 1

New in version 0.3 2

Users manual 2

FAQ 2

Adminstration 2

Installation 2

FAQ 2

Configuration 2

TypoScript configuration options 2

Examples: 3

FAQ 4

Known problems 4

Changelog 4

Introduction

What is cs_counter?

This extension adds a comfortable visitor counter to your Typo3 website. It may be included as a content element or directly via template. I. All the parameters are configurable via TS.

  • May be included as a content element or directly via template
  • Creates either a graphical output consisting of small GIFs (one per digit) or text-only output
  • All parameters are configurable via TypoScript

New in version 0.3

Still to come ...

Users manual

FAQ

Q: Can I use my own GIFs for the graphical output of the counter?

A: Yes:

  • Upload one GIF per digit (1, 2, 3, ...) to the digits subdirectory of the extension (e.g. typo3conf/ext/cs_counter/digits if you did a local installation of the extension.
  • Name yor GIFs like <your_prefix><digit>.gif . The prefix must be identical for each set of digits.
  • Configure your counter in the Setup section of your template record to use your prefix ( plugin.tx_cscounter_pi1.bitmapPrefix=<your_prefix> ).
  • Et voilá

Adminstration

Installation

  • Install the module with the Extension manager.
  • Insert a “plugin” element on the page where the form should be shown – pluginname: “Visitor counter” or replace a marker in your template with the extension's output (see below)
  • Configure the extension using the template record
  • That's it!

FAQ

Q: How can I manually set the counter?

A: The counter is stored in a table called tx_cscounter_info . Just open it with your favourite database admin programm (e.g. phpMyAdmin) and change the values. The Timestamp ist stored in standard Unix format. To change it to your desired date you may want to use the PHP functions.

Configuration

TypoScript configuration options

The configuration options are availabe via: plugin.tx_cscounter_pi1.xxx in the Setup section of your template record.

Generic options

id

a

id

b

int

c

ID of the counter. It is used to distinguish between different counters in one website Default: 0

minDigits

a

minDigits

b

int

c

Minimum number of digits to be shown (fills actual number with zero's) Default: 5

noReload

a

noReload

b

0/1

c

Protect counter from counting reloads Default: 1

wrap

a

wrap

b

String

c

If set, this string is wrapped around the “counter” part of the extension's output. The pipe (|) will be replaced by the actual number or the graphical output. Example: “You are visitor no. |” Default: none

Options for graphical output

textOnly

a

textOnly

b

0/1

c

Switch to turn on/off graphical output

1 --> Return number of visits as text0 --> Return HTML code for graphical display

Default: 1

bitmapPrefix

a

bitmapPrefix

b

String

c

Prefix for the filenames of the digit GIF images. The images are expected to be named <prefix><digit>.gif. If no prefix is configured, the standard GIFs are used ( 1.gif , 2.gif , etc.)

Example: Setting bitmapPrefix to “my” world result in filenames like my1.gif , my2.gif , etc. Of course you have to take care that these files exist in the digits directory

Default: none

bitmapHeight

a

bitmapHeight

b

int

c

If set, the HTML output will be amended with the height= option of the <img> tag

Default: none

Options for showing the date when counting started

showSince

a

showSince

b

0/1

c

Show the date the counter was used for the first time. This value is set automatically.

Default: 1

formatSince

a

formatSince

b

String

c

Format to use when printing the date since (cf. PHP function strftime() for details) Default: %d.%m.%Y

wrapSince

a

wrapSince

b

String

c

Wrap for the date part of the extension's output. The pipe (|) will be replaced by the actual date in the format given by formatSince Example: “<br>since |”

Default: none

Examples:

Example 1:

You want to tune your website with a text-only counter. The counter should be visible on every page an thus be protected against reloads. You use a HTML template file with markers.

Step 1:

Insert a new marker (e.g. ###COUNTER### ) to your HTML template file to the position where you want to appear the actual number in your layout.

Step 2:

Open your root template record and enter the Setup section. Put the following lines in there:

page.10.marks.COUNTER = TEXT
page.10.marks.COUNTER < plugin.tx_cscounter_pi1

Step 3:

Configure the plugin (do this also in the Setup section). In our example the configuration may look something like this:

plugin.tx_cscounter_pi1 {
   minDigits = 5
   id = 1
   noReload = 1
   textOnly = 1
   wrap = You are visitor no. |
   showSince = 1
   wrapSince = <br>since |
   formatSince = %d.%m.%Y
}

Note: For Typo3 4.0 you have also to put the following line into your Setup section (right before the plugin's configuration):

plugin.tx_cscounter_pi1 = USER_INT
Example 2:

You want to put a graphical counter as a content element to one of your pages. Because it's a very special page you want to count each reload of the page.

Step 1:

Insert the new content element to your page.

Step 2:

Create a extension template record on the page. In the Setup section put the configuration of the plugin which may look like this:

plugin.tx_cscounter_pi1 {
   minDigits = 5
   id = 1
   noReload = 0
   textOnly = 0
   bitmapPrefix = fancy
   bitmapHeight = 22
   bitmapWidth = 16
}

Note: For Typo3 4.0 you have also to put the following line into your Setup section (right before the plugin's configuration):

plugin.tx_cscounter_pi1 = USER_INT

FAQ

Q: Can I use multiple instances of the counter on one website?

A: Yes: Just give different ID's to the counters ( plugin.tx_cscounter_pi1.id = xxx )

Q: Can I protect the counter from counting every reload?

A: Yes. Use the config option “noReload” and set it to 1

Known problems

Tell me ;-)

Changelog

  • 0.2.0 First public BETA
  • 0.2.5 Several additions to the manual, including notes for using the extension with Typo3 4.0

img-1 EXT FE cs_counter 4