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 products_match_tags($items) { global $set, $db, $apx, $user; if (!is_array($items)) { return array(); } $result = array(); foreach ($items as $item) { $data = $db->fetch("\n\t\t\tSELECT DISTINCT at.id\n\t\t\tFROM " . PRE . "_products_tags AS at\n\t\t\tLEFT JOIN " . PRE . "_tags AS t USING(tagid)\n\t\t\tWHERE t.tag LIKE '%" . addslashes_like($item) . "%'\n\t\t"); $result[$item] = get_ids($data, 'id'); } return $result; }
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 search_user($items, $conn) { global $set, $db, $apx, $user; //Suchstring generieren foreach ($items as $item) { $search[] = "username LIKE '%" . addslashes_like($item) . "%'"; } //Ergebnisse $data = $db->fetch("SELECT userid,username FROM " . PRE . "_user WHERE ( " . implode($conn, $search) . " ) ORDER BY username ASC"); if (count($data)) { foreach ($data as $res) { ++$i; $result[$i]['TITLE'] = $res['username']; $result[$i]['LINK'] = $user->mkprofile($res['userid'], $res['username']); } } return $result; }
function searchuser() { global $set, $db, $apx; $apx->tmpl->loaddesign('blank'); if ($_POST['send']) { $data = $db->fetch("SELECT userid,username_login FROM " . PRE . "_user WHERE username_login LIKE '%" . addslashes_like($_POST['item']) . "%' OR username LIKE '%" . addslashes_like($_POST['item']) . "%' ORDER BY username_login ASC"); if (count($data)) { foreach ($data as $res) { ++$i; $tabledata[$i]['ID'] = $res['userid']; $tabledata[$i]['NAME'] = $res['username_login']; $tabledata[$i]['INSERT'] = addslashes($res['username_login']); } } } $apx->tmpl->assign('RESULT', $tabledata); $apx->tmpl->assign('ITEM', compatible_hsc($_POST['item'])); $apx->tmpl->assign('INSERTFUNC', $_REQUEST['insertfunc']); $apx->tmpl->parse('searchuser'); }
function suggesttag() { global $apx, $db, $set; $max = 5; $taglist = array(); $data = $db->fetch("\n\t\tSELECT DISTINCT tagid, tag\n\t\tFROM " . PRE . "_tags\n\t\tWHERE tag LIKE '" . addslashes_like(utf8_decode($_REQUEST['query'])) . "%'\n\t\tORDER BY tag ASC\n\t\tLIMIT " . $max . "\n\t"); $rows = $query->num_rows; $ids = array(-1); foreach ($data as $res) { echo utf8_encode($res['tag']) . "\n"; $ids[] = $res['tagid']; } //Ergebnisliste erweitern if ($rows < $max) { $data = $db->fetch("\n\t\t\tSELECT DISTINCT tagid, tag\n\t\t\tFROM " . PRE . "_tags\n\t\t\tWHERE tag LIKE '%" . addslashes_like($_REQUEST['query']) . "%' AND tagid NOT IN (" . implode(',', $ids) . ")\n\t\t\tORDER BY tag ASC\n\t\t\tLIMIT " . ($max - $rows) . "\n\t\t"); foreach ($data as $res) { echo utf8_encode($res['tag']) . "\n"; } } }
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 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 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; }
//////////////////////////////////////////////////////////// SYSTEMSTART /// //////////////////////////////////////////////////////////////////////////////////////////////////////// $apx->module('newsletter'); $apx->lang->drop('form'); headline($apx->lang->get('HEADLINE'), mklink('newsletter.php', 'newsletter.html')); titlebar($apx->lang->get('HEADLINE')); $_REQUEST['activate'] = (int) $_REQUEST['activate']; //////////////////////////////////////////////////////////////////////////////////////////////////////// //Aktivierungscode anfordern if ($_REQUEST['getcode']) { if (!$set['newsletter']['regcode']) { exit; } $apx->lang->drop('getcode'); if ($_POST['send']) { list($aboId) = $db->first("SELECT id FROM " . PRE . "_newsletter_emails WHERE email LIKE '" . addslashes_like($_POST['email']) . "' LIMIT 1"); if (!$_POST['email']) { message('back'); } elseif (!$aboId) { message($apx->lang->get('MSG_NOEMAIL'), 'back'); } else { $insert = array(); $remove = array(); //Abonnements $data = $db->fetch("\n\t\t\t\tSELECT catid, incode, outcode, active\n\t\t\t\tFROM " . PRE . "_newsletter_emails_cat\n\t\t\t\tWHERE eid='" . $aboId . "' AND ( ( incode!='' AND active=0 ) OR outcode!='' )\n\t\t\t"); foreach ($data as $res) { if ($res['outcode']) { $remove[] = $res['catid']; } if ($res['incode'] && !$res['active']) { $insert[] = $res['catid'];
function show() { global $set, $db, $apx, $html; $todaystamp = date('Ymd', time() - TIMEDIFF); //Suche durchführen if ($_REQUEST['item'] && ($_REQUEST['title'] || $_REQUEST['text']) || $_REQUEST['secid'] || $_REQUEST['catid'] || $_REQUEST['userid'] || $_REQUEST['start_day'] && $_REQUEST['start_month'] && $_REQUEST['start_year'] || $_REQUEST['end_day'] && $_REQUEST['end_month'] && $_REQUEST['end_year']) { $where = ''; $_REQUEST['catid'] = (int) $_REQUEST['catid']; $_REQUEST['secid'] = (int) $_REQUEST['secid']; $_REQUEST['userid'] = (int) $_REQUEST['userid']; $_REQUEST['start_day'] = (int) $_REQUEST['start_day']; $_REQUEST['start_month'] = (int) $_REQUEST['start_month']; $_REQUEST['start_year'] = (int) $_REQUEST['start_year']; $_REQUEST['end_day'] = (int) $_REQUEST['end_day']; $_REQUEST['end_month'] = (int) $_REQUEST['end_month']; $_REQUEST['end_year'] = (int) $_REQUEST['end_year']; if (!($_REQUEST['start_day'] && $_REQUEST['start_month'] && $_REQUEST['start_year'])) { unset($_REQUEST['start_day'], $_REQUEST['start_month'], $_REQUEST['start_year']); } if (!($_REQUEST['end_day'] && $_REQUEST['end_month'] && $_REQUEST['end_year'])) { unset($_REQUEST['end_day'], $_REQUEST['end_month'], $_REQUEST['end_year']); } //Suchbegriff if ($_REQUEST['item']) { if ($_REQUEST['title']) { $sc[] = "a.title LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; } if ($_REQUEST['text']) { $sc[] = "a.text LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; } if (is_array($sc)) { $where .= ' AND ( ' . implode(' OR ', $sc) . ' )'; } } //Zeitraum if ($_REQUEST['start_day'] && $_REQUEST['start_month'] && $_REQUEST['start_year'] && $_REQUEST['end_day'] && $_REQUEST['end_month'] && $_REQUEST['end_year']) { $startstamp = sprintf('%04d%02d%02d', $_REQUEST['start_year'], $_REQUEST['start_month'], $_REQUEST['start_day']); $endstamp = sprintf('%04d%02d%02d', $_REQUEST['end_year'], $_REQUEST['end_month'], $_REQUEST['end_day']); $where .= " AND '" . $startstamp . "'<=endday AND '" . $endstamp . "'>=startday "; } elseif ($_REQUEST['start_day'] && $_REQUEST['start_month'] && $_REQUEST['start_year']) { $startstamp = sprintf('%04d%02d%02d', $_REQUEST['start_year'], $_REQUEST['start_month'], $_REQUEST['start_day']); $where .= " AND startday>=" . $startstamp . " "; } elseif ($_REQUEST['end_day'] && $_REQUEST['end_month'] && $_REQUEST['end_year']) { $endstamp = sprintf('%04d%02d%02d', $_REQUEST['end_year'], $_REQUEST['end_month'], $_REQUEST['end_day']); $where .= " AND endday<=" . $endstamp . " "; } //Sektion if (!$apx->session->get('section') && $_REQUEST['secid']) { $where .= " AND ( secid LIKE '%|" . $_REQUEST['secid'] . "|%' OR secid='all' ) "; } //Kategorie if ($_REQUEST['catid']) { if ($set['gallery']['subcats']) { $tree = $this->cat->getChildrenIds($_REQUEST['catid']); $tree[] = $_REQUEST['catid']; if (is_array($tree)) { $where .= " AND catid IN (" . implode(',', $tree) . ") "; } } else { $where .= " AND catid='" . $_REQUEST['catid'] . "' "; } } //Benutzer if ($_REQUEST['userid']) { $where .= " AND userid='" . $_REQUEST['userid'] . "' "; } $data = $db->fetch("SELECT id FROM " . PRE . "_calendar_events AS a WHERE 1 " . $where); $ids = get_ids($data, 'id'); $ids[] = -1; $searchid = saveSearchResult('admin_calendar', $ids, array('item' => $_REQUEST['item'], 'title' => $_REQUEST['title'], 'text' => $_REQUEST['text'], 'catid' => $_REQUEST['catid'], 'secid' => $_REQUEST['secid'], 'userid' => $_REQUEST['userid'], 'start_day' => $_REQUEST['start_day'], 'start_month' => $_REQUEST['start_month'], 'start_year' => $_REQUEST['start_year'], 'end_day' => $_REQUEST['end_day'], 'end_month' => $_REQUEST['end_month'], 'end_year' => $_REQUEST['end_year'])); header("HTTP/1.1 301 Moved Permanently"); header('Location: action.php?action=calendar.show&what=' . $_REQUEST['what'] . '&searchid=' . $searchid); return; } //Voreinstellungen $_REQUEST['title'] = 1; $_REQUEST['text'] = 1; quicklink('calendar.add'); $layerdef[] = array('LAYER_RECENT', 'action.php?action=calendar.show', !$_REQUEST['what']); $layerdef[] = array('LAYER_SEND', 'action.php?action=calendar.show&what=send', $_REQUEST['what'] == 'send'); $layerdef[] = array('LAYER_ARCHIVE', 'action.php?action=calendar.show&what=archive', $_REQUEST['what'] == 'archive'); //Layer Header ausgeben $html->layer_header($layerdef); $orderdef[0] = 'addtime'; $orderdef['title'] = array('a.title', 'ASC', 'COL_TITLE'); $orderdef['cat'] = array('catname', 'ASC', 'COL_CATEGORY'); $orderdef['addtime'] = array('a.addtime', 'DESC', 'SORT_ADDTIME'); $orderdef['startday'] = array('a.startday', 'ASC', 'SORT_STARTDAY'); $orderdef['endday'] = array('a.endday', 'ASC', 'SORT_ENDDAY'); $orderdef['hits'] = array('a.hits', 'DESC', 'COL_HITS'); //Suchergebnis? $resultFilter = ''; if ($_REQUEST['searchid']) { $searchRes = getSearchResult('admin_calendar', $_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']; $_REQUEST['start_day'] = $resultMeta['start_day']; $_REQUEST['start_month'] = $resultMeta['start_month']; $_REQUEST['start_year'] = $resultMeta['start_year']; $_REQUEST['end_day'] = $resultMeta['end_day']; $_REQUEST['end_month'] = $resultMeta['end_month']; $_REQUEST['end_year'] = $resultMeta['end_year']; $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 $catlist = ''; if ($set['calendar']['subcats']) { $data = $this->cat->getTree(array('title')); } else { $data = $db->fetch("SELECT id,title FROM " . PRE . "_calendar_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 $userlist = ''; $data = $db->fetch("SELECT b.userid,b.username FROM " . PRE . "_calendar_events AS a LEFT JOIN " . PRE . "_user AS b USING (userid) WHERE a.userid!=0 AND a.private='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('START_DAY', $_REQUEST['start_day']); $apx->tmpl->assign('START_MONTH', $_REQUEST['start_month']); $apx->tmpl->assign('START_YEAR', $_REQUEST['start_year']); $apx->tmpl->assign('END_DAY', $_REQUEST['end_day']); $apx->tmpl->assign('END_MONTH', $_REQUEST['end_month']); $apx->tmpl->assign('END_YEAR', $_REQUEST['end_year']); $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'] == 'archive') { $layerFilter = " AND a.endday<'" . $todaystamp . "' "; } elseif ($_REQUEST['what'] == 'send') { $layerFilter = " AND a.send_ip!='' "; } else { $layerFilter = " AND a.endday>='" . $todaystamp . "' "; } list($count) = $db->first("SELECT count(id) FROM " . PRE . "_calendar_events AS a WHERE private='0' " . $resultFilter . $layerFilter . section_filter(true, 'secid')); pages('action.php?action=calendar.show&what=' . $_REQUEST['what'] . '&sortby=' . $_REQUEST['sortby'], $count); $data = $db->fetch("SELECT a.id,a.secid,a.send_username,a.title,a.addtime,a.startday,a.endday,a.hits,a.active,a.allowcoms,b.username,c.title AS catname FROM " . PRE . "_calendar_events AS a LEFT JOIN " . PRE . "_user AS b USING(userid) LEFT JOIN " . PRE . "_calendar_cat AS c ON a.catid=c.id WHERE a.private=0 " . $resultFilter . $layerFilter . section_filter(true, 'a.secid') . " " . getorder($orderdef) . getlimit()); $this->show_print($data); orderstr($orderdef, 'action.php?action=calendar.show&what=' . $_REQUEST['what']); save_index($_SERVER['REQUEST_URI']); //Layer-Footer ausgeben $html->layer_footer(); }
$keyword_posts = array_unique(array_diff($tempres['posts'], $result_not['posts'])); //Wort-Highlighting $highlight = array_merge($words_req, $words_one); } ///////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// ALS BEITRÄGE ANZEIGEN ///////////////////////////////////////////////////////////////////////////////////////////////// if ($_POST['display'] == 'posts') { //Nur Themen aus den gewählten Foren $wherethread .= " forumid IN (" . implode(',', $inforum) . ") "; //Nur Themen vom Autor suchen if ($_REQUEST['author'] && $_POST['findthreads'] && !$_POST['findposts']) { if ($_POST['exact']) { $wherethread .= iif($wherethread, ' AND ') . " opener='" . addslashes($_REQUEST['author']) . "' "; } else { $wherethread .= iif($wherethread, ' AND ') . " opener LIKE '%" . addslashes_like($_REQUEST['author']) . "%' "; } } //Antworten: Filter erstellen if ($_POST['answers']) { $wherethread .= iif($wherethread, ' AND ') . " posts>='" . (intval($_POST['answers']) + 1) . "' "; } //Nach Präfixen suchen if (is_array($_POST['prefix']) && count($_POST['prefix'])) { $_POST['prefix'] = array_map('intval', $_POST['prefix']); $wherethread .= iif($wherethread, ' AND ') . " prefix IN (" . implode(',', $_POST['prefix']) . ") "; } //Relevante Themen auslesen $data = $db->fetch("SELECT threadid FROM " . PRE . "_forum_threads WHERE ( " . $wherethread . " AND del=0 AND moved=0 ) ORDER BY threadid ASC"); $inthread = get_ids($data, 'threadid'); if (isset($keyword_threads)) {
function ushow() { global $set, $db, $apx, $html; //Suche durchführen if ($_REQUEST['item'] && ($_REQUEST['title'] || $_REQUEST['text'])) { $where = ''; //Suche wird ausgeführt... if ($_REQUEST['title']) { $sc[] = "title LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; $sc[] = "fullname LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; } if ($_REQUEST['text']) { $sc[] = "text LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; } if ($_REQUEST['else']) { $sc[] = "address LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; $sc[] = "email LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; $sc[] = "phone LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; $sc[] = "website LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; $sc[] = "founder LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; $sc[] = "founding_year LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; $sc[] = "founding_country LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; $sc[] = "legalform LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; $sc[] = "headquaters LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; $sc[] = "executive LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; $sc[] = "sector LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; $sc[] = "products LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; } if (is_array($sc)) { $where .= ' AND ( ' . implode(' OR ', $sc) . ' )'; } $data = $db->fetch("SELECT id FROM " . PRE . "_products_units WHERE 1 " . $where); $ids = get_ids($data, 'id'); $ids[] = -1; $searchid = saveSearchResult('admin_products_units', $ids, array('title' => $_REQUEST['title'], 'text' => $_REQUEST['text'], 'else' => $_REQUEST['else'], 'item' => $_REQUEST['item'])); header("HTTP/1.1 301 Moved Permanently"); header('Location: action.php?action=products.ushow&what=' . $_REQUEST['what'] . '&searchid=' . $searchid); return; } //Vorgaben $_REQUEST['title'] = 1; $_REQUEST['text'] = 1; quicklink('products.uadd'); //Layer Header ausgeben $layerdef[] = array('UNITTYPE_ALL', 'action.php?action=products.ushow', !$_REQUEST['what']); $layerdef[] = array('UNITTYPE_PERSON', 'action.php?action=products.ushow&what=person', $_REQUEST['what'] == 'person'); $layerdef[] = array('UNITTYPE_COMPANY', 'action.php?action=products.ushow&what=company', $_REQUEST['what'] == 'company'); $html->layer_header($layerdef); $typeFilter = ''; if (in_array($_REQUEST['what'], array('company', 'person'))) { $typeFilter = " AND type='" . $_REQUEST['what'] . "' "; } $orderdef[0] = 'title'; $orderdef['title'] = array('title', 'ASC', 'COL_TITLE'); //Suchergebnis? $resultFilter = ''; if ($_REQUEST['searchid']) { $searchRes = getSearchResult('admin_products_units', $_REQUEST['searchid']); if ($searchRes) { list($resultIds, $resultMeta) = $searchRes; $_REQUEST['item'] = $resultMeta['item']; $_REQUEST['title'] = $resultMeta['title']; $_REQUEST['text'] = $resultMeta['text']; $_REQUEST['else'] = $resultMeta['else']; $resultFilter = " AND id IN (" . implode(', ', $resultIds) . ")"; } else { $_REQUEST['searchid'] = ''; } } $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('SELSE', (int) $_REQUEST['else']); $apx->tmpl->assign('WHAT', $_REQUEST['what']); $apx->tmpl->parse('usearch'); //Letters letters('action.php?action=products.ushow&what=' . $_REQUEST['what'] . iif($_REQUEST['searchid'], '&searchid=' . $_REQUEST['searchid'])); if (!$_REQUEST['letter']) { $_REQUEST['letter'] = 0; } $letterfilter = ''; if ($_REQUEST['letter'] === 'spchar') { $letterfilter = " AND title NOT REGEXP(\"^[a-zA-Z]\") "; } elseif ($_REQUEST['letter']) { $letterfilter = " AND title LIKE '" . addslashes($_REQUEST['letter']) . "%' "; } list($count) = $db->first("SELECT count(id) FROM " . PRE . "_products_units WHERE 1 " . $typeFilter . $resultFilter . $letterfilter); pages('action.php?action=products.ushow&what=' . $_REQUEST['what'] . iif($_REQUEST['searchid'], '&searchid=' . $_REQUEST['searchid']) . '&letter=' . $_REQUEST['letter'] . '&sortby=' . $_REQUEST['sortby'], $count); $data = $db->fetch("SELECT * FROM " . PRE . "_products_units WHERE 1 " . $typeFilter . $resultFilter . $letterfilter . getorder($orderdef) . getlimit()); $this->ushow_print($data); orderstr($orderdef, 'action.php?action=products.ushow&what=' . $_REQUEST['what'] . iif($_REQUEST['searchid'], '&searchid=' . $_REQUEST['searchid']) . '&letter=' . $_REQUEST['letter']); save_index($_SERVER['REQUEST_URI']); //Layer-Footer ausgeben $html->layer_footer(); }
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']); }
function eimport() { global $set, $db, $apx; if ($_POST['catid'][0] == 'all' || !isset($_POST['catid'])) { $_POST['catid'] = array('all'); } if ($_POST['send'] == 1) { $emails = explode("\n", $_POST['email']); $emails = array_map('trim', $emails); $wrongmails = array(); foreach ($emails as $email) { if (!strlen($email)) { continue; } if ($email && !checkmail($email)) { $wrongmails[] = $email; } } if (!checkToken()) { infoInvalidToken(); } elseif (!$_POST['catid']) { infoNotComplete(); } elseif ($wrongmails) { info($apx->lang->get('INFO_WRONGSYNTAX', array('EMAILS' => implode(', ', $wrongmails)))); } else { //Kategorien if ($_POST['catid'][0] == 'all') { $catids = array_keys($set['newsletter']['categories']); } else { $catids = array_unique(array_map('intval', $_POST['catid'])); } foreach ($emails as $email) { if (!strlen($email)) { continue; } list($aboId) = $db->first("SELECT id FROM " . PRE . "_newsletter_emails WHERE email LIKE '" . addslashes_like($email) . "' LIMIT 1"); //Email bereits vorhanden if ($aboId) { foreach ($catids as $catid) { $db->query("\n\t\t\t\t\t\t\tINSERT IGNORE INTO " . PRE . "_newsletter_emails_cat\n\t\t\t\t\t\t\t(eid, catid, active, html) VALUES\n\t\t\t\t\t\t\t('" . $aboId . "', '" . $catid . "', '1', '" . ($_POST['html'] ? true : false) . "')\n\t\t\t\t\t\t"); if ($db->affected_rows() == 0) { $db->query("\n\t\t\t\t\t\t\t\tUPDATE " . PRE . "_newsletter_emails_cat\n\t\t\t\t\t\t\t\tSET active=1, html='" . ($_POST['html'] ? 1 : 0) . "', incode=''\n\t\t\t\t\t\t\t\tWHERE eid='" . $aboId . "' AND catid='" . $catid . "'\n\t\t\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\t\t"); } } } else { $db->query("INSERT INTO " . PRE . "_newsletter_emails (email) VALUES ('" . addslashes($email) . "')"); $nid = $db->insert_id(); foreach ($catids as $catid) { $db->query("\n\t\t\t\t\t\t\tINSERT INTO " . PRE . "_newsletter_emails_cat\n\t\t\t\t\t\t\t(eid, catid, active, html) VALUES\n\t\t\t\t\t\t\t('" . $nid . "', '" . $catid . "', '1', '" . ($_POST['html'] ? true : false) . "')\n\t\t\t\t\t\t"); } } logit('NEWSLETTER_EADD', 'ID #' . $nid); } logit('NEWSLETTER_EIMPORT'); printJSRedirect(get_index('newsletter.eshow')); } } else { //Kategorien $catinfo = $set['newsletter']['categories']; asort($catinfo); $catlist = '<option value="all"' . iif($_POST['catid'][0] == 'all', 'selected="selected"') . ' style="font-weight:bold;">' . $apx->lang->get('ALL') . '</option>'; foreach ($catinfo as $id => $name) { $catlist .= '<option value="' . $id . '"' . iif(in_array($id, $_POST['catid']), 'selected="selected"') . '>' . replace($name) . '</option>'; } $apx->tmpl->assign('CATLIST', $catlist); $apx->tmpl->assign('EMAIL', ''); $apx->tmpl->assign('HTML', 0); $apx->tmpl->parse('eimport'); } }
function show() { global $set, $db, $apx, $html; //Suche durchführen if ($_REQUEST['item'] && ($_REQUEST['title'] || $_REQUEST['text'])) { $where = ''; //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) . ' )'; } $data = $db->fetch("SELECT id FROM " . PRE . "_glossar WHERE 1 " . $where); $ids = get_ids($data, 'id'); $ids[] = -1; $searchid = saveSearchResult('admin_glossar', $ids, array('title' => $_REQUEST['title'], 'text' => $_REQUEST['text'], 'item' => $_REQUEST['item'])); header("HTTP/1.1 301 Moved Permanently"); header('Location: action.php?action=glossar.show&what=' . $_REQUEST['what'] . '&searchid=' . $searchid); return; } //Vorgaben $_REQUEST['title'] = 1; $_REQUEST['text'] = 1; quicklink('glossar.add', 'action.php', 'catid=' . $_REQUEST['what']); $orderdef[0] = 'creation'; $orderdef['title'] = array('a.title', 'ASC', 'COL_TITLE'); $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'); //Layer $layerdef[] = array('ALL', 'action.php?action=glossar.show', !$_REQUEST['what']); $data = $db->fetch("SELECT * FROM " . PRE . "_glossar_cat ORDER BY title ASC"); if (count($data)) { foreach ($data as $res) { $layerdef[] = array(compatible_hsc($res['title']), 'action.php?action=glossar.show&what=' . $res['id'], $_REQUEST['what'] == $res['id']); } } $html->layer_header($layerdef); $layerFilter = ''; if (intval($_REQUEST['what'])) { $layerFilter = " AND a.catid='" . intval($_REQUEST['what']) . "' "; } //Suchergebnis? $resultFilter = ''; if ($_REQUEST['searchid']) { $searchRes = getSearchResult('admin_glossar', $_REQUEST['searchid']); if ($searchRes) { list($resultIds, $resultMeta) = $searchRes; $_REQUEST['item'] = $resultMeta['item']; $_REQUEST['title'] = $resultMeta['title']; $_REQUEST['text'] = $resultMeta['text']; $resultFilter = " AND a.id IN (" . implode(', ', $resultIds) . ")"; } else { $_REQUEST['searchid'] = ''; } } $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('WHAT', $_REQUEST['what']); $apx->tmpl->parse('search'); list($count) = $db->first("SELECT count(id) FROM " . PRE . "_glossar AS a WHERE 1 " . $layerFilter . $resultFilter); pages('action.php?action=glossar.show&what=' . $_REQUEST['what'] . '&sortby=' . $_REQUEST['sortby'] . iif($_REQUEST['searchid'], '&searchid=' . $_REQUEST['searchid']), $count); $data = $db->fetch("SELECT a.id,a.title,a.starttime,a.allowcoms,a.allowrating,a.hits,b.title AS catname FROM " . PRE . "_glossar AS a LEFT JOIN " . PRE . "_glossar_cat AS b ON a.catid=b.id WHERE 1 " . $layerFilter . $resultFilter . " " . getorder($orderdef) . getlimit()); $this->show_print($data); orderstr($orderdef, 'action.php?action=glossar.show&what=' . $_REQUEST['what'] . '' . iif($_REQUEST['searchid'], '&searchid=' . $_REQUEST['searchid'])); save_index($_SERVER['REQUEST_URI']); }
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(); }
} } $apx->tmpl->assign('VIDEO', $tabledata); $apx->tmpl->parse('search_result'); } else { $where = ''; //Suchbegriffe if ($_REQUEST['item']) { $items = array(); $it = explode(' ', preg_replace('#[ ]{2,}#', ' ', trim($_REQUEST['item']))); $tagmatches = videos_match_tags($it); foreach ($it as $item) { if (trim($item)) { $string = preg_replace('#[\\s_-]+#', '[^0-9a-zA-Z]*', $item); if (preg_match('#^[0-9a-zA-Z]+$#', $string)) { $items[] = " LIKE '%" . addslashes_like($string) . "%' "; } else { $items[] = " REGEXP '" . addslashes($string) . "' "; } } } if ($_REQUEST['conn'] == 'or') { $conn = ' OR '; } else { $conn = ' AND '; } $search = array(); foreach ($items as $regexp) { $tagmatch = array_shift($tagmatches); $search[] = " ( " . iif($tagmatch, " id IN (" . implode(',', $tagmatch) . ") OR ") . " title " . $regexp . " OR text " . $regexp . " ) "; }
$items = explode(' ', $_POST['item']); $items = array_map('trim', $items); $itemsearchfields = array('username', 'homepage', 'realname', 'interests', 'work'); for ($i = 1; $i <= 10; $i++) { if ($set['user']['cusfield_names'][$i - 1]) { $itemsearchfields[] = 'custom' . $i; } } foreach ($items as $item) { $itemsearch .= ' AND ( '; $elementsearch = ''; foreach ($itemsearchfields as $fieldname) { if ($elementsearch) { $elementsearch .= ' OR '; } $elementsearch .= ' ' . $fieldname . " LIKE '%" . addslashes_like($item) . "%' "; } $itemsearch .= $elementsearch . ' ) '; } $where .= $itemsearch; } //Alter if ($_POST['age_min'] || $_POST['age_max']) { $min = $_POST['age_min']; $max = $_POST['age_max']; if ($min && $max) { $where .= " AND (IF(LENGTH(birthday)>5,IF(CONCAT(SUBSTRING(birthday,4,2),LEFT(birthday,2))<=" . date('md', time() - TIMEDIFF) . "," . date('Y', time() - TIMEDIFF) . " -RIGHT(birthday,4)," . date('Y', time() - TIMEDIFF) . "-1-RIGHT(birthday,4)),NULL)) BETWEEN '" . $min . "' AND '" . $max . "' "; } elseif ($min && !$max) { $where .= " AND (IF(LENGTH(birthday)>5,IF(CONCAT(SUBSTRING(birthday,4,2),LEFT(birthday,2))<=" . date('md', time() - TIMEDIFF) . "," . date('Y', time() - TIMEDIFF) . " -RIGHT(birthday,4)," . date('Y', time() - TIMEDIFF) . "-1-RIGHT(birthday,4)),NULL))>='" . $min . "' "; } elseif (!$min && $max) { $where .= " AND (IF(LENGTH(birthday)>5,IF(CONCAT(SUBSTRING(birthday,4,2),LEFT(birthday,2))<=" . date('md', time() - TIMEDIFF) . "," . date('Y', time() - TIMEDIFF) . " -RIGHT(birthday,4)," . date('Y', time() - TIMEDIFF) . "-1-RIGHT(p.birthday,4)),NULL))<='" . $max . "' ";
function getTagId($tagname) { global $db; list($id) = $db->first("SELECT tagid FROM " . PRE . "_tags WHERE tag LIKE '" . addslashes_like($tagname) . "' LIMIT 1"); return $id; }
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(); }
function show() { global $set, $apx, $db, $html; //Suche durchführen if ($_REQUEST['item'] && ($_REQUEST['name'] || $_REQUEST['profile']) || $_POST['sgroupid']) { $where = ''; if ($_REQUEST['item']) { if ($_REQUEST['name']) { $sc[] = "username LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; $sc[] = "username_login LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; } if ($_REQUEST['profile']) { $sc[] = "email LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; $sc[] = "homepage LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; $sc[] = "icq LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; $sc[] = "aim LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; $sc[] = "yim LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; $sc[] = "msn LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; $sc[] = "skype LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; $sc[] = "realname LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; $sc[] = "city LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; $sc[] = "plz LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; $sc[] = "interests LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; $sc[] = "work LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; $sc[] = "city LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; $sc[] = "custom1 LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; $sc[] = "custom2 LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; $sc[] = "custom3 LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; $sc[] = "custom4 LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; $sc[] = "custom5 LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; $sc[] = "custom6 LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; $sc[] = "custom7 LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; $sc[] = "custom8 LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; $sc[] = "custom9 LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; $sc[] = "custom10 LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; } if (is_array($sc)) { $where .= ' AND ( ' . implode(' OR ', $sc) . ' )'; } } if ($_REQUEST['sgroupid']) { $where .= " AND a.groupid='" . intval($_REQUEST['sgroupid']) . "'"; } $data = $db->fetch("SELECT userid FROM " . PRE . "_user AS a LEFT JOIN " . PRE . "_user_groups AS b USING(groupid) WHERE 1 " . $where); $ids = get_ids($data, 'userid'); $ids[] = -1; $searchid = saveSearchResult('admin_user', $ids, array('item' => $_REQUEST['item'], 'name' => $_REQUEST['name'], 'profile' => $_REQUEST['profile'], 'groupid' => $_REQUEST['sgroupid'])); header("HTTP/1.1 301 Moved Permanently"); header('Location: action.php?action=user.show&who=' . $_REQUEST['who'] . '&searchid=' . $searchid); return; } //Voreinstellungen $_REQUEST['name'] = 1; quicklink('user.add'); $layerdef[] = array('LAYER_TEAM', 'action.php?action=user.show', !$_REQUEST['who']); $layerdef[] = array('LAYER_ALL', 'action.php?action=user.show&who=all', $_REQUEST['who'] == 'all'); $layerdef[] = array('LAYER_ACTIVATE', 'action.php?action=user.show&who=activate', $_REQUEST['who'] == 'activate'); //Layer Header ausgeben $html->layer_header($layerdef); $orderdef[0] = 'user_login'; $orderdef['active'] = array('a.active', 'DESC', 'COL_ACTIVE'); $orderdef['user_login'] = array('a.username_login', 'ASC', 'COL_USER_LOGIN'); $orderdef['user'] = array('a.username', 'ASC', 'COL_USER'); $orderdef['regtime'] = array('a.reg_time', 'DESC', 'COL_REGTIME'); $orderdef['lastactive'] = array('a.lastactive', 'DESC', 'COL_LASTACTIVE'); $orderdef['group'] = array('b.name', 'ASC', 'COL_GROUP'); //Suchergebnis? $resultFilter = ''; if ($_REQUEST['searchid']) { $searchRes = getSearchResult('admin_user', $_REQUEST['searchid']); if ($searchRes) { list($resultIds, $resultMeta) = $searchRes; $_REQUEST['item'] = $resultMeta['item']; $_REQUEST['name'] = $resultMeta['name']; $_REQUEST['profile'] = $resultMeta['profile']; $_REQUEST['sgroupid'] = $resultMeta['groupid']; $resultFilter = " AND a.userid IN (" . implode(', ', $resultIds) . ")"; } else { $_REQUEST['searchid'] = ''; } } //Suchformular $data = $db->fetch("SELECT groupid,name FROM " . PRE . "_user_groups ORDER BY name ASC"); if (count($data)) { foreach ($data as $res) { $grouplist .= '<option value="' . $res['groupid'] . '"' . iif($_REQUEST['sgroupid'] == $res['groupid'], ' selected="selected"') . '>' . replace($res['name']) . '</option>'; } } $apx->tmpl->assign('ITEM', compatible_hsc($_REQUEST['item'])); $apx->tmpl->assign('SNAME', $_REQUEST['name']); $apx->tmpl->assign('SPROFILE', $_REQUEST['profile']); $apx->tmpl->assign('GROUPS', $grouplist); $apx->tmpl->assign('WHO', $_REQUEST['who']); $apx->tmpl->parse('search'); $layerFilter = ''; if ($_REQUEST['who'] == 'all') { //$layerFilter = ""; //Nix :) } elseif ($_REQUEST['who'] == 'activate') { $layerFilter = " AND reg_key!='' "; } else { $admingroups = array(); $data = $db->fetch("SELECT groupid FROM " . PRE . "_user_groups WHERE ( gtype='admin' OR gtype='indiv' )"); if (count($data)) { foreach ($data as $res) { $admingroups[] = $res['groupid']; } } $layerFilter = " AND a.groupid IN (" . implode(',', $admingroups) . ") "; } letters('action.php?action=user.show&who=' . $_REQUEST['who'] . iif($_REQUEST['searchid'], '&searchid=' . $_REQUEST['searchid'])); $letterfilter = ''; if ($_REQUEST['letter'] == 'spchar') { $letterfilter = " AND username NOT REGEXP(\"^[a-zA-Z]\") "; } elseif ($_REQUEST['letter']) { $letterfilter = " AND username LIKE '" . addslashes($_REQUEST['letter']) . "%' "; } list($count) = $db->first("SELECT count(userid) FROM " . PRE . "_user AS a WHERE 1 " . $layerFilter . $letterfilter . $resultFilter); pages('action.php?action=user.show&who=' . $_REQUEST['who'] . '&letter=' . $_REQUEST['letter'] . '&sortby=' . $_REQUEST['sortby'] . iif($_REQUEST['searchid'], '&searchid=' . $_REQUEST['searchid']), $count); $data = $db->fetch("SELECT a.userid,a.username_login,a.username,a.active,a.reg_key,a.lastactive,b.name FROM " . PRE . "_user AS a LEFT JOIN " . PRE . "_user_groups AS b USING(groupid) WHERE 1 " . $layerFilter . $letterfilter . $resultFilter . " " . getorder($orderdef) . getlimit()); $this->show_print($data); orderstr($orderdef, 'action.php?action=user.show&who=' . $_REQUEST['who'] . '&letter=' . $_REQUEST['letter'] . iif($_REQUEST['searchid'], '&searchid=' . $_REQUEST['searchid'])); save_index($_SERVER['REQUEST_URI']); //Layer-Footer ausgeben $html->layer_footer(); }
function show() { global $set, $db, $apx, $html; //Struktur reparieren if ($_REQUEST['repair'] && $set['gallery']['subgals']) { $this->cat->repair(); echo 'Repair done!'; return; } //Suche durchführen if (!$set['gallery']['subgals'] && $_REQUEST['item']) { $where = ''; //Suchbegriff if ($_REQUEST['item']) { $where .= " AND title LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; } $data = $db->fetch("SELECT id FROM " . PRE . "_gallery WHERE 1 " . $where); $ids = get_ids($data, 'id'); $ids[] = -1; $searchid = saveSearchResult('admin_gallery', $ids, array('item' => $_REQUEST['item'])); header("HTTP/1.1 301 Moved Permanently"); header('Location: action.php?action=gallery.show&what=' . $_REQUEST['what'] . '&searchid=' . $searchid); return; } quicklink('gallery.add'); //DnD-Hinweis if ($apx->user->has_right('gallery.edit') && ($set['gallery']['subgals'] || $set['gallery']['ordergal'] == 3)) { echo '<p class="hint">' . $apx->lang->get('USEDND') . '</p>'; } $orderdef[0] = 'title'; $orderdef['title'] = array('title', 'ASC', 'COL_TITLE'); $orderdef['addtime'] = array('addtime', 'DESC', 'SORT_ADDTIME'); $orderdef['starttime'] = array('starttime', 'DESC', 'COL_STARTTIME'); //Suchergebnis? $resultFilter = ''; if (!$set['gallery']['subgals'] && $_REQUEST['searchid']) { $searchRes = getSearchResult('admin_gallery', $_REQUEST['searchid']); if ($searchRes) { list($resultIds, $resultMeta) = $searchRes; $_REQUEST['item'] = $resultMeta['item']; $resultFilter = " AND a.id IN (" . implode(', ', $resultIds) . ")"; } else { $_REQUEST['searchid'] = ''; } } $col[] = array(' ', 0, ''); $col[] = array('ID', 0, 'align="center"'); $col[] = array('COL_TITLE', 60, 'class="title"'); $col[] = array('COL_STARTTIME', 25, 'align="center"'); $col[] = array('COL_COUNT', 15, 'align="center"'); if (!$set['gallery']['subgals']) { $apx->tmpl->assign('ITEM', compatible_hsc($_REQUEST['item'])); $apx->tmpl->parse('search'); letters('action.php?action=gallery.show' . iif($_REQUEST['searchid'], '&searchid=' . $_REQUEST['searchid'])); if ($_REQUEST['letter'] == 'spchar') { $where = " AND title NOT REGEXP(\"^[a-zA-Z]\") "; } elseif ($_REQUEST['letter']) { $where = " AND title LIKE '" . addslashes($_REQUEST['letter']) . "%' "; } list($count) = $db->first("SELECT count(id) FROM " . PRE . "_gallery AS a WHERE 1 " . $resultFilter . $where . section_filter(true, 'secid')); pages('action.php?action=gallery.show' . iif($_REQUEST['searchid'], '&searchid=' . $_REQUEST['searchid']) . '&sortby=' . $_REQUEST['sortby'] . '&letter=' . $_REQUEST['letter'], $count); //Orderby if ($set['gallery']['ordergal'] == 3) { $sortby = ' ORDER BY ord ASC '; $orderdef = array(); } else { $sortby = getorder($orderdef); } $data = $db->fetch("SELECT id,secid,title,starttime,endtime FROM " . PRE . "_gallery AS a WHERE 1 " . $resultFilter . $where . section_filter(true, 'secid') . $sortby . getlimit()); } else { $data = $this->cat->getTree(array('*'), null, section_filter(false, 'secid')); } if (count($data)) { //Untergalerien? if ($set['gallery']['subgals']) { list($space, $follow) = parse_tree($data); $isactive[0] = true; //Root ist immer aktiv ;) } $i = ($_REQUEST['p'] - 1) * $set['admin_epp']; foreach ($data as $res) { ++$i; if ($res['level'] == 1) { ++$tree; } $isactive[$res['level']] = $res['starttime']; 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']); $title = replace(strip_tags($res['title'])); $link = mklink('gallery.php?id=' . $res['id'], 'gallery,list' . $res['id'] . ',1' . urlformat($res['title']) . '.html', iif($set['main']['forcesection'], iif(unserialize_section($res['secid']) == array('all'), $apx->section_default, array_shift($tmp)), 0)); list($pics) = $db->first("SELECT count(id) FROM " . PRE . "_gallery_pics WHERE galid='" . $res['id'] . "'"); list($activepics) = $db->first("SELECT count(id) FROM " . PRE . "_gallery_pics WHERE ( galid='" . $res['id'] . "' AND active='1' )"); $tabledata[$i]['COL2'] = $res['id']; $tabledata[$i]['COL3'] = '<a href="' . $link . '" target="_blank">' . $title . '</a>'; $tabledata[$i]['COL4'] = iif($res['starttime'], mkdate($res['starttime'], '<br />'), ' '); $tabledata[$i]['COL5'] = number_format($pics, 0, '', '.'); $tabledata[$i]['CLASS'] = 'l' . ($res['level'] - 1) . ($res['children'] ? ' haschildren' : '') . ($res['level'] > 1 ? ' hidden' : ''); $tabledata[$i]['ID'] = 'node:' . $res['id']; //Optionen if ($apx->user->has_right('gallery.edit')) { $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'gallery.edit', 'id=' . $res['id'], $apx->lang->get('CORE_EDIT')); } else { $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />'; } if ($apx->user->has_right('gallery.del')) { $tabledata[$i]['OPTIONS'] .= '<span class="ifhasnochildren">' . optionHTMLOverlay('del.gif', 'gallery.del', 'id=' . $res['id'], $apx->lang->get('CORE_DEL')) . '</span><span class="ifhaschildren"><img alt="" src="design/ispace.gif"/></span>'; } else { $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />'; } if ((!$res['starttime'] || $res['endtime'] < time()) && $apx->user->has_right('gallery.enable') && (!$set['gallery']['subgals'] || $isactive[$res['level'] - 1])) { $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('enable.gif', 'gallery.enable', 'id=' . $res['id'], $apx->lang->get('CORE_ENABLE')); } elseif ($res['starttime'] && $apx->user->has_right('gallery.disable')) { $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('disable.gif', 'gallery.disable', 'id=' . $res['id'], $apx->lang->get('CORE_DISABLE')); } else { $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />'; } $tabledata[$i]['OPTIONS'] .= ' '; if ($apx->user->has_right('gallery.pshow')) { $tabledata[$i]['OPTIONS'] .= optionHTML('pic.gif', 'gallery.pshow', 'id=' . $res['id'], $apx->lang->get('SHOWPICS')); } if ($apx->user->has_right('gallery.padd')) { $tabledata[$i]['OPTIONS'] .= optionHTML('picadd.gif', 'gallery.padd', 'id=' . $res['id'], $apx->lang->get('ADDPICS')); } //Kommentare + Bewertungen if ($apx->is_module('comments')) { $tabledata[$i]['OPTIONS'] .= ' '; list($comments) = $db->first("SELECT count(id) FROM " . PRE . "_comments WHERE ( module='galleryself' AND mid='" . $res['id'] . "' )"); if ($comments && $set['gallery']['galcoms'] && $res['allowcoms'] && $apx->user->has_right('comments.show')) { $tabledata[$i]['OPTIONS'] .= optionHTML('comments.gif', 'comments.show', 'module=galleryself&mid=' . $res['id'], $apx->lang->get('COMMENTS') . ' (' . $comments . ')'); } else { $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />'; } } //Anordnen: Untergalerien /*if ( $set['gallery']['subgals'] ) { $tabledata[$i]['OPTIONS'].=' '; if ( $apx->user->has_right('gallery.move') && $follow[$res['id']]['prev'] ) $tabledata[$i]['OPTIONS'].=optionHTML('moveup.gif', 'gallery.move', 'direction=up&id='.$res['id'].'§oken='.$apx->session->get('sectoken'), $apx->lang->get('MOVEUP')); else $tabledata[$i]['OPTIONS'].='<img src="design/ispace_small.gif" alt="" style="vertical-align:middle;" />'; if ( $apx->user->has_right('gallery.move') && $follow[$res['id']]['next'] ) $tabledata[$i]['OPTIONS'].=optionHTML('movedown.gif', 'gallery.move', 'direction=down&id='.$res['id'].'§oken='.$apx->session->get('sectoken'), $apx->lang->get('MOVEDOWN')); else $tabledata[$i]['OPTIONS'].='<img src="design/ispace_small.gif" alt="" style="vertical-align:middle;" />'; } //Anordnen: Einfach elseif ( !$set['gallery']['subgals'] && $set['gallery']['ordergal']==3 ) { $tabledata[$i]['OPTIONS'].=' '; if ( $apx->user->has_right('gallery.move') && $i!=1 ) $tabledata[$i]['OPTIONS'].=optionHTML('moveup.gif', 'gallery.move', 'direction=up&id='.$res['id'].'§oken='.$apx->session->get('sectoken'), $apx->lang->get('MOVEUP')); else $tabledata[$i]['OPTIONS'].='<img src="design/ispace_small.gif" alt="" style="vertical-align:middle;" />'; if ( $apx->user->has_right('gallery.move') && $i!=$count ) $tabledata[$i]['OPTIONS'].=optionHTML('movedown.gif', 'gallery.move', 'direction=down&id='.$res['id'].'§oken='.$apx->session->get('sectoken'), $apx->lang->get('MOVEDOWN')); else $tabledata[$i]['OPTIONS'].='<img src="design/ispace_small.gif" alt="" style="vertical-align:middle;" />'; }*/ if ($res['level'] == 1) { ++$pdone[0]; } else { ++$pdone[$tree][$res['level']]; } } } $apx->tmpl->assign('TABLE', $tabledata); if ($set['gallery']['subgals']) { echo '<div class="treeview" id="tree">'; $html->table($col); echo '</div>'; $open = $apx->session->get('gallery_open'); $open = dash_unserialize($open); $opendata = array(); foreach ($open as $catid) { $opendata[] = array('ID' => $catid); } $apx->tmpl->assign('OPEN', $opendata); $apx->tmpl->assign('EDIT_ALLOWED', $apx->user->has_Right('gallery.edit')); $apx->tmpl->parse('show_js'); } elseif ($set['gallery']['ordergal'] == 3) { echo '<div class="listview" id="list">'; $html->table($col); echo '</div>'; $apx->tmpl->parse('show_listjs'); } else { $html->table($col); orderstr($orderdef, 'action.php?action=gallery.show' . iif($_REQUEST['searchid'], '&searchid=' . $_REQUEST['searchid']) . '&letter=' . $_REQUEST['letter']); } save_index($_SERVER['REQUEST_URI']); }