本文整理汇总了PHP中CASHSystem::formatCount方法的典型用法代码示例。如果您正苦于以下问题:PHP CASHSystem::formatCount方法的具体用法?PHP CASHSystem::formatCount怎么用?PHP CASHSystem::formatCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CASHSystem
的用法示例。
在下文中一共展示了CASHSystem::formatCount方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
// add campaign to dropdown options
$cash_admin->page_data['campaigns_as_options'] .= '<option value="' . $campaign['id'] . '"';
if ($campaign['id'] == $current_campaign) {
$cash_admin->page_data['campaigns_as_options'] .= ' selected="selected"';
}
$cash_admin->page_data['campaigns_as_options'] .= '>' . $campaign['title'] . '</option>';
// normalize modification/creation dates
if ($campaign['modification_date'] == 0) {
$campaign['formatted_date'] = CASHSystem::formatTimeAgo($campaign['creation_date']);
} else {
$campaign['formatted_date'] = CASHSystem::formatTimeAgo($campaign['modification_date']);
}
if ($campaign['id'] == $current_campaign) {
// get campaign analytics
$analytics_response = $cash_admin->requestAndStore(array('cash_request_type' => 'element', 'cash_action' => 'getanalyticsforcampaign', 'id' => $campaign['id']));
$campaign['formatted_views'] = CASHSystem::formatCount(0 + $analytics_response['payload']['total_views']);
// set the campaign as the selected campaign
$cash_admin->page_data['selected_campaign'] = $campaign;
}
}
}
if ($cash_admin->page_data['template_id']) {
foreach ($campaigns_response['payload'] as &$campaign) {
if ($campaign['template_id'] == $cash_admin->page_data['template_id']) {
$campaign['currently_published'] = true;
}
}
}
// set all campaigns as a mustache var
if ($campaigns_response['payload']) {
$cash_admin->page_data['campaigns_for_user'] = new ArrayIterator($campaigns_response['payload']);
示例2: array
$cash_admin->requestAndStore(array('cash_request_type' => 'system', 'cash_action' => 'deletetemplate', 'template_id' => $_POST['current_template_id']));
}
$cash_admin->page_data['template_id'] = $_POST['change_template_id'];
}
}
}
// deal with templates
$embed_templates = AdminHelper::echoTemplateOptions('embed', $cash_admin->page_data['template_id']);
$cash_admin->page_data['template_options'] = $embed_templates;
if ($cash_admin->page_data['template_id'] >= 0) {
$cash_admin->page_data['custom_template'] = true;
}
$analytics = $cash_admin->requestAndStore(array('cash_request_type' => 'element', 'cash_action' => 'getanalytics', 'analtyics_type' => 'elementbasics', 'element_id' => $request_parameters[0], 'user_id' => $cash_admin->effective_user_id));
$cash_admin->page_data['total_views'] = 0;
if (is_array($analytics['payload'])) {
$cash_admin->page_data['total_views'] = CASHSystem::formatCount($analytics['payload']['total']);
$methods_array = array();
$locations_array = array();
foreach ($analytics['payload']['methods'] as $method => $total) {
$methods_string = array('direct', 'api_public', 'api_key', 'api_fullauth');
$methods_translation = array('direct (embedded on this site)', 'api_public (shared to another site)', 'api_key (shared to another site)', 'api_fullauth (another site with your API credentials)');
$methods_array[] = array('access_method' => str_replace($methods_string, $methods_translation, $method), 'total' => $total);
}
foreach ($analytics['payload']['locations'] as $location => $total) {
$locations_array[] = array('access_location' => $location, 'total' => $total);
}
$tmp_locations_array = array();
// temp array to combine totals by hostname
foreach ($locations_array as $key => $location) {
// cycle through all locations, push to temp array and combine if necessary
$parsed = parse_url($location['access_location']);
示例3: array
$service_has_image = false;
}
if (in_array($cash_admin->platform_type, $data['compatibility'])) {
$all_mass_services[] = array('key' => $key, 'name' => $data['name'], 'description' => $data['description'], 'link' => $data['link'], 'alternating_type' => $alternating_type, 'service_has_image' => $service_has_image);
$typecount++;
}
}
}
$cash_admin->page_data['all_mass_services'] = new ArrayIterator($all_mass_services);
// lists
if (is_array($list_response['payload'])) {
foreach ($list_response['payload'] as &$list) {
$list_analytics = $cash_admin->requestAndStore(array('cash_request_type' => 'people', 'cash_action' => 'getanalytics', 'analtyics_type' => 'listmembership', 'list_id' => $list['id'], 'user_id' => $cash_admin->effective_user_id));
$list['analytics_active'] = CASHSystem::formatCount($list_analytics['payload']['active']);
$list['analytics_inactive'] = CASHSystem::formatCount($list_analytics['payload']['inactive']);
$list['analytics_last_week'] = CASHSystem::formatCount($list_analytics['payload']['last_week']);
// now make some data points for the page
if ($list['analytics_last_week'] > 0) {
$list['analytics_icon'] = 'lg-arw';
} elseif ($list['analytics_last_week'] < 0) {
$list['analytics_icon'] = 'lg-arw down';
} else {
$list['analytics_icon'] = 'lg-arw nochange';
}
}
$cash_admin->page_data['lists_all'] = new ArrayIterator(array_reverse($list_response['payload']));
}
$user_response = $cash_admin->requestAndStore(array('cash_request_type' => 'people', 'cash_action' => 'getuser', 'user_id' => $cash_admin->effective_user_id));
if (is_array($user_response['payload'])) {
$current_userdata = $user_response['payload']['data'];
}