function misc_productsfeed() { global $set, $db, $apx; $apx->tmpl->loaddesign('blank'); header('Content-type: application/rss+xml'); $apx->lang->drop('types', 'products'); $type = $_REQUEST['type']; $alltypes = array('normal', 'game', 'software', 'hardware', 'music', 'movie', 'book'); if (!in_array($type, $alltypes)) { $type = ''; } $data = $db->fetch("SELECT * FROM " . PRE . "_products WHERE active='1' " . iif($type, " AND type='" . $type . "'") . " ORDER BY addtime DESC LIMIT 20"); if (count($data)) { foreach ($data as $res) { ++$i; //Link $link = mklink('products.php?id=' . $res['id'], 'products,id' . $res['id'] . urlformat($res['title']) . '.html'); $tabledata[$i]['ID'] = $res['id']; $tabledata[$i]['TITLE'] = rss_replace($res['title']); $tabledata[$i]['TIME'] = date('r', $res['starttime']); //Kein TIMEDIFF weil Zeitverschiebung mit angegeben! $tabledata[$i]['TEXT'] = rss_replace(preg_replace('#{IMAGE\\(([0-9]+)\\)}#s', '', $res['text'])); $tabledata[$i]['TYPE'] = $res['type']; $tabledata[$i]['LINK'] = HTTP_HOST . $link; } } $apx->tmpl->assign('WEBSITENAME', $set['main']['websitename']); $apx->tmpl->assign('PRODUCT', $tabledata); $apx->tmpl->parse('rss', 'products'); }
function search_gallery($items, $conn) { global $set, $db, $apx, $user; require_once BASEDIR . getmodulepath('gallery') . 'functions.php'; //Suchstring generieren $tagmatches = gallery_match_tags($items); foreach ($items as $item) { $tagmatch = array_shift($tagmatches); $search1[] = "caption LIKE '" . addslashes_like($item) . "'"; $search2[] = " ( " . iif($tagmatch, " id IN (" . implode(',', $tagmatch) . ") OR ") . " title LIKE '%" . addslashes_like($item) . "%' OR description LIKE '%" . addslashes_like($item) . "%' ) "; } $searchstring1 = implode($conn, $search1); $searchstring2 = implode($conn, $search2); //Bilder durchsuchen $data = $db->fetch("SELECT galid FROM " . PRE . "_gallery_pics WHERE ( active='1' AND ( " . $searchstring1 . " ) ) GROUP BY galid"); $galids = get_ids($data, 'galid'); if (count($galids)) { $picres = " id IN (" . @implode(',', $galids) . ") OR "; } //Ergebnisse $data = $db->fetch("SELECT id,title FROM " . PRE . "_gallery WHERE ( searchable='1' AND '" . time() . "' BETWEEN starttime AND endtime " . section_filter() . " AND ( " . $picres . " ( " . $searchstring2 . " ) ) ) ORDER BY title ASC"); if (count($data)) { foreach ($data as $res) { ++$i; $result[$i]['TITLE'] = strip_tags($res['title']); $result[$i]['LINK'] = mklink('gallery.php?id=' . $res['id'], 'gallery,list' . $res['id'] . ',1' . urlformat($res['title']) . '.html'); } } return $result; }
function user_loginbox() { global $set, $apx, $db, $user; $tmpl = new tengine(); $apx->lang->drop('func_loginbox', 'user'); if (!$user->info['userid']) { $tmpl->assign('POSTTO', mklink('user.php', 'user.html')); } $tmpl->parse('functions/loginbox', 'user'); }
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 glossar_highlight($text, $module = false, $ignore = false) { global $apx, $db, $set; static $highlights; $ignore = (int) $ignore; if (!$set['glossar']['highlight'] || !$text) { return $text; } $apx->lang->drop('highlights', 'glossar'); $classname_word = 'glossar_highlight'; $classname_title = 'glossar_info_title'; $classname_text = 'glossar_info_text'; $classname_readmore = 'glossar_info_readmore'; //Daten auslesen if (!isset($highlights)) { $highlights = array(); $data = $db->fetch("SELECT id,title,spelling,text FROM " . PRE . "_glossar WHERE starttime!=0" . iif($ignore, " AND id!='" . $ignore . "'")); if (count($data)) { foreach ($data as $res) { $words = array(); if ($res['spelling']) { $words = explode(',', strtolower($res['spelling'])); } $words[] = strtolower($res['title']); $words = array_unique(array_map('trim', $words)); $link = mklink('glossar.php?id=' . $res['id'], 'glossar,id' . $res['id'] . urlformat($res['title']) . '.html'); $content = '<div class="' . $classname_title . '"><a href="' . $link . '">' . $res['title'] . '</a></div><div class="' . $classname_text . '">' . shorttext($res['text'], 200) . '</div><div class="' . $classname_readmore . '"><a href="' . $link . '">' . $apx->lang->get('READMORE') . '</a></div>'; $content = strtr(compatible_hsc($content), array("\n" => ' ', "\r" => '', '\'' => '\\\'', '\\' => '\\\\')); $highlights[] = array('words' => $words, 'content' => $content); } } } //Text nach Highlights durchsuchen $lowertext = strtolower($text); foreach ($highlights as $element) { $words = $element['words']; foreach ($words as $wkey => $word) { if (strpos($lowertext, strtolower($word)) === false) { unset($words[$wkey]); } } if (!count($words)) { continue; } $words = array_map('preg_quote', $words); $searchfor = implode('|', $words); $hover = 'Tip(\'' . $element['content'] . '\')'; $text = preg_replace('#((<[^>]*)|($|[\\s<>,.:;_!-])(' . $searchfor . ')([\\s<>,.:;_!-]|$))#ie', '"\\2"=="\\1" ? glossar_stripslashes("\\1") : glossar_stripslashes("\\3")."<span class=\\"' . $classname_word . '\\" onmouseover=\\"' . strtr($hover, array('\\' => '\\\\')) . '\\">".glossar_stripslashes("\\4")."</span>".glossar_stripslashes("\\5")', $text); //$text=preg_replace('#((<[^>]*)|('.$searchfor.'))#ie', '"\2"=="\1" ? glossar_stripslashes("\1") : "<span class=\"'.$classname_word.'\" onmouseover=\"'.$hover.'\">".glossar_stripslashes("\3")."</span>"', $text); } return $text; }
function main_nav() { global $pstart_args, $login; $ret = ""; $ret .= "<div id='nav'>\n"; $ret .= " <div id='nav-inner'>\n"; $ret .= "<ul class='nav'>\n"; $ret .= sprintf("<li>%s</li>\n", mklink("home", "/")); $ret .= "</ul>\n"; $ret .= "<div style='clear:both'></div>\n"; $ret .= " </div>\n"; $ret .= "</div>\n"; return $ret; }
function search_poll($items, $conn) { global $set, $db, $apx, $user; require_once BASEDIR . getmodulepath('poll') . 'functions.php'; $tagmatches = poll_match_tags($items); foreach ($items as $item) { $tagmatch = array_shift($tagmatches); $query = " ( " . iif($tagmatch, " id IN (" . implode(',', $tagmatch) . ") OR ") . " question LIKE '%" . addslashes_like($item) . "%'"; $query .= " OR a1 LIKE '%" . addslashes_like($item) . "%'"; $query .= " OR a2 LIKE '%" . addslashes_like($item) . "%'"; $query .= " OR a3 LIKE '%" . addslashes_like($item) . "%'"; $query .= " OR a4 LIKE '%" . addslashes_like($item) . "%'"; $query .= " OR a5 LIKE '%" . addslashes_like($item) . "%'"; $query .= " OR a6 LIKE '%" . addslashes_like($item) . "%'"; $query .= " OR a7 LIKE '%" . addslashes_like($item) . "%'"; $query .= " OR a8 LIKE '%" . addslashes_like($item) . "%'"; $query .= " OR a9 LIKE '%" . addslashes_like($item) . "%'"; $query .= " OR a10 LIKE '%" . addslashes_like($item) . "%'"; $query .= " OR a11 LIKE '%" . addslashes_like($item) . "%'"; $query .= " OR a12 LIKE '%" . addslashes_like($item) . "%'"; $query .= " OR a13 LIKE '%" . addslashes_like($item) . "%'"; $query .= " OR a14 LIKE '%" . addslashes_like($item) . "%'"; $query .= " OR a15 LIKE '%" . addslashes_like($item) . "%'"; $query .= " OR a16 LIKE '%" . addslashes_like($item) . "%'"; $query .= " OR a17 LIKE '%" . addslashes_like($item) . "%'"; $query .= " OR a18 LIKE '%" . addslashes_like($item) . "%'"; $query .= " OR a19 LIKE '%" . addslashes_like($item) . "%'"; $query .= " OR a20 LIKE '%" . addslashes_like($item) . "%' )"; $search[] = $query; } $searchstring = implode($conn, $search); //Aktuelle Umfrage require_once BASEDIR . getmodulepath('poll') . 'functions.php'; $recent = poll_recent(); //Ergebnisse $data = $db->fetch("SELECT id,question FROM " . PRE . "_poll WHERE ( searchable='1' AND '" . time() . "' BETWEEN starttime AND endtime " . section_filter() . " AND ( " . $searchstring . " ) ) ORDER BY starttime DESC"); if (count($data)) { foreach ($data as $res) { ++$i; if ($res['id'] == $recent) { $link = mklink('poll.php?recent=1', 'poll,recent.html'); } else { $link = mklink('poll.php?id=' . $res['id'], 'poll,' . $res['id'] . '.html'); } $result[$i]['TITLE'] = strip_tags($res['question']); $result[$i]['LINK'] = $link; } } return $result; }
function misc_articlesfeed() { global $set, $db, $apx; $apx->tmpl->loaddesign('blank'); header('Content-type: application/rss+xml'); //Verwendete Variablen $parse = $apx->tmpl->used_vars('rss', 'articles'); //Baum holen, wenn nur eine bestimmte Kategorie gezeigt werden soll $cattree = articles_tree($_REQUEST['catid']); $data = $db->fetch("SELECT a.id,a.type,a.catid,a.title,a.subtitle,a.teaser,a.starttime,a.top,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 " . iif(count($cattree), "AND catid IN (" . @implode(',', $cattree) . ")") . " " . section_filter() . " ) ORDER BY starttime DESC LIMIT 20"); //Kategorien auslesen $catinfo = articles_catinfo(get_ids($data, 'catid')); if (count($data)) { foreach ($data as $res) { ++$i; //Wohin soll verlinkt werden? if ($res['type'] == 'normal') { $link2file = 'articles'; } else { $link2file = $res['type'] . 's'; } //Link $link = mklink($link2file . '.php?id=' . $res['id'], $link2file . ',id' . $res['id'] . ',0' . urlformat($res['title']) . '.html'); //Text: Teaser oder Artikelseite if ($res['teaser'] && $set['articles']['teaser']) { $text = $res['teaser']; } else { list($text) = $db->first("SELECT text FROM " . PRE . "_articles_pages WHERE artid='" . $res['id'] . "' ORDER BY ord ASC LIMIT 1"); $text = $text; } $tabledata[$i]['ID'] = $res['id']; $tabledata[$i]['TITLE'] = rss_replace($res['title']); $tabledata[$i]['SUBTITLE'] = rss_replace($res['subtitle']); $tabledata[$i]['TIME'] = date('r', $res['starttime']); //Kein TIMEDIFF weil Zeitverschiebung mit angegeben! $tabledata[$i]['TEXT'] = rss_replace(preg_replace('#{IMAGE\\(([0-9]+)\\)}#s', '', $text)); $tabledata[$i]['CATTITLE'] = rss_replace($catinfo[$res['catid']]['title']); $tabledata[$i]['LINK'] = HTTP_HOST . $link; $tabledata[$i]['USERNAME'] = replace($res['username']); $tabledata[$i]['EMAIL'] = replace(iif(!$res['pub_hidemail'], $res['email'])); $tabledata[$i]['EMAIL_ENCRYPTED'] = replace(iif(!$res['pub_hidemail'], cryptMail($res['email']))); $tabledata[$i]['TOP'] = $res['top']; } } $apx->tmpl->assign('WEBSITENAME', $set['main']['websitename']); $apx->tmpl->assign('ARTICLE', $tabledata); $apx->tmpl->parse('rss', 'articles'); }
function init() { global $set, $db, $apx; //Login über Cookies if ($_COOKIE[$set['forum_cookiename_userid']] && $_COOKIE[$set['forum_cookiename_password']]) { $forumdb = $this->getForumConn(); $userid = $_COOKIE[$set['forum_cookiename_userid']]; $password = $_COOKIE[$set['forum_cookiename_password']]; $this->info = $forumdb->first("\n\t\t\tSELECT \n\t\t\tuserid,username,email,2 AS groupid, 'Benutzer' AS name, 'public' AS gtype, 'all' AS section_access\n\t\t\tFROM " . VBPRE . "user\n\t\t\tWHERE userid='" . intval($userid) . "' AND MD5(CONCAT(password,'" . addslashes($set['forum_cookie_salt']) . "'))='" . addslashes($password) . "' AND usergroupid!=3\n\t\t\tLIMIT 1\n\t\t", 1); //Invalide Benutzerdaten => Logout erzwingen if (!$set['forum_invalidlogin_ignore'] && (!$this->info['userid'] || !$this->info['active']) && $apx->module() != 'user' && $_REQUEST['action'] != 'logout') { $link = mklink('user.php?action=logout', 'user,logout.html'); header('location:' . $link); exit; } //Autologin im Forum if ($set['forum_autologin'] && !$_COOKIE[$set['forum_cookiename_session']]) { $this->createForumSession($userid); } $this->info['buddies'] = $this->get_buddies(); $this->update_lastonline(); } elseif ($_COOKIE[$set['forum_cookiename_session']]) { $forumdb = $this->getForumConn(); $session = $_COOKIE[$set['forum_cookiename_session']]; $idhash = $this->getIdHash(); list($userid) = $forumdb->first("SELECT userid FROM " . VBPRE . "session WHERE sessionhash='" . addslashes($session) . "' AND idhash='" . $idhash . "'"); //Invalide Benutzerdaten => Logout erzwingen if (!$userid && !$set['forum_invalidlogin_ignore']) { $link = mklink('user.php?action=logout', 'user,logout.html'); header('location:' . $link); exit; } //Benutzerinfo auslesen $this->info = $forumdb->first("\n\t\t\tSELECT \n\t\t\tuserid,username,email,2 AS groupid, 'Benutzer' AS name, 'public' AS gtype, 'all' AS section_access\n\t\t\tFROM " . VBPRE . "user\n\t\t\tWHERE userid='" . intval($userid) . "' AND usergroupid!=3\n\t\t\tLIMIT 1\n\t\t", 1); //Invalide Benutzerdaten => Logout erzwingen if (!$set['forum_invalidlogin_ignore'] && (!$this->info['userid'] || !$this->info['active']) && $apx->module() != 'user' && $_REQUEST['action'] != 'logout') { $link = mklink('user.php?action=logout', 'user,logout.html'); header('location:' . $link); exit; } } else { $this->info = $db->first("SELECT * FROM " . PRE . "_user_groups WHERE groupid='3' LIMIT 1", 1); $this->info['buddies'] = array(); } $apx->lang->langid($this->info['pub_lang']); $this->update_onlinelist(); }
function section_check($id) { global $user; if ($user->info['section_access'] == 'all') { $secacc = 'all'; } else { $secacc = unserialize($user->info['section_access']); if (!is_array($secacc)) { $secacc = array(); } } //Beschränkung durch Benutzergruppe if ($secacc != 'all' && !in_array($id, $secacc) && $id != $this->section_default) { $this->lang->init(); //Sprachpaket ist noch nicht initialisiert! $indexpage = mklink('index.php', 'index.html', $this->section_default); message($this->sections[$id]['msg_noaccess'], $indexpage); } }
function search_faq($items, $conn) { global $set, $db, $apx, $user; //Suchstring generieren foreach ($items as $item) { $search[] = " ( question LIKE '%" . addslashes_like($item) . "%' OR answer LIKE '%" . addslashes_like($item) . "%' ) "; } $searchstring = implode($conn, $search); //Ergebnisse $data = $db->fetch("SELECT id,question FROM " . PRE . "_faq WHERE ( searchable='1' AND starttime!='0' AND ( " . $searchstring . " ) ) ORDER BY starttime DESC"); if (count($data)) { foreach ($data as $res) { ++$i; $link = mklink('faq.php?id=' . $res['id'], 'faq,' . $res['id'] . urlformat($res['question']) . '.html'); $result[$i]['TITLE'] = strip_tags($res['question']); $result[$i]['LINK'] = $link; } } return $result; }
function links_path($id) { global $set, $db, $apx, $user; $id = (int) $id; if (!$id) { return array(); } require_once BASEDIR . 'lib/class.recursivetree.php'; $tree = new RecursiveTree(PRE . '_links_cat', 'id'); $data = $tree->getPathTo(array('title'), $id); if (!count($data)) { return array(); } foreach ($data as $res) { ++$i; $pathdata[$i]['TITLE'] = $res['title']; $pathdata[$i]['LINK'] = mklink('links.php?catid=' . $res['id'], 'links,' . $res['id'] . ',1' . urlformat($res['title']) . '.html'); } return $pathdata; }
function search_videos($items, $conn) { global $set, $db, $apx, $user; require_once BASEDIR . getmodulepath('videos') . 'functions.php'; //Suchstring generieren $tagmatches = videos_match_tags($items); foreach ($items as $item) { $tagmatch = array_shift($tagmatches); $search[] = " ( " . iif($tagmatch, " id IN (" . implode(',', $tagmatch) . ") OR ") . " title LIKE '%" . addslashes_like($item) . "%' OR text LIKE '%" . addslashes_like($item) . "%' ) "; } $searchstring = implode($conn, $search); //Videos durchsuchen $data = $db->fetch("SELECT id,title FROM " . PRE . "_videos WHERE ( searchable='1' AND '" . time() . "' BETWEEN starttime AND endtime " . section_filter() . " AND ( " . $searchstring . " ) ) ORDER BY addtime DESC"); if (count($data)) { foreach ($data as $res) { ++$i; $result[$i]['TITLE'] = $res['title']; $result[$i]['LINK'] = mklink('videos.php?id=' . $res['id'], 'videos,id' . $res['id'] . urlformat($res['title']) . '.html'); } } return $result; }
function search_glossar($items, $conn) { global $set, $db, $apx, $user; require_once BASEDIR . getmodulepath('glossar') . 'functions.php'; //Suchstring generieren $tagmatches = glossar_match_tags($items); foreach ($items as $item) { $tagmatch = array_shift($tagmatches); $search[] = " ( " . iif($tagmatch, " id IN (" . implode(',', $tagmatch) . ") OR ") . " title LIKE '%" . addslashes_like($item) . "%' OR text LIKE '%" . addslashes_like($item) . "%' ) "; } $searchstring = implode($conn, $search); //Ergebnisse $data = $db->fetch("SELECT id,title FROM " . PRE . "_glossar WHERE ( searchable='1' AND starttime!='0' AND ( " . $searchstring . " ) ) ORDER BY title ASC"); if (count($data)) { foreach ($data as $res) { ++$i; $result[$i]['TITLE'] = strip_tags($res['title']); $result[$i]['LINK'] = mklink('glossar.php?id=' . $res['id'], 'glossar,id' . $res['id'] . urlformat($res['title']) . '.html'); } } return $result; }
function search_content($items, $conn) { global $set, $db, $apx, $user; //Suchstring generieren foreach ($items as $item) { $search[] = " ( title LIKE '%" . addslashes_like($item) . "%' OR text LIKE '%" . addslashes_like($item) . "%' ) "; } $searchstring = implode($conn, $search); //Ergebnisse $data = $db->fetch("SELECT id,title FROM " . PRE . "_content WHERE ( searchable='1' AND active='1' " . section_filter() . " AND ( " . $searchstring . " ) ) ORDER BY title ASC"); if (count($data)) { foreach ($data as $res) { ++$i; $temp = explode('->', $res['title']); $title = array_pop($temp); $link = mklink('content.php?id=' . $res['id'], 'content,' . $res['id'] . urlformat($title) . '.html'); $result[$i]['TITLE'] = strip_tags($title); $result[$i]['LINK'] = $link; } } return $result; }
function misc_linksfeed() { global $set, $db, $apx; $apx->tmpl->loaddesign('blank'); header('Content-type: application/rss+xml'); //Baum holen, wenn nur eine bestimmte Kategorie gezeigt werden soll $cattree = links_tree($_REQUEST['catid']); $data = $db->fetch("SELECT a.id,a.catid,a.title,a.text,a.starttime,a.top,b.username,b.email,b.pub_hidemail FROM " . PRE . "_links AS a LEFT JOIN " . PRE . "_user AS b USING (userid) WHERE ( ( '" . time() . "' BETWEEN starttime AND endtime ) " . iif(count($cattree), "AND catid IN (" . @implode(',', $cattree) . ")") . " " . section_filter() . " ) ORDER BY starttime DESC LIMIT 20"); if (count($data)) { //Kategorien auslesen $catids = get_ids($data, 'catid'); if (count($catids)) { $catdata = $db->fetch("SELECT id,title FROM " . PRE . "_links_cat WHERE id IN (" . implode(',', $catids) . ")"); if (count($catdata)) { foreach ($catdata as $catres) { $catinfo[$catres['id']] = $catres; } } } foreach ($data as $res) { ++$i; //Link $link = mklink('links.php?id=' . $res['id'], 'links,id' . $res['id'] . urlformat($res['title']) . '.html'); $tabledata[$i]['ID'] = $res['id']; $tabledata[$i]['TITLE'] = rss_replace($res['title']); $tabledata[$i]['URL'] = $res['url']; $tabledata[$i]['TIME'] = date('r', $res['starttime']); //Kein TIMEDIFF weil Zeitverschiebung mit angegeben! $tabledata[$i]['TEXT'] = rss_replace(preg_replace('#{IMAGE\\(([0-9]+)\\)}#s', '', $res['text'])); $tabledata[$i]['CATTITLE'] = rss_replace($catinfo[$res['catid']]['title']); $tabledata[$i]['LINK'] = HTTP_HOST . $link; $tabledata[$i]['TOP'] = $res['top']; } } $apx->tmpl->assign('WEBSITENAME', $set['main']['websitename']); $apx->tmpl->assign('LINK', $tabledata); $apx->tmpl->parse('rss', 'links'); }
function misc_galleryfeed() { global $set, $db, $apx; $apx->tmpl->loaddesign('blank'); header('Content-type: application/rss+xml'); $data = $db->fetch("SELECT id,title,description,starttime FROM " . PRE . "_gallery WHERE ( ( '" . time() . "' BETWEEN starttime AND endtime ) " . section_filter() . " ) ORDER BY starttime DESC LIMIT 20"); if (count($data)) { foreach ($data as $res) { ++$i; //Link $link = mklink('gallery.php?id=' . $res['id'], 'gallery,list' . $res['id'] . ',1' . urlformat($res['title']) . '.html'); $tabledata[$i]['ID'] = $res['id']; $tabledata[$i]['TITLE'] = rss_replace($res['title']); $tabledata[$i]['TIME'] = date('r', $res['starttime']); //Kein TIMEDIFF weil Zeitverschiebung mit angegeben! $tabledata[$i]['DESCRIPTION'] = rss_replace($res['description']); $tabledata[$i]['LINK'] = HTTP_HOST . $link; } } $apx->tmpl->assign('WEBSITENAME', $set['main']['websitename']); $apx->tmpl->assign('GALLERY', $tabledata); $apx->tmpl->parse('rss', 'gallery'); }
function search_calendar($items, $conn) { global $set, $db, $apx, $user; require_once BASEDIR . getmodulepath('calendar') . 'functions.php'; //Suchstring generieren $tagmatches = calendar_match_tags($items); foreach ($items as $item) { $tagmatch = array_shift($tagmatches); $search[] = " ( " . iif($tagmatch, " id IN (" . implode(',', $tagmatch) . ") OR ") . " title LIKE '%" . addslashes_like($item) . "%' OR text LIKE '%" . addslashes_like($item) . "%' ) "; } $searchstring = implode($conn, $search); //Ergebnisse $data = $db->fetch("SELECT id,title FROM " . PRE . "_calendar_events WHERE ( active!=0 AND private=0 " . section_filter() . " AND ( " . $searchstring . " ) ) ORDER BY startday ASC, starttime ASC, title ASC"); if (count($data)) { foreach ($data as $res) { ++$i; $link = mklink('events.php?id=' . $res['id'], 'events,id' . $res['id'] . urlformat($res['title']) . '.html'); $result[$i]['TITLE'] = strip_tags($res['title']); $result[$i]['LINK'] = $link; } } return $result; }
function search_articles($items, $conn) { global $set, $db, $apx, $user; require_once BASEDIR . getmodulepath('articles') . 'functions.php'; //Suchstrings generieren $tagmatches = articles_match_tags($items); foreach ($items as $item) { $tagmatch = array_shift($tagmatches); $search1[] = "( title LIKE '%" . addslashes_like($item) . "%' OR text LIKE '%" . addslashes_like($item) . "%' ) "; $search2[] = "( " . iif($tagmatch, " id IN (" . implode(',', $tagmatch) . ") OR ") . " title LIKE '%" . addslashes_like($item) . "%' OR subtitle LIKE '%" . addslashes_like($item) . "%' OR teaser LIKE '%" . addslashes_like($item) . "%' ) "; } $searchstring1 = "( " . implode($conn, $search1) . " )"; $searchstring2 = "( " . implode($conn, $search2) . " )"; //Seiten durchsuchen $data = $db->fetch("SELECT artid FROM " . PRE . "_articles_pages WHERE ( " . $searchstring1 . " ) GROUP BY artid"); $artids = get_ids($data, 'artid'); if (count($artids)) { $pageres = "id IN (" . @implode(',', $artids) . ") OR"; } //Artikel durchsuchen $data = $db->fetch("SELECT id,type,title,subtitle FROM " . PRE . "_articles WHERE ( searchable='1' AND '" . time() . "' BETWEEN starttime AND endtime " . section_filter() . " AND ( " . $pageres . " " . $searchstring2 . " ) ) ORDER BY starttime DESC"); if (count($data)) { foreach ($data as $res) { ++$i; //Wohin soll verlinkt werden? if ($res['type'] == 'normal') { $link2file = 'articles'; } else { $link2file = $res['type'] . 's'; } $link = mklink($link2file . '.php?id=' . $res['id'], $link2file . ',id' . $res['id'] . ',0' . urlformat($res['title']) . '.html'); $result[$i]['TITLE'] = strip_tags($res['title']) . iif($res['subtitle'], ' - ' . strip_tags($res['subtitle'])); $result[$i]['LINK'] = $link; } } return $result; }
require 'lib/_end.php'; } $db->query("UPDATE " . PRE . "_user SET avatar='" . addslashes($newfile) . "',avatar_title='" . addslashes($_POST['avatar_title']) . "' WHERE userid='" . $user->info['userid'] . "' LIMIT 1"); if ($user->info['avatar']) { $mm->deletefile('user/' . $user->info['avatar']); } message($apx->lang->get('MSG_OK'), mklink('user.php?action=avatar', 'user,avatar.html')); } } } elseif ($_POST['delav']) { require BASEDIR . 'lib/class.mediamanager.php'; $mm = new mediamanager(); $mm->deletefile('user/' . $user->info['avatar']); $db->query("UPDATE " . PRE . "_user SET avatar='',avatar_title='' WHERE userid='" . $user->info['userid'] . "' LIMIT 1"); message($apx->lang->get('MSG_OK'), mklink('user.php?action=avatar', 'user,avatar.html')); } else { $db->query("UPDATE " . PRE . "_user SET avatar_title='" . addslashes($_POST['avatar_title']) . "' WHERE userid='" . $user->info['userid'] . "' LIMIT 1"); message($apx->lang->get('MSG_OK'), mklink('user.php?action=avatar', 'user,avatar.html')); } } else { if ($user->info['avatar']) { $apx->tmpl->assign('CURRENT_AVATAR', $user->mkavatar($user->info)); $apx->tmpl->assign('CURRENT_TITLE', $user->mkavtitle($user->info)); } $apx->tmpl->assign('MAX_DIMENSIONS', $set['user']['avatar_maxdim']); $apx->tmpl->assign('MAX_FILESIZE', user_getsize($set['user']['avatar_maxsize'], 0)); $postto = mklink('user.php?action=avatar', 'user,avatar.html'); $apx->tmpl->assign('POSTTO', $postto); $apx->tmpl->assign('AVATAR_TITLE', compatible_hsc($user->info['avatar_title'])); $apx->tmpl->parse('avatar'); }
$goto = mklink('user.php?action=ignorelist', 'user,ignorelist.html'); message($apx->lang->get('MSG_ADD_OK'), $goto); } } } else { tmessage('addignore', array('USERNAME' => compatible_hsc($_REQUEST['username']))); } } elseif ($_REQUEST['del']) { if ($_POST['del']) { $db->query("DELETE FROM " . PRE . "_user_ignore WHERE userid='" . $user->info['userid'] . "' AND ignored='" . intval($_POST['del']) . "' LIMIT 1"); $goto = mklink('user.php?action=ignorelist', 'user,ignorelist.html'); message($apx->lang->get('MSG_DEL_OK'), $goto); } else { tmessage('delignore', array('ID' => $_REQUEST['del'])); } } else { //Ignorierte Benutzer auslesen $data = $db->fetch("SELECT u.userid,u.username,i.reason FROM " . PRE . "_user_ignore AS i LEFT JOIN " . PRE . "_user AS u ON i.ignored=u.userid WHERE i.userid='" . $user->info['userid'] . "' ORDER BY u.username ASC"); if (count($data)) { foreach ($data as $res) { ++$i; $tabledata[$i]['ID'] = $res['userid']; $tabledata[$i]['NAME'] = replace($res['username']); $tabledata[$i]['REASON'] = replace($res['reason']); $tabledata[$i]['LINK_DEL'] = mklink('user.php?action=ignorelist&del=' . $res['userid'], 'user,ignorelist.html?del=' . $res['userid']); } } $apx->tmpl->assign('LINK_ADD', mklink('user.php?action=ignorelist&add=1', 'user,ignorelist.html?add=1')); $apx->tmpl->assign('USER', $tabledata); $apx->tmpl->parse('ignorelist'); }
function sendpm_send($res, $subject, $text, $cleartext) { global $apx, $db, $set; list($touser, $email, $pop, $mailpm) = $res; //PM erstellen $db->query("INSERT INTO " . PRE . "_user_pms (fromuser,touser,subject,text,time,addsig) VALUES ('" . $apx->user->info['userid'] . "','" . $touser . "','" . addslashes($subject) . "','" . addslashes($text) . "','" . time() . "','0')"); if ($pop) { $db->query("UPDATE " . PRE . "_user SET pmpopup='1' WHERE userid='" . $touser . "' LIMIT 1"); } //eMail-Benachrichtigung bei neuer PM if ($mailpm) { $inboxlink = HTTP_HOST . mklink('user.php?action=pms', 'user,pms.html'); $input = array('USERNAME' => $apx->user->info['username'], 'WEBSITE' => $set['main']['websitename'], 'INBOX' => $inboxlink, 'SUBJECT' => $subject, 'TEXT' => $cleartext); sendmail($email, 'NEWPM', $input); } }
function announce() { global $set, $apx, $db, $html; //Aktionen if ($_REQUEST['do'] == 'add') { return $this->announce_add(); } if ($_REQUEST['do'] == 'edit') { return $this->announce_edit(); } if ($_REQUEST['do'] == 'del') { return $this->announce_del(); } //Voreinstellung if (!$_REQUEST['what']) { $_REQUEST['what'] = 'posts'; } echo '<p class="slink">» <a href="action.php?action=forum.announce&do=add&criteria=' . $_REQUEST['what'] . '">' . $apx->lang->get('ADDANNOUNCE') . '</a></p>'; $col[] = array('', 0, ''); $col[] = array('COL_TITLE', 50, 'class="title"'); $col[] = array('COL_USER', 30, 'align="center"'); $col[] = array('COL_PUBDATE', 20, 'align="center"'); $orderdef[0] = 'addtime'; $orderdef['title'] = array('a.title', 'ASC', 'COL_TITLE'); $orderdef['username'] = array('b.username', 'ASC', 'COL_USER'); $orderdef['addtime'] = array('a.starttime', 'DESC', 'SORT_ADDTIME'); $orderdef['publication'] = array('a.starttime', 'DESC', 'COL_PUBDATE'); list($count) = $db->first("SELECT count(id) FROM " . PRE . "_forum_announcements WHERE userid!=''"); pages('action.php?action=forum.announce&sortby=' . $_REQUEST['sortby'], $count); $data = $db->fetch("SELECT a.id,a.title,a.userid,a.starttime,a.endtime,b.username FROM " . PRE . "_forum_announcements AS a LEFT JOIN " . PRE . "_user AS b USING(userid) WHERE a.userid!='' " . getorder($orderdef) . getlimit()); if (count($data)) { foreach ($data as $res) { ++$i; if (!$res['starttime']) { $tabledata[$i]['COL1'] = '<img src="design/reddot.gif" alt="' . $apx->lang->get('CORE_INACTIVE') . '" title="' . $apx->lang->get('CORE_INACTIVE') . '" />'; } elseif ($res['endtime'] < time()) { $tabledata[$i]['COL1'] = '<img src="design/greendotcross.gif" alt="' . $apx->lang->get('CORE_INACTIVE') . '" title="' . $apx->lang->get('CORE_INACTIVE') . '" />'; } elseif ($res['starttime'] > time()) { $tabledata[$i]['COL1'] = '<img src="design/greendotwait.gif" alt="' . $apx->lang->get('CORE_ACTIVE') . '" title="' . $apx->lang->get('CORE_ACTIVE') . '" />'; } else { $tabledata[$i]['COL1'] = '<img src="design/greendot.gif" alt="' . $apx->lang->get('CORE_ACTIVE') . '" title="' . $apx->lang->get('CORE_ACTIVE') . '" />'; } $link = mklink($set['forum']['directory'] . '/announcement.php?id=' . $res['id'], $set['forum']['directory'] . '/announcement,' . $res['id'] . urlformat($res['title']) . '.html'); $tabledata[$i]['COL2'] = '<a href="' . $link . '" target="_blank">' . replace($res['title']) . '</a>'; $tabledata[$i]['COL3'] = $res['username']; if ($res['starttime']) { $tabledata[$i]['COL4'] = mkdate($res['starttime'], '<br />'); } else { $tabledata[$i]['COL4'] = ' '; } //Optionen $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'forum.announce', 'do=edit&id=' . $res['id'], $apx->lang->get('CORE_EDIT')); $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', 'forum.announce', 'do=del&id=' . $res['id'], $apx->lang->get('CORE_DEL')); } } $apx->tmpl->assign('TABLE', $tabledata); $html->table($col); orderstr($orderdef, 'action.php?action=forum.announce'); save_index($_SERVER['REQUEST_URI']); }
if ($elt->tid != $arg_tid) { $similar_tids[] = $elt->tid; } $rownum++; $o = odd_even($rownum); $rows .= "<tr {$o}>"; $rows .= sprintf("<td>%s</td>", h($elt->posted)); $t = sprintf("trans.php?tid=%d", $elt->tid); $rows .= sprintf("<td>%s</td>\n", mklink($elt->name2, $t)); $t = sprintf("trans.php?tid=%d", $elt->tid); $rows .= sprintf("<td>%s</td>\n", mklink($elt->name, $t)); $text = sprintf("%.2f", $elt->amount); $rows .= sprintf("<td class='num'>%s</td>\n", mklink($text, $t)); $tag_name = @$tag_id_to_name[$elt->tag_id]; $t = sprintf("tag.php?tag_id=%d", $elt->tag_id); $rows .= sprintf("<td>%s</td>", mklink($tag_name, $t)); $rows .= "</tr>\n"; } $body .= "<h2>Similar transactions</h2>\n"; if (count($splits) == 1 && count($similar_tids) > 0) { $sp = $splits[0]; $body .= "<form action='trans.php'>\n"; $body .= "<input type='hidden' name='set_splits' value='1' />\n"; $body .= sprintf("<input type='hidden' name='tid' value='%d' />\n", $arg_tid); $body .= sprintf("<input type='hidden' name='name2' value='%s' />\n", h($db_name2)); $val = join(",", $similar_tids); $body .= sprintf("<input type='hidden' name='tids' value='%s' />\n", h($val)); $body .= sprintf("<input type='hidden' name='tag_id' value='%d' />\n", $sp->tag_id); $body .= "<input type='checkbox'" . " name='set_splits_checkbox' value='1' />\n"; $tag_name = $tag_id_to_name[$sp->tag_id]; $text = sprintf("Set %d transactions to %s", count($similar_tids), $tag_name);
$apx->tmpl->assign('PREVIEW', $text); $apx->tmpl->assign('USERNAME', compatible_hsc($_POST['touser'])); $apx->tmpl->assign('SUBJECT', compatible_hsc($_POST['subject'])); $apx->tmpl->assign('TEXT', compatible_hsc($_POST['text'])); $apx->tmpl->assign('ADDSIG', intval($_POST['addsig'])); } else { $text = ''; if ($_REQUEST['answer']) { $res = $db->first("SELECT a.subject,a.text,b.userid,b.username,c.username AS username2 FROM " . PRE . "_user_pms AS a LEFT JOIN " . PRE . "_user AS b ON a.fromuser=b.userid LEFT JOIN " . PRE . "_user AS c ON a.touser=c.userid WHERE ( a.id='" . $_REQUEST['answer'] . "' AND ( a.touser='******'userid'] . "' OR a.fromuser='******'userid'] . "' ) )"); if ($res['userid'] == $user->info['userid']) { $username = compatible_hsc($res['username2']); $subject = compatible_hsc($res['subject']); $text = '[QUOTE]' . compatible_hsc($res['text']) . "[/QUOTE]\n"; } else { $username = compatible_hsc($res['username']); $subject = iif($res['subject'] && substr($res['subject'], 0, 4) != 'Re: ', 'Re: ') . compatible_hsc($res['subject']); $text = '[QUOTE]' . compatible_hsc($res['text']) . "[/QUOTE]\n"; } } elseif ($_REQUEST['touser']) { list($username) = $db->first("SELECT username FROM " . PRE . "_user WHERE userid='" . $_REQUEST['touser'] . "' LIMIT 1"); $username = compatible_hsc($username); } $apx->tmpl->assign('USERNAME', replace($username)); $apx->tmpl->assign('SUBJECT', $subject); $apx->tmpl->assign('TEXT', $text); $apx->tmpl->assign('ADDSIG', 1); } $postto = mklink('user.php?action=newpm', 'user,newpm.html'); $apx->tmpl->assign('POSTTO', $postto); $apx->tmpl->parse('newpm'); }
function user_assign_profile_links(&$tmpl, $userinfo) { global $apx, $set, $db, $user; $link_profile = mklink('user.php?action=profile&id=' . $userinfo['userid'], 'user,profile,' . $userinfo['userid'] . urlformat($userinfo['username']) . '.html'); if ($set['user']['blog']) { $link_blog = mklink('user.php?action=blog&id=' . $userinfo['userid'], 'user,blog,' . $userinfo['userid'] . ',1.html'); } if ($set['user']['gallery']) { $link_gallery = mklink('user.php?action=gallery&id=' . $userinfo['userid'], 'user,gallery,' . $userinfo['userid'] . ',0,0.html'); } if ($set['user']['guestbook'] && $userinfo['pub_usegb']) { $link_guestbook = mklink('user.php?action=guestbook&id=' . $userinfo['userid'], 'user,guestbook,' . $userinfo['userid'] . ',1.html'); } if ($apx->is_module('products') && $set['products']['collection']) { $link_collection = mklink('user.php?action=collection&id=' . $userinfo['userid'], 'user,collection,' . $userinfo['userid'] . ',0,1.html'); } $tmpl->assign('LINK_PROFILE', $link_profile); $tmpl->assign('LINK_BLOG', $link_blog); $tmpl->assign('LINK_GALLERY', $link_gallery); $tmpl->assign('LINK_GUESTBOOK', $link_guestbook); $tmpl->assign('LINK_COLLECTION', $link_collection); }
function products_print($data, $template) { global $set, $db, $apx, $user; $tmpl = new tengine(); $apx->lang->drop('fields', 'products'); //Verwendet Variablen auslesen $parse = $apx->tmpl->used_vars($template, 'products'); $ids = get_ids($data, 'id'); $types = get_ids($data, 'type'); if (count($data)) { $unitvars = array('PRODUCT.DEVELOPER', 'PRODUCT.DEVELOPER_WEBSITE', 'PRODUCT.DEVELOPER_LINK', 'PRODUCT.PUBLISHER', 'PRODUCT.PUBLISHER_WEBSITE', 'PRODUCT.PUBLISHER_LINK', 'PRODUCT.MANUFACTURER', 'PRODUCT.MANUFACTURER_WEBSITE', 'PRODUCT.MANUFACTURER_LINK', 'PRODUCT.STUDIO', 'PRODUCT.STUDIO_WEBSITE', 'PRODUCT.STUDIO_LINK', 'PRODUCT.LABEL', 'PRODUCT.LABEL_WEBSITE', 'PRODUCT.LABEL_LINK', 'PRODUCT.ARTIST', 'PRODUCT.ARTIST_WEBSITE', 'PRODUCT.ARTIST_LINK', 'PRODUCT.AUTHOR', 'PRODUCT.AUTHOR_WEBSITE', 'PRODUCT.AUTHOR_LINK'); //Einheiten auslesen $unitinfo = array(); if (in_template($unitvars, $parse)) { $unitids = array_merge(get_ids($data, 'manufacturer'), get_ids($data, 'publisher')); $unitinfo = $db->fetch_index("SELECT id,title,website FROM " . PRE . "_products_units WHERE id IN (" . implode(',', $unitids) . ")", 'id'); } //Gruppen auslesen $groupinfo = array(); $groups = array(); /*if ( in_template(array('PRODUCT.MEDIA'),$parse) ) $groups = array_merge($groups,get_ids($data,'media')); if ( in_array('PRODUCT.GENRE',$parse) ) $groups = array_merge($groups,get_ids($data,'genre')); if ( in_array('game',$types) && in_template(array('PRODUCT.RELEASE.SYSTEM','PRODUCT.RELEASE.SYSTEM_ICON','PRODUCT.SYSTEM'),$parse) ) { if ( count($groups)==0 ) $groups = array(0); $groupinfo = $db->fetch_index("SELECT id,title,icon FROM ".PRE."_products_groups WHERE id IN (".implode(',',$groups).") OR grouptype='system'",'id'); } elseif ( in_array('movie',$types) && in_template(array('PRODUCT.RELEASE.MEDIA','PRODUCT.RELEASE.MEDIA_ICON','PRODUCT.MEDIA'),$parse) ) { if ( count($groups)==0 ) $groups = array(0); $groupinfo = $db->fetch_index("SELECT id,title,icon FROM ".PRE."_products_groups WHERE id IN (".implode(',',$groups).") OR grouptype='media'",'id'); } elseif ( count($groups) ) { $groupinfo = $db->fetch_index("SELECT id,title,icon FROM ".PRE."_products_groups WHERE id IN (".implode(',',$groups).")",'id'); }*/ $groupinfo = $db->fetch_index("SELECT id,title,icon FROM " . PRE . "_products_groups", 'id'); //Veröffentlichungs-Daten auslesen $releaseinfo = array(); if (in_array('PRODUCT.RELEASE', $parse)) { $releasedata = $db->fetch("SELECT prodid,system,data,stamp FROM " . PRE . "_products_releases WHERE prodid IN (" . implode(',', $ids) . ") ORDER BY stamp ASC"); if (count($releasedata)) { foreach ($releasedata as $relres) { $info = unserialize($relres['data']); $releasedate = products_format_release($info); $relentry = array('stamp' => $relres['stamp'], 'DATE' => $releasedate, 'SYSTEM' => $groupinfo[$relres['system']]['title'], 'SYSTEM_ICON' => $groupinfo[$relres['system']]['icon'], 'MEDIA' => $groupinfo[$relres['system']]['title'], 'MEDIA_ICON' => $groupinfo[$relres['system']]['icon']); $releaseinfo[$relres['prodid']][] = $relentry; } } } //Produkte auflisten foreach ($data as $res) { ++$i; //Link $link = mklink('products.php?id=' . $res['id'], 'products,id' . $res['id'] . urlformat($res['title']) . '.html'); //Produktbild if (in_array('PRODUCT.PICTURE', $parse) || in_array('PRODUCT.PICTURE_POPUP', $parse) || in_array('PRODUCT.PICTURE_POPUPPATH', $parse)) { list($picture, $picture_popup, $picture_popuppath) = products_pic($res['picture']); } //Teaserbild if (in_array('PRODUCT.TEASERPIC', $parse) || in_array('PRODUCT.TEASERPIC_POPUP', $parse) || in_array('PRODUCT.TEASERPIC_POPUPPATH', $parse)) { list($teaserpic, $teaserpic_popup, $teaserpic_popuppath) = products_pic($res['teaserpic']); } //Text $text = ''; if (in_array('PRODUCT.TEXT', $parse)) { $text = mediamanager_inline($res['text']); if ($apx->is_module('glossar')) { $text = glossar_highlight($text); } } //Datehead if ($laststamp != date('Y/m/d', $res['addtime'] - TIMEDIFF)) { $tabledata[$i]['DATEHEAD'] = $res['addtime']; } //Tags if (in_array('PRODUCT.TAG', $parse) || in_array('PRODUCT.TAG_IDS', $parse) || in_array('PRODUCT.KEYWORDS', $parse)) { list($tagdata, $tagids, $keywords) = products_tags($res['id']); } //Standard-Platzhalter $tabledata[$i]['ID'] = $res['id']; $tabledata[$i]['TYPE'] = $res['type']; $tabledata[$i]['LINK'] = $link; $tabledata[$i]['TITLE'] = $res['title']; $tabledata[$i]['TEXT'] = $text; $tabledata[$i]['TIME'] = $res['addtime']; $tabledata[$i]['WEBSITE'] = $res['website']; $tabledata[$i]['BUYLINK'] = $res['buylink']; $tabledata[$i]['PRICE'] = $res['price']; $tabledata[$i]['HITS'] = $res['hits']; $tabledata[$i]['PICTURE'] = $picture; $tabledata[$i]['PICTURE_POPUP'] = $picture_popup; $tabledata[$i]['PICTURE_POPUPPATH'] = $picture_popuppath; $tabledata[$i]['TEASERPIC'] = $teaserpic; $tabledata[$i]['TEASERPIC_POPUP'] = $teaserpic_popup; $tabledata[$i]['TEASERPIC_POPUPPATH'] = $teaserpic_popuppath; $tabledata[$i]['PRODUCT_ID'] = $res['prodid']; $tabledata[$i]['RECOMMENDED_PRICE'] = $res['recprice']; $tabledata[$i]['GUARANTEE'] = $res['guarantee']; //Sammlung if ($user->info['userid']) { if (!products_in_coll($res['id'])) { $tabledata[$i]['LINK_COLLECTION_ADD'] = mklink('products.php?id=' . $res['id'] . '&addcoll=1', 'products,id' . $res['id'] . urlformat($res['title']) . '.html?addcoll=1'); } else { $tabledata[$i]['LINK_COLLECTION_REMOVE'] = mklink('products.php?id=' . $res['id'] . '&removecoll=1', 'products,id' . $res['id'] . urlformat($res['title']) . '.html?removecoll=1'); } } //Tags $tabledata[$i]['TAG'] = $tagdata; $tabledata[$i]['TAG_IDS'] = $tagids; $tabledata[$i]['KEYWORDS'] = $keywords; //NORMAL if ($res['type'] == 'normal') { $manulink = mklink('manufacturers.php?id=' . $res['manufacturer'], 'manufacturers,id' . $res['manufacturer'] . urlformat($unitinfo[$res['manufacturer']]['title']) . '.html'); $tabledata[$i]['MANUFACTURER'] = $unitinfo[$res['manufacturer']]['title']; $tabledata[$i]['MANUFACTURER_WEBSITE'] = $unitinfo[$res['manufacturer']]['website']; $tabledata[$i]['MANUFACTURER_LINK'] = $manulink; } elseif ($res['type'] == 'game') { //System-Liste $systemdata = array(); if (in_array('PRODUCT.SYSTEM', $parse)) { $systems = dash_unserialize($res['systems']); if (!is_array($systems)) { $systems = array(); } foreach ($systems as $sysid) { ++$ii; $systemdata[$ii]['TITLE'] = $groupinfo[$sysid]['title']; $systemdata[$ii]['ICON'] = $groupinfo[$sysid]['icon']; } } //Media-Liste $media = dash_unserialize($res['media']); if (!is_array($media)) { $media = array(); } $mediadata = array(); foreach ($media as $medid) { ++$ii; $mediadata[$ii]['TITLE'] = $groupinfo[$medid]['title']; $mediadata[$ii]['ICON'] = $groupinfo[$medid]['icon']; } $manulink = mklink('manufacturers.php?id=' . $res['manufacturer'], 'manufacturers,id' . $res['manufacturer'] . urlformat($unitinfo[$res['manufacturer']]['title']) . '.html'); $publink = mklink('manufacturers.php?id=' . $res['publisher'], 'manufacturers,id' . $res['publisher'] . urlformat($unitinfo[$res['publisher']]['title']) . '.html'); $tabledata[$i]['DEVELOPER'] = $unitinfo[$res['manufacturer']]['title']; $tabledata[$i]['DEVELOPER_WEBSITE'] = $unitinfo[$res['manufacturer']]['website']; $tabledata[$i]['DEVELOPER_LINK'] = $manulink; $tabledata[$i]['PUBLISHER'] = $unitinfo[$res['publisher']]['title']; $tabledata[$i]['PUBLISHER_WEBSITE'] = $unitinfo[$res['publisher']]['website']; $tabledata[$i]['PUBLISHER_LINK'] = $publink; $tabledata[$i]['USK'] = $res['sk']; $tabledata[$i]['GENRE'] = $groupinfo[$res['genre']]['title']; $tabledata[$i]['MEDIA'] = $mediadata; $tabledata[$i]['SYSTEM'] = $systemdata; $tabledata[$i]['REQUIREMENTS'] = $res['requirements']; } elseif ($res['type'] == 'hardware') { $manulink = mklink('manufacturers.php?id=' . $res['manufacturer'], 'manufacturers,id' . $res['manufacturer'] . urlformat($unitinfo[$res['manufacturer']]['title']) . '.html'); $tabledata[$i]['MANUFACTURER'] = $unitinfo[$res['manufacturer']]['title']; $tabledata[$i]['MANUFACTURER_WEBSITE'] = $unitinfo[$res['manufacturer']]['website']; $tabledata[$i]['MANUFACTURER_LINK'] = $manulink; $tabledata[$i]['EQUIPMENT'] = $res['equipment']; } elseif ($res['type'] == 'software') { //Media-Liste $media = dash_unserialize($res['media']); if (!is_array($media)) { $media = array(); } $mediadata = array(); foreach ($media as $medid) { ++$ii; $mediadata[$ii]['TITLE'] = $groupinfo[$medid]['title']; $mediadata[$ii]['ICON'] = $groupinfo[$medid]['icon']; } $manulink = mklink('manufacturers.php?id=' . $res['manufacturer'], 'manufacturers,id' . $res['manufacturer'] . urlformat($unitinfo[$res['manufacturer']]['title']) . '.html'); $tabledata[$i]['MANUFACTURER'] = $unitinfo[$res['manufacturer']]['title']; $tabledata[$i]['MANUFACTURER_WEBSITE'] = $unitinfo[$res['manufacturer']]['website']; $tabledata[$i]['MANUFACTURER_LINK'] = $manulink; $tabledata[$i]['OS'] = $res['os']; $tabledata[$i]['LANGUAGES'] = $res['languages']; $tabledata[$i]['REQUIREMENTS'] = $res['requirements']; $tabledata[$i]['LICENSE'] = $res['license']; $tabledata[$i]['VERSION'] = $res['version']; $tabledata[$i]['MEDIA'] = $mediadata; } elseif ($res['type'] == 'music') { //Media-Liste $media = dash_unserialize($res['media']); if (!is_array($media)) { $media = array(); } $mediadata = array(); foreach ($media as $medid) { ++$ii; $mediadata[$ii]['TITLE'] = $groupinfo[$medid]['title']; $mediadata[$ii]['ICON'] = $groupinfo[$medid]['icon']; } $manulink = mklink('manufacturers.php?id=' . $res['manufacturer'], 'manufacturers,id' . $res['manufacturer'] . urlformat($unitinfo[$res['manufacturer']]['title']) . '.html'); $publink = mklink('manufacturers.php?id=' . $res['publisher'], 'manufacturers,id' . $res['publisher'] . urlformat($unitinfo[$res['publisher']]['title']) . '.html'); $tabledata[$i]['ARTIST'] = $unitinfo[$res['manufacturer']]['title']; $tabledata[$i]['ARTIST_WEBSITE'] = $unitinfo[$res['manufacturer']]['website']; $tabledata[$i]['ARTIST_LINK'] = $manulink; $tabledata[$i]['LABEL'] = $unitinfo[$res['publisher']]['title']; $tabledata[$i]['LABEL_WEBSITE'] = $unitinfo[$res['publisher']]['website']; $tabledata[$i]['LABEL_LINK'] = $publink; $tabledata[$i]['FSK'] = $res['sk']; $tabledata[$i]['GENRE'] = $groupinfo[$res['genre']]['title']; $tabledata[$i]['MEDIA'] = $mediadata; } elseif ($res['type'] == 'movie') { //Media-Liste $media = dash_unserialize($res['media']); if (!is_array($media)) { $media = array(); } $mediadata = array(); foreach ($media as $medid) { ++$ii; $mediadata[$ii]['TITLE'] = $groupinfo[$medid]['title']; $mediadata[$ii]['ICON'] = $groupinfo[$medid]['icon']; } $publink = mklink('manufacturers.php?id=' . $res['publisher'], 'manufacturers,id' . $res['publisher'] . urlformat($unitinfo[$res['publisher']]['title']) . '.html'); $tabledata[$i]['STUDIO'] = $unitinfo[$res['publisher']]['title']; $tabledata[$i]['STUDIO_WEBSITE'] = $unitinfo[$res['publisher']]['website']; $tabledata[$i]['STUDIO_LINK'] = $publink; $tabledata[$i]['REGISSEUR'] = $res['regisseur']; $tabledata[$i]['ACTORS'] = $res['actors']; $tabledata[$i]['LENGTH'] = $res['length']; $tabledata[$i]['FSK'] = $res['sk']; $tabledata[$i]['GENRE'] = $groupinfo[$res['genre']]['title']; $tabledata[$i]['MEDIA'] = $mediadata; } elseif ($res['type'] == 'book') { //Media-Liste $media = dash_unserialize($res['media']); if (!is_array($media)) { $media = array(); } $mediadata = array(); foreach ($media as $medid) { ++$ii; $mediadata[$ii]['TITLE'] = $groupinfo[$medid]['title']; $mediadata[$ii]['ICON'] = $groupinfo[$medid]['icon']; } $manulink = mklink('manufacturers.php?id=' . $res['manufacturer'], 'manufacturers,id' . $res['manufacturer'] . urlformat($unitinfo[$res['manufacturer']]['title']) . '.html'); $publink = mklink('manufacturers.php?id=' . $res['publisher'], 'manufacturers,id' . $res['publisher'] . urlformat($unitinfo[$res['publisher']]['title']) . '.html'); $tabledata[$i]['AUTHOR'] = $unitinfo[$res['manufacturer']]['title']; $tabledata[$i]['AUTHOR_WEBSITE'] = $unitinfo[$res['manufacturer']]['website']; $tabledata[$i]['AUTHOR_LINK'] = $manulink; $tabledata[$i]['PUBLISHER'] = $unitinfo[$res['publisher']]['title']; $tabledata[$i]['PUBLISHER_WEBSITE'] = $unitinfo[$res['publisher']]['website']; $tabledata[$i]['PUBLISHER_LINK'] = $publink; $tabledata[$i]['GENRE'] = $groupinfo[$res['genre']]['title']; $tabledata[$i]['MEDIA'] = $mediadata; $tabledata[$i]['ISBN'] = $res['isbn']; } //Benutzerdefinierte Felder for ($ii = 1; $ii <= 10; $ii++) { $tabledata[$i]['CUSTOM' . $ii . '_NAME'] = replace($set['products']['custom_' . $res['type']][$ii - 1]); $tabledata[$i]['CUSTOM' . $ii] = $res['custom' . $ii]; } //Veröffentlichung if (in_array('PRODUCT.RELEASE', $parse)) { if ($res['releasestamp']) { $temprel = $releaseinfo[$res['id']]; foreach ($temprel as $rel) { if ($rel['stamp'] != $res['releasestamp']) { continue; } ++$ii; $tabledata[$i]['RELEASE'][$ii] = $rel; } } else { $tabledata[$i]['RELEASE'] = $releaseinfo[$res['id']]; } } //Kommentare if ($apx->is_module('comments') && $set['products']['coms'] && $res['allowcoms']) { require_once BASEDIR . getmodulepath('comments') . 'class.comments.php'; if (!isset($coms)) { $coms = new comments('products', $res['id']); } else { $coms->mid = $res['id']; } $link = mklink('products.php?id=' . $res['id'], 'products,id' . $res['id'] . urlformat($res['title']) . '.html'); $tabledata[$i]['COMMENT_COUNT'] = $coms->count(); $tabledata[$i]['COMMENT_LINK'] = $coms->link($link); $tabledata[$i]['DISPLAY_COMMENTS'] = 1; if (in_template(array('PRODUCT.COMMENT_LAST_USERID', 'PRODUCT.COMMENT_LAST_NAME', 'PRODUCT.COMMENT_LAST_TIME'), $parse)) { $tabledata[$i]['COMMENT_LAST_USERID'] = $coms->last_userid(); $tabledata[$i]['COMMENT_LAST_NAME'] = $coms->last_name(); $tabledata[$i]['COMMENT_LAST_TIME'] = $coms->last_time(); } } //Bewertungen if ($apx->is_module('ratings') && $set['products']['ratings'] && $res['allowrating']) { require_once BASEDIR . getmodulepath('ratings') . 'class.ratings.php'; if (!isset($rate)) { $rate = new ratings('products', $res['id']); } else { $rate->mid = $res['id']; } $tabledata[$i]['RATING'] = $rate->display(); $tabledata[$i]['RATING_VOTES'] = $rate->count(); $tabledata[$i]['DISPLAY_RATING'] = 1; } $laststamp = date('Y/m/d', $res['addtime'] - TIMEDIFF); } } $tmpl->assign('PRODUCT', $tabledata); $tmpl->parse($template, 'products'); }
function show() { global $set, $db, $apx, $html; quicklink('poll.add'); $orderdef[0] = 'addtime'; $orderdef['question'] = array('question', 'ASC', 'COL_QUESTION'); $orderdef['addtime'] = array('addtime', 'DESC', 'COL_ADDTIME'); $orderdef['starttime'] = array('starttime', 'DESC', 'COL_STARTTIME'); $orderdef['endtime'] = array('endtime', 'DESC', 'COL_ENDTIME'); $col[] = array('', 1, 'align="center"'); $col[] = array('COL_QUESTION', 60, 'class="title"'); $col[] = array('COL_STARTTIME', 20, 'align="center"'); $col[] = array('COL_ENDTIME', 20, 'align="center"'); list($count) = $db->first("SELECT count(id) FROM " . PRE . "_poll"); pages('action.php?action=poll.show&sortby=' . $_REQUEST['sortby'], $count); $data = $db->fetch("SELECT id,secid,question,addtime,starttime,endtime,days,allowcoms FROM " . PRE . "_poll " . getorder($orderdef) . getlimit()); if (count($data)) { foreach ($data as $res) { ++$i; if (!$res['starttime']) { $tabledata[$i]['COL1'] = '<img src="design/reddot.gif" alt="' . $apx->lang->get('CORE_INACTIVE') . '" title="' . $apx->lang->get('CORE_INACTIVE') . '" />'; } elseif ($res['endtime'] < time()) { $tabledata[$i]['COL1'] = '<img src="design/greendotcross.gif" alt="' . $apx->lang->get('CORE_INACTIVE') . '" title="' . $apx->lang->get('CORE_INACTIVE') . '" />'; } elseif ($res['starttime'] > time()) { $tabledata[$i]['COL1'] = '<img src="design/greendotwait.gif" alt="' . $apx->lang->get('CORE_ACTIVE') . '" title="' . $apx->lang->get('CORE_ACTIVE') . '" />'; } else { $tabledata[$i]['COL1'] = '<img src="design/greendot.gif" alt="' . $apx->lang->get('CORE_ACTIVE') . '" title="' . $apx->lang->get('CORE_ACTIVE') . '" />'; } $tmp = unserialize_section($res['secid']); $question = shorttext(strip_tags($res['question']), 60); $link = mklink('poll.php?id=' . $res['id'], 'poll,' . $res['id'] . urlformat($res['question']) . '.html', iif($set['main']['forcesection'], iif(unserialize_section($res['secid']) == array('all'), $apx->section_default, array_shift($tmp)), 0)); $tabledata[$i]['COL2'] = '<a href="' . $link . '" target="_blank">' . $question . '</a>'; if ($res['starttime']) { $tabledata[$i]['COL3'] = mkdate($res['starttime'], '<br />'); } if ($res['starttime']) { $tabledata[$i]['COL4'] = mkdate($res['starttime'] + $res['days'] * 24 * 3600, '<br />'); } //Optionen if ($apx->user->has_right('poll.edit')) { $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'poll.edit', 'id=' . $res['id'], $apx->lang->get('CORE_EDIT')); } else { $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />'; } if ($apx->user->has_right('poll.del')) { $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', 'poll.del', 'id=' . $res['id'], $apx->lang->get('CORE_DEL')); } else { $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />'; } if ((!$res['starttime'] || $res['endtime'] < time()) && $apx->user->has_right('poll.enable')) { $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('enable.gif', 'poll.enable', 'id=' . $res['id'], $apx->lang->get('CORE_ENABLE')); } elseif ($res['starttime'] && $apx->user->has_right('poll.disable')) { $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('disable.gif', 'poll.disable', 'id=' . $res['id'], $apx->lang->get('CORE_DISABLE')); } else { $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />'; } //Kommentare if ($apx->is_module('comments')) { $tabledata[$i]['OPTIONS'] .= ' '; list($comments) = $db->first("SELECT count(mid) FROM " . PRE . "_comments WHERE ( module='poll' AND mid='" . $res['id'] . "' )"); if ($comments && ($apx->is_module('comments') && $set['poll']['coms']) && $res['allowcoms'] && $apx->user->has_right('comments.show')) { $tabledata[$i]['OPTIONS'] .= optionHTML('comments.gif', 'comments.show', 'module=poll&mid=' . $res['id'], $apx->lang->get('COMMENTS')); } else { $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />'; } } } } $apx->tmpl->assign('TABLE', $tabledata); $html->table($col); orderstr($orderdef, 'action.php?action=poll.show'); save_index($_SERVER['REQUEST_URI']); }
require 'lib/_end.php'; } //////////////////////////////////////////////////////////////////////////////////////////////////////// //Kategorien auflisten require_once BASEDIR . 'lib/class.recursivetree.php'; $tree = new RecursiveTree(PRE . '_links_cat', 'id'); $data = $tree->getTree(array('title', 'open')); if (count($data)) { foreach ($data as $res) { ++$i; $catdata[$i]['ID'] = $res['id']; $catdata[$i]['TITLE'] = $res['title']; $catdata[$i]['LEVEL'] = $res['level']; $catdata[$i]['OPEN'] = $res['open']; } } //Captcha erstellen if ($set['links']['captcha'] && !$user->info['userid']) { require BASEDIR . 'lib/class.captcha.php'; $captcha = new captcha(); $captchacode = $captcha->generate(); } $posto = mklink('sendlink.php', 'sendlink.html'); $apx->tmpl->assign('CAPTCHA', $captchacode); $apx->tmpl->assign('CATEGORY', $catdata); $apx->tmpl->assign('POSTTO', $postto); $apx->tmpl->parse('send'); //////////////////////////////////////////////////////////////////////////////////////////////////////// require 'lib/_end.php'; /////////////////////////////////////////////////////////// SCRIPT BEENDEN /// ////////////////////////////////////////////////////////////////////////////////////////////////////////
function show() { global $set, $db, $apx, $html; //Suche durchführen if ($_REQUEST['item'] && ($_REQUEST['title'] || $_REQUEST['text']) || $_REQUEST['secid'] || $_REQUEST['catid'] || $_REQUEST['userid']) { $where = ''; $_REQUEST['secid'] = (int) $_REQUEST['secid']; $_REQUEST['catid'] = (int) $_REQUEST['catid']; $_REQUEST['userid'] = (int) $_REQUEST['userid']; //Suche wird ausgeführt... if ($_REQUEST['title']) { $sc[] = "title LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; } if ($_REQUEST['text']) { $sc[] = "text LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; } if (is_array($sc)) { $where .= ' AND ( ' . implode(' OR ', $sc) . ' )'; } //Sektion if (!$apx->session->get('section') && $_REQUEST['secid']) { $where .= " AND ( secid LIKE '%|" . $_REQUEST['secid'] . "|%' OR secid='all' ) "; } //Kategorie if ($_REQUEST['catid']) { $where .= " AND catid='" . $_REQUEST['catid'] . "' "; } //Benutzer if ($_REQUEST['userid']) { $where .= " AND userid='" . $_REQUEST['userid'] . "' "; } $data = $db->fetch("SELECT id FROM " . PRE . "_content WHERE 1 " . $where); $ids = get_ids($data, 'id'); $ids[] = -1; $searchid = saveSearchResult('admin_content', $ids, array('title' => $_REQUEST['title'], 'text' => $_REQUEST['text'], 'item' => $_REQUEST['item'], 'catid' => $_REQUEST['catid'], 'secid' => $_REQUEST['secid'], 'userid' => $_REQUEST['userid'])); header("HTTP/1.1 301 Moved Permanently"); header('Location: action.php?action=content.show&searchid=' . $searchid); return; } //Vorgaben $_REQUEST['title'] = 1; $_REQUEST['text'] = 1; quicklink('content.add'); $orderdef[0] = 'time'; $orderdef['title'] = array('a.title', 'ASC', 'COL_TITLE'); $orderdef['user'] = array('b.username', 'ASC', 'COL_USER'); $orderdef['time'] = array('a.time', 'DESC', 'COL_ADDTIME'); $orderdef['lastchange'] = array('a.lastchange', 'DESC', 'COL_LASTCHANGE'); $orderdef['hits'] = array('a.hits', 'DESC', 'COL_HITS'); $col[] = array('', 1, 'align="center"'); $col[] = array('COL_TITLE', 50, 'class="title"'); $col[] = array('COL_USER', 20, 'align="center"'); $col[] = array('COL_LASTCHANGE', 20, 'align="center"'); $col[] = array('COL_HITS', 10, 'align="center"'); //Suchergebnis? $resultFilter = ''; if ($_REQUEST['searchid']) { $searchRes = getSearchResult('admin_content', $_REQUEST['searchid']); if ($searchRes) { list($resultIds, $resultMeta) = $searchRes; $_REQUEST['item'] = $resultMeta['item']; $_REQUEST['title'] = $resultMeta['title']; $_REQUEST['text'] = $resultMeta['text']; $_REQUEST['catid'] = $resultMeta['catid']; $_REQUEST['secid'] = $resultMeta['secid']; $_REQUEST['userid'] = $resultMeta['userid']; $resultFilter = " AND a.id IN (" . implode(', ', $resultIds) . ")"; } else { $_REQUEST['searchid'] = ''; } } //Sektionen auflisten $seclist = ''; if (is_array($apx->sections) && count($apx->sections)) { foreach ($apx->sections as $res) { $seclist .= '<option value="' . $res['id'] . '"' . iif($_REQUEST['secid'] == $res['id'], ' selected="selected"') . '>' . replace($res['title']) . '</option>'; } } //Kategorien auflisten $catlist = ''; $data = $set['content']['groups']; if (count($data)) { foreach ($data as $id => $title) { $catlist .= '<option value="' . $id . '"' . iif($_REQUEST['catid'] == $id, ' selected="selected"') . '>' . replace($title) . '</option>'; } } //Benutzer auflisten $userlist = ''; $data = $db->fetch("SELECT b.userid,b.username FROM " . PRE . "_content AS a LEFT JOIN " . PRE . "_user AS b USING (userid) WHERE a.userid!=0 GROUP BY userid ORDER BY username ASC"); if (count($data)) { foreach ($data as $res) { $userlist .= '<option value="' . $res['userid'] . '"' . iif($_REQUEST['userid'] == $res['userid'], ' selected="selected"') . '>' . replace($res['username']) . '</option>'; } } $apx->tmpl->assign('ITEM', compatible_hsc($_REQUEST['item'])); $apx->tmpl->assign('STITLE', (int) $_REQUEST['title']); $apx->tmpl->assign('STEXT', (int) $_REQUEST['text']); $apx->tmpl->assign('SECLIST', $seclist); $apx->tmpl->assign('CATLIST', $catlist); $apx->tmpl->assign('USERLIST', $userlist); $apx->tmpl->assign('EXTENDED', $searchRes); $apx->tmpl->parse('search'); list($count) = $db->first("SELECT count(id) FROM " . PRE . "_content AS a WHERE 1 " . $resultFilter . section_filter()); pages('action.php?action=content.show&sortby=' . $_REQUEST['sortby'] . iif($_REQUEST['searchid'], '&searchid=' . $_REQUEST['searchid']), $count); $data = $db->fetch("SELECT a.id,a.secid,a.title,a.lastchange,a.allowcoms,a.allowrating,a.active,a.hits,b.userid,b.username FROM " . PRE . "_content AS a LEFT JOIN " . PRE . "_user AS b USING(userid) WHERE 1 " . $resultFilter . section_filter(true, 'a.secid') . " " . getorder($orderdef) . getlimit()); if (count($data)) { foreach ($data as $res) { ++$i; if ($res['active']) { $tabledata[$i]['COL1'] = '<img src="design/greendot.gif" alt="' . $apx->lang->get('CORE_ACTIVE') . '" title="' . $apx->lang->get('CORE_ACTIVE') . '" />'; } else { $tabledata[$i]['COL1'] = '<img src="design/reddot.gif" alt="' . $apx->lang->get('CORE_INACTIVE') . '" title="' . $apx->lang->get('CORE_INACTIVE') . '" />'; } $title = $res['title']; $title = strip_tags($title); //$title=str_replace('=>','»',$title); $title = str_replace('->', '»', $title); $title = shorttext($title, 40); $title = replace($title); $temp = explode('->', $res['title']); $tmp = unserialize_section($res['secid']); $link = mklink('content.php?id=' . $res['id'], 'content,' . $res['id'] . urlformat(array_pop($temp)) . '.html', iif($set['main']['forcesection'], iif(unserialize_section($res['secid']) == array('all'), $apx->section_default, array_shift($tmp)), 0)); $tabledata[$i]['COL2'] = '<a href="' . $link . '" target="_blank">' . $title . '</a>'; $tabledata[$i]['COL3'] = replace($res['username']); $tabledata[$i]['COL4'] = mkdate($res['lastchange'], '<br />'); $tabledata[$i]['COL5'] = $res['hits']; //Optionen if ($apx->user->has_right('content.edit') && ($res['userid'] == $apx->user->info['userid'] || $apx->user->has_spright('content.edit'))) { $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'content.edit', 'id=' . $res['id'], $apx->lang->get('CORE_EDIT')); } if ($apx->user->has_right('content.del') && ($res['userid'] == $apx->user->info['userid'] || $apx->user->has_spright('content.del'))) { $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', 'content.del', 'id=' . $res['id'], $apx->lang->get('CORE_DEL')); } if ($res['active'] && $apx->user->has_right('content.disable') && ($res['userid'] == $apx->user->info['userid'] || $apx->user->has_spright('content.disable'))) { $tabledata[$i]['OPTIONS'] .= optionHTML('disable.gif', 'content.disable', 'id=' . $res['id'] . '§oken=' . $apx->session->get('sectoken'), $apx->lang->get('CORE_DISABLE')); } elseif (!$res['active'] && $apx->user->has_right('content.enable') && ($res['userid'] == $apx->user->info['userid'] || $apx->user->has_spright('content.enable'))) { $tabledata[$i]['OPTIONS'] .= optionHTML('enable.gif', 'content.enable', 'id=' . $res['id'] . '§oken=' . $apx->session->get('sectoken'), $apx->lang->get('CORE_ENABLE')); } else { $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />'; } //Kommentare + Bewertungen if ($apx->is_module('comments') || $apx->is_module('ratings')) { $tabledata[$i]['OPTIONS'] .= ' '; } if ($apx->is_module('comments')) { list($comments) = $db->first("SELECT count(id) FROM " . PRE . "_comments WHERE ( module='content' AND mid='" . $res['id'] . "' )"); if ($comments && ($apx->is_module('comments') && $set['content']['coms']) && $res['allowcoms'] && $apx->user->has_right('comments.show')) { $tabledata[$i]['OPTIONS'] .= optionHTML('comments.gif', 'comments.show', 'module=content&mid=' . $res['id'], $apx->lang->get('COMMENTS') . ' (' . $comments . ')'); } else { $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />'; } } if ($apx->is_module('ratings')) { list($ratings) = $db->first("SELECT count(id) FROM " . PRE . "_ratings WHERE ( module='content' AND mid='" . $res['id'] . "' )"); if ($ratings && ($apx->is_module('ratings') && $set['content']['ratings']) && $res['allowrating'] && $apx->user->has_right('ratings.show')) { $tabledata[$i]['OPTIONS'] .= optionHTML('ratings.gif', 'ratings.show', 'module=content&mid=' . $res['id'], $apx->lang->get('RATINGS') . ' (' . $ratings . ')'); } else { $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />'; } } } } $apx->tmpl->assign('TABLE', $tabledata); $html->table($col); orderstr($orderdef, 'action.php?action=content.show' . iif($_REQUEST['searchid'], '&searchid=' . $_REQUEST['searchid'])); save_index($_SERVER['REQUEST_URI']); }