本文整理汇总了PHP中MAX_commonCompressInt函数的典型用法代码示例。如果您正苦于以下问题:PHP MAX_commonCompressInt函数的具体用法?PHP MAX_commonCompressInt怎么用?PHP MAX_commonCompressInt使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MAX_commonCompressInt函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: MAX_Delivery_log_setClickBlocked
function MAX_Delivery_log_setClickBlocked($index, $aAdIds)
{
$aConf = $GLOBALS['_MAX']['CONF'];
MAX_cookieAdd("_{$aConf['var']['blockLoggingClick']}[{$aAdIds[$index]}]", MAX_commonCompressInt(MAX_commonGetTimeNow()), _getTimeThirtyDaysFromNow());
}
示例2: test_MAX_Delivery_log_isClickBlocked
/**
* A method to test the MAX_Delivery_log_isClickBlocked() function.
*
* Requirements:
* Test 1: Test with a 0 seconds click block looging window (block logging no active)
* and ensure that false is returned.
* Test 2: Test with a click block looging window bigger than 0 seconds and an add
* not clicked yet, and ensure that false is returned.
* Test 3: Test with a click block looging window bigger than 0 seconds and an add
* clicked that still in the click block logging window, and ensure that
* true is returned.
* Test 4: Test with a click block looging window bigger than 0 seconds and an add
* clicked the same time ago that the click block logging window's lenght,
* and ensure that true is returned.
* Test 5: Test with a click block looging window bigger than 0 seconds and an add
* clicked with the click block logging window expired, and ensure that
* false is returned.
*/
function test_MAX_Delivery_log_isClickBlocked()
{
$timeNow = MAX_commonGetTimeNow();
$add1ClickTime = MAX_commonCompressInt($timeNow - 60);
$add3ClickTime = MAX_commonCompressInt($timeNow - 30);
$add9ClickTime = MAX_commonCompressInt($timeNow - 15);
$aBlockLoggingClick = array(1 => $add1ClickTime, 3 => $add3ClickTime, 9 => $add9ClickTime);
// Test 1
$GLOBALS['conf']['logging']['blockAdClicksWindow'] = 0;
$aReturn = MAX_Delivery_log_isClickBlocked(1, $aBlockLoggingClick);
$this->assertTrue(!$aReturn);
// Test 2
$GLOBALS['conf']['logging']['blockAdClicksWindow'] = 30;
$aReturn = MAX_Delivery_log_isClickBlocked(2, $aBlockLoggingClick);
$this->assertTrue(!$aReturn);
// Test 3
$GLOBALS['conf']['logging']['blockAdClicksWindow'] = 30;
$aReturn = MAX_Delivery_log_isClickBlocked(9, $aBlockLoggingClick);
$this->assertTrue($aReturn);
// Test 4
$GLOBALS['conf']['logging']['blockAdClicksWindow'] = 30;
$aReturn = MAX_Delivery_log_isClickBlocked(3, $aBlockLoggingClick);
$this->assertTrue($aReturn);
// Test 5
$GLOBALS['conf']['logging']['blockAdClicksWindow'] = 30;
$aReturn = MAX_Delivery_log_isClickBlocked(1, $aBlockLoggingClick);
$this->assertTrue(!$aReturn);
}