function createTeamData($res, $parse) { global $apx, $db, $set, $user; $userdata = array(); if ($res['birthday']) { $bd = explode('-', $res['birthday']); $birthday = intval($bd[0]) . '. ' . getcalmonth($bd[1]) . iif($bd[2], ' ' . $bd[2]); if ($bd[2]) { $age = date('Y') - $bd[2]; if (intval(sprintf('%02d%02d', $bd[1], $bd[0])) > intval(date('md'))) { $age -= 1; } } } $userdata['ID'] = $res['userid']; $userdata['USERID'] = $res['userid']; $userdata['NAME'] = replace($res['username']); $userdata['USERNAME'] = replace($res['username']); $userdata['GROUPID'] = $res['groupid']; $userdata['EMAIL'] = replace(iif(!$res['pub_hidemail'], $res['email'])); $userdata['EMAIL_ENCRYPTED'] = replace(iif(!$res['pub_hidemail'], cryptMail($res['email']))); $userdata['ONLINE'] = iif(!$res['pub_invisible'] && $res['lastactive'] + $set['user']['timeout'] * 60 >= time(), 1, 0); $userdata['ISONLINE'] = $userdata['ONLINE']; $userdata['REALNAME'] = replace($res['realname']); $userdata['GENDER'] = $res['gender']; $userdata['CITY'] = replace($res['city']); $userdata['PLZ'] = replace($res['plz']); $userdata['COUNTRY'] = $res['country']; $userdata['REGTIME'] = $res['reg_time']; $userdata['REGDAYS'] = floor((time() - $res['reg_time']) / (24 * 3600)); $userdata['LASTACTIVE'] = $res['lastactive']; $userdata['AVATAR'] = $user->mkavatar($res); $userdata['AVATAR_TITLE'] = $user->mkavtitle($res); $userdata['BIRTHDAY'] = $birthday; $userdata['AGE'] = $age; if (in_array($varname . '.ISBUDDY', $parse)) { $userdata['ISBUDDY'] = $user->is_buddy($res['userid']); } //Custom-Felder for ($ii = 1; $ii <= 10; $ii++) { $userdata['CUSTOM' . $ii . '_NAME'] = $set['user']['cusfield_names'][$ii - 1]; $userdata['CUSTOM' . $ii] = compatible_hsc($res['custom' . $ii]); } //Interaktions-Links if ($user->info['userid']) { $userdata['LINK_SENDPM'] = mklink('user.php?action=newpm&touser='******'userid'], 'user,newpm,' . $res['userid'] . '.html'); $userdata['LINK_SENDEMAIL'] = mklink('user.php?action=newmail&touser='******'userid'], 'user,newmail,' . $res['userid'] . '.html'); if (in_array($varname . '.LINK_BUDDY', $parse) && !$user->is_buddy($res['userid'])) { $userdata['LINK_BUDDY'] = mklink('user.php?action=addbuddy&id=' . $res['userid'], 'user,addbuddy,' . $res['userid'] . '.html'); } } return $userdata; }
function products_format_release($info) { global $set, $db, $apx; if ($info['day'] && $info['month'] && $info['year']) { $releasedate = sprintf('%02d.%02d.%04d', $info['day'], $info['month'], $info['year']); } elseif ($info['month'] && $info['year']) { $releasedate = getcalmonth($info['month']) . ' ' . $info['year']; } elseif ($info['quater'] && $info['year']) { $releasedate = $info['quater'] . '. ' . $apx->lang->get('CORE_QUATER') . ' ' . $info['year']; } else { $releasedate = $info['year']; } return $releasedate; }
function main_mkdate($pattern = 'd.m.Y - H:i:s', $time = false) { global $apx, $set; static $yesterday, $today, $tomorrow; if ($time === false) { $time = time(); } $time = (int) $time; //Timestamps if (!isset($yesterday)) { $yesterday = date('d/m/Y', time() - 24 * 3600 - TIMEDIFF); } if (!isset($today)) { $today = date('d/m/Y'); } if (!isset($tomorrow)) { $tomorrow = date('d/m/Y', time() + 24 * 3600 - TIMEDIFF); } $stamp = date('d/m/Y', $time - TIMEDIFF); //Gestern/Heute/Morgen if (strtolower($pattern) == 'date' && $stamp == $yesterday) { echo '<b>' . $apx->lang->get('YESTERDAY') . '</b>'; return; } if (strtolower($pattern) == 'date' && $stamp == $today) { echo '<b>' . $apx->lang->get('TODAY') . '</b>'; return; } if (strtolower($pattern) == 'date' && $stamp == $tomorrow) { echo '<b>' . $apx->lang->get('TOMORROW') . '</b>'; return; } //Standard-Pattern verwenden if (strtolower($pattern) == 'date') { $pattern = $set['main']['dateformat']; } if (strtolower($pattern) == 'time') { $pattern = $set['main']['timeformat']; } $string = date($pattern, $time - TIMEDIFF); if (strpos($pattern, 'F') !== false || strpos($pattern, 'M') !== false) { $string = getcalmonth($string); } if (strpos($pattern, 'l') !== false || strpos($pattern, 'D') !== false) { $string = getweekday($string); } echo $string; }
if (!$res['id']) { filenotfound(); } //Altersabfrage if ($res['restricted']) { checkage(); } //Counter $db->query("UPDATE " . PRE . "_news SET hits=hits+1 WHERE ( " . time() . " BETWEEN starttime AND endtime AND id='" . $_REQUEST['id'] . "' " . section_filter() . " )"); //Headline + Titlebar if (news_is_recent($res['id'])) { headline($apx->lang->get('HEADLINE'), mklink('news.php', 'news.html')); titlebar($apx->lang->get('HEADLINE') . ': ' . $res['title']); } else { headline($apx->lang->get('HEADLINE_ARCHIVE'), mklink('newsarchive.php', 'newsarchive.html')); headline(getcalmonth(date('m', $res['starttime'] - TIMEDIFF)) . ' ' . date('Y', $res['starttime'] - TIMEDIFF), mklink('newsarchive.php?month=' . date('m', $res['starttime'] - TIMEDIFF) . date('Y', $res['starttime'] - TIMEDIFF), 'newsarchive,' . date('m', $res['starttime'] - TIMEDIFF) . ',' . date('Y', $res['starttime'] - TIMEDIFF) . ',1.html')); titlebar($apx->lang->get('HEADLINE_ARCHIVE') . ': ' . $res['title']); } //Kategorie-Info if (in_array('CATTITLE', $parse) || in_array('CATICON', $parse) || in_array('CATLINK', $parse)) { $catinfo = news_catinfo($res['catid']); } //Link $link = mklink('news.php?id=' . $res['id'], 'news,id' . $res['id'] . urlformat($res['title']) . '.html'); //Newspic if (in_array('PICTURE', $parse) || in_array('PICTURE_POPUP', $parse) || in_array('PICTURE_POPUPPATH', $parse)) { list($picture, $picture_popup, $picture_popuppath) = news_newspic($res['newspic']); } //Username + eMail if ($res['userid']) { $username = $res['username'];
$link_report = "javascript:popupwin('user.php?action=report&contentid=profile:" . $_REQUEST['id'] . "',500,300);"; $apx->tmpl->assign('LINK_REPORT', $link_report); //Buddyliste $userdata = array(); if ($res['pub_showbuddies'] && in_array('BUDDY', $parse)) { $data = $db->fetch("SELECT friendid FROM " . PRE . "_user_friends WHERE userid='" . $res['userid'] . "'"); $buddies = get_ids($data, 'friendid'); if (count($buddies)) { $data = $db->fetch("SELECT userid,username,groupid,reg_time,realname,gender,city,plz,country,city,lastactive,pub_invisible,avatar,avatar_title,birthday,pub_hidemail FROM " . PRE . "_user WHERE userid IN (" . implode(',', $buddies) . ") ORDER BY username ASC"); if (count($data)) { foreach ($data as $res) { ++$i; $age = 0; if ($res['birthday']) { $bd = explode('-', $res['birthday']); $birthday = intval($bd[0]) . '. ' . getcalmonth($bd[1]) . iif($bd[2], ' ' . $bd[2]); if ($bd[2]) { $age = date('Y') - $bd[2]; if (intval(sprintf('%02d%02d', $bd[1], $bd[0])) > intval(date('md'))) { $age -= 1; } } } $tabledata[$i]['ID'] = $res['userid']; $tabledata[$i]['USERID'] = $res['userid']; $tabledata[$i]['NAME'] = replace($res['username']); $tabledata[$i]['USERNAME'] = replace($res['username']); $tabledata[$i]['GROUPID'] = $res['groupid']; $tabledata[$i]['EMAIL'] = replace(iif(!$res['pub_hidemail'], $res['email'])); $tabledata[$i]['EMAIL_ENCRYPTED'] = replace(iif(!$res['pub_hidemail'], cryptMail($res['email']))); $tabledata[$i]['ONLINE'] = iif(!$res['pub_invisible'] && $res['lastactive'] + $set['user']['timeout'] * 60 >= time(), 1, 0);
$year = $maxyear; } if ($year < $minyear) { $year = $minyear; } if ($month > 12) { $month = 12; } if ($month < 1) { $month = 1; } //Verwendete Variablen auslesen $parse = $apx->tmpl->used_vars('calendar_month'); //Headline und Titlebar $firstdaystamp = mktime(0, 0, 0, $month, 1, $year) + TIMEDIFF; $monthtitle = getcalmonth(date('F', $firstdaystamp - TIMEDIFF)) . ' ' . date('Y', $firstdaystamp - TIMEDIFF); headline($monthtitle, mklink('calendar.php?month=' . $month . '&year=' . $year . iif($_REQUEST['mode'] == 'private', '&mode=private'), 'calendar,' . $_REQUEST['mode'] . ',month' . sprintf('%02d', $month) . $year . '.html')); titlebar($apx->lang->get('HEADLINE') . ': ' . $monthtitle); //Tage des vorherigen Monats auffüllen $startday = 1; $timestamp = mktime(0, 0, 0, $month, 1, $year) + TIMEDIFF; $subday = (date('w', $timestamp - TIMEDIFF) + 6) % 7; //Tage des nächsten Monats auffüllen $monthdays = (int) date('t', $timestamp - TIMEDIFF); $timestamp = mktime(0, 0, 0, $month, $monthdays, $year) + TIMEDIFF; $weekday = date('w', $timestamp - TIMEDIFF); $adddays = (7 - $weekday) % 7; //Tage des gewählten Monats durchlaufen $monthdata = array(); $firstweekofmonth = ''; for ($day = 1 - $subday; $day <= $monthdays + $adddays; $day++) {
$searchid = saveSearchResult('articles', $resultIds); header("HTTP/1.1 301 Moved Permanently"); header('Location: ' . str_replace('&', '&', mklink('articlearchive.php?action=search&searchid=' . $searchid, 'articlearchive.html?action=search&searchid=' . $searchid))); } } require 'lib/_end.php'; } //////////////////////////////////////////////////////////////////////////////////////////////////////// ARTIKEL AUFLISTEN if ($_REQUEST['month']) { //Verwendete Variablen auslesen $parse = $apx->tmpl->used_vars('archive_index'); //Headline $month = substr($_REQUEST['month'], 0, 2); $year = substr($_REQUEST['month'], 2); headline(getcalmonth($month) . ' ' . $year, mklink('articlearchive.php?month=' . $month . $year, 'articlearchive,' . $month . ',' . $year . ',1.html')); titlebar($apx->lang->get('HEADLINE_ARCHIVE') . ': ' . getcalmonth($month) . ' ' . $year); //Seitenzahlen generieren list($count) = $db->first("SELECT count(id) FROM " . PRE . "_articles WHERE ( ( ( " . time() . " BETWEEN starttime AND endtime ) AND starttime BETWEEN '" . (mktime(0, 0, 0, intval($month), 1, intval($year)) + TIMEDIFF) . "' AND '" . (mktime(0, 0, 0, intval($month + 1), 1, intval($year)) - 1 + TIMEDIFF) . "' ) " . $filter . " " . section_filter() . " )"); pages(mklink('articlearchive.php?month=' . $_REQUEST['month'], 'articlearchive,' . $month . ',' . $year . ',{P}.html'), $count, $set['articles']['archiveepp']); //Artikel ausgeben if ($set['articles']['archiveentrysort'] == 1) { $orderby = ' starttime DESC '; } else { $orderby = ' starttime ASC'; } $data = $db->fetch("SELECT a.*,b.userid,b.username,b.email,b.pub_hidemail FROM " . PRE . "_articles AS a LEFT JOIN " . PRE . "_user AS b USING(userid) WHERE ( ( ( " . time() . " BETWEEN starttime AND endtime ) AND starttime BETWEEN '" . (mktime(0, 0, 0, intval($month), 1, intval($year)) + TIMEDIFF) . "' AND '" . (mktime(0, 0, 0, intval($month + 1), 1, intval($year)) - 1 + TIMEDIFF) . "' ) " . $filter . " " . section_filter() . " ) ORDER BY " . $orderby . " " . getlimit($set['articles']['archiveepp'])); $data = articles_extend_data($data, $parse); //Datensatz erweitern durch Preview/Review-Daten //Kategorien auslesen if (in_array('ARTICLE.CATTITLE', $parse) || in_array('ARTICLE.CATICON', $parse) || in_array('ARTICLE.CATLINK', $parse)) { $catinfo = articles_catinfo(get_ids($data, 'catid'));
function user_info($userid = 0, $template = 'information') { global $set, $db, $apx, $user; $userid = (int) $userid; if (!$userid) { return; } $tmpl = new tengine(); $apx->lang->drop('profile', 'user'); //Verwendete Variablen auslesen $parse = $tmpl->used_vars('functions/' . $template, 'user'); $res = $db->first("SELECT * FROM " . PRE . "_user WHERE userid='" . $userid . "' LIMIT 1"); $userid = $res['userid']; if (!$res['userid']) { return; } list($groupname) = $db->first("SELECT name FROM " . PRE . "_user_groups WHERE groupid='" . $res['groupid'] . "' LIMIT 1"); $age = 0; if ($res['birthday']) { $bd = explode('-', $res['birthday']); $birthday = intval($bd[0]) . '. ' . getcalmonth($bd[1]) . iif($bd[2], ' ' . $bd[2]); if ($bd[2]) { $age = date('Y') - $bd[2]; if (intval(sprintf('%02d%02d', $bd[1], $bd[0])) > intval(date('md'))) { $age -= 1; } } } $tmpl->assign('USERID', $res['userid']); $tmpl->assign('USERNAME', replace($res['username'])); $tmpl->assign('GROUP', replace($groupname)); $tmpl->assign('REGDATE', $res['reg_time']); $tmpl->assign('REGDAYS', floor((time() - $res['reg_time']) / (24 * 3600))); $tmpl->assign('LASTACTIVE', (int) $res['lastactive']); $tmpl->assign('IS_ONLINE', iif(!$res['pub_invisible'] && $res['lastactive'] + $set['user']['timeout'] * 60 >= time(), 1, 0)); $tmpl->assign('EMAIL', replace($res['email'])); $tmpl->assign('EMAIL_ENCRYPTED', replace(cryptMail($res['email']))); $tmpl->assign('HIDEMAIL', $res['pub_hidemail']); $tmpl->assign('HOMEPAGE', replace($res['homepage'])); $tmpl->assign('ICQ', replace($res['icq'])); $tmpl->assign('AIM', replace($res['aim'])); $tmpl->assign('YIM', replace($res['yim'])); $tmpl->assign('MSN', replace($res['msn'])); $tmpl->assign('SKYPE', replace($res['skype'])); $tmpl->assign('REALNAME', replace($res['realname'])); $tmpl->assign('CITY', replace($res['city'])); $tmpl->assign('PLZ', replace($res['plz'])); $tmpl->assign('COUNTRY', replace($res['country'])); $tmpl->assign('INTERESTS', replace($res['interests'])); $tmpl->assign('WORK', replace($res['work'])); $tmpl->assign('GENDER', (int) $res['gender']); $tmpl->assign('BIRTHDAY', $birthday); $tmpl->assign('AGE', $age); $tmpl->assign('SIGNATURE', $user->mksig($res, 1)); $tmpl->assign('AVATAR', $user->mkavatar($res)); $tmpl->assign('AVATAR_TITLE', $user->mkavtitle($res)); //Custom-Felder for ($i = 1; $i <= 10; $i++) { $tmpl->assign('CUSTOM' . $i . '_NAME', replace($set['user']['cusfield_names'][$i - 1])); $tmpl->assign('CUSTOM' . $i, replace($res['custom' . $i])); } //Forum-Variablen if ($apx->is_module('forum')) { if ($res['forum_lastactive'] == 0) { $res['forum_lastactive'] = $res['lastactive']; } $tmpl->assign('FORUM_LASTACTIVE', (int) $res['forum_lastactive']); $tmpl->assign('FORUM_POSTS', (int) $res['forum_posts']); $tmpl->assign('FORUM_FINDPOSTS', HTTPDIR . $set['forum']['directory'] . '/search.php?send=1&author=' . urlencode($res['username'])); } //Kommentare if ($apx->is_module('comments') && in_array('COMMENTS', $parse)) { require_once BASEDIR . getmodulepath('comments') . 'functions.php'; $tmpl->assign('COMMENTS', comments_count($res['userid'])); } //Interaktionen $link_buddy = iif($user->info['userid'] && !$user->is_buddy($res['userid']), mklink('user.php?action=addbuddy&id=' . $res['userid'], 'user,addbuddy,' . $res['userid'] . '.html')); $link_sendpm = iif($user->info['userid'], mklink('user.php?action=newpm&touser='******'userid'], 'user,newpm,' . $res['userid'] . '.html')); $link_sendmail = iif($user->info['userid'], mklink('user.php?action=newmail&touser='******'userid'], 'user,newmail,' . $res['userid'] . '.html')); $tmpl->assign('LINK_BUDDY', $link_buddy); $tmpl->assign('LINK_SENDPM', $link_sendpm); $tmpl->assign('LINK_SENDEMAIL', $link_sendmail); //Links zu den Profil-Funktionen require_once dirname(__FILE__) . '/functions.php'; user_assign_profile_links($tmpl, $res); //Buddyliste $tabledata = array(); if ($res['pub_showbuddies'] && in_array('BUDDY', $parse)) { $data = $db->fetch("SELECT friendid FROM " . PRE . "_user_friends WHERE userid='" . $res['userid'] . "'"); $buddies = get_ids($data, 'friendid'); if (count($buddies)) { $data = $db->fetch("SELECT userid,username,groupid,reg_time,realname,gender,city,plz,country,city,lastactive,pub_invisible,avatar,avatar_title,birthday,pub_hidemail,custom1,custom2,custom3,custom4,custom5,custom6,custom7,custom8,custom9,custom10 FROM " . PRE . "_user WHERE userid IN (" . implode(',', $buddies) . ") ORDER BY username ASC"); if (count($data)) { foreach ($data as $res) { ++$i; $age = 0; if ($res['birthday']) { $bd = explode('-', $res['birthday']); $birthday = intval($bd[0]) . '. ' . getcalmonth($bd[1]) . iif($bd[2], ' ' . $bd[2]); if ($bd[2]) { $age = date('Y') - $bd[2]; if (intval(sprintf('%02d%02d', $bd[1], $bd[0])) > intval(date('md'))) { $age -= 1; } } } $tabledata[$i]['ID'] = $res['userid']; $tabledata[$i]['USERID'] = $res['userid']; $tabledata[$i]['NAME'] = replace($res['username']); $tabledata[$i]['USERNAME'] = replace($res['username']); $tabledata[$i]['GROUPID'] = $res['groupid']; $tabledata[$i]['EMAIL'] = replace(iif(!$res['pub_hidemail'], $res['email'])); $tabledata[$i]['EMAIL_ENCRYPTED'] = replace(iif(!$res['pub_hidemail'], cryptMail($res['email']))); $tabledata[$i]['ONLINE'] = iif(!$res['pub_invisible'] && $res['lastactive'] + $set['user']['timeout'] * 60 >= time(), 1, 0); $tabledata[$i]['ISONLINE'] = $tabledata[$i]['ONLINE']; $tabledata[$i]['REALNAME'] = replace($res['realname']); $tabledata[$i]['GENDER'] = $res['gender']; $tabledata[$i]['CITY'] = replace($res['city']); $tabledata[$i]['PLZ'] = replace($res['plz']); $tabledata[$i]['COUNTRY'] = $res['country']; $tabledata[$i]['REGTIME'] = $res['reg_time']; $tabledata[$i]['REGDAYS'] = floor((time() - $res['reg_time']) / (24 * 3600)); $tabledata[$i]['LASTACTIVE'] = $res['lastactive']; $tabledata[$i]['AVATAR'] = $user->mkavatar($res); $tabledata[$i]['AVATAR_TITLE'] = $user->mkavtitle($res); $tabledata[$i]['BIRTHDAY'] = $birthday; $tabledata[$i]['AGE'] = $age; //Custom-Felder for ($ii = 1; $ii <= 10; $ii++) { $tabledata[$i]['CUSTOM' . $ii . '_NAME'] = $set['user']['cusfield_names'][$ii - 1]; $tabledata[$i]['CUSTOM' . $ii] = compatible_hsc($res['custom' . $ii]); } //Interaktions-Links if ($user->info['userid']) { $tabledata[$i]['LINK_SENDPM'] = mklink('user.php?action=newpm&touser='******'userid'], 'user,newpm,' . $res['userid'] . '.html'); $tabledata[$i]['LINK_SENDEMAIL'] = mklink('user.php?action=newmail&touser='******'userid'], 'user,newmail,' . $res['userid'] . '.html'); } //Nur Buddy-Liste if ($buddylist) { $tabledata[$i]['LINK_DELBUDDY'] = mklink('user.php?action=delbuddy&id=' . $res['userid'], 'user,delbuddy,' . $res['userid'] . '.html'); } } } } } $tmpl->assign('BUDDY', $tabledata); //Template ausgeben $tmpl->parse('functions/' . $template, 'user'); }
function apxdate($time = false, $forceformat = false) { global $set, $apx; static $yesterday, $today, $tomorrow; if ($forceformat) { $format = $forceformat; } else { $format = $set['main']['dateformat']; } if ($time === false) { $time = time(); } if (!isset($yesterday)) { $yesterday = date('d/m/Y', time() - 24 * 3600 - TIMEDIFF); } if (!isset($today)) { $today = date('d/m/Y'); } if (!isset($tomorrow)) { $tomorrow = date('d/m/Y', time() + 24 * 3600 - TIMEDIFF); } $stamp = date('d/m/Y', $time - TIMEDIFF); if ($stamp == $yesterday) { return '<b>' . $apx->lang->get('YESTERDAY') . '</b>'; } if ($stamp == $today) { return '<b>' . $apx->lang->get('TODAY') . '</b>'; } if ($stamp == $tomorrow) { return '<b>' . $apx->lang->get('TOMORROW') . '</b>'; } $string = date($format, $time - TIMEDIFF); return getcalmonth(getweekday($string)); }