Index: /home/metskem/workspace/JSPWiki/src/com/ecyrd/jspwiki/plugin/Counter.java
===================================================================
--- /home/metskem/workspace/JSPWiki/src/com/ecyrd/jspwiki/plugin/Counter.java	(revision 632655)
+++ /home/metskem/workspace/JSPWiki/src/com/ecyrd/jspwiki/plugin/Counter.java	(working copy)
@@ -27,6 +27,8 @@
  *  <P>Parameters
  *  <UL>
  *    <LI>name - Name of the counter.  Optional.
+ *    <LI>increment - The amount to increment, may be a negative value, default is 1.  Optional.
+ *    <LI>showResult - Should the counter value be visible on the page, default is true.  Optional.
  *  </UL>
  *
  *  Stores a variable in the WikiContext called "counter", with the name of the
@@ -41,7 +43,12 @@
 {
     // private static Logger log = Logger.getLogger( Counter.class );
 
-    static final String VARIABLE_NAME = "counter";
+    private static final String PARAM_NAME = "name";
+    private static final String PARAM_INCREMENT = "increment";
+    private static final String PARAM_SHOW_RESULT= "showResult";
+    private static final String DEFAULT_NAME = "counter";
+    private static final int DEFAULT_INCREMENT = 1;
+    private static final boolean DEFAULT_SHOW_RESULT = true;
 
     public String execute( WikiContext context, Map params )
         throws PluginException
@@ -50,15 +57,15 @@
         //  First, determine which kind of name we use to store in
         //  the WikiContext.
         //
-        String  countername = (String)params.get( "name" );
+        String  countername = (String)params.get(  PARAM_NAME);
 
         if( countername == null ) 
         {
-            countername = VARIABLE_NAME;
+            countername = DEFAULT_NAME;
         }
         else
         {
-            countername = VARIABLE_NAME+"-"+countername;
+            countername = DEFAULT_NAME+"-"+countername;
         }
 
         //
@@ -70,12 +77,42 @@
         {
             val = new Integer( 0 );
         }
+        
+        //
+        // Now determine how much to increment
+        //
+        Object incrementObj = params.get(PARAM_INCREMENT);
+        
+        int increment = DEFAULT_INCREMENT;
+        
+        if (incrementObj != null) 
+        {
+            increment = (new Integer((String)incrementObj)).intValue();
+        }
 
-        val = new Integer( val.intValue() + 1 );
+        val = new Integer( val.intValue() + increment );
 
         context.setVariable( countername, val );
 
+        //
+        // check if we want to hide the result (just count, don't show result on the page
+        //
+        Object showObj = params.get(PARAM_SHOW_RESULT);
+        
+        boolean show = DEFAULT_SHOW_RESULT;
+        
+        if (showObj != null) 
+        {
+            show = (new Boolean((String)showObj)).booleanValue();
+        }
+        
+        if (show)
+        {
         return val.toString();
+        } 
+       
+         return "";
+        
     }
 
 }

