video badges code review
This commit is contained in:
@@ -384,7 +384,7 @@ class Menu {
|
||||
$data['is_old_user'] = false;
|
||||
if(!empty($data['settings']['installed_at'])) {
|
||||
$installed_at = Carbon::createFromTimestamp(strtotime($data['settings']['installed_at']));
|
||||
$current_time = Carbon::createFromTimestamp(WPFunctions::currentTime('timestamp'));
|
||||
$current_time = Carbon::createFromTimestamp(WPFunctions::currentTime('timestamp'));
|
||||
$data['is_new_user'] = $current_time->diffInDays($installed_at) <= 30;
|
||||
$data['is_old_user'] = $current_time->diffInMonths($installed_at) >= 6;
|
||||
$data['stop_call_for_rating'] = isset($data['settings']['stop_call_for_rating']) ? $data['settings']['stop_call_for_rating'] : false;
|
||||
@@ -438,12 +438,7 @@ class Menu {
|
||||
)
|
||||
);
|
||||
|
||||
$data['is_new_user'] = true;
|
||||
if(!empty($data['settings']['installed_at'])) {
|
||||
$installed_at = Carbon::createFromTimestamp(strtotime($data['settings']['installed_at']));
|
||||
$current_time = Carbon::createFromTimestamp(WPFunctions::currentTime('timestamp'));
|
||||
$data['is_new_user'] = $current_time->diffInDays($installed_at) <= 30;
|
||||
}
|
||||
$data['is_new_user'] = $this->is_new_user();
|
||||
|
||||
$data = array_merge($data, Installer::getPremiumStatus());
|
||||
|
||||
@@ -548,13 +543,7 @@ class Menu {
|
||||
$data['items_per_page'] = $this->getLimitPerPage('forms');
|
||||
$data['segments'] = Segment::findArray();
|
||||
|
||||
$data['is_new_user'] = true;
|
||||
$installed_at = Setting::getValue('installed_at');
|
||||
if(!is_null($installed_at)) {
|
||||
$installed_at = Carbon::createFromTimestamp(strtotime($installed_at));
|
||||
$current_time = Carbon::createFromTimestamp(WPFunctions::currentTime('timestamp'));
|
||||
$data['is_new_user'] = $current_time->diffInDays($installed_at) <= 30;
|
||||
}
|
||||
$data['is_new_user'] = $this->is_new_user();
|
||||
|
||||
$this->displayPage('forms.html', $data);
|
||||
}
|
||||
@@ -594,12 +583,7 @@ class Menu {
|
||||
|
||||
$data['automatic_emails'] = array();
|
||||
|
||||
$data['is_new_user'] = 'true';
|
||||
if(!empty($data['settings']['installed_at'])) {
|
||||
$installed_at = Carbon::createFromTimestamp(strtotime($data['settings']['installed_at']));
|
||||
$current_time = Carbon::createFromTimestamp(WPFunctions::currentTime('timestamp'));
|
||||
$data['is_new_user'] = $current_time->diffInDays($installed_at) <= 30 ? 'true' : 'false';
|
||||
}
|
||||
$data['is_new_user'] = $this->is_new_user();
|
||||
|
||||
wp_enqueue_script('jquery-ui');
|
||||
wp_enqueue_script('jquery-ui-datepicker');
|
||||
@@ -632,13 +616,7 @@ class Menu {
|
||||
'sub_menu' => 'mailpoet-subscribers'
|
||||
));
|
||||
|
||||
$data['is_new_user'] = true;
|
||||
$installed_at = Setting::getValue('installed_at');
|
||||
if(!is_null($installed_at)) {
|
||||
$installed_at = Carbon::createFromTimestamp(strtotime($installed_at));
|
||||
$current_time = Carbon::createFromTimestamp(WPFunctions::currentTime('timestamp'));
|
||||
$data['is_new_user'] = $current_time->diffInDays($installed_at) <= 30;
|
||||
}
|
||||
$data['is_new_user'] = $this->is_new_user();
|
||||
|
||||
$this->displayPage('subscribers/importExport/import.html', $data);
|
||||
}
|
||||
@@ -778,4 +756,14 @@ class Menu {
|
||||
$notice->displayWPNotice();
|
||||
}
|
||||
}
|
||||
|
||||
function is_new_user() {
|
||||
$installed_at = Setting::getValue('installed_at');
|
||||
if(is_null($installed_at)) {
|
||||
return true;
|
||||
}
|
||||
$installed_at = Carbon::createFromTimestamp(strtotime($installed_at));
|
||||
$current_time = Carbon::createFromTimestamp(WPFunctions::currentTime('timestamp'));
|
||||
return $current_time->diffInDays($installed_at) <= 30;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user