Counter Administration (Adding, Setting, and Deleting Counter Values)

Introduction

The admin mode of the mgiCounter tag displays a web-based administration screen for the internal MGI Counter Database. Although new counters are added automatically to the database by the mgiCounter tag, you may add new counters via the admin screen. In addition, you may set the value of a counter, reset the value of a counter to zero, or delete a counter from the database.

The following tutorial describes how to create and use a counter administration page.

MGI Tags

Steps

  1. Create a counter administration page in a text editor.
  2. Insert the mgiCounter tag in admin mode.
  3. Save the counter administration page.
  4. FTP the counter administration page to the web server running MGI.
  5. View the counter administration page in a web browser.
  6. How to add a new counter.
  7. How to set the value of a counter.
  8. How to reset the value of a counter.
  9. How to delete a counter.


Step 1: Create a counter administration page in a text editor.

Create a new page in a text editing program to display the web-based counter administration interface.

Step 2: Insert the mgiCounter tag in admin mode.

On the counter administration page, enter the mgiCounter tag and mode parameter. In the mode parameter, enter "admin".
<mgiCounter mode="Admin">

Step 3: Save the counter administration page.

Save the counter administration page and name it "counteradmin.mgi".

Step 4: FTP the counter administration page to the web server running MGI.

Upload the counter administration page from your local computer to the web server using an FTP program.

Step 5: View the counter administration page in a web browser.

View the counter administration page in a web browser. The first screen of the web-based administration interface displays.

Step 6: How to add a new counter.

To add a new counter, enter a counter name in the first field under the column labeled "Counter Name". If you wish to set the counter to a specific value, enter the counter value in the first field under the column labeled "New Value". If you do not enter a new value for the counter, it will begin at zero. To create the counter, click the "Add" button and the counter appears alphabetically in the list.
 
In this example, a new counter named "Home" is created and set at the value "1000".

Step 7: How to set the value of a counter.

Once a counter is created manually using the counter administration interface or automatically by the mgiCounter tag, the counter value may be set to any number up to 9,999,999,999. To set a counter value, enter the new value in the field to the right of the counter name under the "New Value" column and click the "Set" button. The new counter displays in the "Value" column and is the basis for all subsequent counts.
 
In this example, the "Info" counter is set to "50".

Step 8: How to reset the value of a counter.

The reset feature of the counter administration interface will set any counter value to zero. To reset a counter value to zero, click the "Reset" button beside the counter name.
 
You may also reset a counter value by entering "0" in the "New Value" field and clicking the "Set" button.

Step 9: How to delete a counter.

The counter administration interface allows you to delete old counters from the counter database, however the counter must also be deleted from your code or it will be recreated by the mgiCounter tag.
To delete a counter from the database, click the "Delete" button beside the counter name.


[Return to the Displaying Page Counters Menu]


[Understanding MGI Menu] [Using MGI Menu] [Referencing MGI Menu]


[MGI Guides Main Menu] [User Guide Main Menu]