function motm() { global $db, $allowHover; $userpics = get_files(basePath . '/inc/images/uploads/userpics/'); $qry = db("SELECT * FROM " . $db['users'] . " WHERE level >= 2"); while ($rs = _fetch($qry)) { foreach ($userpics as $userpic) { $tmpId = intval($userpic); if ($tmpId == $rs['id']) { $temparr[] = $rs['id']; $a++; break; } } } $arrayID = rand(0, count($temparr) - 1); $uid = $temparr[$arrayID]; $get = _fetch(db("SELECT * FROM " . $db['users'] . " WHERE id = '" . $uid . "'")); if (!empty($get) && !empty($temparr)) { $status = $get['status'] == 1 || $get['level'] == 1 ? _aktiv : _inaktiv; if ($allowHover == 1) { $info = 'onmouseover="DZCP.showInfo(\'<tr><td colspan=2 align=center padding=3 class=infoTop>' . rawautor($get['id']) . '</td></tr><tr><td width=80px><b>' . _posi . ':</b></td><td>' . getrank($get['id']) . '</td></tr><tr><td><b>' . _status . ':</b></td><td>' . $status . '</td></tr><tr><td><b>' . _age . ':</b></td><td>' . getAge($get['bday']) . '</td></tr><tr><td colspan=2 align=center>' . jsconvert(userpic($get['id'])) . '</td></tr>\')" onmouseout="DZCP.hideInfo()"'; } $member = show("menu/motm", array("uid" => $get['id'], "upic" => userpic($get['id'], 130, 161), "info" => $info)); } else { $member = ''; } return empty($member) ? '' : '<table class="navContent" cellspacing="0">' . $member . '</table>'; }
function counter() { //$sql_prefix hinzufügen global $db, $today, $counter_start, $useronline, $where, $isSpider, $sql_prefix; if (!$isSpider) { $qry2day = db("SELECT visitors FROM " . $db['counter'] . "\n WHERE today = '" . $today . "'"); if (_rows($qry2day)) { $get2day = _fetch($qry2day); $v_today = $get2day['visitors']; } else { $v_today = 0; } $gestern = time() - 86400; $tag = date("j", $gestern); $monat = date("n", $gestern); $jahr = date("Y", $gestern); $yesterday = $tag . "." . $monat . "." . $jahr; $qryyday = db("SELECT visitors FROM " . $db['counter'] . "\n WHERE today = '" . $yesterday . "'"); if (_rows($qryyday)) { $getyday = _fetch($qryyday); $yDay = $getyday['visitors']; } else { $yDay = 0; } $qrystats = db("SELECT SUM(visitors) AS allvisitors,\n MAX(visitors) AS maxvisitors,\n MAX(maxonline) AS maxonline,\n AVG(visitors) AS avgvisitors,\n SUM(visitors) AS allvisitors\n FROM " . $db['counter'] . ""); $getstats = _fetch($qrystats); if (abs(online_reg()) != 0) { $qryo = db("SELECT id FROM " . $db['users'] . "\n WHERE time+'" . $useronline . "'>'" . time() . "'\n AND online = 1\n ORDER BY nick"); while ($geto = _fetch($qryo)) { $ousers .= '<tr><td>' . rawautor($geto['id']) . '</td><td align=right valign=middle><small>' . jsconvert(getrank($geto['id'])) . '</small></td></tr>'; } $info = 'onmouseover="DZCP.showInfo(\'<tr><td colspan=2 align=center padding=3 class=infoTop>' . _online_head . '</td></tr><tr><td><table width=100% cellpadding=0 cellspacing=0>' . $ousers . '</table></td></tr>\')" onmouseout="DZCP.hideInfo()"'; } //Klicks Mod if (strpos($_SERVER['PHP_SELF'], "/admin/") !== false) { $clicksnumber = "-"; } else { if ($_SERVER['QUERY_STRING'] != "") { $whereclicks = $_SERVER['PHP_SELF'] . "?" . $_SERVER['QUERY_STRING']; } else { $whereclicks = $_SERVER['PHP_SELF']; } $clicksrownumber = mysql_num_rows(db("SELECT klicks FROM " . $sql_prefix . "klicks WHERE wo = '" . $whereclicks . "'")); if ($clicksrownumber == 0) { $qry = db("INSERT INTO " . $sql_prefix . "klicks \n SET `wo` = '" . $whereclicks . "',\n `klicks` = '1'"); $clicksnumber = 1; } else { $clicksnumber = mysql_fetch_array(db("SELECT klicks FROM " . $sql_prefix . "klicks WHERE wo = '" . $whereclicks . "'")); $clicksnumber = $clicksnumber[0] + 1; $qry = db("UPDATE " . $sql_prefix . "klicks SET klicks = '" . $clicksnumber . "' WHERE wo LIKE '" . $whereclicks . "'"); } } //Klicks Mod Ende $counter = show("menu/counter", array("v_today" => $v_today, "aufrufe" => $clicksnumber, "v_yesterday" => $yDay, "v_all" => $getstats['allvisitors'] + $counter_start, "v_perday" => round($getstats['avgvisitors'], 2), "v_max" => $getstats['maxvisitors'], "g_online" => abs(online_guests($where) - online_reg()), "u_online" => abs(online_reg()), "info" => $info, "v_online" => $getstats['maxonline'], "head_online" => _head_online, "head_visits" => _head_visits, "head_max" => _head_max, "user" => _cnt_user, "guests" => _cnt_guests, "today" => _cnt_today, "yesterday" => _cnt_yesterday, "all" => _cnt_all, "percentperday" => _cnt_pperday, "perday" => _cnt_perday, "online" => _cnt_online)); return '<table class="navContent" cellspacing="0">' . $counter . '</table>'; } }
function team($tID = '') { global $db, $teamRow, $l_team; //SQL if (!empty($tID)) { $where = "WHERE id = '" . intval($tID) . "' AND navi = 1"; } else { $where = "WHERE navi = '1' ORDER BY RAND()"; } $get = _fetch(db("SELECT * FROM " . $db['squads'] . " " . $where . "")); //Members $qrym = db("SELECT s1.squad,s2.id,s2.level,s2.nick,s2.status,s2.rlname,s2.bday,s4.position\n FROM " . $db['squaduser'] . " AS s1\n LEFT JOIN " . $db['users'] . " AS s2\n ON s2.id=s1.user\n LEFT JOIN " . $db['userpos'] . " AS s3\n ON s3.squad=s1.squad AND s3.user=s1.user\n LEFT JOIN " . $db['pos'] . " AS s4\n ON s4.id=s3.posi\n WHERE s1.squad='" . $get['id'] . "'\n AND s2.level != 0\n ORDER BY s4.pid"); $i = 1; $cnt = 0; while ($getm = _fetch($qrym)) { unset($tr1, $tr2); if ($i == 0 || $i == 1) { $tr1 = "<tr>"; } if ($i == $teamRow) { $tr2 = "</tr>"; $i = 0; } $status = $getm['status'] == 1 || $getm['level'] == 1 ? _aktiv : _inaktiv; $info = 'onmouseover="DZCP.showInfo(\'<tr><td colspan=2 align=center padding=3 class=infoTop>' . rawautor($getm['id']) . '</td></tr><tr><td width=80px><b>' . _posi . ':</b></td><td>' . getrank($getm['id'], $get['id']) . '</td></tr><tr><td><b>' . _status . ':</b></td><td>' . $status . '</td></tr><tr><td><b>' . _age . ':</b></td><td>' . getAge($getm['bday']) . '</td></tr><tr><td colspan=2 align=center>' . jsconvert(userpic($getm['id'])) . '</td></tr>\')" onmouseout="DZCP.hideInfo()"'; $member .= show("menu/team_show", array("pic" => userpic($getm['id'], 40, 50), "tr1" => $tr1, "tr2" => $tr2, "squad" => $get['id'], "info" => $info, "id" => $getm['id'], "width" => round(100 / $teamRow, 0))); $i++; $cnt++; } if (is_float($cnt / $teamRow)) { for ($e = $i; $e <= $teamRow; $e++) { $end .= '<td></td>'; } $end = $end . "</tr>"; } // Next / last ID $all = cnt($db['squads'], "WHERE `navi` = '1'"); $next = _fetch(db("SELECT id FROM " . $db['squads'] . " WHERE `navi` = '1' AND `id` > '" . $get['id'] . "' ORDER BY `id` ASC LIMIT 1")); if (empty($next)) { $next = _fetch(db("SELECT id FROM " . $db['squads'] . " WHERE `navi` = '1' ORDER BY `id` ASC LIMIT 1")); } $last = _fetch(db("SELECT id FROM " . $db['squads'] . " WHERE `navi` = '1' AND `id` < '" . $get['id'] . "' ORDER BY `id` DESC LIMIT 1")); if (empty($last)) { $last = _fetch(db("SELECT id FROM " . $db['squads'] . " WHERE `navi` = '1' ORDER BY `id` DESC LIMIT 1")); } //Output $team = show("menu/team", array("row" => $teamRow, "team" => re($get['name']), "id" => $get['id'], "next" => $next['id'], "last" => $last['id'], "br1" => $all <= 1 ? '<!--' : '', "br2" => $all <= 1 ? '-->' : '', "member" => $member, "end" => $end)); return '<div id="navTeam">' . $team . '</div>'; }
function newsticker() { global $db, $allowHover; if (!permission("intnews")) { $int = "AND intern = 0"; } $qry = db("SELECT id,titel,autor,datum,kat FROM " . $db['news'] . " WHERE public = '1'AND datum <= '" . time() . "' " . $int . " ORDER BY id DESC LIMIT 20"); while ($get = _fetch($qry)) { if ($allowHover == 1) { $getkat = _fetch(db("SELECT kategorie FROM " . $db['newskat'] . " WHERE id = '" . $get['kat'] . "'")); $info = 'onmouseover="DZCP.showInfo(\'<tr><td colspan=2 align=center padding=3 class=infoTop>' . jsconvert(re($get['titel'])) . '</td></tr><tr><td><b>' . _datum . ':</b></td><td>' . date("d.m.Y H:i", $get['datum']) . _uhr . '</td></tr><tr><td><b>' . _autor . ':</b></td><td>' . rawautor($get['autor']) . '</td></tr><tr><td><b>' . _news_admin_kat . ':</b></td><td>' . jsconvert(re($getkat['kategorie'])) . '</td></tr><tr><td><b>' . _comments_head . ':</b></td><td>' . cnt($db['newscomments'], "WHERE news = '" . $get['id'] . "'") . '</td></tr>\')" onmouseout="DZCP.hideInfo()"'; } $news .= '<a href="../news/?action=show&id=' . $get['id'] . '" ' . $info . '>' . re($get['titel']) . '</a> | '; } return show("menu/newsticker", array("news" => $news)); }
function l_artikel() { global $db, $maxlartikel, $lartikel, $allowHover; $qry = db("SELECT id,titel,text,autor,datum,kat,public FROM " . $db['artikel'] . "\n\t\t\t WHERE public = 1\n ORDER BY id DESC\n LIMIT " . $maxlartikel . ""); if (_rows($qry)) { while ($get = _fetch($qry)) { $qrykat = db("SELECT kategorie FROM " . $db['newskat'] . "\n WHERE id = '" . $get['kat'] . "'"); $getkat = _fetch($qrykat); $text = strip_tags($get['text']); if ($allowHover == 1) { $info = 'onmouseover="DZCP.showInfo(\'<tr><td colspan=2 align=center padding=3 class=infoTop>' . jsconvert(re($get['titel'])) . '</td></tr><tr><td><b>' . _datum . ':</b></td><td>' . date("d.m.Y H:i", $get['datum']) . _uhr . '</td></tr><tr><td><b>' . _autor . ':</b></td><td>' . rawautor($get['autor']) . '</td></tr><tr><td><b>' . _news_admin_kat . ':</b></td><td>' . jsconvert(re($getkat['kategorie'])) . '</td></tr><tr><td><b>' . _comments_head . ':</b></td><td>' . cnt($db['acomments'], "WHERE artikel = '" . $get['id'] . "'") . '</td></tr>\')" onmouseout="DZCP.hideInfo()"'; } $l_articles .= show("menu/last_artikel", array("id" => $get['id'], "titel" => re(cut($get['titel'], $lartikel)), "text" => cut(bbcode($text), 260), "datum" => date("d.m.Y", $get['datum']), "info" => $info)); } } return empty($l_articles) ? '' : '<table class="navContent" cellspacing="0">' . $l_articles . '</table>'; }
function l_news() { global $db, $maxlnews, $lnews, $allowHover; if (!permission("intnews")) { $int = "AND intern = 0"; } $qry = db("SELECT id,titel,autor,datum,kat,public,timeshift FROM " . $db['news'] . "\n WHERE public = 1\n\t\t\t\t\t\t\t AND datum <= " . time() . "\n\t\t\t " . $int . "\n ORDER BY id DESC\n LIMIT " . $maxlnews . ""); while ($get = _fetch($qry)) { $qrykat = db("SELECT kategorie FROM " . $db['newskat'] . "\n WHERE id = '" . $get['kat'] . "'"); $getkat = _fetch($qrykat); if ($allowHover == 1) { $info = 'onmouseover="DZCP.showInfo(\'<tr><td colspan=2 align=center padding=3 class=infoTop>' . jsconvert(re($get['titel'])) . '</td></tr><tr><td><b>' . _datum . ':</b></td><td>' . date("d.m.Y H:i", $get['datum']) . _uhr . '</td></tr><tr><td><b>' . _autor . ':</b></td><td>' . rawautor($get['autor']) . '</td></tr><tr><td><b>' . _news_admin_kat . ':</b></td><td>' . jsconvert(re($getkat['kategorie'])) . '</td></tr><tr><td><b>' . _comments_head . ':</b></td><td>' . cnt($db['newscomments'], "WHERE news = '" . $get['id'] . "'") . '</td></tr>\')" onmouseout="DZCP.hideInfo()"'; } $l_news .= show("menu/last_news", array("id" => $get['id'], "titel" => re(cut($get['titel'], $lnews)), "datum" => date("d.m.Y", $get['datum']), "info" => $info)); } return empty($l_news) ? '' : '<table class="navContent" cellspacing="0">' . $l_news . '</table>'; }
function uotm() { global $db, $allowHover; $imgFiles = array(); $folder = get_files('../inc/images/uploads/userpics'); foreach ($folder as $file) { array_push($imgFiles, $file); } if (count($imgFiles) != 0) { $userid = intval($imgFiles[rand(0, count($imgFiles) - 1)]); $get = _fetch(db("SELECT id,nick,country,bday FROM " . $db['users'] . " WHERE id = '" . $userid . "'")); if (!empty($get)) { if ($allowHover == 1) { $info = 'onmouseover="DZCP.showInfo(\'<tr><td colspan=2 align=center padding=3 class=infoTop>' . rawautor($get['id']) . '</td></tr><tr><td width=50%><b>' . _age . ':</b></td><td>' . getAge($get['bday']) . '</td></tr><tr><td colspan=2 align=center>' . jsconvert(userpic($get['id'])) . '</td></tr>\')" onmouseout="DZCP.hideInfo()"'; } $uotm = show("menu/uotm", array("uid" => $userid, "upic" => userpic($get['id'], 130, 161), "info" => $info)); } } return empty($uotm) ? '' : '<table class="navContent" cellspacing="0">' . $uotm . '</table>'; }
function counter() { global $db, $today, $counter_start, $useronline, $where, $isSpider; if (!$isSpider) { $qry2day = db("SELECT visitors FROM " . $db['counter'] . "\n WHERE today = '" . $today . "'"); if (_rows($qry2day)) { $get2day = _fetch($qry2day); $v_today = $get2day['visitors']; } else { $v_today = 0; } $gestern = time() - 86400; $tag = date("j", $gestern); $monat = date("n", $gestern); $jahr = date("Y", $gestern); $yesterday = $tag . "." . $monat . "." . $jahr; $qryyday = db("SELECT visitors FROM " . $db['counter'] . "\n WHERE today = '" . $yesterday . "'"); if (_rows($qryyday)) { $getyday = _fetch($qryyday); $yDay = $getyday['visitors']; } else { $yDay = 0; } $qrystats = db("SELECT SUM(visitors) AS allvisitors,\n MAX(visitors) AS maxvisitors,\n MAX(maxonline) AS maxonline,\n AVG(visitors) AS avgvisitors,\n SUM(visitors) AS allvisitors\n FROM " . $db['counter'] . ""); $getstats = _fetch($qrystats); if (abs(online_reg()) != 0) { $qryo = db("SELECT id FROM " . $db['users'] . "\n WHERE time+'" . $useronline . "'>'" . time() . "'\n AND online = 1\n ORDER BY nick"); while ($geto = _fetch($qryo)) { $ousers .= '<tr><td>' . rawautor($geto['id']) . '</td><td align=right valign=middle><small>' . jsconvert(getrank($geto['id'])) . '</small></td></tr>'; } $info = 'onmouseover="DZCP.showInfo(\'<tr><td colspan=2 align=center padding=3 class=infoTop>' . _online_head . '</td></tr><tr><td><table width=100% cellpadding=0 cellspacing=0>' . $ousers . '</table></td></tr>\')" onmouseout="DZCP.hideInfo()"'; } $counter = show("menu/counter", array("v_today" => $v_today, "v_yesterday" => $yDay, "v_all" => $getstats['allvisitors'] + $counter_start, "v_perday" => round($getstats['avgvisitors'], 2), "v_max" => $getstats['maxvisitors'], "g_online" => abs(online_guests($where) - online_reg()), "u_online" => abs(online_reg()), "info" => $info, "v_online" => $getstats['maxonline'], "head_online" => _head_online, "head_visits" => _head_visits, "head_max" => _head_max, "user" => _cnt_user, "guests" => _cnt_guests, "today" => _cnt_today, "yesterday" => _cnt_yesterday, "all" => _cnt_all, "percentperday" => _cnt_pperday, "perday" => _cnt_perday, "online" => _cnt_online)); return '<table class="navContent" cellspacing="0">' . $counter . '</table>'; } }
$markerCount = 0; while ($mm_get = _fetch($mm_qry)) { if ($mm_lastCoord != $mm_get['gmaps_koord']) { if ($i > 0) { $mm_coords .= ','; $mm_infos .= "</tr>','<tr>"; } $mm_infos .= '<td><b style="font-size:13px"> ' . re($mm_get['city']) . '</td></tr><tr>'; $mm_coords .= 'new google.maps.LatLng' . $mm_get['gmaps_koord']; $realCount++; } else { if ($markerCount > 0) { $mm_markerIcon .= ','; } $mm_markerIcon .= $realCount - 1 . ':true'; $markerCount++; } $userInfos = '<b>' . rawautor($mm_get['id']) . '</b><br /><b>' . _position . ':</b> ' . getrank($mm_get['id']) . '<br />' . userpic($mm_get['id']); $mm_infos .= '<td><div id="memberMapInner">' . $userInfos . '</div></td>'; $mm_lastCoord = $mm_get['gmaps_koord']; $i++; } $mm_infos .= "</tr>'"; $index = show($dir . "/membermap", array('head' => _membermap, 'mm_coords' => $mm_coords, 'mm_infos' => $mm_infos, 'mm_markerIcon' => $mm_markerIcon)); ## SETTINGS ## $title = $pagetitle . " - " . $where . ""; $time_end = generatetime(); $time = round($time_end - $time_start, 4); page($index, $title, $where, $time); ## OUTPUT BUFFER END ## gz_output();
for ($iw = 1; $iw <= 7; $iw++) { unset($bdays, $cws, $infoBday, $infoCW, $infoEvent); $datum = mktime(0, 0, 0, $monat, $i, $jahr); $wday = getdate($datum); $wday = $wday['wday']; if (!$wday) { $wday = 7; } if ($wday != $iw) { $data .= '<td class="calDay"></td>'; } else { $qry = db("SELECT id,bday,nick FROM " . $db['users'] . "\n WHERE bday LIKE '" . cal($i) . "." . $monat . ".____" . "'"); if (_rows($qry)) { $infoBday = ''; while ($get = _fetch($qry)) { $infoBday .= '<img src=../inc/images/bday.gif class=icon alt= />' . ' ' . jsconvert(_kal_birthday . rawautor($get['id'])) . '<br />'; } $info = ' onmouseover="DZCP.showInfo(\'' . $infoBday . '\')" onmouseout="DZCP.hideInfo()"'; $bdays = '<a href="../user/?action=userlist&show=bday&time=' . $datum . '"' . $info . '><img src="../inc/images/bday.gif" alt="" /></a>'; } else { $bdays = ""; } $qry = db("SELECT datum,gegner FROM " . $db['cw'] . "\n WHERE DATE_FORMAT(FROM_UNIXTIME(datum), '%d.%m.%Y') = '" . cal($i) . "." . $monat . "." . $jahr . "'"); if (_rows($qry)) { $infoCW = ''; while ($get = _fetch($qry)) { $infoCW .= '<img src=../inc/images/cw.gif class=icon alt= />' . ' ' . jsconvert(_kal_cw . re($get['gegner'])) . '<br />'; } $info = ' onmouseover="DZCP.showInfo(\'' . $infoCW . '\')" onmouseout="DZCP.hideInfo()"'; $cws = '<a href="../clanwars/?action=kalender&time=' . $datum . '"' . $info . '><img src="../inc/images/cw.gif" alt="" /></a>'; } else {
function kalender($month = "", $year = "") { global $db, $sql_prefix; if (!empty($month) && !empty($year)) { $monat = cal($month); $jahr = $year; } else { $monat = date("m"); $jahr = date("Y"); } for ($i = 1; $i <= 12; $i++) { $mname = array("1" => _jan, "2" => _feb, "3" => _mar, "4" => _apr, "5" => _mai, "6" => _jun, "7" => _jul, "8" => _aug, "9" => _sep, "10" => _okt, "11" => _nov, "12" => _dez); if ($monat == $i) { $month = $mname[$i]; } } $today = mktime(0, 0, 0, date("n"), date("d"), date("Y")); $i = 1; while ($i <= 31 && checkdate($monat, $i, $jahr)) { unset($event); unset($data); unset($bdays); unset($cws); for ($iw = 1; $iw <= 7; $iw++) { unset($titlecw); unset($titlebd); unset($titleev); $datum = mktime(0, 0, 0, $monat, $i, $jahr); $wday = getdate($datum); $wday = $wday['wday']; if (!$wday) { $wday = 7; } if ($wday != $iw) { $data .= "<td class=\"navKalEmpty\"></td>"; } else { $qry = db("SELECT id,bday FROM " . $db['users'] . " WHERE bday LIKE '" . cal($i) . "." . $monat . ".____" . "'"); if (_rows($qry)) { while ($get = _fetch($qry)) { $bdays = "set"; $titlebd .= '<tr><td><img src=../inc/images/bday.gif class=icon alt= /> ' . jsconvert(_kal_birthday . rawautor($get['id'])) . '</td></tr>'; } } else { $bdays = ""; $titlebd = ""; } $qry = db("SELECT datum,cid FROM " . $db['cw'] . " WHERE DATE_FORMAT(FROM_UNIXTIME(datum), '%d.%m.%Y') = '" . cal($i) . "." . $monat . "." . $jahr . "'"); if (_rows($qry)) { while ($get = _fetch($qry)) { //Clans Mod $clandetailssql = db("SELECT gegner FROM " . $sql_prefix . "clans WHERE id LIKE " . $get['cid']); $clans = _fetch($clandetailssql); $cws = "set"; $titlecw .= '<tr><td><img src=../inc/images/cw.gif class=icon alt= /> ' . jsconvert(_kal_cw . re($clans['gegner'])) . '</td></tr>'; } } else { $cws = ""; $titlecw = ""; } $qry = db("SELECT datum,title FROM " . $db['events'] . " WHERE DATE_FORMAT(FROM_UNIXTIME(datum), '%d.%m.%Y') = '" . cal($i) . "." . $monat . "." . $jahr . "'"); if (_rows($qry)) { while ($get = _fetch($qry)) { $event = "set"; $titleev .= '<tr><td><img src=../inc/images/event.gif class=icon alt= /> ' . jsconvert(_kal_event . re($get['title'])) . '</td></tr>'; } } else { $event = ""; $titleev = ""; } $info = 'onmouseover="DZCP.showInfo(\'<tr><td colspan=2 align=center padding=3 class=infoTop>' . cal($i) . '.' . $monat . '.' . $jahr . '</td></tr>' . $titlebd . $titlecw . $titleev . '\')" onmouseout="DZCP.hideInfo()"'; if ($event == "set" || $cws == "set" || $bdays == "set") { $day = '<a class="navKal" href="../kalender/?m=' . $monat . '&y=' . $jahr . '&hl=' . $i . '" ' . $info . '>' . cal($i) . '</a>'; } else { $day = cal($i); } if (!checkdate($monat, $i, $jahr)) { $data .= '<td class="navKalEmpty"></td>'; } elseif ($datum == $today) { $data .= show("menu/kal_day", array("day" => $day, "id" => "navKalToday")); } else { $data .= show("menu/kal_day", array("day" => $day, "id" => "navKalDays")); } $i++; } } $show .= "<tr>" . $data . "</tr>"; } if ($monat + 1 == 13) { $nm = 1; $ny = $jahr + 1; } else { $nm = $monat + 1; $ny = $jahr; } if ($monat - 1 == 0) { $lm = 12; $ly = $jahr - 1; } else { $lm = $monat - 1; $ly = $jahr; } $kalender = show("menu/kalender", array("monat" => $month, "show" => $show, "year" => $jahr, "nm" => $nm, "ny" => $ny, "lm" => $lm, "ly" => $ly, "montag" => _nav_montag, "dienstag" => _nav_dienstag, "mittwoch" => _nav_mittwoch, "donnerstag" => _nav_donnerstag, "freitag" => _nav_freitag, "samstag" => _nav_samstag, "sonntag" => _nav_sonntag)); return '<div id="navKalender">' . $kalender . '</div>'; }
/** * DZCP - deV!L`z ClanPortal 1.6 Final * http://www.dzcp.de * Menu: Kalender */ function kalender($month = "", $year = "") { global $db, $sql_prefix; if (!empty($month) && !empty($year)) { $monat = cal($month); $jahr = $year; } else { $monat = date("m"); $jahr = date("Y"); } for ($i = 1; $i <= 12; $i++) { $mname = array("1" => _jan, "2" => _feb, "3" => _mar, "4" => _apr, "5" => _mai, "6" => _jun, "7" => _jul, "8" => _aug, "9" => _sep, "10" => _okt, "11" => _nov, "12" => _dez); if ($monat == $i) { $month = $mname[$i]; } } $today = mktime(0, 0, 0, date("n"), date("d"), date("Y")); $i = 1; $show = ''; while ($i <= 31 && checkdate($monat, $i, $jahr)) { $data = ''; $event = ''; $bdays = ''; $cws = ''; for ($iw = 1; $iw <= 7; $iw++) { unset($titlecw); unset($titlebd); unset($titleev); $datum = mktime(0, 0, 0, $monat, $i, $jahr); $wday = getdate($datum); $wday = $wday['wday']; if (!$wday) { $wday = 7; } if ($wday != $iw) { $data .= "<td class=\"navKalEmpty\"></td>"; } else { $titlebd = ''; $bdays = ""; $qry = db("SELECT id,bday FROM " . $db['users'] . " WHERE bday LIKE '" . cal($i) . "." . $monat . ".____" . "'"); if (_rows($qry)) { while ($get = _fetch($qry)) { $bdays = "set"; $titlebd .= '<img src=../inc/images/bday.gif class=icon alt= />' . ' ' . jsconvert(_kal_birthday . rawautor($get['id'])) . '<br />'; } } $cws = ""; $titlecw = ""; $qry = db("SELECT datum,gegner FROM " . $db['cw'] . " WHERE DATE_FORMAT(FROM_UNIXTIME(datum), '%d.%m.%Y') = '" . cal($i) . "." . $monat . "." . $jahr . "'"); if (_rows($qry)) { while ($get = _fetch($qry)) { $cws = "set"; $titlecw .= '<img src=../inc/images/cw.gif class=icon alt= />' . ' ' . jsconvert(_kal_cw . re($get['gegner'])) . '<br />'; } } $event = ""; $titleev = ""; $qry = db("SELECT s1.*, s2.name as katname FROM " . $sql_prefix . "events_info as s1 JOIN " . $sql_prefix . "events_kat as s2\n WHERE s1.kat = s2.id AND DATE_FORMAT(FROM_UNIXTIME(start), '%d.%m.%Y') <= '" . cal($i) . "." . $monat . "." . $jahr . "' AND DATE_FORMAT(FROM_UNIXTIME(ende), '%d.%m.%Y') >= '" . cal($i) . "." . $monat . "." . $jahr . "' AND s1.show = 1"); if (_rows($qry)) { while ($get = _fetch($qry)) { $pfadbild = "inc/images/eventkat/" . $get['kat']; if (file_exists(basePath . "/" . $pfadbild . ".gif")) { $bild = '<img src=../' . $pfadbild . '.gif class=icon alt= />'; } elseif (file_exists(basePath . "/" . $pfadbild . ".jpg")) { $bild = '<img src=../' . $pfadbild . '.jpg class=icon alt= />'; } elseif (file_exists(basePath . "/" . $pfadbild . ".png")) { $bild = '<img src=../' . $pfadbild . '.png class=icon alt= />'; } else { $bild = "<img src=../inc/images/event.gif class=icon alt= />"; } $event = "set"; $titleev .= '<tr><td>' . $bild . jsconvert(re($get['katname']) . ': ' . re($get['name'])) . '</td></tr>'; } } $info = 'onmouseover="DZCP.showInfo(\'' . cal($i) . '.' . $monat . '.' . $jahr . '\', \'' . $titlebd . $titlecw . $titleev . '\')" onmouseout="DZCP.hideInfo()"'; if ($event == "set" || $cws == "set" || $bdays == "set") { $day = '<a class="navKal" href="../kalender/?m=' . $monat . '&y=' . $jahr . '&hl=' . $i . '" ' . $info . '>' . cal($i) . '</a>'; } else { $day = cal($i); } if (!checkdate($monat, $i, $jahr)) { $data .= '<td class="navKalEmpty"></td>'; } elseif ($datum == $today) { $data .= show("menu/kal_day", array("day" => $day, "id" => "navKalToday")); } else { $data .= show("menu/kal_day", array("day" => $day, "id" => "navKalDays")); } $i++; } } $show .= "<tr>" . $data . "</tr>"; } if ($monat + 1 == 13) { $nm = 1; $ny = $jahr + 1; } else { $nm = $monat + 1; $ny = $jahr; } if ($monat - 1 == 0) { $lm = 12; $ly = $jahr - 1; } else { $lm = $monat - 1; $ly = $jahr; } $kalender = show("menu/kalender", array("monat" => $month, "show" => $show, "year" => $jahr, "nm" => $nm, "ny" => $ny, "lm" => $lm, "ly" => $ly, "montag" => _nav_montag, "dienstag" => _nav_dienstag, "mittwoch" => _nav_mittwoch, "donnerstag" => _nav_donnerstag, "freitag" => _nav_freitag, "samstag" => _nav_samstag, "sonntag" => _nav_sonntag)); return '<div id="navKalender">' . $kalender . '</div>'; }