1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
| 1. / 2. / ...
<?php
// ClanSphere 2009 - www.clansphere.net
// $Id: statistik.php 2346 2009-03-22 19:43:56Z hajo $
$cs_lang = cs_translate('board');
// Statistik Start
$data = array();
$all_threads = cs_sql_count(__FILE__,'threads');
$all_comment = cs_sql_count(__FILE__,'comments',"comments_mod = 'board'");
$data['stats']['threads'] = cs_html_big(1) . $all_threads . cs_html_big(0);
$data['stats']['comments'] = cs_html_big(1) . $all_comment . cs_html_big(0);
$select = 'users_id, users_nick, users_register, users_active';
$order = 'users_register DESC';
$cs_users = cs_sql_select(__FILE__,'users',$select,'users_delete = "0" AND users_active = "1"',$order,0,1);
$secure_name = cs_secure($cs_users['users_nick']);
$data['user']['newest'] = cs_user($cs_users['users_id'],$cs_users['users_nick'], $cs_users['users_active']);
// Statistik End
// All Users Start
$data['user']['all'] = cs_sql_count(__FILE__,'users', 'users_delete = "0"');
// All Users End
// Online Users Start
$five_min = cs_time() - 300;
$select = 'users_id, users_nick, users_country, users_active, users_invisible, users_delete';
$upcome = "users_laston > '" . $five_min . "' AND users_invisible = '0'";
$order = 'users_laston DESC';
$users_count = cs_sql_count(__FILE__,'users',$upcome);
$data['stats']['online'] = sprintf($cs_lang['user_online'], $users_count);
$where = 'count_time > \'' . $five_min . '\'';
$visitor_online = cs_sql_count(__FILE__,'count',$where) - $users_count;
if($visitor_online < 0) { $visitor_online = 0; }
$data['stats']['online'] .= sprintf($cs_lang['visitor_online'], $visitor_online);
$cs_users = cs_sql_select(__FILE__,'users',$select,$upcome,$order,0,0);
if(empty($cs_users)) {
$data['users'][0]['nick'] = $cs_lang['no_data'];
} else {
for($run = 0; $run < count($cs_users); $run++) {
if($run != 0) {
$data['users'][$run]['nick'] = ', ';
}
else {
$data['users'][$run]['nick'] = '';
}
$data['users'][$run]['nick'] .= cs_html_img('symbols/countries/' . $cs_users[$run]['users_country'] . '.png') . ' ';
$data['users'][$run]['nick'] .= cs_user($cs_users[$run]['users_id'], $cs_users[$run]['users_nick'], $cs_users[$run]['users_active'], $cs_users[$run]['users_delete']);
}
}
// Online Users End
$data['if']['list'] = false;
$data['if']['listcat'] = false;
if(empty($_GET['action']) OR $_GET['action'] == 'list') { $data['if']['list'] = true; }
if(!empty($_GET['action']) AND $_GET['action'] == 'listcat') { $data['if']['listcat'] = true; }
// kommende geburtstag start
// Wieviele sollen angezeigte werden
$max_users = 5;
$max_users = $max_users - 1;
$day = cs_datereal('d',cs_time());
$month = cs_datereal('m', cs_time());
$select = 'users_id, users_nick, users_age, users_active, users_country, access_id ';
$where = "users_hidden NOT LIKE '%users_age%' AND users_age != '0' AND users_active = '1' AND access_id > '2'";
$where .= " AND users_age > '%-" . $month . "-%'";
$cs_users = cs_sql_select(__FILE__,'users',$select,$where,"users_age DESC",0,0);
$users_count = count($cs_users);
$data1 = array();
if(empty($users_count)) {
echo $cs_lang['no_data'];
} else {
for($run=0; $run < $users_count; $run++) {
if(!empty($cs_users[$run]['users_age'])) {
$birth = explode('-', $cs_users[$run]['users_age']);
if($birth[1] == $month and $birth[2] > $day or $birth[1] >= ($month + 1)) {
$data1[$run]['users_id'] = $cs_users[$run]['users_id'];
$data1[$run]['users_nick'] = $cs_users[$run]['users_nick'];
$data1[$run]['users_day'] = $birth[2];
$data1[$run]['users_month'] = $birth[1];
$data1[$run]['users_year'] = $birth[0];
}
}
}
foreach($data1 as $sortarray) {
$column[] = $sortarray['users_month'];
$column2[] = $sortarray['users_day'];
}
array_multisort($column, SORT_ASC, $column2, SORT_ASC, $data1);
$new_count = count($data1);
for($run = 0; $run < $new_count; $run++) {
if($run <= $max_users) {
$age = cs_datereal('Y') - $data1[$run]['users_year'];
$data['geb']['nextbirth'] .= cs_html_img('symbols/countries/' . $cs_users[$run]['users_country'] . '.png') . ' ';
$data['geb']['nextbirth'] .= cs_user($data1[$run]['users_id'], $data1[$run]['users_nick'], $cs_users[$run]['users_active']).' (' . $age . ') ';
$data['geb']['nextbirth'] .= ' (' . $data1[$run]['users_day'] . '.' . $data1[$run]['users_month']. ') '. ' ';
}
}
}
// kommende geburtstag ende
// kommende geburtstag ende
// geburtstag start
$select = 'users_id, users_nick, users_age, users_active, users_country, access_id ';
$where = "users_age LIKE '%-" . cs_datereal('m') . "-" . cs_datereal('d') . "' AND users_hidden NOT LIKE '%users_age%' AND users_active = '1' AND access_id > '2'";
$order = 'users_nick ASC';
$cs_users = cs_sql_select(__FILE__,'users',$select,$where,$order,0,4);
$data['geb']['birth'] = "";
if(empty($cs_users)) {
$data['geb']['birth'] = "niemand Geburtstag.";
$data['geb']['birth1'] = "";
}
else {
foreach ($cs_users AS $users) {
$birth = explode ('-', $users['users_age']);
$age = cs_datereal('Y') - $birth[0];
$data['geb']['birth'] .= cs_html_img('symbols/countries/' . $users['users_country'] . '.png') . ' ';
$data['geb']['birth'] .= cs_user($users['users_id'], $users['users_nick'], $users['users_active']).' (' . $age . ') ';
$data['geb']['birth1'] = " Geburtstag. Herzlichen Glückwunsch!";
}
}
// geburtstag ende
echo cs_subtemplate(__FILE__,$data,'board','statistik');
?> |