コード例 #1
0
ファイル: admin_stats.php プロジェクト: AroundPBT/PHPBoost
 $keyword = $request->get_getint('keyword', 0);
 $browser = $request->get_getint('browser', 0);
 $os = $request->get_getint('os', 0);
 $all = $request->get_getint('all', 0);
 $user_lang = $request->get_getint('lang', 0);
 $bot = $request->get_getint('bot', 0);
 $erase = $request->get_postvalue('erase', false);
 if ($erase) {
     $file = new File('../stats/cache/robots.txt');
     try {
         $file->delete();
     } catch (IOException $exception) {
         echo $exception->getMessage();
     }
 }
 $tpl->put_all(array('L_SITE' => $LANG['site'], 'L_STATS' => $LANG['stats'], 'L_USERS' => $LANG['member_s'], 'L_VISITS' => $LANG['guest_s'], 'L_PAGES' => $LANG['page_s'], 'L_BROWSERS' => $LANG['browser_s'], 'L_OS' => $LANG['os'], 'L_LANG' => $LANG['stat_lang'], 'L_KEYWORD' => $LANG['keyword_s'], 'L_REFERER' => $LANG['referer_s'], 'L_ROBOTS' => $LANG['robots'], 'L_UPDATE' => $LANG['update'], 'L_RESET' => $LANG['reset'], 'L_AUTHORIZATIONS' => $LANG['admin.authorizations'], 'L_READ_AUTHORIZATION' => $LANG['admin.authorizations.read'], 'READ_AUTHORIZATION' => Authorizations::generate_select(StatsAuthorizationsService::READ_AUTHORIZATIONS, StatsConfig::load()->get_authorizations())));
 $date_lang = LangLoader::get('date-common');
 if (!empty($members)) {
     $stats_cache = StatsCache::load();
     $last_user_group_color = User::get_group_color($stats_cache->get_stats_properties('last_member_groups'), $stats_cache->get_stats_properties('last_member_level'));
     $tpl->put_all(array('C_STATS_USERS' => true, 'C_LAST_USER_GROUP_COLOR' => !empty($last_user_group_color), 'LAST_USER' => $stats_cache->get_stats_properties('last_member_login'), 'LAST_USER_LEVEL_CLASS' => UserService::get_level_class($stats_cache->get_stats_properties('last_member_level')), 'LAST_USER_GROUP_COLOR' => $last_user_group_color, 'U_LAST_USER_PROFILE' => UserUrlBuilder::profile($stats_cache->get_stats_properties('last_member_id'))->rel(), 'USERS' => $stats_cache->get_stats_properties('nbr_members'), 'GRAPH_RESULT_THEME' => !file_exists('../cache/theme.png') ? '<img src="display_stats.php?theme=1" alt="' . $LANG['theme_s'] . '" />' : '<img src="../cache/theme.png" alt="' . $LANG['theme_s'] . '" />', 'GRAPH_RESULT_SEX' => !file_exists('../cache/sex.png') ? '<img src="display_stats.php?sex=1" alt="' . $LANG['sex'] . '" />' : '<img src="../cache/sex.png" alt="' . $LANG['sex'] . '" />', 'L_LAST_USER' => $LANG['last_member'], 'L_TEMPLATES' => $LANG['theme_s'], 'L_PSEUDO' => LangLoader::get_message('display_name', 'user-common'), 'L_MSG' => $LANG['message_s'], 'L_TOP_TEN_POSTERS' => $LANG['top_10_posters'], 'L_COLORS' => $LANG['colors'], 'L_USERS' => $LANG['member_s'], 'L_SEX' => $LANG['sex']));
     $stats_array = array();
     foreach (ThemesManager::get_activated_themes_map() as $theme) {
         $stats_array[$theme->get_id()] = $db_querier->count(DB_TABLE_MEMBER, "WHERE theme = '" . $theme->get_id() . "'");
     }
     $Stats = new ImagesStats();
     $Stats->load_data($stats_array, 'ellipse');
     foreach ($Stats->data_stats as $name => $angle_value) {
         $array_color = $Stats->array_allocated_color[$Stats->image_color_allocate_dark(false, NO_ALLOCATE_COLOR)];
         $tpl->assign_block_vars('templates', array('NBR_THEME' => NumberHelper::round($angle_value * $Stats->nbr_entry / 360, 0), 'COLOR' => 'RGB(' . $array_color[0] . ', ' . $array_color[1] . ', ' . $array_color[2] . ')', 'THEME' => $name == 'Other' ? $LANG['other'] : $name, 'PERCENT' => NumberHelper::round($angle_value / 3.6, 1)));
     }
コード例 #2
0
 private function get_authorizations($bit)
 {
     return AppContext::get_current_user()->check_auth(StatsConfig::load()->get_authorizations(), $bit);
 }