Difference between revisions of "Timed Cascade Rules"
Line 9: | Line 9: | ||
== NATS4 == | == NATS4 == | ||
− | Go to [[Billers Admin]], setup your cascades, and click the Edit Cascade [[Rules|Rules]] icon. Use show and hide rules to show and hide cascades for a specific time period. For the start and end dates, you can enter any [[Freeform Date|freeform date]]. | + | <p>Go to [[Billers Admin]], setup your cascades, and click the Edit Cascade [[Rules|Rules]] icon. Use show and hide rules to show and hide cascades for a specific time period. For the start and end dates, you can enter any [[Freeform Date|freeform date]]. </p> |
+ | |||
+ | <p>'''If a disable rule and an enable rule exist at the same time, the disable rule will be honored over the enable rule.''' </p> | ||
+ | |||
+ | ===Simple Form=== | ||
+ | [[File:Cascade-rules.png|550px]] | ||
+ | You can select from the three types of rules: IGNORE, SHOW, and DISABLE. Under the affiliate section, you can add an affiliate by entering their user name or ALL for all the affiliates. If you want to add more than one affiliate but not all the affiliate, you must click on the Advanced Form link above the Add Cascade Table. Also you can choose the rule for either all the sites or just one site and for either all the program or just one program. | ||
+ | |||
+ | ===Advanced Form=== | ||
+ | [[File:advancedForm.jpg|550px]] | ||
− | |||
== NATS3 == | == NATS3 == |
Revision as of 13:24, 18 March 2010
NATS 3
|
---|
You can display different cascades at different times of the day in both NATS3 and NATS4.
NATS4
Go to Billers Admin, setup your cascades, and click the Edit Cascade Rules icon. Use show and hide rules to show and hide cascades for a specific time period. For the start and end dates, you can enter any freeform date.
If a disable rule and an enable rule exist at the same time, the disable rule will be honored over the enable rule.
Simple Form
You can select from the three types of rules: IGNORE, SHOW, and DISABLE. Under the affiliate section, you can add an affiliate by entering their user name or ALL for all the affiliates. If you want to add more than one affiliate but not all the affiliate, you must click on the Advanced Form link above the Add Cascade Table. Also you can choose the rule for either all the sites or just one site and for either all the program or just one program.
Advanced Form
NATS3
The following PHP code returns a different cascade shortname at different times of the day. To use it, install it in your Smarty plugins directory, create or enable two Hidden Cascades, set the $defaultCascadeName and $specialCascadeName to the shortnames of your two hidden cascades, and Manually add a cascade to your join form. Use this Smarty function to set the value parameter in your cascade form. For example:
<input type="radio" name="cascade" checked="checked" value="{smarty_function_output_this_hours_cascade_name}"} />
Code
<?php /* change the cascade based on hour of the day */ /* For more details, please see http://wiki.toomuchmedia.com/index.php/Timed_Cascade_Rules /* NOTE : this does not check whether or not your cascades are setup properly */ /* USE AT YOUR OWN RISK -- NO WARRANTY PROVIDED */ function smarty_function_output_this_hours_cascade_name() { $startHour = 10; $endHour = 13; $defaultCascadeName = 'default'; $specialCascadeName = 'default2'; $currentTime = localtime( mktime() , 1); return $currentTime['tm_hour'] >= $startHour && $currentTime['tm_hour'] < $endHour ? $specialCascadeName : $defaultCascadeName; } ?>
Credits
- Special thanks to Nick Hahn for assistance with this article.