The trigger feature of AutoRank PHP is new to the 3.0.x series and allows you to automatically add or subtract hit counts for one or more member accounts
in your database. Triggers are executed before and after reranks and resets, and you can specify when each trigger will occur. This document will give
you an overview of how to setup triggers through the software control panel.
Adding a Trigger
To add a new trigger click on the Manage Triggers link in the Setup section of the control panel menu. The software will load a page where you can add new
triggers and see your defined triggers, if there are any. To add a new trigger you need to fill in the fields in the Add a Trigger section at the top of the
page. Each field is described below.
Type - This value specifies when the trigger will occur. Each of the items in the drop down menu should be self-explanatory.
Account - This value specifies which account the trigger will affect. You can enter either a specific username or the keyword ALL which means that
the trigger will be applied to all accounts in the database.
Action - These values specify what will happen when the trigger is executed. In the text input box you will need to enter a number that you want
to use for this action, or the special random value which is described in the next section.
Once you have filled in the fields how you want them, press the Add Trigger button. The information will be stored and the trigger will be visible in the
Existing Triggers section. The trigger will begin executing the next time that the Type event you selected occurs.
Generating Random Values
If you want the software to generate a random number for you each time the trigger is executed, you can use the special rand(low, high) value in the Action field.
For example, if you wanted the software to add a random number between 1 and 50 to the account's in hit count you would use rand(1, 50) in that field. You must always
use this same format when using the rand(low, high) value. The first number must always be lower than the second in order for this to work, and the numbers must be
separated by a comma.
Updating a Trigger
From the Manage Triggers interface you can view all of your existing triggers. To edit a specific trigger, click on the [Edit] link that corresponds with the
trigger you want to modify. A window will pop-up where you can alter the settings for the trigger. When you have made the changes you want, click on the Update
Trigger button. The new information will be stored, and the next time the Type event you selected occurs, the modified trigger will be executed.
Removing a Trigger
From the Manage Triggers interface you can view all of your existing triggers. To delete a specific trigger, click on the [Delete] link that corresponds with the
trigger you want to modify. A window will pop-up asking you to confirm the deletion. Click Ok to delete the trigger. It will be remove from
the database and no longer executed.