case 'confirmdel': account_del_confirm((int) $_GET['id'], strsave($_GET['code'])); break; case 'delmsg': account_del_msg((int) $_GET['id']); break; case 'newmsg': account_new_msg(); break; case 'stats': account_stats(); break; case 'guestbook': $conditions['action'] = 'add'; $conditions['link'] = '?section=account&action=guestbook'; comments_get('user', $_SESSION['userID'], $conditions, 0, 1, "user"); break; case 'addcomment': $conditions['action'] = 'add'; $conditions['link'] = '?section=account&action=guestbook'; comments_add('user', $_SESSION['userID'], $conditions, "user"); break; case 'editcomment': $conditions['action'] = 'edit'; $conditions['link'] = '?section=account&action=guestbook'; comments_edit('user', $_SESSION['userID'], (int) $_GET['id'], $conditions, "user"); break; default: account(); } // Funktionen für nicht angemelde User //
$content = ob_get_contents(); ob_end_clean(); main_content(AWARDS, $content, '', 1); } else { table(ERROR, NO_ENTRIES_ID); } } $conditions = array('LIMIT' => LIMIT_COMMENTS, 'ORDER' => COMMENTS_ORDER, 'SPAM' => SPAM_AWARDS_COMMENTS, 'section' => 'awards'); if (isset($_GET['action'])) { switch ($_GET['action']) { case 'view': if (@$_SESSION['rights']['public']['awards']['view'] or @$_SESSION['rights']['superadmin']) { awards_view((int) $_GET['id']); $conditions['action'] = 'add'; $conditions['link'] = '?section=news&action=comments&id=' . (int) $_GET['id']; comments_get('awards', (int) $_GET['id'], $conditions); } else { echo table(ACCESS_DENIED, NO_ACCESS_RIGHTS); } break; case 'addcomment': if (@$_SESSION['rights']['public']['awards']['com_add'] or @$_SESSION['rights']['superadmin']) { $conditions['action'] = 'add'; $conditions['link'] = '?section=awards&action=view&id=' . (int) $_GET['id']; comments_add('awards', (int) $_GET['id'], $conditions); } else { echo table(ACCESS_DENIED, NO_ACCESS_RIGHTS); } break; case 'editcomment': $conditions['action'] = 'edit';
} if (@$_SESSION['rights']['public']['gallery']['view'] or @$_SESSION['rights']['superadmin']) { $conditions = array('LIMIT' => LIMIT_COMMENTS, 'ORDER' => COMMENTS_ORDER, 'SPAM' => SPAM_GALLERY_COMMENTS, 'section' => 'gallery'); if (isset($_GET['action'])) { switch ($_GET['action']) { case 'kate': gallery_kate((int) $_GET['id']); break; case 'gallery': gallery_gallery((int) $_GET['id']); break; case 'viewpic': gallery_viewpic((int) $_GET['id']); $conditions['action'] = 'add'; $conditions['link'] = '?section=gallery&action=viewpic&id=' . (int) $_GET['id']; comments_get('gallery', (int) $_GET['id'], $conditions); break; case 'addcomment': if (@$_SESSION['rights']['public']['gallery']['com_add'] or @$_SESSION['rights']['superadmin']) { $conditions['action'] = 'add'; $conditions['link'] = '?section=gallery&action=viewpic&id=' . (int) $_GET['id']; comments_add('gallery', (int) $_GET['id'], $conditions); } else { echo table(ACCESS_DENIED, NO_ACCESS_RIGHTS); } break; case 'editcomment': $conditions['action'] = 'edit'; $conditions['link'] = '?section=gallery&action=viewpic&id=' . (int) $_GET['subid']; comments_edit('gallery', (int) $_GET['subid'], (int) $_GET['id'], $conditions); break;
} $conditions = array('LIMIT' => LIMIT_COMMENTS, 'ORDER' => COMMENTS_ORDER, 'SPAM' => SPAM_NEWS_COMMENTS, 'section' => 'news'); if (isset($_GET['action'])) { switch ($_GET['action']) { case 'topic': news((int) @$_GET['id']); break; case 'archiv': news_archiv((int) @$_GET['tid']); break; case 'comments': if (@$_SESSION['rights']['public']['news']['com_view'] or @$_SESSION['rights']['superadmin']) { news_once((int) $_GET['id']); $conditions['action'] = 'add'; $conditions['link'] = '?section=news&action=comments&id=' . (int) $_GET['id']; comments_get('news', (int) $_GET['id'], $conditions); } else { echo table(ACCESS_DENIED, NO_ACCESS_RIGHTS); } break; case 'addcomment': if (@$_SESSION['rights']['public']['news']['com_add'] or @$_SESSION['rights']['superadmin']) { $conditions['action'] = 'add'; $conditions['link'] = '?section=news&action=comments&id=' . (int) $_GET['id']; comments_add('news', (int) $_GET['id'], $conditions); } else { echo table(ACCESS_DENIED, NO_ACCESS_RIGHTS); } break; case 'editcomment': $conditions['action'] = 'edit';
$error = ERROR_FORUM_UPLOAD; } } else { $error = ACCESS_DENIED; } if (isset($error)) { echo html_ajax_convert(json_encode(array('result' => 'failed', 'error' => $error))); } else { echo html_ajax_convert(json_encode(array('result' => 'success', 'size' => str_replace('{datei}', $_FILES['Filedata']['name'], UPLOAD_SUCCESS)))); } break; case "getcomments": $conditions = array('LIMIT' => LIMIT_COMMENTS, 'ORDER' => $_GET['bereich'] == 'guestbook' ? 'DESC' : COMMENTS_ORDER, 'section' => $_GET['bereich']); $conditions['action'] = 'add'; $conditions['link'] = ''; comments_get($_GET['bereich'], (int) $_GET['id'], $conditions, 1); break; case "get_user_messages": if (isset($_SESSION['userID'])) { if ($_GET['mode'] == 'in') { $tpl = new Smarty(); $anzahl = $db->result(DB_PRE . 'ecp_messages', 'COUNT(msgID)', 'touser = '******'userID'] . ' AND del = 0'); if ($anzahl) { $limits = get_sql_limit($anzahl, LIMIT_MESSAGES); $db->query('SELECT `msgID`, `fromuser`, `title`, `datum`, `readed`, username, country FROM ' . DB_PRE . 'ecp_messages LEFT JOIN ' . DB_PRE . 'ecp_user ON (ID = fromuser) WHERE del = 0 AND touser = '******'userID'] . ' ORDER BY datum DESC LIMIT ' . $limits[1] . ',' . LIMIT_MESSAGES); $msgin = array(); while ($row = $db->fetch_assoc()) { $row['datum'] = date(LONG_DATE, $row['datum']); $msgin[] = $row; } $tpl->assign('messages', $msgin);
$content = ob_get_contents(); ob_end_clean(); main_content(SURVEY, $content, '', 1); } else { table(INFO, NO_ENTRIES_ID); } } $conditions = array('LIMIT' => LIMIT_COMMENTS, 'ORDER' => COMMENTS_ORDER, 'SPAM' => SPAM_SURVEY_COMMENTS, 'section' => 'survey'); if (isset($_GET['action'])) { switch ($_GET['action']) { case 'viewsurvey': if (@$_SESSION['rights']['public']['survey']['com_view'] or @$_SESSION['rights']['superadmin']) { survey_view((int) $_GET['id']); $conditions['action'] = 'add'; $conditions['link'] = '?section=survey&action=viewsurvey&id=' . (int) $_GET['id']; comments_get('survey', (int) $_GET['id'], $conditions); } else { echo table(ACCESS_DENIED, NO_ACCESS_RIGHTS); } break; case 'vote': if (@$_SESSION['rights']['public']['survey']['view'] or @$_SESSION['rights']['superadmin']) { survey_vote((int) $_GET['id']); } else { echo table(ACCESS_DENIED, NO_ACCESS_RIGHTS); } break; case 'addcomment': if (@$_SESSION['rights']['public']['survey']['com_add'] or @$_SESSION['rights']['superadmin']) { $conditions['action'] = 'add'; $conditions['link'] = '?section=survey&action=viewsurvey&id=' . (int) $_GET['id'];
if (isset($_GET['action'])) { $action = $_GET['action']; } else { $action = ''; } if ($action == 'add') { if (!empty($_POST)) { // ваш секретный ключ $secret = "6Lf_OQ4TAAAAAODrO91tDS6tpsUk5LT2Jc0jsJ3K"; // пустой ответ $response = null; // проверка секретного ключа $reCaptcha = new ReCaptcha($secret); if ($_POST["g-recaptcha-response"]) { $response = $reCaptcha->verifyResponse($_SERVER["REMOTE_ADDR"], $_POST["g-recaptcha-response"]); } if ($response != null && $response->success) { $article_id = (int) $_GET['id']; add_comment($link, $_POST['name'], $_POST['email'], $_POST['url'], $_POST['comment'], $article_id); header("Location: http://localhost:8080/gitrepo/article.php?id={$article_id}"); } else { $article_id = (int) $_GET['id']; header("Location: http://localhost:8080/gitrepo/article.php?id={$article_id}"); } } include "Views/article.html"; $comments = comments_get($link, $article_id); } else { $articles = articles_all($link); include "Views/articles.php"; }
function clanwars_view($id) { global $db, $countries; $db->query('SELECT `warID`, ' . DB_PRE . 'ecp_wars.datum, `result`, `resultscore`, `tname`, `oppname`, `country`, ' . DB_PRE . 'ecp_wars_opp.homepage, `icon`, `gamename`, `matchtypename`, COUNT(comID) as comments, matchtypename, oppshort, ownplayers, oppplayers, xonx, matchlink, report FROM ' . DB_PRE . 'ecp_wars LEFT JOIN ' . DB_PRE . 'ecp_teams ON ' . DB_PRE . 'ecp_teams.tID = ' . DB_PRE . 'ecp_wars.tID LEFT JOIN ' . DB_PRE . 'ecp_wars_games ON gID = gameID LEFT JOIN ' . DB_PRE . 'ecp_wars_opp ON oID = oppID LEFT JOIN ' . DB_PRE . 'ecp_wars_matchtype ON mID = matchtypeID LEFT JOIN ' . DB_PRE . 'ecp_comments ON (subID = warID AND bereich = "clanwars") WHERE warID = ' . $id . ' GROUP BY warID'); if ($db->num_rows()) { $tpl = new smarty(); $row = $db->fetch_assoc(); $report = json_decode($row['report'], true); if (isset($report[LANGUAGE])) { $row['report'] = $report[LANGUAGE]; } else { $row['report'] = @$report['de']; } $row['datum'] = date(LONG_DATE, $row['datum']); $row['countryname'] = $countries[$row['country']]; $own = explode(',', $row['ownplayers']); foreach ($own as $value) { if ($value) { @($search .= ' OR ID = ' . (int) $value); } } $db->query('SELECT username, ID FROM ' . DB_PRE . 'ecp_user WHERE ID = 0' . @$search . ' ORDER BY username ASC'); while ($subrow = $db->fetch_assoc()) { @($players .= '<a href="?section=user&id=' . $subrow['ID'] . '">' . htmlspecialchars($subrow['username']) . '</a>, '); } $row['ownplayers'] = substr(@$players, 0, strlen(@$players) - 2); foreach ($row as $key => $value) { $tpl->assign($key, $value); } $result = $db->query('SELECT scoreID, locationname, ownscore, oppscore FROM ' . DB_PRE . 'ecp_wars_scores LEFT JOIN ' . DB_PRE . 'ecp_wars_locations ON lID = locationID WHERE wID = ' . $id); $locations = array(); while ($s = mysql_fetch_assoc($result)) { if (file_exists('images/maps/' . $s['locationname'] . '.jpg')) { $s['exist'] = true; } if ($s['ownscore'] > $s['oppscore']) { $s['own_result'] = 'win'; $s['opp_result'] = 'loss'; } elseif ($s['ownscore'] < $s['oppscore']) { $s['own_result'] = 'loss'; $s['opp_result'] = 'win'; } else { $s['own_result'] = 'draw'; $s['opp_result'] = 'draw'; } $screens = array(); $i = 0; $db->query('SELECT filename FROM ' . DB_PRE . 'ecp_wars_screens WHERE sID = ' . $s['scoreID'] . ' AND wID = ' . $id); while ($pic = $db->fetch_assoc()) { $pic['i'] = @++$i; $screens[] = $pic; } $s['screens'] = $screens; $locations[] = $s; @($maps .= ', ' . $s['locationname']); } $tpl->assign('locations', substr($maps, 2)); $tpl->assign('maps', $locations); ob_start(); $tpl->display(DESIGN . '/tpl/clanwars/detail.html'); $content = ob_get_contents(); ob_end_clean(); main_content(CLANWAR_DETAIL, $content, '', 1); if (@$_SESSION['rights']['public']['clanwars']['com_view'] or @$_SESSION['rights']['superadmin']) { $conditions = array('LIMIT' => LIMIT_COMMENTS, 'ORDER' => COMMENTS_ORDER, 'SPAM' => SPAM_CLANWARS_COMMENTS, 'section' => 'clanwars'); $conditions['action'] = 'add'; $conditions['link'] = '?section=clanwars&action=view&id=' . $id; comments_get('clanwars', $id, $conditions); } else { echo table(ACCESS_DENIED, NO_RIGHTS_READ_COMMENT); } } else { table(ERROR, NO_ENTRIES_ID); } }
$conditions = array('LIMIT' => LIMIT_COMMENTS, 'ORDER' => COMMENTS_ORDER, 'SPAM' => SPAM_GUESTBOOK_COMMENTS, 'section' => 'guestbook'); if (isset($_GET['action'])) { switch ($_GET['action']) { case 'add': if (@$_SESSION['rights']['public']['guestbook']['add'] or @$_SESSION['rights']['superadmin']) { guestbook_add(); } else { echo table(ACCESS_DENIED, NO_ACCESS_RIGHTS); } break; case 'comments': if (@$_SESSION['rights']['public']['guestbook']['com_view'] or @$_SESSION['rights']['superadmin']) { gb_once((int) $_GET['id']); $conditions['action'] = 'add'; $conditions['link'] = '?section=guestbook&action=comments&id=' . (int) $_GET['id']; comments_get('gb_com', (int) $_GET['id'], $conditions, 0, 1, 'guestbook'); } else { echo table(ACCESS_DENIED, NO_ACCESS_RIGHTS); } break; case 'addcomment': if (@$_SESSION['rights']['public']['guestbook']['com_add'] or @$_SESSION['rights']['superadmin']) { $conditions['action'] = 'add'; $conditions['link'] = '?section=guestbook&action=comments&id=' . (int) $_GET['id']; comments_add('gb_com', (int) $_GET['id'], $conditions, 'guestbook'); } else { echo table(ACCESS_DENIED, NO_ACCESS_RIGHTS); } break; case 'editcomment': $conditions['action'] = 'edit';
function user_details($id) { if (@$_SESSION['rights']['public']['user']['view'] or @$_SESSION['rights']['superadmin']) { global $db, $countries, $groups; $data = $db->fetch_assoc('SELECT ID, `username`, `country`, `sex`, `signatur`, `realname`, `wohnort`, `geburtstag`, `homepage`, `icq`, `msn`, `yahoo`, `skype`, `xfire`, `aim`, `clanname`, `clanirc`, `clanhomepage`, `clanhistory`, `cpu`, `mainboard`, `ram`, `gkarte`, `skarte`, `monitor`, `maus`, `tastatur`, `mauspad`, `internet`, `festplatte`, `headset`, `aboutme`, lastlogin, registerdate, uID AS online, user_pic FROM ' . DB_PRE . 'ecp_user LEFT JOIN ' . DB_PRE . 'ecp_online ON (uID = ' . $id . ' AND lastklick > ' . (time() - SHOW_USER_ONLINE) . ') WHERE ID = ' . $id . ' GROUP BY ID'); if (isset($data['username'])) { if (isset($_SESSION['userID']) and $_SESSION['userID'] != $id) { $db->query('UPDATE ' . DB_PRE . 'ecp_user_lastvisits SET datum = ' . time() . ' WHERE userID = ' . $id . ' AND visitID = ' . $_SESSION['userID']); if ($db->affekt_rows() == 0) { $db->query('INSERT INTO ' . DB_PRE . 'ecp_user_lastvisits (userID, visitID, datum) VALUES (' . $id . ', ' . $_SESSION['userID'] . ', ' . time() . ')'); } $anzahl = $db->result(DB_PRE . 'ecp_user_lastvisits', 'COUNT(userID)', 'userID = ' . $id); if ($anzahl > 10) { $db->query('DELETE FROM ' . DB_PRE . 'ecp_user_lastvisits WHERE userID =' . $id . ' LIMIT ' . ($anzahl - 10)); } } if (!isset($_SESSION['profil'][$id]) and @$_SESSION['userID'] != $id) { $db->query('UPDATE ' . DB_PRE . 'ecp_user_stats SET profilhits = profilhits + 1 WHERE userID = ' . $id); $_SESSION['profil'][$id] = true; } $tpl = new smarty(); $data['ID'] = format_nr($data['ID']); $data['homepage'] = check_url_length($data['homepage']); $data['clanhomepage'] = check_url_length($data['clanhomepage']); $data['registerdate'] = date(LONG_DATE, $data['registerdate']); if ($data['lastlogin'] == 0) { $data['lastlogin'] = NEVER_LOGGED_IN; } else { $data['lastlogin'] = date(LONG_DATE, $data['lastlogin']); } $data['countryname'] = $countries[$data['country']]; if ($data['geburtstag'] == '0000-00-00') { $data['geburtstag'] = ''; } if ($data['geburtstag']) { $birthday = explode('-', $data['geburtstag']); $data['geburtstag'] = $birthday[2] . '.' . $birthday[1] . '.' . $birthday[0]; $alter = alter($birthday[2], $birthday[1], $birthday[0]); if (date('m') == $birthday[1] and date('d') < $birthday[2]) { $alter -= 1; } $next = @mktime(0, 0, 0, $birthday[1], $birthday[2], $birthday[0] + $alter + 1) - time(); $tpl->assign('alter', $alter); if (date('m') == $birthday[1] and date('d') == $birthday[2]) { $tpl->assign('next', BIRTH_TODAY); } else { $tpl->assign('next', round(($next + 86400) / 60 / 60 / 24) . ' ' . DAYS); } } $data['icqtrim'] = str_replace('-', '', $data['icq']); $data['sextext'] = $data['sex'] == 'male' ? MALE : FEMALE; foreach ($data as $key => $value) { $tpl->assign($key, $value); } ob_start(); $conditions = array('LIMIT' => LIMIT_COMMENTS, 'ORDER' => 'DESC', 'SPAM' => SPAM_USER_GB_COMMENTS, 'section' => 'user'); $conditions['action'] = 'add'; $conditions['link'] = '?section=user&view=gb&id=' . $id; comments_get('user', $id, $conditions, 0, 0); $content = ob_get_contents(); $tpl->assign('guestbook', $content); ob_end_clean(); $db->query('SELECT buddyID, username, country, uID as online, user_pic, lastlogin, sex FROM ' . DB_PRE . 'ecp_buddy LEFT JOIN ' . DB_PRE . 'ecp_user ON (buddyID = ID) LEFT JOIN ' . DB_PRE . 'ecp_online ON (uID = buddyID AND lastklick > ' . (time() - SHOW_USER_ONLINE) . ') WHERE userID = ' . $id . ' GROUP BY buddyID ORDER BY online DESC,username ASC'); $buddy = array(); while ($row = $db->fetch_assoc()) { if ($row['lastlogin'] == 0) { $row['lastlogin'] = NEVER_LOGGED_IN; } else { $row['lastlogin'] = date(SHORT_DATE, $row['lastlogin']); } $buddy[] = $row; } $tpl->assign('buddies', $buddy); $last = array(); $db->query('SELECT visitID, username, country, datum, uID as online FROM ' . DB_PRE . 'ecp_user_lastvisits LEFT JOIN ' . DB_PRE . 'ecp_user ON visitID = ID LEFT JOIN ' . DB_PRE . 'ecp_online ON (uID = visitID AND lastklick > ' . (time() - SHOW_USER_ONLINE) . ') WHERE userID = ' . $id . ' GROUP BY visitID ORDER BY datum DESC'); while ($row = $db->fetch_assoc()) { $row['countryname'] = $countries[$row['country']]; $row['time'] = goodtime(time() - $row['datum'], 4); $last[] = $row; } $tpl->assign('last', $last); $user = $db->fetch_assoc('SELECT `registerdate`, rankname, `clicks`, `logins`, `comments`, a.money, iconname, `msg_s`, `msg_r`, `profilhits`, `scheine`, `2er`, `3er`, `4er`, COUNT(b.scheinID) as scheine FROM ' . DB_PRE . 'ecp_user LEFT JOIN ' . DB_PRE . 'ecp_user_stats as a ON (a.userID = ID) LEFT JOIN ' . DB_PRE . 'ecp_ranks ON (rID = rankID) LEFT JOIN ' . DB_PRE . 'ecp_lotto_scheine as b ON (b.userID = ID) WHERE ID = ' . $id . ' GROUP BY ID'); $db->query('SELECT SUM(gewinn) as gewinn, art FROM ' . DB_PRE . 'ecp_lotto_gewinner WHERE userID = ' . $id . ' GROUP BY art'); $user['wonmoney'] = 0; $user['2ermoney'] = 0; $user['3ermoney'] = 0; $user['4ermoney'] = 0; while ($row = $db->fetch_assoc()) { $user['wonmoney'] += $row['gewinn']; $user[$row['art'] . 'ermoney'] = $row['gewinn']; } $user['runden'] = $db->result(DB_PRE . 'ecp_lotto_scheine', 'COUNT(DISTINCT(rundenID)) as runden', 'userID = ' . $id); $user['gesamtrunden'] = mysql_result($db->query('SHOW TABLE STATUS LIKE "' . DB_PRE . 'ecp_lotto_runden"'), 0, 'Auto_increment') - 1; $user['tage'] = ceil((time() - $user['registerdate']) / 86400); $user['teilqoute'] = format_nr($user['runden'] / ($user['gesamtrunden'] == 0 ? 1 : $user['gesamtrunden']) * 100, 2); $user['scheinrunde'] = format_nr($user['scheine'] / ($user['runden'] == 0 ? 1 : $user['runden']), 2); $user['winscheine'] = format_nr($user['2er'] + $user['3er'] + $user['4er']); $user['winqoute'] = format_nr($user['winscheine'] / ($user['scheine'] == 0 ? 1 : $user['scheine']) * 100, 2); $user['registerdate'] = date(LONG_DATE, $user['registerdate']); $user['2erpro'] = format_nr($user['2er'] / ($user['winscheine'] == 0 ? 1 : $user['winscheine']) * 100, 2); $user['3erpro'] = format_nr($user['3er'] / ($user['winscheine'] == 0 ? 1 : $user['winscheine']) * 100, 2); $user['4erpro'] = format_nr($user['4er'] / ($user['winscheine'] == 0 ? 1 : $user['winscheine']) * 100, 2); $user['2ermpro'] = format_nr($user['2ermoney'] / ($user['wonmoney'] == 0 ? 1 : $user['wonmoney']) * 100, 2); $user['3ermpro'] = format_nr($user['3ermoney'] / ($user['wonmoney'] == 0 ? 1 : $user['wonmoney']) * 100, 2); $user['4ermpro'] = format_nr($user['4ermoney'] / ($user['wonmoney'] == 0 ? 1 : $user['wonmoney']) * 100, 2); foreach ($user as $key => $value) { if ($key == 'clicks' or $key == 'comments' or $key == 'gesamtrunden' or $key == 'runden' or $key == 'msg_s' or $key == 'msg_r' or $key == 'profilhits' or $key == 'scheine' or $key == '2er' or $key == '3er' or $key == '4er') { $value = format_nr($value); } if ($key == 'money' or $key == 'wonmoney' or $key == '2ermoney' or $key == '3ermoney' or $key == '4ermoney') { $value = format_nr($value, 2); } $tpl->assign($key, $value); } $db->query('SELECT `awardID`, `eventname`, `eventdatum`, `url`, `platz`, `teamID`, `gID`, `preis`, tname, icon, gamename, COUNT(comID) as comments FROM `' . DB_PRE . 'ecp_awards` LEFT JOIN ' . DB_PRE . 'ecp_teams ON tID = teamID LEFT JOIN ' . DB_PRE . 'ecp_wars_games ON gameID = gID LEFT JOIN ' . DB_PRE . 'ecp_comments ON (bereich = "awards" AND subID = awardID) WHERE spieler LIKE "%,' . $id . ',%" GROUP BY awardID ORDER BY eventdatum DESC'); $awards = array(); while ($row = $db->fetch_assoc()) { $row['eventdatum'] = date('d.m.Y', $row['eventdatum']); $awards[] = $row; } $tpl->assign('awards', $awards); $tpl->assign('award', count($awards)); $db->query('SELECT `warID`, ' . DB_PRE . 'ecp_wars.datum, `result`, `resultscore`, `tname`, `oppname`, `country`, ' . DB_PRE . 'ecp_wars_opp.homepage, `icon`, `gamename`, `matchtypename`, COUNT(comID) as comments FROM ' . DB_PRE . 'ecp_wars LEFT JOIN ' . DB_PRE . 'ecp_teams ON ' . DB_PRE . 'ecp_teams.tID = ' . DB_PRE . 'ecp_wars.tID LEFT JOIN ' . DB_PRE . 'ecp_wars_games ON gID = gameID LEFT JOIN ' . DB_PRE . 'ecp_wars_opp ON oID = oppID LEFT JOIN ' . DB_PRE . 'ecp_wars_matchtype ON mID = matchtypeID LEFT JOIN ' . DB_PRE . 'ecp_comments ON (subID = warID AND bereich = "clanwars") WHERE status = 1 AND ownplayers LIKE "%,' . $id . ',%" GROUP BY warID ORDER BY datum DESC'); $clanwars = array(); while ($row = $db->fetch_assoc()) { $row['datum'] = date('d.m.y', $row['datum']); $row['countryname'] = $countries[$row['country']]; $clanwars[] = $row; } $tpl->assign('clanwars', $clanwars); $tpl->assign('clanwar', count($clanwars)); ob_start(); $tpl->display(DESIGN . '/tpl/user/user_stats.html'); $content = ob_get_contents(); ob_end_clean(); $tpl->assign('stats', $content); ob_start(); $db->query('SELECT gID, name FROM `' . DB_PRE . 'ecp_user_groups` LEFT JOIN `' . DB_PRE . 'ecp_groups` ON (gID = groupID) WHERE userID = ' . $id . ' ORDER BY name ASC'); $gruppen = array(); while ($row = $db->fetch_assoc()) { if (array_key_exists($row['name'], $groups)) { $row['name'] = $groups[$row['name']]; } $gruppen[] = $row; } $tpl->assign('gruppen', $gruppen); $tpl->display(DESIGN . '/tpl/user/user_details.html'); $content = ob_get_contents(); ob_end_clean(); main_content(USER_PROFIL, $content, '', 1); } else { table(ERROR, NO_ENTRIES_ID); } } else { table(ERROR, ACCESS_DENIED); } }
function dl_view($id) { global $db; $row = $db->fetch_assoc('SELECT dID, name, ' . DB_PRE . 'ecp_downloads.userID, info, kID, subkID, kname, ' . DB_PRE . 'ecp_downloads.homepage, version, size, traffic, downloads, ' . DB_PRE . 'ecp_downloads.datum, COUNT(comID) as comments, username FROM ' . DB_PRE . 'ecp_downloads LEFT JOIN ' . DB_PRE . 'ecp_user ON (' . DB_PRE . 'ecp_downloads.userID = ID) LEFT JOIN ' . DB_PRE . 'ecp_comments ON (bereich = "downloads" AND subID = dID) LEFT JOIN ' . DB_PRE . 'ecp_downloads_kate ON (kID = cID) WHERE dID = ' . $id . ' AND (' . DB_PRE . 'ecp_downloads.access = "" OR ' . str_replace('access', DB_PRE . 'ecp_downloads.access', $_SESSION['access_search']) . ') GROUP BY dID ORDER BY name ASC'); if (isset($row['dID'])) { $tpl = new smarty(); if ($row['subkID']) { $tpl->assign('pfad', dl_get_path($row['kID']) . '->' . $row['name']); } else { $tpl->assign('pfad', '<a href="?section=downloads">' . OVERVIEW . '</a>-><a href="?section=downloads&action=viewkate&id=' . $row['kID'] . '">' . $row['kname'] . '</a>' . '->' . $row['name']); } $row['size'] = goodsize($row['size']); $row['datum'] = date(LONG_DATE, $row['datum']); $row['traffic'] = goodsize($row['traffic']); $row['downloads'] = number_format($row['downloads'], 0, ',', '.'); $lang = json_decode($row['info'], true); if (isset($lang[LANGUAGE])) { $row['info'] = $lang[LANGUAGE]; } else { $row['info'] = @$lang['de']; } foreach ($row as $key => $value) { $tpl->assign($key, $value); } ob_start(); $tpl->display(DESIGN . '/tpl/downloads/download_view.html'); $content = ob_get_contents(); ob_end_clean(); main_content(DOWNLOADS, $content, '', 1); if (@$_SESSION['rights']['public']['downloads']['com_view'] or @$_SESSION['rights']['superadmin']) { $conditions = array('LIMIT' => LIMIT_COMMENTS, 'ORDER' => COMMENTS_ORDER, 'SPAM' => SPAM_DOWNLOADS_COMMENTS, 'section' => 'downloads'); $conditions['action'] = 'add'; $conditions['link'] = '?section=downloads&action=viewdl&id=' . $id; comments_get('downloads', $id, $conditions); } } else { table(ACCESS_DENIED, NO_ACCESS_RIGHTS); } }