function get_gallery_list($selected = 0) { global $set, $db, $apx; $list = '<option value=""></option>'; if ($set['gallery']['subgals']) { require_once BASEDIR . 'lib/class.recursivetree.php'; $tree = new RecursiveTree(PRE . '_gallery', 'id'); $data = $tree->getTree(array('title'), null, "'" . time() . "' BETWEEN starttime AND endtime " . section_filter(true, 'secid')); if (!count($data)) { return ''; } foreach ($data as $res) { $list .= '<option value="' . $res['id'] . '"' . iif($selected == $res['id'], ' selected="selected"') . '>' . str_repeat(' ', $res['level'] - 1) . replace(strip_tags($res['title'])) . '</option>'; } } else { $data = $db->fetch("SELECT id,title FROM " . PRE . "_gallery WHERE '" . time() . "' BETWEEN starttime AND endtime " . section_filter(true, 'secid') . " ORDER BY title ASC"); if (!count($data)) { return ''; } foreach ($data as $res) { $list .= '<option value="' . $res['id'] . '"' . iif($selected == $res['id'], ' selected="selected"') . '>' . replace(strip_tags($res['title'])) . '</option>'; } } return $list; }
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 content_showcomments($id) { global $set, $db, $apx, $user; $res = $db->first("SELECT allowcoms FROM " . PRE . "_content WHERE ( id='" . $id . "' AND active='1' " . section_filter() . " ) LIMIT 1"); if (!$apx->is_module('comments') || !$set['content']['coms'] || !$res['allowcoms']) { return; } require_once BASEDIR . getmodulepath('comments') . 'class.comments.php'; $coms = new comments('content', $id); $coms->assign_comments(); $apx->tmpl->parse('comments', 'comments'); require 'lib/_end.php'; }
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 teaser_show($count = 0, $start = 0, $group = 0, $template = 'teaser') { global $set, $db, $apx; $count = (int) $count; $start = (int) $start; $group = (int) $group; $tmpl = new tengine(); $groupfilter = ''; if ($group) { $groupfilter = " AND `group`='" . $group . "'"; } if ($set['teaser']['orderby'] == 1) { $data = $db->fetch("SELECT id,title,text,link,image,hits FROM " . PRE . "_teaser WHERE '" . time() . "' BETWEEN starttime AND endtime " . $groupfilter . section_filter() . " ORDER BY ord ASC" . iif($count, " LIMIT " . iif($start, $start . ',') . $count)); } elseif ($set['teaser']['orderby'] == 2) { $data = $db->fetch("SELECT id,title,text,link,image,hits FROM " . PRE . "_teaser WHERE '" . time() . "' BETWEEN starttime AND endtime " . $groupfilter . section_filter() . " ORDER BY addtime DESC" . iif($count, " LIMIT " . iif($start, $start . ',') . $count)); } else { $data = $db->fetch("SELECT id,title,text,link,image,hits FROM " . PRE . "_teaser WHERE '" . time() . "' BETWEEN starttime AND endtime" . $groupfilter . section_filter()); if (count($data)) { srand((double) microtime() * 1000000); shuffle($data); if ($count) { foreach ($data as $res) { ++$ii; $newdata[] = $res; if ($ii == $count) { break; } } $data = $newdata; unset($newdata); } } } if (count($data)) { $apx->lang->drop('teaser', 'teaser'); foreach ($data as $res) { ++$i; $affdata[$i]['TITLE'] = $res['title']; $affdata[$i]['TEXT'] = $res['text']; $affdata[$i]['URL'] = $res['link']; $affdata[$i]['IMAGE'] = iif($res['image'], HTTPDIR . getpath('uploads') . $res['image']); $affdata[$i]['HITS'] = number_format($res['hits'], 0, '', '.'); $affdata[$i]['LINK'] = HTTPDIR . 'misc.php?action=teaserlink&id=' . $res['id']; } } $tmpl->assign('TEASER', $affdata); $tmpl->parse($template, 'teaser'); }
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 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 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; }
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']; //Suchbegriff if ($_REQUEST['item']) { if ($_REQUEST['title']) { $sc[] = "title LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; } if ($_REQUEST['subtitle']) { $sc[] = "subtitle LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; } if ($_REQUEST['teaser']) { $sc[] = "teaser 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']) { $tree = $this->cat->getChildrenIds($_REQUEST['catid']); $tree[] = $_REQUEST['catid']; if (is_array($tree)) { $where .= " AND catid IN (" . implode(',', $tree) . ") "; } } //Benutzer if ($_REQUEST['userid']) { $where .= " AND userid='" . $_REQUEST['userid'] . "' "; } $data = $db->fetch("SELECT id FROM " . PRE . "_videos WHERE 1 " . $where); $ids = get_ids($data, 'id'); $ids[] = -1; $searchid = saveSearchResult('admin_videos', $ids, array('item' => $_REQUEST['item'], 'title' => $_REQUEST['title'], 'text' => $_REQUEST['text'], 'catid' => $_REQUEST['catid'], 'secid' => $_REQUEST['secid'], 'userid' => $_REQUEST['userid'])); header("HTTP/1.1 301 Moved Permanently"); header('Location: action.php?action=videos.show&what=' . $_REQUEST['what'] . '&searchid=' . $searchid); return; } //Unbroken setzen $_REQUEST['unbroken'] = (int) $_REQUEST['unbroken']; if ($_REQUEST['unbroken']) { $db->query("UPDATE " . PRE . "_videos SET broken='' WHERE id='" . $_REQUEST['unbroken'] . "' LIMIT 1"); } //Vorgaben $_REQUEST['title'] = 1; $_REQUEST['text'] = 1; quicklink('videos.add'); $layerdef[] = array('LAYER_ALL', 'action.php?action=videos.show', !$_REQUEST['what']); $layerdef[] = array('LAYER_BROKEN', 'action.php?action=videos.show&what=broken', $_REQUEST['what'] == 'broken'); if ($set['videos']['ffmpeg'] && $set['videos']['flvtool2']) { $layerdef[] = array('LAYER_FAILED', 'action.php?action=videos.show&what=failed', $_REQUEST['what'] == 'failed'); } //Layer Header ausgeben $html->layer_header($layerdef); $orderdef[0] = 'creation'; $orderdef['title'] = array('a.title', 'ASC', 'COL_TITLE'); $orderdef['user'] = array('b.username', 'ASC', 'COL_AUTHOR'); $orderdef['category'] = array('c.title', 'ASC', 'COL_CATEGORY'); $orderdef['creation'] = array('a.addtime', 'DESC', 'SORT_ADDTIME'); $orderdef['publication'] = array('a.starttime', 'DESC', 'SORT_STARTTIME'); $orderdef['hits'] = array('a.hits', 'DESC', 'COL_HITS'); $orderdef['downloads'] = array('a.downloads', 'DESC', 'COL_DOWNLOADS'); //Suchergebnis? $resultFilter = ''; if ($_REQUEST['searchid']) { $searchRes = getSearchResult('admin_videos', $_REQUEST['searchid']); if ($searchRes) { list($resultIds, $resultMeta) = $searchRes; $_REQUEST['item'] = $resultMeta['item']; $_REQUEST['title'] = $resultMeta['title']; $_REQUEST['subtitle'] = $resultMeta['subtitle']; $_REQUEST['teaser'] = $resultMeta['teaser']; $_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 = $this->cat->getTree(array('title', 'open')); if (count($data)) { foreach ($data as $res) { if ($res['level']) { $space = str_repeat(' ', $res['level'] - 1); } $catlist .= '<option value="' . $res['id'] . '"' . iif($_REQUEST['catid'] == $res['id'], ' selected="selected"') . '>' . $space . replace($res['title']) . '</option>'; } } //Benutzer auflisten $userlist = ''; $data = $db->fetch("SELECT b.userid,b.username FROM " . PRE . "_videos 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('SECLIST', $seclist); $apx->tmpl->assign('CATLIST', $catlist); $apx->tmpl->assign('USERLIST', $userlist); $apx->tmpl->assign('STITLE', (int) $_REQUEST['title']); $apx->tmpl->assign('STEXT', (int) $_REQUEST['text']); $apx->tmpl->assign('WHAT', $_REQUEST['what']); $apx->tmpl->assign('EXTENDED', $searchRes); $apx->tmpl->parse('search'); //Filter $layerFilter = ''; if ($_REQUEST['what'] == 'broken') { $layerFilter = " AND a.broken!=0 "; } elseif ($_REQUEST['what'] == 'failed') { $layerFilter = " AND a.status='failed' "; } list($count) = $db->first("SELECT count(userid) FROM " . PRE . "_videos AS a WHERE 1 " . $resultFilter . $layerFilter . section_filter(true, 'secid')); pages('action.php?action=videos.show&what=' . $_REQUEST['what'] . iif($_REQUEST['searchid'], '&searchid=' . $_REQUEST['searchid']) . '&sortby=' . $_REQUEST['sortby'], $count); $data = $db->fetch("SELECT a.id,a.secid,a.title,a.addtime,a.status,a.allowcoms,a.allowrating,a.starttime,a.endtime,a.broken,a.hits,a.downloads,b.userid,b.username,c.title AS catname FROM " . PRE . "_videos AS a LEFT JOIN " . PRE . "_user AS b USING(userid) LEFT JOIN " . PRE . "_videos_cat AS c ON a.catid=c.id WHERE 1 " . $resultFilter . $layerFilter . section_filter(true, 'a.secid') . " " . getorder($orderdef) . getlimit()); $this->show_print($data); orderstr($orderdef, 'action.php?action=videos.show&what=' . $_REQUEST['what'] . iif($_REQUEST['searchid'], '&searchid=' . $_REQUEST['searchid'])); save_index($_SERVER['REQUEST_URI']); //Layer-Footer ausgeben $html->layer_footer(); }
$apx->tmpl->parse('detail'); require 'lib/_end.php'; } //////////////////////////////////////////////////////////////////////////////////////////////////////// NEWS AUFLISTEN //Titelleiste headline($apx->lang->get('HEADLINE'), mklink('news.php', 'news.html')); titlebar($apx->lang->get('HEADLINE')); //Verwendete Variablen auslesen $parse = $apx->tmpl->used_vars('index'); //Kategorie-Baum holen $cattree = news_tree($_REQUEST['catid']); //Seitenzahlen generieren list($count) = $db->first("SELECT count(id) FROM " . PRE . "_news WHERE ( " . time() . " BETWEEN starttime AND endtime " . iif(count($cattree), ' AND catid IN (' . @implode(',', $cattree) . ') ') . section_filter() . ")"); pages(mklink('news.php?catid=' . $_REQUEST['catid'], 'news,' . $_REQUEST['catid'] . ',{P}.html'), $count, $set['news']['epp']); //News ausgeben $data = $db->fetch("SELECT a.*,IF(a.sticky>=" . time() . ",1,0) AS sticky,b.userid,b.username,b.email,b.pub_hidemail FROM " . PRE . "_news 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 sticky DESC,starttime DESC " . getlimit($set['news']['epp'])); //Kategorien auslesen if (in_array('NEWS.CATTITLE', $parse) || in_array('NEWS.CATICON', $parse) || in_array('NEWS.CATLINK', $parse)) { $catinfo = news_catinfo(get_ids($data, 'catid')); } if (count($data)) { foreach ($data as $res) { ++$i; //Link $link = mklink('news.php?id=' . $res['id'], 'news,id' . $res['id'] . urlformat($res['title']) . '.html'); //Newspic if (in_array('NEWS.PICTURE', $parse) || in_array('NEWS.PICTURE_POPUP', $parse) || in_array('NEWS.PICTURE_POPUPPATH', $parse)) { list($picture, $picture_popup, $picture_popuppath) = news_newspic($res['newspic']); } //Username + eMail if ($res['userid']) {
function gallery_active($secid = false, $prodid = false) { global $db; $secid = (int) $secid; $prodid = (int) $prodid; $saved = array(); if ($secid < 0) { $data = $db->fetch("SELECT id FROM " . PRE . "_gallery WHERE ( ( '" . time() . "' BETWEEN starttime AND endtime ) AND password='' " . iif($prodid, " AND prodid='" . $prodid . "' ") . " )"); } elseif ($secid) { $data = $db->fetch("SELECT id FROM " . PRE . "_gallery WHERE ( ( '" . time() . "' BETWEEN starttime AND endtime ) AND password='' " . iif($prodid, " AND prodid='" . $prodid . "' ") . " AND ( secid LIKE '%|" . $secid . "|%' OR secid='all' ) )"); } else { $data = $db->fetch("SELECT id FROM " . PRE . "_gallery WHERE ( ( '" . time() . "' BETWEEN starttime AND endtime ) " . iif($prodid, " AND prodid='" . $prodid . "' ") . " " . section_filter() . " )"); } if (!count($data)) { return array(-1); } foreach ($data as $res) { $saved[] = $res['id']; } return $saved; }
function articles_showcomments($id) { global $set, $db, $apx, $user; $id = (int) $id; $res = $db->first("SELECT id,allowcoms FROM " . PRE . "_articles WHERE ( id='" . $id . "' " . section_filter() . " ) LIMIT 1"); if (!$apx->is_module('comments') || !$set['articles']['coms'] || !$res['allowcoms']) { return; } require_once BASEDIR . getmodulepath('comments') . 'class.comments.php'; $coms = new comments('articles', $id); $coms->assign_comments(); if (!articles_recent($id) && !$set['articles']['archcoms']) { $apx->tmpl->assign('COMMENT_NOFORM', 1); } $apx->tmpl->parse('comments', 'comments'); require 'lib/_end.php'; }
++$hi; if ($number == $hi) { headline(trim($one), str_replace('&', '&', $_SERVER['REQUEST_URI'])); } else { headline(trim($one)); } $last = $one; } titlebar(strip_tags($last)); content_showcomments($_REQUEST['id']); require 'lib/_end.php'; } elseif ($_REQUEST['id']) { $apx->lang->drop('content'); //Klicks+1 $db->query("UPDATE " . PRE . "_content SET hits=hits+1 WHERE id='" . $_REQUEST['id'] . "' LIMIT 1"); $res = $db->first("SELECT a.*,b.username,b.email,b.pub_hidemail,c.username AS lc_username,c.email AS lc_email,c.pub_hidemail AS lc_pub_hidemail FROM " . PRE . "_content AS a LEFT JOIN " . PRE . "_user AS b USING(userid) LEFT JOIN " . PRE . "_user AS c ON a.lastchange_userid=c.userid WHERE ( a.id='" . $_REQUEST['id'] . "' " . iif(!$user->is_team_member(), " AND a.active='1' " . section_filter() . " ") . " ) LIMIT 1"); if (!$res['id']) { filenotfound(); } //Titel $headline = array(); $tt = explode('->', $res['title']); $number = count($tt); foreach ($tt as $one) { ++$hi; if ($number == $hi) { headline(trim($one), str_replace('&', '&', $_SERVER['REQUEST_URI'])); } else { headline(trim($one)); } $last = $one;
function misc_eventsfeed() { 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 = calendar_tree($_REQUEST['catid']); if ($catid) { $cattree = calendar_tree($catid); if (count($cattree)) { $catfilter = " AND a.catid IN (" . implode(',', $cattree) . ") "; } } $todaystamp = date('Ymd', time() - TIMEDIFF); $data = $db->fetch("SELECT a.*,b.username,b.email,b.pub_hidemail FROM " . PRE . "_calendar_events AS a LEFT JOIN " . PRE . "_user AS b USING(userid) WHERE a.active!=0 AND a.private='0' AND '" . $todaystamp . "'<=endday " . section_filter(true, 'a.secid') . " " . $catfilter . $modefilter . " ORDER BY startday ASC, starttime ASC, title ASC LIMIT 20"); //Kategorie-Info $catids = get_ids($data, 'catid'); $catdata = array(); if (count($catids)) { $catdata = $db->fetch_index("SELECT * FROM " . PRE . "_calendar_cat WHERE id IN (" . implode(',', $catids) . ")", 'id'); } if (count($data)) { foreach ($data as $res) { ++$i; $event = array(); //Kategorie-Info $catinfo = $catdata[$res['catid']]; //Link zum Termin $link = mklink('events.php?id=' . $res['id'], 'events,id' . $res['id'] . urlformat($res['title']) . '.html'); //Start berechnen $startday = $starttime = $endday = $endtime = 0; $startday = calendar_stamp2time($res['startday']); if ($res['starttime'] != -1) { $time_comp = calendar_explode_stamp($res['startday']); $tmpstamp = sprintf('%04d', $res['starttime']); $time_comp['hour'] = substr($tmpstamp, 0, 2); $time_comp['minute'] = substr($tmpstamp, 2, 2); $starttime = mktime($time_comp['hour'], $time_comp['minute'], 0, $time_comp['month'], $time_comp['day'], $time_comp['year']) + TIMEDIFF; } //Ende berechnen (falls nötig) if ($res['endday'] != $res['startday'] || $res['endtime'] != -1) { $endday = calendar_stamp2time($res['endday']); if ($res['endtime'] != -1) { $time_comp = calendar_explode_stamp($res['endday']); $tmpstamp = sprintf('%04d', $res['endtime']); $time_comp['hour'] = substr($tmpstamp, 0, 2); $time_comp['minute'] = substr($tmpstamp, 2, 2); $endtime = mktime($time_comp['hour'], $time_comp['minute'], 0, $time_comp['month'], $time_comp['day'], $time_comp['year']) + TIMEDIFF; } } $event['ID'] = $res['id']; $event['TITLE'] = rss_replace($res['title']); $event['TEXT'] = rss_replace($res['text']); $event['LINK'] = HTTP_HOST . $link; $event['LOCATION'] = $res['location']; $event['LOCATION_LINK'] = $res['location_link']; $event['STARTDAY'] = $startday; $event['STARTTIME'] = $starttime; $event['ENDDAY'] = $endday; $event['ENDTIME'] = $endtime; $event['ADDTIME'] = $res['addtime']; $event['TIME'] = date('r', $res['addtime']); $event['CATID'] = $res['catid']; $event['CATTITLE'] = $catinfo['title']; $event['CATICON'] = $catinfo['icon']; $tabledata[] = $event; } } $apx->tmpl->assign('WEBSITENAME', $set['main']['websitename']); $apx->tmpl->assign('EVENT', $tabledata); $apx->tmpl->parse('rss', 'calendar'); }
function poll_showcomments($id) { global $set, $db, $apx, $user; $id = (int) $id; if (!$id) { die('missing ID!'); } $recent = poll_recent(); $res = $db->first("SELECT id,allowcoms FROM " . PRE . "_poll WHERE ( id='" . $id . "' AND ( '" . time() . "' BETWEEN starttime AND endtime ) " . iif($apx->section_id(), " " . section_filter() . " ") . " ) LIMIT 1"); if (!$apx->is_module('comments') || !$set['poll']['coms'] || !$res['allowcoms']) { return; } require_once BASEDIR . getmodulepath('comments') . 'class.comments.php'; $coms = new comments('poll', $id); $coms->assign_comments(); if ($recent != $res['id'] && !$set['poll']['archcoms']) { $apx->tmpl->assign('COMMENT_NOFORM', 1); } $apx->tmpl->parse('comments', 'comments'); require 'lib/_end.php'; }
function calendar_tagcloud($count = 10, $random = false, $template = 'tagcloud') { global $set, $db, $apx, $user; $tmpl = new tengine(); $catid = (int) $catid; if ($random) { $orderby = "RAND()"; } else { $orderby = "weight DESC"; } //Sektion gewählt if ($apx->section_id()) { $data = $db->fetch("\n\t\t\tSELECT t.tagid, t.tag, count(nt.id) AS weight\n\t\t\tFROM " . PRE . "_calendar_tags AS nt\n\t\t\tLEFT JOIN " . PRE . "_calendar_events AS n ON nt.id=n.id\n\t\t\tLEFT JOIN " . PRE . "_tags AS t ON nt.tagid=t.tagid\n\t\t\tLEFT JOIN " . PRE . "_calendar_tags AS nt2 ON nt.tagid=nt2.tagid\n\t\t\tWHERE 1 " . section_filter(true, 'n.secid') . "\n\t\t\tGROUP BY nt.tagid\n\t\t\tORDER BY " . $orderby . "\n\t\t\tLIMIT " . $count . "\n\t\t"); } else { $data = $db->fetch("\n\t\t\tSELECT t.tagid, t.tag, count(nt.id) AS weight\n\t\t\tFROM " . PRE . "_calendar_tags AS nt\n\t\t\tLEFT JOIN " . PRE . "_tags AS t ON nt.tagid=t.tagid\n\t\t\tLEFT JOIN " . PRE . "_calendar_tags AS nt2 ON nt.tagid=nt2.tagid\n\t\t\tGROUP BY nt.tagid\n\t\t\tORDER BY " . $orderby . "\n\t\t\tLIMIT " . $count . "\n\t\t"); } if (count($data)) { $maxweight = 1; foreach ($data as $res) { if ($res['weight'] > $maxweight) { $maxweight = $res['weight']; } } if (!$random) { shuffle($data); } foreach ($data as $res) { $tagdata[] = array('ID' => $res['tagid'], 'NAME' => replace($res['tag']), 'WEIGHT' => $res['weight'] / $maxweight); } } $tmpl->assign('TAG', $tagdata); $tmpl->parse('functions/' . $template, 'calendar'); }
function show() { global $set, $db, $apx, $html; //Suche durchführen if ($_REQUEST['item'] && ($_REQUEST['title'] || $_REQUEST['subtitle'] || $_REQUEST['pages'] || $_REQUEST['teaser']) || $_REQUEST['secid'] || $_REQUEST['catid'] || $_REQUEST['userid']) { $where = ''; $_REQUEST['secid'] = (int) $_REQUEST['secid']; $_REQUEST['catid'] = (int) $_REQUEST['catid']; $_REQUEST['userid'] = (int) $_REQUEST['userid']; if (!isset($_REQUEST['item'])) { $_REQUEST['title'] = 1; $_REQUEST['subtitle'] = 1; $_REQUEST['teaser'] = 1; $_REQUEST['pages'] = 1; } //Suche wird ausgeführt... if ($_REQUEST['item']) { if ($_REQUEST['title']) { $sc[] = "a.title LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; } if ($_REQUEST['subtitle']) { $sc[] = "a.subtitle LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; } if ($_REQUEST['teaser']) { $sc[] = "a.teaser LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; } //Artikelseiten mit Treffern $data = $db->fetch("SELECT artid FROM " . PRE . "_articles_pages WHERE title LIKE '%" . addslashes_like($_REQUEST['item']) . "%' OR text LIKE '%" . addslashes_like($_REQUEST['item']) . "%' GROUP BY artid"); if (count($data)) { $pagelist = array(); foreach ($data as $res) { $pagelist[] = $res['artid']; } if (count($pagelist)) { $sc[] = "a.id IN (" . implode(',', $pagelist) . ")"; } } if (is_array($sc)) { $where .= ' AND ( ' . implode(' OR ', $sc) . ' )'; } } if (!$apx->session->get('section') && $_REQUEST['secid']) { $where .= " AND ( a.secid LIKE '%|" . $_REQUEST['secid'] . "|%' OR a.secid='all' )"; } if ($_REQUEST['catid']) { if ($set['articles']['subcats']) { $tree = $this->cat->getChildrenIds($_REQUEST['catid']); $tree[] = $_REQUEST['catid']; if (is_array($tree)) { $where .= ' AND catid IN (' . implode(',', $tree) . ')'; } } else { $where .= " AND a.catid='" . $_REQUEST['catid'] . "' "; } } if ($_REQUEST['userid']) { $where .= " AND a.userid='" . $_REQUEST['userid'] . "' "; } $data = $db->fetch("SELECT id FROM " . PRE . "_articles AS a WHERE 1 " . $where); $ids = get_ids($data, 'id'); $ids[] = -1; $searchid = saveSearchResult('admin_articles', $ids, array('item' => $_REQUEST['item'], 'title' => $_REQUEST['title'], 'subtitle' => $_REQUEST['subtitle'], 'teaser' => $_REQUEST['teaser'], 'pages' => $_REQUEST['pages'], 'catid' => $_REQUEST['catid'], 'secid' => $_REQUEST['secid'], 'userid' => $_REQUEST['userid'])); header("HTTP/1.1 301 Moved Permanently"); header('Location: action.php?action=articles.show&what=' . $_REQUEST['what'] . '&type=' . $_REQUEST['type'] . '&searchid=' . $searchid); return; } //Vorgaben $_REQUEST['title'] = 1; $_REQUEST['subtitle'] = 1; $_REQUEST['teaser'] = 1; $_REQUEST['pages'] = 1; quicklink('articles.add'); $layerdef[] = array('LAYER_ALL', 'action.php?action=articles.show', !$_REQUEST['what']); $layerdef[] = array('NORMALS', 'action.php?action=articles.show&what=type&type=normal', $_REQUEST['what'] == 'type' && $_REQUEST['type'] == 'normal'); $layerdef[] = array('PREVIEWS', 'action.php?action=articles.show&what=type&type=preview', $_REQUEST['what'] == 'type' && $_REQUEST['type'] == 'preview'); $layerdef[] = array('REVIEWS', 'action.php?action=articles.show&what=type&type=review', $_REQUEST['what'] == 'type' && $_REQUEST['type'] == 'review'); $layerdef[] = array('LAYER_SELF', 'action.php?action=articles.show&what=self', $_REQUEST['what'] == 'self'); //Layer Header ausgeben $html->layer_header($layerdef); $orderdef[0] = 'creation'; $orderdef['title'] = array('a.title', 'ASC', 'COL_TITLE'); $orderdef['user'] = array('b.username', 'ASC', 'COL_USER'); $orderdef['category'] = array('catname', 'ASC', 'COL_CATEGORY'); $orderdef['creation'] = array('a.addtime', 'DESC', 'SORT_ADDTIME'); $orderdef['publication'] = array('a.starttime', 'DESC', 'SORT_STARTTIME'); $orderdef['hits'] = array('a.hits', 'DESC', 'COL_HITS'); //Suchergebnis? $resultFilter = ''; if ($_REQUEST['searchid']) { $searchRes = getSearchResult('admin_articles', $_REQUEST['searchid']); if ($searchRes) { list($resultIds, $resultMeta) = $searchRes; $_REQUEST['item'] = $resultMeta['item']; $_REQUEST['title'] = $resultMeta['title']; $_REQUEST['subtitle'] = $resultMeta['subtitle']; $_REQUEST['teaser'] = $resultMeta['teaser']; $_REQUEST['pages'] = $resultMeta['pages']; $_REQUEST['catid'] = $resultMeta['catid']; $_REQUEST['secid'] = $resultMeta['secid']; $_REQUEST['userid'] = $resultMeta['userid']; $resultFilter = " AND a.id IN (" . implode(', ', $resultIds) . ")"; } else { $_REQUEST['searchid'] = ''; } } //Sektionen auflisten if (is_array($apx->sections) && count($apx->sections) && !$apx->session->get('section')) { foreach ($apx->sections as $res) { $seclist .= '<option value="' . $res['id'] . '"' . iif($_REQUEST['secid'] == $res['id'], ' selected="selected"') . '>' . replace($res['title']) . '</option>'; } } //Kategorien auflisten if ($set['articles']['subcats']) { $data = $this->cat->getTree(array('title')); } else { $data = $db->fetch("SELECT * FROM " . PRE . "_articles_cat ORDER BY title ASC"); } if (count($data)) { foreach ($data as $res) { if ($res['level']) { $space = str_repeat(' ', $res['level'] - 1); } $catlist .= '<option value="' . $res['id'] . '"' . iif($_REQUEST['catid'] == $res['id'], ' selected="selected"') . '>' . $space . replace($res['title']) . '</option>'; } } //Benutzer auflisten $data = $db->fetch("SELECT b.userid,b.username FROM " . PRE . "_articles 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('SECLIST', $seclist); $apx->tmpl->assign('CATLIST', $catlist); $apx->tmpl->assign('USERLIST', $userlist); $apx->tmpl->assign('STITLE', (int) $_REQUEST['title']); $apx->tmpl->assign('SSUBTITLE', (int) $_REQUEST['subtitle']); $apx->tmpl->assign('STEASER', (int) $_REQUEST['teaser']); $apx->tmpl->assign('SPAGES', (int) $_REQUEST['pages']); $apx->tmpl->assign('SET_TEASER', $set['articles']['teaser']); $apx->tmpl->assign('WHAT', $_REQUEST['what']); $apx->tmpl->assign('TYPE', $_REQUEST['type']); $apx->tmpl->assign('EXTENDED', $searchRes); $apx->tmpl->parse('search'); //Filter $layerFilter = ''; if ($_REQUEST['what'] == 'type') { $layerFilter = " AND a.type='" . addslashes($_REQUEST['type']) . "' "; } if ($_REQUEST['what'] == 'self') { $layerFilter = " AND a.userid='" . $apx->user->info['userid'] . "' "; } elseif ($_REQUEST['what'] == 'send') { $layerFilter = " AND a.send_ip!='' "; } list($count) = $db->first("SELECT count(userid) FROM " . PRE . "_articles AS a WHERE 1 " . $resultFilter . $layerFilter . section_filter(true, 'secid')); pages('action.php?action=articles.show&what=' . $_REQUEST['what'] . iif($_REQUEST['what'] == 'type', '&type=' . $_REQUEST['type']) . iif($_REQUEST['searchid'], '&searchid=' . $_REQUEST['searchid']) . '&sortby=' . $_REQUEST['sortby'], $count); $data = $db->fetch("SELECT a.id,a.secid,a.type,a.title,a.starttime,a.endtime,a.endtime,a.allowcoms,a.allowrating,IF(a.sticky>=" . time() . ",1,0) AS sticky,a.hits,b.userid,b.username,c.title AS catname FROM " . PRE . "_articles AS a LEFT JOIN " . PRE . "_user AS b USING(userid) LEFT JOIN " . PRE . "_articles_cat AS c ON a.catid=c.id WHERE 1 " . $resultFilter . $layerFilter . section_filter(true, 'a.secid') . " " . getorder($orderdef, 'sticky DESC', 1) . getlimit()); $this->show_print($data); orderstr($orderdef, 'action.php?action=articles.show&what=' . $_REQUEST['what'] . iif($_REQUEST['what'] == 'type', '&type=' . $_REQUEST['type']) . iif($_REQUEST['searchid'], '&searchid=' . $_REQUEST['searchid'])); save_index($_SERVER['REQUEST_URI']); //Legende $apx->tmpl->parse('legend'); //Layer-Footer ausgeben $html->layer_footer(); }
\***************************************************************/ define('APXRUN', true); //////////////////////////////////////////////////////////////////////////////////////////////////////// require 'lib/_start.php'; //////////////////////////////////////////////////////////// SYSTEMSTART /// //////////////////////////////////////////////////////////////////////////////////////////////////////// require_once BASEDIR . getmodulepath('glossar') . 'functions.php'; $apx->module('glossar'); $apx->lang->drop('global'); headline($apx->lang->get('HEADLINE'), mklink('glossar.php', 'glossar.html')); titlebar($apx->lang->get('HEADLINE')); $_REQUEST['catid'] = (int) $_REQUEST['catid']; $_REQUEST['id'] = (int) $_REQUEST['id']; ////////////////////////////////////////////////////////////////////////////////// NUR KOMMENTARE if ($_REQUEST['id'] && $_REQUEST['comments']) { $res = $db->first("SELECT title FROM " . PRE . "_glossar WHERE ( id='" . $_REQUEST['id'] . "' " . section_filter() . " ) LIMIT 1"); titlebar($apx->lang->get('HEADLINE') . ': ' . $res['title']); glossar_showcomments($_REQUEST['id']); } ///////////////////////////////////////////////////////////////////////////////////////// DETAILS if ($_REQUEST['id']) { $apx->lang->drop('detail'); //Counter $db->query("UPDATE " . PRE . "_glossar SET hits=hits+1 WHERE id='" . $_REQUEST['id'] . "' LIMIT 1"); //Verwendete Variablen auslesen $parse = $apx->tmpl->used_vars('detail'); //Begriff-Info $res = $db->first("SELECT * FROM " . PRE . "_glossar WHERE ( id='" . $_REQUEST['id'] . "' " . iif(!$user->is_team_member(), "AND starttime!='0'") . " ) LIMIT 1"); if (!$res['id']) { filenotfound(); }
$apx->lang->drop('search'); $parse = $apx->tmpl->used_vars('archive'); $data = $db->fetch("SELECT id,starttime FROM " . PRE . "_articles WHERE ( ( '" . time() . "' BETWEEN starttime AND endtime ) " . $filter . " " . section_filter() . " ) ORDER BY starttime " . iif($set['articles']['archivesort'] == 2, 'ASC', 'DESC')); if (count($data)) { foreach ($data as $res) { if ($laststamp == date('Y/m', $res['starttime'] - TIMEDIFF)) { continue; } ++$i; //Link $link = mklink('articlearchive.php?month=' . date('mY', $res['starttime'] - TIMEDIFF), 'articlearchive,' . date('m,Y', $res['starttime'] - TIMEDIFF) . ',1.html'); //Links if (in_array('ARCHIVE.COUNT', $parse)) { $monthStart = mktime(0, 0, 0, date('n', $res['starttime'] - TIMEDIFF), 1, date('Y', $res['starttime'] - TIMEDIFF)) + TIMEDIFF; $monthEnd = mktime(0, 0, 0, date('n', $res['starttime'] - TIMEDIFF) + 1, 1, date('Y', $res['starttime'] - TIMEDIFF)) + TIMEDIFF - 1; list($count) = $db->first("SELECT count(id) FROM " . PRE . "_articles WHERE ( ( '" . time() . "' BETWEEN starttime AND endtime ) AND ( starttime BETWEEN " . $monthStart . " AND " . $monthEnd . " ) " . $filter . " " . section_filter() . " )"); $tabledata[$i]['COUNT'] = $count; } $tabledata[$i]['YEAR'] = date('Y', $res['starttime'] - TIMEDIFF); $tabledata[$i]['MONTH'] = $res['starttime']; $tabledata[$i]['LINK'] = $link; $laststamp = date('Y/m', $res['starttime'] - TIMEDIFF); } } $apx->tmpl->assign('ARCHIVE', $tabledata); //Suchbox $data = articles_catinfo(); foreach ($data as $id => $cat) { ++$i; $catdata[$i]['ID'] = $id; $catdata[$i]['TITLE'] = $cat['title'];
//Galerie sortieren nach if ($set['gallery']['subgals']) { require_once BASEDIR . 'lib/class.recursivetree.php'; $tree = new RecursiveTree(PRE . '_gallery', 'id'); $data = $tree->getLevel(array('*'), 0, "'" . time() . "' BETWEEN starttime AND endtime " . section_filter(true, 'secid')); } else { if ($_REQUEST['letter']) { $orderby = 'title ASC'; } elseif ($set['gallery']['ordergal'] == 2) { $orderby = 'title ASC'; } elseif ($set['gallery']['ordergal'] == 3) { $orderby = 'lft ASC'; } else { $orderby = 'starttime DESC'; } $data = $db->fetch("SELECT *,1 AS level FROM " . PRE . "_gallery WHERE ( '" . time() . "' BETWEEN starttime AND endtime " . $where . " " . section_filter() . " ) ORDER BY " . $orderby . " " . iif($set['gallery']['listepp'], getlimit($set['gallery']['listepp']))); } //Galerien auslesen, die veröffentlicht sind if ($set['gallery']['subgals']) { $openData = $db->fetch("SELECT id FROM " . PRE . "_gallery WHERE '" . time() . "' BETWEEN starttime AND endtime"); $openIds = get_ids($openData); } //Galerien auflisten if (count($data)) { foreach ($data as $res) { ++$i; if ($set['gallery']['subgals']) { $subtreeIds = array_merge($res['children'], array($res['id'])); $subtreeIds = array_intersect($subtreeIds, $openIds); } else { $subtreeIds = array($res['id']);
function show() { global $set, $db, $apx, $html; quicklink('teaser.add'); //Gruppen-Auswahl $_REQUEST['gid'] = (int) $_REQUEST['gid']; $groupdata = array(); foreach ($set['teaser']['groups'] as $id => $title) { $groupdata[] = array('ID' => $id, 'TITLE' => compatible_hsc($title), 'SELECTED' => $_REQUEST['gid'] == $id); } $apx->tmpl->assign('GROUP', $groupdata); $apx->tmpl->parse('show_choose'); //DnD-Hinweis if ($set['teaser']['orderby'] == 1 && $apx->user->has_right('articles.edit')) { echo '<p class="hint">' . $apx->lang->get('USEDND') . '</p>'; } if ($set['teaser']['orderby'] != 1) { $orderdef[0] = 'title'; $orderdef['title'] = array('title', 'ASC', 'COL_TITLE'); $orderdef['hits'] = array('hits', 'ASC', 'COL_HITS'); } $col[] = array(' ', 1, ''); $col[] = array('COL_TITLE', 50, 'class="title"'); $col[] = array('COL_IMAGE', 40, 'align="center"'); $col[] = array('COL_HITS', 10, 'align="center"'); list($count) = $db->first("SELECT count(id) FROM " . PRE . "_teaser WHERE 1 " . iif($_REQUEST['gid'], "AND `group`=" . $_REQUEST['gid'])); pages('action.php?action=teaser.show&sortby=' . $_REQUEST['sortby'] . iif($_REQUEST['gid'], '&gid=' . $_REQUEST['gid']), $count); $data = $db->fetch("SELECT id,title,link,image,hits,starttime,endtime FROM " . PRE . "_teaser WHERE 1 " . iif($_REQUEST['gid'], "AND `group`=" . $_REQUEST['gid']) . section_filter() . " " . iif(is_array($orderdef), getorder($orderdef), " ORDER BY ord ASC") . getlimit()); $count = count($data); if ($count) { foreach ($data as $res) { ++$i; $size = @getimagesize(BASEDIR . getpath('uploads') . $res['image']); if ($size[0] && $size[0] > 300) { $imageWidth = 300; } 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') . '" />'; } $tabledata[$i]['COL2'] = '<a href="../misc.php?action=redirect&url=' . urlencode($res['link']) . '" target="_blank">' . replace($res['title']) . '</a>'; $tabledata[$i]['COL3'] = iif($res['image'], '<img src="../' . getpath('uploads') . $res['image'] . '" width="' . $imageWidth . '" alt="" />', ' '); $tabledata[$i]['COL4'] = number_format($res['hits'], 0, '', '.'); $tabledata[$i]['COL5'] = number_format($res['hits'], 0, '', '.'); $tabledata[$i]['ID'] = 'node:' . $res['id']; //Optionen if ($apx->user->has_right('teaser.edit')) { $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'teaser.edit', 'id=' . $res['id'], $apx->lang->get('CORE_EDIT')); } else { $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />'; } if ($apx->user->has_right('teaser.del')) { $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', 'teaser.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()) { $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('enable.gif', 'teaser.enable', 'id=' . $res['id'], $apx->lang->get('CORE_ENABLE')); } elseif ($res['starttime'] && $apx->user->has_right('teaser.disable')) { $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('disable.gif', 'teaser.disable', 'id=' . $res['id'], $apx->lang->get('CORE_DISABLE')); } else { $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />'; } } } $apx->tmpl->assign('TABLE', $tabledata); if ($set['teaser']['orderby'] == 1 && $apx->user->has_right('articles.edit')) { echo '<div class="listview" id="list">'; $html->table($col); echo '</div>'; $apx->tmpl->parse('show_js'); } else { $html->table($col); } orderstr($orderdef, 'action.php?action=teaser.show' . iif($_REQUEST['gid'], '&gid=' . $_REQUEST['gid'])); save_index($_SERVER['REQUEST_URI']); }
function calendar_events_from_day($thisdaystamp, $parse, $parseprefix = 'DAY.') { global $set, $apx, $db, $user; static $eventcache, $catdata; if (!isset($eventcache)) { $eventcache = array(); } //Termin-Kategorien auslesen if (!isset($catdata)) { $catdata = array(); if (in_template(array($parseprefix . 'EVENT.CATTITLE', $parseprefix . 'EVENT.CATICON'), $parse)) { $catdata = $db->fetch_index("SELECT * FROM " . PRE . "_calendar_cat", 'id'); } } //Modefilter if ($_REQUEST['mode'] == 'private') { $modefilter = " AND a.private='1' AND a.userid='" . $user->info['userid'] . "' "; } else { $modefilter = " AND a.private='0' "; } //Sortby if ($set['calendar']['sortby'] == 2) { $sortby = " title ASC "; } else { $sortby = " startday DESC, starttime ASC "; } //Termine auslesen $edata = $db->fetch("SELECT a.*,b.username FROM " . PRE . "_calendar_events AS a LEFT JOIN " . PRE . "_user AS b USING(userid) WHERE '" . $thisdaystamp . "' BETWEEN startday AND endday AND a.active!=0 " . section_filter(true, 'a.secid') . " " . $modefilter . " ORDER BY " . $sortby); $eventdata = array(); if (count($edata)) { foreach ($edata as $res) { ++$i; //Termin wurde schon verarbeitet => Übernehmen und fertig if (isset($eventcache[$res['id']])) { $eventdata[$i] = $eventcache[$res['id']]; continue; } //Kategorie-Info $catinfo = $catdata[$res['catid']]; //Link zum Termin $link = mklink('events.php?id=' . $res['id'], 'events,id' . $res['id'] . urlformat($res['title']) . '.html'); //Aufmacher $picture = $picture_popup = $picture_popuppath = ''; if (in_template(array($parseprefix . 'EVENT.PICTURE', $parseprefix . 'EVENT.PICTURE_POPUP', $parseprefix . 'EVENT.PICTURE_POPUPPATH'), $parse)) { list($picture, $picture_popup, $picture_popuppath) = calendar_pic($res['picture']); } //Start berechnen $startday = $starttime = $endday = $endtime = 0; if (in_template(array($parseprefix . 'EVENT.STARTDAY', $parseprefix . 'EVENT.STARTTIME'), $parse)) { $startday = calendar_stamp2time($res['startday']); if ($res['starttime'] != -1) { $time_comp = calendar_explode_stamp($res['startday']); $tmpstamp = sprintf('%04d', $res['starttime']); $time_comp['hour'] = substr($tmpstamp, 0, 2); $time_comp['minute'] = substr($tmpstamp, 2, 2); $starttime = mktime($time_comp['hour'], $time_comp['minute'], 0, $time_comp['month'], $time_comp['day'], $time_comp['year']) + TIMEDIFF; } } //Ende berechnen (falls nötig) if (in_template(array($parseprefix . 'EVENT.ENDDAY', $parseprefix . 'EVENT.ENDTIME'), $parse)) { if ($res['endday'] != $res['startday'] || $res['endtime'] != -1) { $endday = calendar_stamp2time($res['endday']); if ($res['endtime'] != -1) { $time_comp = calendar_explode_stamp($res['endday']); $tmpstamp = sprintf('%04d', $res['endtime']); $time_comp['hour'] = substr($tmpstamp, 0, 2); $time_comp['minute'] = substr($tmpstamp, 2, 2); $endtime = mktime($time_comp['hour'], $time_comp['minute'], 0, $time_comp['month'], $time_comp['day'], $time_comp['year']) + TIMEDIFF; } } } //Username + eMail if ($res['userid']) { $username = $res['username']; $email = iif(!$res['pub_hidemail'], $res['email']); } else { $username = $res['send_username']; $email = $res['send_email']; } //Text $eventtext = ''; if (in_array($parseprefix . 'EVENT.TEXT', $parse)) { $eventtext = mediamanager_inline($res['text']); } //Tags if (in_array($parseprefix . 'EVENT.TAG', $parse) || in_array($parseprefix . 'EVENT.TAG_IDS', $parse) || in_array($parseprefix . 'EVENT.KEYWORDS', $parse)) { list($tagdata, $tagids, $keywords) = calendar_tags($res['id']); } $event = array(); $event['ID'] = $res['id']; $event['TITLE'] = $res['title']; $event['TEXT'] = $eventtext; $event['LINK'] = $link; $event['PRIORITY'] = $res['priority']; $event['RESTRICTED'] = $res['restricted']; $event['LOCATION'] = compatible_hsc($res['location']); $event['LOCATION_LINK'] = compatible_hsc($res['location_link']); $event['PRIVATE'] = $res['private']; $event['HITS'] = $res['hits']; $event['RELATED'] = calendar_links($res['links']); $event['PICTURE'] = $picture; $event['PICTURE_POPUP'] = $picture_popup; $event['PICTURE_POPUPPATH'] = $picture_popuppath; $event['STARTDAY'] = $startday; $event['STARTTIME'] = $starttime; $event['ENDDAY'] = $endday; $event['ENDTIME'] = $endtime; $event['USERID'] = $res['userid']; $event['USERNAME'] = replace($username); $event['EMAIL'] = replace($email); $event['EMAIL_ENCRYPTED'] = replace(cryptMail($email)); $event['CATID'] = $res['catid']; $event['CATTITLE'] = $catinfo['title']; $event['CATICON'] = $catinfo['icon']; //Tags $event['TAG'] = $tagdata; $event['TAG_IDS'] = $tagids; $event['KEYWORDS'] = $keywords; $eventcache[$res['id']] = $event; $eventdata[$i] = $event; } } return $eventdata; }
$orderdef[0] = 'date'; } else { $orderdef[0] = 'title'; } $orderdef['title'] = array('a.title', 'ASC'); $orderdef['date'] = array('a.starttime', 'DESC'); $orderdef['hits'] = array('a.hits', 'DESC'); $orderdef['user'] = array('b.username', 'ASC'); if ($apx->is_module('ratings')) { $orderdef['rating'] = array('c.rating', 'DESC'); } //Videos Select if ($apx->is_module('ratings') && ($_REQUEST['sortby'] == 'rating.ASC' || $_REQUEST['sortby'] == 'rating.DESC')) { $data = $db->fetch("SELECT a.*,b.username,b.email,b.pub_hidemail,avg(c.rating) AS rating FROM " . PRE . "_videos AS a LEFT JOIN " . PRE . "_user AS b USING(userid) LEFT JOIN " . PRE . "_ratings AS c ON ( c.module='videos' AND a.id=c.mid ) WHERE ( a.status='finished' AND ( '" . time() . "' BETWEEN starttime AND endtime ) AND " . $filter . " " . section_filter() . " ) GROUP BY a.id " . getorder($orderdef) . getlimit($set['videos']['epp'])); } else { $data = $db->fetch("SELECT *,b.username,b.email,b.pub_hidemail FROM " . PRE . "_videos AS a LEFT JOIN " . PRE . "_user AS b USING(userid) WHERE ( a.status='finished' AND ( '" . time() . "' BETWEEN starttime AND endtime ) AND " . $filter . " " . section_filter() . " ) " . getorder($orderdef) . getlimit($set['videos']['epp'])); } $catids = get_ids($data, 'catid'); //Kategorien auslesen, falls notwendig $catinfo = array(); if (count($catids) && in_template(array('VIDEO.CATTITLE', 'VIDEO.CATTEXT', 'VIDEO.CATICON'), $parse)) { $catinfo = videos_catinfo($catids); } if (count($data)) { foreach ($data as $res) { ++$i; //Link $link = mklink('videos.php?id=' . $res['id'], 'videos,id' . $res['id'] . urlformat($res['title']) . '.html'); //Teaserbild if (in_array('VIDEO.PICTURE', $parse) || in_array('VIDEO.PICTURE_POPUP', $parse) || in_array('VIDEO.PICTURE_POPUPPATH', $parse)) { list($picture, $picture_popup, $picture_popuppath) = videos_teaserpic($res['teaserpic']);
letters(mklink($link2file . '.php?catid=' . $_REQUEST['catid'], $link2file . ',{LETTER},' . $_REQUEST['catid'] . ',1.html')); if (!$_REQUEST['letter']) { $_REQUEST['letter'] = 0; } if ($_REQUEST['letter']) { if ($_REQUEST['letter'] == 'spchar') { $where = "AND title NOT REGEXP(\"^[a-zA-Z]\")"; } else { $where = "AND title LIKE '" . addslashes($_REQUEST['letter']) . "%'"; } } //Seitenzahlen list($count) = $db->first("SELECT count(id) FROM " . PRE . "_articles WHERE ( '" . time() . "' BETWEEN starttime AND endtime " . $where . " " . iif(count($cattree), "AND catid IN (" . @implode(',', $cattree) . ")") . " " . $artfilter . " " . section_filter() . " )"); pages(mklink($link2file . '.php?catid=' . $_REQUEST['catid'] . '&letter=' . $_REQUEST['letter'], $link2file . ',' . $_REQUEST['letter'] . ',' . $_REQUEST['catid'] . ',{P}.html'), $count, $set['articles']['epp']); //Ausgabe erfolgt $data = $db->fetch("SELECT a.*,IF(a.sticky>=" . time() . ",1,0) AS sticky,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 " . $where . " " . iif(count($cattree), "AND catid IN (" . @implode(',', $cattree) . ")") . " " . $artfilter . " " . section_filter() . " ) ORDER BY sticky DESC,starttime DESC " . getlimit($set['articles']['epp'])); $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')); } if (count($data)) { foreach ($data as $res) { ++$i; //Wohin soll verlinkt werden? if ($res['type'] == 'normal') { $link2file = 'articles'; } else { $link2file = $res['type'] . 's'; }
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']); }
$tabledata[$i]['STARTTIME'] = $res['starttime']; $tabledata[$i]['ENDTIME'] = $res['starttime'] + $res['days'] * 24 * 3600; $tabledata[$i]['VOTES'] = $res['total']; //Tags $tabledata[$i]['TAG'] = $tagdata; $tabledata[$i]['TAG_IDS'] = $tagids; $tabledata[$i]['KEYWORDS'] = $keywords; $tabledata[$i]['LINK'] = mklink('poll.php?id=' . $res['id'], 'poll,' . $res['id'] . urlformat($res['question']) . '.html'); } } $apx->tmpl->assign('ARCHIVE', $tabledata); $apx->tmpl->parse('archive'); require 'lib/_end.php'; } //////////////////////////////////////////////////////////////////////////////////////////////////////// ABSTIMMEN $query = "SELECT *,a1_c+a2_c+a3_c+a4_c+a5_c+a6_c+a7_c+a8_c+a9_c+a10_c+a11_c+a12_c+a13_c+a14_c+a15_c+a16_c+a17_c+a18_c+a19_c+a20_c AS total FROM " . PRE . "_poll WHERE ( id='" . $_REQUEST['id'] . "' " . section_filter() . " ) " . iif(!$user->is_team_member(), " AND ( '" . time() . "' BETWEEN starttime AND endtime ) ") . " " . section_filter() . " ORDER BY starttime DESC LIMIT 1"; $pollinfo = $db->first($query); if (!$pollinfo['id']) { filenotfound(); } if ($user->info['userid']) { list($ipblock) = $db->first("SELECT ip FROM " . PRE . "_poll_iplog WHERE ( id='" . $_REQUEST['id'] . "' AND userid='" . $user->info['userid'] . "' AND time>" . (time() - 24 * 3600) . " ) LIMIT 1"); } else { list($ipblock) = $db->first("SELECT ip FROM " . PRE . "_poll_iplog WHERE ( id='" . $_REQUEST['id'] . "' AND ip='" . ip2integer(get_remoteaddr()) . "' AND time>" . (time() - 24 * 3600) . " ) LIMIT 1"); } if ($_POST['send'] && ($recent == $_REQUEST['id'] || $set['poll']['archvote']) && $_POST['vote'] && $_COOKIE[$set['main']['cookie_pre'] . '_voted'][$_REQUEST['id']] != '1' && !$ipblock) { $_POST['vote'] = (int) $_POST['vote']; //Mehrere if ($pollinfo['multiple']) { $cset = array(); foreach ($_POST['vote'] as $aid => $true) {