SCounter

From MODx Wiki

Jump to: navigation, search

 MODx Snippet 

SCounter v1.3
Author 
SimonSimCity
MODx Versions 
>= 0.9.5
Last Updated 
1/4/2008

Contents

SCounter is a snippet for MODx that counts your users.

Downloads

Download the latest version of SCounter from MODx repository.

Description

De:SCounter Description in German

Features

  • Count your Users
    • today
    • yesterday
    • total
    • now online

Installation

  1. Download and extract the archive.
  2. Create a directory called "scounter" in your [MODx Directory]/assets/snippets directory
  3. The files to create are all under this text in the code-boxes
  4. FTP or copy the files into [MODx Directory]/assets/snippets/scounter
  5. Create a new snippet in the manager called "scounter" and copy/paste the contents of sc.snippet.txt into the code field.
  6. If you want to set the value "Total", just edit the file "includes/sc.install.db.sql" and replace the null (CURDATE( )-2, 0)to the number you want. Example: for 50 Visitors: (CURDATE( )-2, 50)
  7. It´s the same with the value "Yesterday": (CURDATE( )-1, 0) Example: for 10 Visitors: (CURDATE( )-1, 10)

Parameters

name description
[+SCounter.total+] counts how many users have been on your site
[+SCounter.today+] counts how many users have been on your site today
[+SCounter.yesterday+] counts how many users have been on your site yesterday
[+SCounter.useronline+] counts how many users are on your site now


Example

<div>[[scounter]]
	<div>User total: [+SCounter.total+]</div>
    <div>User today: [+SCounter.today+]</div>
    <div>User yesterday: [+SCounter.yesterday+]</div>
    <div>User online: [+SCounter.useronline+]</div>
</div>


Output

User total: 120
User today: 12
User yesterday: 13
User online: 2
Personal tools