*/
function backfill_users_added_weekly($count=10000) {
- $arr =& $this->getWeekStartArr();
+ $arr = array_slice ($this->getMonthStartArr(), -$count-1);
+ rsort($arr);
for ($i=0; $i<count($arr); $i++) {
if (!$this->users_added_weekly($arr[$i])) {
$this->setError('backfill_users_added_weekly:: Error adding weekly row: '.db_error());
return false;
}
- if ($i >= $count) {
- break;
- }
}
return true;
}
*/
function backfill_groups_added_weekly($count=10000) {
- $arr =& $this->getWeekStartArr();
+ $arr = array_slice ($this->getMonthStartArr(), -$count-1);
+ rsort($arr);
for ($i=0; $i<count($arr); $i++) {
if (!$this->groups_added_weekly($arr[$i])) {
$this->setError('backfill_groups_added_weekly:: Error adding weekly row: '.db_error());
return false;
}
- if ($i >= $count) {
- break;
- }
}
return true;
}
*/
function backfill_users_added_monthly($count=10000) {
- $arr =& $this->getMonthStartArr();
+ $arr = array_slice ($this->getMonthStartArr(), -$count-1);
+ rsort($arr);
//skipping first one
for ($i=1; $i<count($arr); $i++) {
$this->setError('backfill_users_added_monthly:: Error adding monthly row: '.db_error());
return false;
}
- if ($i >= $count) {
- break;
- }
}
return true;
}
*/
function backfill_groups_added_monthly($count=10000) {
- $arr =& $this->getMonthStartArr();
+ $arr = array_slice ($this->getMonthStartArr(), -$count-1);
+ rsort($arr);
//skipping first one
for ($i=1; $i<count($arr); $i++) {
$this->setError('backfill_groups_added_monthly:: Error adding monthly row: '.db_error());
return false;
}
- if ($i >= $count) {
- break;
- }
}
return true;
}
*/
function backfill_users_cum_weekly($count=10000) {
- $arr =& $this->getWeekStartArr();
+ $arr = array_slice ($this->getMonthStartArr(), -$count-1);
+ rsort($arr);
for ($i=0; $i<count($arr); $i++) {
if (!$this->groups_cum_weekly($arr[$i])) {
$this->setError('backfill_users_cum_weekly:: Error adding weekly row: '.db_error());
return false;
}
- if ($i >= $count) {
- break;
- }
}
return true;
}
*/
function backfill_groups_cum_weekly($count=10000) {
- $arr =& $this->getWeekStartArr();
+ $arr = array_slice ($this->getMonthStartArr(), -$count-1);
+ rsort($arr);
for ($i=0; $i<count($arr); $i++) {
if (!$this->users_cum_weekly($arr[$i])) {
$this->setError('backfill_groups_cum_weekly:: Error adding weekly row: '.db_error());
return false;
}
- if ($i >= $count) {
- break;
- }
}
return true;
}
*/
function backfill_users_cum_monthly($count=10000) {
- $arr =& $this->getMonthStartArr();
+ $arr = array_slice ($this->getMonthStartArr(), -$count-1);
+ rsort($arr);
//skip first one
for ($i=1; $i<count($arr); $i++) {
$this->setError('backfill_users_cum_monthly:: Error adding monthly row: '.db_error());
return false;
}
- if ($i >= $count) {
- break;
- }
}
return true;
}
*/
function backfill_groups_cum_monthly($count=10000) {
- $arr =& $this->getMonthStartArr();
+ $arr = array_slice ($this->getMonthStartArr(), -$count-1);
+ rsort($arr);
//skip first one
for ($i=1; $i<count($arr); $i++) {
$this->setError('backfill_groups_cum_monthly:: Error adding monthly row: '.db_error());
return false;
}
- if ($i >= $count) {
- break;
- }
}
return true;
}
*/
function backfill_user_act_weekly($count=10000) {
- $arr =& $this->getWeekStartArr();
+ $arr = array_slice ($this->getMonthStartArr(), -$count-1);
+ rsort($arr);
for ($i=0; $i<count($arr); $i++) {
if (!$this->user_act_weekly($arr[$i])) {
$this->setError('backfill_user_act_weekly:: Error adding weekly row: '.db_error());
return false;
}
- if ($i >= $count) {
- break;
- }
}
return true;
}
*/
function backfill_user_act_monthly($count=10000) {
- $arr =& $this->getMonthStartArr();
+ $arr = array_slice ($this->getMonthStartArr(), -$count-1);
+ rsort($arr);
for ($i=1; $i<count($arr); $i++) {
if (!$this->user_act_monthly($arr[$i],($arr[$i-1]-1))) {
$this->setError('backfill_user_act_monthly:: Error adding monthly row: '.db_error());
return false;
}
- if ($i >= $count) {
- break;
- }
}
return true;
}
*/
function backfill_group_act_weekly($count=10000) {
- $arr =& $this->getWeekStartArr();
+ $arr = array_slice ($this->getMonthStartArr(), -$count-1);
+ rsort($arr);
for ($i=0; $i<count($arr); $i++) {
if (!$this->group_act_weekly($arr[$i])) {
$this->setError('backfill_user_act_weekly:: Error adding weekly row: '.db_error());
return false;
}
- if ($i >= $count) {
- break;
- }
}
return true;
}
*/
function backfill_group_act_monthly($count=10000) {
- $arr =& $this->getMonthStartArr();
+ $arr = array_slice ($this->getMonthStartArr(), -$count-1);
+ rsort($arr);
for ($i=1; $i<count($arr); $i++) {
if (!$this->group_act_monthly($arr[$i],($arr[$i-1]-1))) {
$this->setError('backfill_group_act_monthly:: Error adding monthly row: '.db_error());
return false;
}
- if ($i >= $count) {
- break;
- }
}
return true;
}