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.
| 1. / 2. / ...
<?php
// ClanSphere 2009 - www.clansphere.net
// $Id: statistik.php 2346 2009-03-22 19:43:56Z hajo $
$cs_lang = cs_translate('birthday');
// kommende geburtstag start
$birthday_options = cs_sql_option(__FILE__,'birthday');
$max_users = $birthday_options['max_users'];
$max_users = $max_users - 1;
$day = cs_datereal('j',cs_time());
$month = cs_datereal('n', 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 >= " . $birthday_options['access_level'] . ")";
$where .= " AND users_age > '%-" . $month . "-%'";
$cs_users = cs_sql_select(__FILE__,'users',$select,$where,"users_age DESC",0,0);
$users_count = count($cs_users);
$data = array();
if(empty($users_count)) {
$data['geb']['nextbirth'] = $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)) {
$data[$run]['users_id'] = $cs_users[$run]['users_id'];
$data[$run]['users_nick'] = $cs_users[$run]['users_nick'];
$data[$run]['users_country'] = $cs_users[$run]['users_country'];
$data[$run]['users_day'] = $birth[2];
$data[$run]['users_month'] = $birth[1];
$data[$run]['users_year'] = $birth[0];
}
}
}
foreach($data as $sortarray) {
$column[] = $sortarray['users_month'];
$column2[] = $sortarray['users_day'];
}
if(empty($data)) {
$data['geb']['nextbirth'] = $cs_lang['no_data'];
} else {
array_multisort($column, SORT_ASC, $column2, SORT_ASC, $data);
$new_count = count($data);
for($run = 0; $run < $new_count; $run++) {
if($run <= $max_users) {
$age = cs_datereal('Y') - $data[$run]['users_year'];
isset($data['geb']['nextbirth']) ? $data['geb']['nextbirth'] .= cs_html_img('symbols/countries/' . $data[$run]['users_country'] . '.png') . ' ' : $data['geb']['nextbirth'] = cs_html_img('symbols/countries/' . $data[$run]['users_country'] . '.png') . ' ';
isset($data['geb']['nextbirth']) ? $data['geb']['nextbirth'] .= cs_user($data[$run]['users_id'], $data[$run]['users_nick'], $cs_users[$run]['users_active']).' (' . $age . ') ' : $data['geb']['nextbirth'] = cs_user($data[$run]['users_id'], $data[$run]['users_nick'], $cs_users[$run]['users_active']).' (' . $age . ') ';
isset($data['geb']['nextbirth']) ? $data['geb']['nextbirth'] .= ' (' . $data[$run]['users_day'] . '.' . $data[$run]['users_month']. ') '. ' ' : $data['geb']['nextbirth'] = ' (' . $data[$run]['users_day'] . '.' . $data[$run]['users_month']. ') '. ' ';
$data['geb']['nextbirth'] .= cs_html_br(1);
}
}
}
// kommende geburtstag ende
// geburtstag start
$select = 'users_id, users_nick, users_age, users_active, users_country, access_id ';
$where = "users_age LIKE '%-" . cs_datereal('n') . "-" . cs_datereal('j') . "' AND users_hidden NOT LIKE '%users_age%' AND users_active = '1' AND (access_id >= " . $birthday_options['access_level'] . ")";
$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.<br /><hr>nobody has Birthday today.";
$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!<br /><hr>Happy Birthday and Congratulations!";
}
}
}
// geburtstag ende
echo cs_subtemplate(__FILE__,$data,'birthday','birthday');
?> |