Cimy Counter – documentation

REQUIREMENTS:

  • PHP >= 5.0.0
  • WORDPRESS >= 2.6.x
  • MYSQL >= 4.0

INSTALLATION:

  • just copy whole cimy-counter subdir into your plug-in directory and activate it

UPDATE FROM A PREVIOUS VERSION:

  • always deactivate the plug-in and reactivate after the update

Example of use:
Link

Modify to:
Download my application

To add a page visit counter you just need to copy/paste the views link provided; page visit counter will be a total visit counter NOT unique visitor.

Example:

To display a counter in your posts/pages use one of the following code:
[cc_counter#counter_name] – This will display only the counter (int) of the given counter_name
[cc_since#counter_name] – This will display counter beginning date of the given counter_name
[cc_string#counter_name] – This will display formatted string of the given counter_name

FUNCTIONS USEFUL FOR YOUR THEMES OR TEMPLATES:

[Function cc_add_one_to_the_counter]
Add one to a counter

PARAMETERS: pass counter_name as first parameter
RETURNED VALUE: none

GENERIC:

cc_add_one_to_the_counter();

EXAMPLE:

cc_add_one_to_the_counter("my_app");

[Function cc_get_counter]
Read state of a counter in a given moment

PARAMETERS: pass counter_name as first parameter
RETURNED VALUE: the function will return the integer value of the counter; in case of error will return -1

GENERIC:

cc_get_counter();

EXAMPLE:

$myapp_downloads = cc_get_counter("my_app");

[Function cc_get_since]
Get the date of a counter

PARAMETERS: pass counter_name as first parameter; as second argument (optional) pass date’s formatting string [default: blog’s date format]
RETURNED VALUE: the function will return the string representing the date of the counter; in case of error will return false

GENERIC:

cc_get_since(, );

EXAMPLE:

$myapp_date = cc_get_since("my_app", "j F Y");

[Function cc_get_display_str]
Get the string to be displayed of a counter

PARAMETERS: pass counter_name as first parameter; as second argument (optional) pass date’s formatting string [default: blog’s date format]
RETURNED VALUE: the function will return the display string of the counter; in case of error will return false

GENERIC:

cc_get_display_str(, );

EXAMPLE:

$myapp_display_str = cc_get_display_str("my_app", "j F Y");

KNOWN ISSUES:

  • Plug-in doesn’t provide a widget (will come in a future release)
  • If your ‘wp-content’ directory is not in the default location you have to edit cc_redirect.php and read WARNING comment inside