Beispiel #1
0
<?php

// ClanSphere 2010 - www.clansphere.net
// $Id$
$tday = cs_datereal('d');
$tmonth = cs_datereal('n');
$tyear = cs_datereal('Y');
$daystart = mktime(0, 0, 0, $tmonth, $tday, $tyear);
$daystart = cs_timediff($daystart, 1);
$where = 'count_time > \'' . $daystart . '\'';
echo number_format(cs_sql_count(__FILE__, 'count', $where), 0, ',', '.');
Beispiel #2
0
} else {
    $data['clans']['country'] = '-';
}
if (!empty($cs_clan['clans_url'])) {
    $data['clans']['url'] = cs_html_link('http://' . $cs_clan['clans_url'], cs_secure($cs_clan['clans_url']));
} else {
    $data['clans']['url'] = '';
}
if (!empty($cs_clan['clans_since'])) {
    $content = cs_date('date', $cs_clan['clans_since']);
    $birth = explode('-', $cs_clan['clans_since']);
    $age = cs_datereal('Y') - $birth[0];
    if (cs_datereal('m') <= $birth[1]) {
        $age--;
    }
    if (cs_datereal('d') >= $birth[2] and cs_datereal('m') == $birth[1]) {
        $age++;
    }
    $content .= ' (' . $age . ')';
    $data['clans']['since'] = $content;
} else {
    $data['clans']['since'] = '-';
}
$select = 'squads_name, games_id, squads_id';
$where = "clans_id = '" . $cs_clans_id . "'";
$cs_squads = cs_sql_select(__FILE__, 'squads', $select, $where, 'squads_order, squads_name', 0, 0);
$squads_loop = count($cs_squads);
$data['lang']['game'] = $cs_lang['game'];
$data['lang']['squads'] = $cs_lang[$op_squads['label']];
$data['lang']['members'] = $cs_lang[$op_members['label']];
if (empty($squads_loop)) {
Beispiel #3
0
    $data['cal'][$run]['if']['event'] = FALSE;
    if ($row == 9) {
        $data['cal'][$run]['if']['row'] = TRUE;
        $data['cal'][$run]['week'] = date('W', mktime(0, 0, 0, $month, $count, $year));
        $row = 2;
    }
    if (array_key_exists($count, $events)) {
        $css = 'calevent';
        $unix = mktime(0, 0, 0, $month, $count, $year);
        $out = cs_link($count, 'events', 'timer', 'unix=' . $unix);
    } else {
        $css = 'calday';
        $out = $count;
    }
    $current = $count . '-' . $zero . '-' . $year;
    $css2 = $current == cs_datereal('j-m-Y') ? 'caltoday' : $css;
    $data['cal'][$run]['css'] = $css2;
    $data['cal'][$run]['out'] = $out;
    $count++;
    $row++;
}
$data['if']['colspan2'] = FALSE;
if ($row < 9) {
    $colspan2 = 9 - $row;
    $data['if']['colspan2'] = TRUE;
    $data['cal1']['colspan2'] = $colspan2;
}
$nom = date('F', mktime(0, 0, 0, $month, 1, $year));
$next = $month == 12 ? 'year=' . ($year + 1) . '&amp;month=1' : 'year=' . $year . '&amp;month=' . ($month + 1);
$last = $month == 1 ? 'year=' . ($year - 1) . '&amp;month=12' : 'year=' . $year . '&amp;month=' . ($month - 1);
$data['cal1']['bef_month'] = ($year < 1970 or $year == 1970 and $month == 1) ? '&lt;' : cs_link('&lt;', 'events', 'calendar', $last);
Beispiel #4
0
<?php

// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('cash');
$data = array();
$data['op'] = cs_sql_option(__FILE__, 'cash');
$tables = 'cash ca INNER JOIN {pre}_users usr ON ca.users_id = usr.users_id';
$cells = 'ca.cash_id AS cash_id, ca.cash_time AS cash_time, ca.cash_inout AS cash_inout, ca.users_id AS users_id, usr.users_nick AS users_nick, ca.cash_text AS cash_text';
$cells .= ', ca.cash_money AS cash_money, ca.cash_id AS cash_id, usr.users_country AS users_country, usr.users_active AS users_active, usr.users_delete AS users_delete';
$cond = "cash_inout = 'in' AND ca.cash_time LIKE '" . cs_datereal('Y-m') . "%'";
$data['cash'] = cs_sql_select(__FILE__, $tables, $cells, $cond, 'cash_time DESC', 0, 0);
if (!empty($data['cash'])) {
    $count_cash = count($data['cash']);
    for ($run = 0; $run < $count_cash; $run++) {
        $data['cash'][$run]['users_flag'] = cs_html_img('symbols/countries/' . $data['cash'][$run]['users_country'] . '.png');
        $data['cash'][$run]['user'] = cs_user($data['cash'][$run]['users_id'], $data['cash'][$run]['users_nick'], $data['cash'][$run]['users_active'], $data['cash'][$run]['users_delete']);
        $data['cash'][$run]['date'] = cs_date('date', $data['cash'][$run]['cash_time']);
        $data['cash'][$run]['cash_text'] = cs_secure($data['cash'][$run]['cash_text'], 0, 0, 0);
        $data['cash'][$run]['cash_money'] = cs_secure($data['cash'][$run]['cash_money'], 0, 0, 0);
    }
}
echo cs_subtemplate(__FILE__, $data, 'cash', 'view_cash');
Beispiel #5
0
<?php

// ClanSphere 2010 - www.clansphere.net
// $Id$
$time_now = explode('-', date('Y-m-d'));
$output = array();
$data = cs_cache_load('nextbirth');
$cs_lang = cs_translate('users');
$options = cs_sql_option(__FILE__, 'users');
if (empty($data) or $data['day'] != $time_now['2'] . $time_now['1']) {
    $data = array();
    // We need to reset the data array here, else new birthdays will be added to existing cached entries!
    $nextday = cs_datereal('d', cs_time() + $options['nextbirth_time_interval']);
    $nextmonth = cs_datereal('m', cs_time() + $options['nextbirth_time_interval']);
    $data['day'] = $time_now['2'] . $time_now['1'];
    $check_n = $nextmonth == '01' ? (int) 13 . $nextday : (int) $nextmonth . $nextday;
    $check_t = (int) $time_now['1'] . $time_now['2'];
    $select = 'users_id, users_nick, users_age';
    $where = "users_hidden NOT LIKE '%users_age%' AND users_active = 1 ";
    $where .= $nextmonth == $time_now['1'] ? " AND users_age LIKE '%-" . $time_now['1'] . "-%'" : "AND (users_age LIKE '%-" . $time_now['1'] . "-%' OR users_age LIKE '%-" . $nextmonth . "-%')";
    $cs_users = cs_sql_select(__FILE__, 'users', $select, $where, 'users_age', 0, 0);
    if (!empty($cs_users)) {
        $run = 0;
        foreach ($cs_users as $birth_users) {
            $birth = explode('-', $birth_users['users_age']);
            $check_b = $birth[1] == '01' ? (int) 13 . $birth[2] : (int) $birth[1] . $birth[2];
            if ($check_b < $check_n and $check_b >= $check_t) {
                $data['users'][$run]['users_id'] = $birth_users['users_id'];
                $data['users'][$run]['users_nick'] = $birth_users['users_nick'];
                $data['users'][$run]['users_day'] = $birth[2];
                $data['users'][$run]['users_month'] = $birth[1];
Beispiel #6
0
 $data['value']['tablescount'] = $tablescount;
 // Show
 $_POST['showcount'] = empty($_POST['showcount']) ? 1 : (int) $_POST['showcount'];
 $showcount = empty($_POST['addshow']) ? $_POST['showcount'] : $_POST['showcount'] + 1;
 for ($run = 0; $run < $showcount; $run++) {
     $data['show'][$run]['run'] = $run;
     $data['show'][$run]['value'] = empty($_POST['show_' . $run]) ? '' : $_POST['show_' . $run];
     $data['show'][$run]['axx_value'] = empty($_POST['showaccess_' . $run]) ? '' : $_POST['showaccess_' . $run];
 }
 $data['value']['showcount'] = $showcount;
 $data['value']['modname'] = empty($_POST['modname']) ? '' : $_POST['modname'];
 $data['value']['moddir'] = empty($_POST['moddir']) ? '' : $_POST['moddir'];
 $data['value']['modversion'] = empty($_POST['modversion']) ? '' : $_POST['modversion'];
 $data['value']['description'] = empty($_POST['description']) ? '' : $_POST['description'];
 $var = cs_datepost('release', 'date');
 $data['value']['dateselect'] = empty($var) ? cs_datereal('Y-m-d') : $var;
 $data['value']['creator'] = empty($_POST['creator']) ? '' : $_POST['creator'];
 $data['value']['team'] = empty($_POST['team']) ? '' : $_POST['team'];
 $data['value']['homepage'] = empty($_POST['homepage']) ? '' : $_POST['homepage'];
 $data['value']['icon'] = empty($_POST['icon']) ? '' : $_POST['icon'];
 $clip[1] = $cs_lang['help'];
 $clip[2] = $cs_lang['helptext'];
 $data['help']['clip'] = cs_abcode_clip($clip);
 $sel = 'selected="selected"';
 $data['selected']['categories_no'] = empty($_POST['categories']) ? $sel : '';
 $data['selected']['categories_yes'] = empty($_POST['categories']) ? '' : $sel;
 $data['selected']['protected_no'] = empty($_POST['protected']) ? $sel : '';
 $data['selected']['protected_yes'] = empty($_POST['protected']) ? '' : $sel;
 $data['form']['url'] = cs_url('modules', 'create');
 $data['input']['dateselect'] = cs_dateselect('release', 'date', $data['value']['dateselect']);
 echo cs_subtemplate(__FILE__, $data, 'modules', 'create');
Beispiel #7
0
$data['head']['month'] = number_format($cmon, 0, ',', '.');
$data['count'][$max_step - 1]['count'] = $cmon;
$data['count'][$max_step - 1]['day'] = round(($count_all + $count_arcday['count']) / $aday);
$mon_max = $cmon;
if ($op_count['view'] == 'amstats') {
    $data['countall'][$max_step - 1]['value'] = $cmon;
    $data['countave'][$max_step - 1]['value'] = round(($count_all + $count_arcday['count']) / $aday);
}
// other months
$cs_arcmon = cs_sql_select(__FILE__, 'count_archiv', 'count_month, count_num', "count_mode = 0", 0, 0, 0);
$count_arcmon = count($cs_arcmon);
$count_month = 0;
for ($run = 0; $run < $count_arcmon; $run++) {
    $count_month += $cs_arcmon[$run]['count_num'];
    $date = explode("-", $cs_arcmon[$run]['count_month']);
    $days = cs_datereal('t', mktime(0, 0, 0, (int) $date[0], 1, (int) $date[1]));
    $place = $max_step - ($ayear - (int) $date[1]) * 12 - ($amonth - (int) $date[0]) - 1;
    if ($place >= 0 && $place < $max_step) {
        $data['count'][$place]['count'] = $cs_arcmon[$run]['count_num'];
        $data['count'][$place]['day'] = round($cs_arcmon[$run]['count_num'] / $days);
        if ($cs_arcmon[$run]['count_num'] > $mon_max) {
            $mon_max = $cs_arcmon[$run]['count_num'];
        }
        if ($op_count['view'] == 'amstats') {
            $data['countall'][$place]['value'] = $cs_arcmon[$run]['count_num'];
            $data['countave'][$place]['value'] = round($cs_arcmon[$run]['count_num'] / $days);
        }
    }
}
// statistics
if ($op_count['view'] == 'stats') {
Beispiel #8
0
<?php

// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('news');
$where = "nws.news_public > 0 AND cat.categories_access <= '" . $account['access_news'] . "'";
$join = 'news nws INNER JOIN {pre}_categories cat ON nws.categories_id = cat.categories_id';
$newsmod = "categories_mod = 'news' AND categories_access <= '" . $account['access_news'] . "'";
$select = 'nws.news_headline AS news_headline, nws.news_time AS news_time, nws.news_id AS news_id';
$cs_news = cs_sql_select(__FILE__, $join, $select, $where, 'news_time DESC', 0, $account['users_limit']);
$day = -1;
$run = 0;
$lastday = 0;
if (empty($cs_news)) {
    $data['days'] = '';
}
foreach ($cs_news as $news) {
    $newsday = cs_date('unix', $news['news_time']);
    if ($newsday != $lastday) {
        $day++;
        $run = 0;
        $lastday = $newsday;
        $dayname = cs_datereal('l', $news['news_time']);
        $data['days'][$day]['content'] = $cs_lang[$dayname] . ' - ' . cs_date('unix', $news['news_time']);
    }
    $data['days'][$day]['news'][$run]['news_time'] = cs_date('unix', $news['news_time'], 1, 0);
    $sec_head = cs_secure($news['news_headline']);
    $data['days'][$day]['news'][$run]['news_headline'] = cs_link($sec_head, 'news', 'view', 'id=' . $news['news_id']);
    $run++;
}
echo cs_subtemplate(__FILE__, $data, 'news', 'summary');
Beispiel #9
0
$data['head']['year'] = $year;
$mon = array($cs_lang['January'], $cs_lang['February'], $cs_lang['March'], $cs_lang['April'], $cs_lang['May'], $cs_lang['June'], $cs_lang['July'], $cs_lang['August'], $cs_lang['September'], $cs_lang['October'], $cs_lang['November'], $cs_lang['December']);
for ($run = 0; $run < 12; $run++) {
    $data['count'][$run]['id'] = $run + 1;
    $data['count'][$run]['month'] = $mon[$run];
    $data['countall'][$run]['id'] = $run + 1;
    $data['countall'][$run]['value'] = 0;
    $data['countave'][$run]['id'] = $run + 1;
    $data['countave'][$run]['value'] = 0;
}
// actual month if given year is actual year
$ayear = cs_datereal('Y');
if ($year == $ayear) {
    $count_all = cs_sql_count(__FILE__, 'count');
    $count_arcday = cs_sql_select(__FILE__, 'count_archiv', 'SUM(count_num) AS count', 'count_mode = 1', 0, 0, 1);
    $amonth = cs_datereal('n');
    $aday = cs_datereal('j');
    $data['countall'][$amonth - 1]['value'] = $count_all + $count_arcday['count'];
    $data['countave'][$amonth - 1]['value'] = round(($count_all + $count_arcday['count']) / $aday);
}
// other months from given year
$where = "count_month LIKE '%" . $year . "' AND count_mode = 0";
$cs_arcmon = cs_sql_select(__FILE__, 'count_archiv', 'count_month, count_num', $where, 0, 0, 0);
$count_arcmon = count($cs_arcmon);
for ($run = 0; $run < $count_arcmon; $run++) {
    $date = explode("-", $cs_arcmon[$run]['count_month']);
    $days = cs_datereal('t', mktime(0, 0, 0, (int) $date[0], 1, $year));
    $data['countall'][(int) $date[0] - 1]['value'] = $cs_arcmon[$run]['count_num'];
    $data['countave'][(int) $date[0] - 1]['value'] = round($cs_arcmon[$run]['count_num'] / $days);
}
echo cs_subtemplate(__FILE__, $data, 'count', 'statsyear');
Beispiel #10
0
    $search_collision = cs_sql_count(__FILE__, 'members', $where);
    if (!empty($search_collision)) {
        $error .= $cs_lang['collision'] . cs_html_br(1);
    }
} else {
    $cs_squads['squads_id'] = 0;
    $cs_squads['squads_pwd'] = '';
}
if (!isset($_POST['submit'])) {
    $data['head']['body'] = $cs_lang['body_join'];
} elseif (!empty($error)) {
    $data['head']['body'] = $error;
}
if (!empty($error) or !isset($_POST['submit'])) {
    $data['head']['mod'] = $cs_lang[$label . 's'];
    $data['lang']['label'] = $cs_lang[$label];
    $squads_data = cs_sql_select(__FILE__, 'squads', 'squads_name,squads_id', 0, 'squads_name', 0, 0);
    $data['squads']['squad_sel'] = cs_dropdown('squads_id', 'squads_name', $squads_data, $cs_squads['squads_id']);
    echo cs_subtemplate(__FILE__, $data, 'squads', 'join');
} else {
    $cs_members['squads_id'] = $cs_squads['squads_id'];
    $cs_members['users_id'] = $account['users_id'];
    $cs_members['members_task'] = $cs_lang['member'];
    $cs_members['members_since'] = cs_datereal('Y-m-d');
    $cs_members['members_order'] = 50;
    $cs_members['members_admin'] = 0;
    $members_cells = array_keys($cs_members);
    $members_save = array_values($cs_members);
    cs_sql_insert(__FILE__, 'members', $members_cells, $members_save);
    cs_redirect($cs_lang['join_done'], 'squads', 'center');
}
Beispiel #11
0
function cs_dateselect($name, $mode, $time, $year_start = 0)
{
    global $com_lang;
    $data = array();
    $data['date']['name'] = $name;
    $data['if']['ampm'] = 0;
    $real_start = $mode == 'unix' ? 1970 : 1950;
    $year_start = empty($year_start) ? $real_start : $year_start;
    if (empty($time)) {
        $explode = array(0 => 0, 1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 'am');
    } elseif ($mode == 'date') {
        $explode = explode('-', $time);
    } elseif ($mode == 'unix') {
        $explode[0] = cs_datereal('Y', $time);
        $explode[1] = cs_datereal('m', $time);
        $explode[2] = cs_datereal('d', $time);
        $explode[4] = cs_datereal('i', $time);
        if (strpos($com_lang['timeset'], 'a') === false and strpos($com_lang['timeset'], 'A') === false) {
            $explode[3] = cs_datereal('H', $time);
        } else {
            $explode[3] = cs_datereal('h', $time);
            $explode[5] = cs_datereal('a', $time);
            $data['if']['ampm'] = 1;
            $data['ampm']['options'] = cs_html_option('am', 'am', $explode[5] == 'am' ? 1 : 0);
            $data['ampm']['options'] .= cs_html_option('pm', 'pm', $explode[5] == 'pm' ? 1 : 0);
        }
    }
    #year
    $year_end = cs_datereal('Y') + 4;
    $data['year']['options'] = cs_html_option('----', 0, 0);
    while ($year_start < $year_end) {
        $sel = $explode[0] == $year_start ? 1 : 0;
        $data['year']['options'] .= cs_html_option($year_start, $year_start, $sel);
        $year_start++;
    }
    #month
    $month_start = 1;
    $month_end = 13;
    $data['month']['options'] = '';
    while ($month_start < $month_end) {
        $month_value = $month_start < 10 ? '0' . $month_start : $month_start;
        $explode[1] == $month_value ? $sel = 1 : ($sel = 0);
        $data['month']['options'] .= cs_html_option($month_start, $month_value, $sel);
        $month_start++;
    }
    #day
    $day_start = 1;
    $day_end = 32;
    $data['day']['options'] = '';
    while ($day_start < $day_end) {
        $day_value = $day_start < 10 ? '0' . $day_start : $day_start;
        $explode[2] == $day_value ? $sel = 1 : ($sel = 0);
        $data['day']['options'] .= cs_html_option($day_start, $day_value, $sel);
        $day_start++;
    }
    #unix (hours + minutes)
    $data['if']['unix'] = 0;
    if ($mode == 'unix') {
        $data['if']['unix'] = 1;
        $data['expl']['hours'] = $explode[3];
        $data['expl']['mins'] = $explode[4];
    }
    return cs_subtemplate(__FILE__, $data, 'clansphere', 'dateselect');
}
Beispiel #12
0
            $link = cs_link($sec_head, 'events', 'view', 'id=' . $cs_events[$run]['events_id']);
        } elseif (!empty($cs_events[$run]['wars_id'])) {
            $link = cs_link($sec_head, 'wars', 'view', 'id=' . $cs_events[$run]['wars_id']);
        }
        $data['events'][$run]['link'] = $link;
        $data['events'][$run]['time'] = cs_date('unix', $cs_events[$run]['events_time'], 1);
    }
}
// user part
$month = cs_datereal('m', $unix);
$day = cs_datereal('d', $unix);
$select = 'users_nick, users_age, users_place, users_id, users_active';
$like = "users_age LIKE '%-" . $month . '-' . $day . "' AND users_hidden NOT LIKE '%users_age%'";
$birthdays = cs_sql_select(__FILE__, 'users', $select, $like, 'users_nick ASC', 0, 0);
$bday_loop = count($birthdays);
$data['if']['av_users'] = empty($bday_loop) ? 0 : 1;
if (!empty($bday_loop)) {
    for ($run = 0; $run < $bday_loop; $run++) {
        $sec_user = cs_secure($birthdays[$run]['users_nick']);
        $sec_user = cs_user($birthdays[$run]['users_id'], $birthdays[$run]['users_nick'], $birthdays[$run]['users_active']);
        $birth = explode('-', $birthdays[$run]['users_age']);
        $age = cs_datereal('Y', $unix) - $birth[0];
        if (cs_datereal('m', $unix) < $birth[1] or cs_datereal('d', $unix) < $birth[2] and cs_datereal('m', $unix) == $birth[1]) {
            $age--;
        }
        $data['users'][$run]['link'] = $sec_user;
        $data['users'][$run]['new_age'] = $age;
        $data['users'][$run]['place'] = cs_secure($birthdays[$run]['users_place']);
    }
}
echo cs_subtemplate(__FILE__, $data, 'events', 'timer');
Beispiel #13
0
// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('events');
$data = array();
$year = !empty($_GET['year']) ? (int) $_GET['year'] : cs_datereal('Y');
if (1970 > $year) {
    $year = 1970;
} elseif (2037 < $year) {
    $year = 2037;
}
# limited by current operating systems
$month = !empty($_GET['month']) ? (int) $_GET['month'] : cs_datereal('n');
$nom = date('F', mktime(0, 0, 0, $month, 1, $year));
$days = date('t', mktime(0, 0, 0, $month, 1, $year));
$min = cs_datereal('U', mktime(0, 0, 0, $month, 1, $year), 1);
$max = cs_datereal('U', mktime(23, 59, 59, $month, $days, $year), 1);
$data['month'][1] = $month == 1 ? $cs_lang['January'] : cs_link($cs_lang['January'], 'events', 'agenda', 'year=' . $year . '&amp;month=1');
$data['month'][2] = $month == 2 ? $cs_lang['February'] : cs_link($cs_lang['February'], 'events', 'agenda', 'year=' . $year . '&amp;month=2');
$data['month'][3] = $month == 3 ? $cs_lang['March'] : cs_link($cs_lang['March'], 'events', 'agenda', 'year=' . $year . '&amp;month=3');
$data['month'][4] = $month == 4 ? $cs_lang['April'] : cs_link($cs_lang['April'], 'events', 'agenda', 'year=' . $year . '&amp;month=4');
$data['month'][5] = $month == 5 ? $cs_lang['May'] : cs_link($cs_lang['May'], 'events', 'agenda', 'year=' . $year . '&amp;month=5');
$data['month'][6] = $month == 6 ? $cs_lang['June'] : cs_link($cs_lang['June'], 'events', 'agenda', 'year=' . $year . '&amp;month=6');
$data['month'][7] = $month == 7 ? $cs_lang['July'] : cs_link($cs_lang['July'], 'events', 'agenda', 'year=' . $year . '&amp;month=7');
$data['month'][8] = $month == 8 ? $cs_lang['August'] : cs_link($cs_lang['August'], 'events', 'agenda', 'year=' . $year . '&amp;month=8');
$data['month'][9] = $month == 9 ? $cs_lang['September'] : cs_link($cs_lang['September'], 'events', 'agenda', 'year=' . $year . '&amp;month=9');
$data['month'][10] = $month == 10 ? $cs_lang['October'] : cs_link($cs_lang['October'], 'events', 'agenda', 'year=' . $year . '&amp;month=10');
$data['month'][11] = $month == 11 ? $cs_lang['November'] : cs_link($cs_lang['November'], 'events', 'agenda', 'year=' . $year . '&amp;month=11');
$data['month'][12] = $month == 12 ? $cs_lang['December'] : cs_link($cs_lang['December'], 'events', 'agenda', 'year=' . $year . '&amp;month=12');
$data['year']['last'] = 1970 > $year ? '' : cs_link($year - 1, 'events', 'agenda', 'year=' . ($year - 1) . '&amp;month=' . $month);
$data['year']['current'] = $year;
$data['year']['next'] = 2037 < $year ? '' : cs_link($year + 1, 'events', 'agenda', 'year=' . ($year + 1) . '&amp;month=' . $month);
Beispiel #14
0
// ClanSphere 2010 - www.clansphere.net
// $Id$
$thisday = cs_datereal('m-d');
$output = array();
$data = array();
$data = cs_cache_load('navbirth');
$cs_lang = cs_translate('users');
$options = cs_sql_option(__FILE__, 'users');
if ($data['day'] != $thisday) {
    $data['day'] = $thisday;
    $select = 'users_id, users_nick, users_age';
    $where = "users_age LIKE '%-" . $data['day'] . "' AND users_hidden NOT LIKE '%users_age%' AND users_active = 1";
    $order = 'users_nick ASC';
    $data['users'] = cs_sql_select(__FILE__, 'users', $select, $where, $order, 0, 0);
    cs_cache_save('navbirth', $data);
}
if (empty($data['users'])) {
    echo $cs_lang['no_data'];
} else {
    $count = empty($options['navbirth_max_users']) ? count($data['users']) : min(count($data['users']), $options['navbirth_max_users']);
    for ($run = 0; $run < $count; $run++) {
        $birth = explode('-', $data['users'][$run]['users_age']);
        $output['users'][$run]['age'] = cs_datereal('Y') - $birth[0];
        $output['users'][$run]['day'] = $birth[2];
        $output['users'][$run]['month'] = $birth[1];
        $output['users'][$run]['year'] = $birth[0];
        $output['users'][$run]['user'] = cs_user($data['users'][$run]['users_id'], $data['users'][$run]['users_nick']);
        $output['users'][$run]['messageurl'] = cs_url('messages', 'create', 'to_id=' . $data['users'][$run]['users_id']);
    }
    echo cs_subtemplate(__FILE__, $output, 'users', 'navbirth');
}
Beispiel #15
0
    if (empty($cs_replays['replays_team1'])) {
        $error .= $cs_lang['no_team1'] . cs_html_br(1);
    }
    if (empty($cs_replays['replays_team2'])) {
        $error .= $cs_lang['no_team2'] . cs_html_br(1);
    }
    if (empty($cs_replays['replays_date'])) {
        $error .= $cs_lang['no_date'] . cs_html_br(1);
    }
} else {
    $cs_replays['categories_id'] = 0;
    $cs_replays['games_id'] = 0;
    $cs_replays['replays_version'] = '';
    $cs_replays['replays_team1'] = '';
    $cs_replays['replays_team2'] = '';
    $cs_replays['replays_date'] = cs_datereal('Y-m-d');
    $cs_replays['replays_map'] = '';
    $cs_replays['replays_mirror_urls'] = '';
    $cs_replays['replays_mirror_names'] = '';
    $cs_replays['replays_info'] = '';
    $cs_replays['replays_close'] = 0;
}
if (!isset($_POST['submit'])) {
    $data['head']['body'] = $cs_lang['body_create'];
} elseif (!empty($error)) {
    $data['head']['body'] = $error;
}
if (!empty($error) or !isset($_POST['submit'])) {
    $data['replays'] = $cs_replays;
    $data['replays']['cat_dropdown'] = cs_categories_dropdown('replays', $cs_replays['categories_id']);
    $data['games'] = array();
Beispiel #16
0
    $pattern = "=^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@([0-9a-z](-?[0-9a-z])*\\.)+[a-z]{2}([zmuvtg]|fo|me)?\$=i";
    if (!preg_match($pattern, $cs_user['users_email'])) {
        $error++;
        $errormsg .= $cs_lang['email_false'] . cs_html_br(1);
    }
    include_once 'mods/contact/trashmail.php';
    if (cs_trashmail($cs_user['users_email'])) {
        $error++;
        $errormsg .= $cs_lang['email_false'] . cs_html_br(1);
    }
    if (!empty($cs_user['users_sex'])) {
        $cs_user['users_sex'] = $cs_user['users_sex'] == 'male' ? 'male' : 'female';
    }
    $country = $cs_user['users_country'];
    $cs_user['users_country'] = isset($cs_country[$country]) ? $cs_user['users_country'] : 'fam';
    if ((int) $_POST['age_year'] . $_POST['age_month'] . $_POST['age_day'] > (int) cs_datereal('Ymd')) {
        $error++;
        $errormsg .= $cs_lang['age_false'] . cs_html_br(1);
    }
} else {
    $cells = 'users_nick, users_name, users_surname, users_sex, users_age, users_height, users_country, users_postalcode, users_place, users_adress, users_icq, users_jabber, users_skype, users_email, users_url, users_phone, users_mobile, users_info, users_hidden';
    $cs_user = cs_sql_select(__FILE__, 'users', $cells, "users_id = '" . $account['users_id'] . "'");
    $hidden = explode(',', $cs_user['users_hidden']);
}
if (!isset($_POST['submit'])) {
    $data['users']['body'] = $cs_lang['errors_here'];
} elseif (!empty($error)) {
    $data['users']['body'] = $errormsg;
} else {
    $data['users']['body'] = $cs_lang['changes_done'];
}
Beispiel #17
0
    }
} else {
    $data['join']['games_id'] = '';
    $data['join']['squads_id'] = '';
    $data['join']['joinus_nick'] = '';
    $data['join']['joinus_name'] = '';
    $data['join']['joinus_surname'] = '';
    $data['join']['joinus_age'] = 0;
    $data['join']['joinus_country'] = 'fam';
    $data['join']['joinus_place'] = '';
    $data['join']['joinus_icq'] = '';
    $data['join']['joinus_jabber'] = '';
    $data['join']['joinus_email'] = '';
    $data['join']['joinus_lanact'] = '';
    $data['join']['joinus_webcon'] = '';
    $data['join']['joinus_date'] = cs_datereal('Y-m-d');
    $data['join']['joinus_more'] = '';
    $data['join']['users_pwd'] = '';
    $data2['join']['joinus_rules'] = 0;
    if (!empty($account['users_id'])) {
        $fetch = 'users_nick, users_name, users_surname, users_age, users_country, users_place, users_icq, users_jabber, users_email';
        $cs_user = cs_sql_select(__FILE__, 'users', $fetch, "users_id = '" . $account['users_id'] . "'");
        $data['join']['joinus_nick'] = $cs_user['users_nick'];
        $data['join']['joinus_name'] = $cs_user['users_name'];
        $data['join']['joinus_surname'] = $cs_user['users_surname'];
        $data['join']['joinus_age'] = $cs_user['users_age'];
        $data['join']['joinus_country'] = $cs_user['users_country'];
        $data['join']['joinus_place'] = $cs_user['users_place'];
        $data['join']['joinus_icq'] = empty($cs_user['users_icq']) ? '' : $cs_user['users_icq'];
        $data['join']['joinus_jabber'] = $cs_user['users_jabber'];
        $data['join']['joinus_email'] = $cs_user['users_email'];