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 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 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(); }
if ($_REQUEST['start_day'] && $_REQUEST['start_month'] && $_REQUEST['start_year'] && $_REQUEST['end_day'] && $_REQUEST['end_month'] && $_REQUEST['end_year']) { $where .= iif($where, ' AND ') . "starttime BETWEEN '" . (mktime(0, 0, 0, intval($_REQUEST['start_month']), intval($_REQUEST['start_day']), intval($_REQUEST['start_year'])) + TIMEDIFF) . "' AND '" . (mktime(0, 0, 0, intval($_REQUEST['end_month']), intval($_REQUEST['end_day']) + 1, intval($_REQUEST['end_year'])) - 1 + TIMEDIFF) . "'"; } //Keine Suchkriterien vorhanden if (!$where) { message($apx->lang->get('CORE_BACK'), 'javascript:history.back();'); require 'lib/_end.php'; } else { $data = $db->fetch("SELECT id FROM " . PRE . "_videos WHERE " . $where); $resultIds = get_ids($data, 'id'); //Keine Ergebnisse if (!$resultIds) { message($apx->lang->get('MSG_NORESULT'), 'javascript:history.back();'); require 'lib/_end.php'; } $searchid = saveSearchResult('videos', $resultIds); header("HTTP/1.1 301 Moved Permanently"); header('Location: ' . str_replace('&', '&', mklink('videos.php?action=search&searchid=' . $searchid, 'videos.html?action=search&searchid=' . $searchid))); } } require 'lib/_end.php'; } ///////////////////////////////////////////////////////////////////////////////////////// KATEGORIEN DURCHSUCHEN //Sprachpaket $apx->lang->drop('list'); $apx->lang->drop('search'); //Verwendete Variablen auslesen $parse = $apx->tmpl->used_vars('index'); //Kategorie auslesen $catinfo = array(); if ($_REQUEST['catid']) {
if ($_REQUEST['start_day'] && $_REQUEST['start_month'] && $_REQUEST['start_year'] && $_REQUEST['end_day'] && $_REQUEST['end_month'] && $_REQUEST['end_year']) { $where .= iif($where, ' AND ') . " a.starttime BETWEEN '" . (mktime(0, 0, 0, intval($_REQUEST['start_month']), intval($_REQUEST['start_day']), intval($_REQUEST['start_year'])) + TIMEDIFF) . "' AND '" . (mktime(0, 0, 0, intval($_REQUEST['end_month']), intval($_REQUEST['end_day']) + 1, intval($_REQUEST['end_year'])) - 1 + TIMEDIFF) . "'"; } //Keine Suchkriterien vorhanden if (!$where) { message($apx->lang->get('CORE_BACK'), 'javascript:history.back();'); require 'lib/_end.php'; } else { $data = $db->fetch("\n\t\t\t\tSELECT DISTINCT a.id\n\t\t\t\tFROM " . PRE . "_articles AS a\n\t\t\t\tLEFT JOIN " . PRE . "_articles_pages AS p ON a.id=p.artid\n\t\t\t\tWHERE " . $where); $resultIds = get_ids($data, 'id'); //Keine Ergebnisse if (!$resultIds) { message($apx->lang->get('MSG_NORESULT'), 'javascript:history.back();'); require 'lib/_end.php'; } $searchid = saveSearchResult('articles', $resultIds); header("HTTP/1.1 301 Moved Permanently"); header('Location: ' . str_replace('&', '&', mklink('articlearchive.php?action=search&searchid=' . $searchid, 'articlearchive.html?action=search&searchid=' . $searchid))); } } require 'lib/_end.php'; } //////////////////////////////////////////////////////////////////////////////////////////////////////// ARTIKEL AUFLISTEN if ($_REQUEST['month']) { //Verwendete Variablen auslesen $parse = $apx->tmpl->used_vars('archive_index'); //Headline $month = substr($_REQUEST['month'], 0, 2); $year = substr($_REQUEST['month'], 2); headline(getcalmonth($month) . ' ' . $year, mklink('articlearchive.php?month=' . $month . $year, 'articlearchive,' . $month . ',' . $year . ',1.html')); titlebar($apx->lang->get('HEADLINE_ARCHIVE') . ': ' . getcalmonth($month) . ' ' . $year);
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(); }
//Zeitperiode if ($_REQUEST['start_day'] && $_REQUEST['start_month'] && $_REQUEST['start_year'] && $_REQUEST['end_day'] && $_REQUEST['end_month'] && $_REQUEST['end_year']) { $where .= iif($where, ' AND ') . "starttime BETWEEN '" . (mktime(0, 0, 0, intval($_REQUEST['start_month']), intval($_REQUEST['start_day']), intval($_REQUEST['start_year'])) + TIMEDIFF) . "' AND '" . (mktime(0, 0, 0, intval($_REQUEST['end_month']), intval($_REQUEST['end_day']) + 1, intval($_REQUEST['end_year'])) - 1 + TIMEDIFF) . "'"; } //Keine Suchkriterien vorhanden if (!$where) { message($apx->lang->get('CORE_BACK'), 'javascript:history.back();'); } else { $data = $db->fetch("SELECT id FROM " . PRE . "_news WHERE " . $where); $resultIds = get_ids($data, 'id'); //Keine Ergebnisse if (!$resultIds) { message($apx->lang->get('MSG_NORESULT'), 'javascript:history.back();'); require 'lib/_end.php'; } $searchid = saveSearchResult('news', $resultIds); header("HTTP/1.1 301 Moved Permanently"); header('Location: ' . str_replace('&', '&', mklink('newsarchive.php?action=search&searchid=' . $searchid, 'newsarchive.html?action=search&searchid=' . $searchid))); } } require 'lib/_end.php'; } //////////////////////////////////////////////////////////////////////////////////////////////////////// NEWS AUFLISTEN if ($_REQUEST['month']) { //Verwendete Variablen auslesen $parse = $apx->tmpl->used_vars('archive_index'); //Headline $month = substr($_REQUEST['month'], 0, 2); $year = substr($_REQUEST['month'], 2); headline(getcalmonth($month) . ' ' . $year, mklink('newsarchive.php?month=' . $month . $year, 'newsarchive,' . $month . ',' . $year . ',1.html')); titlebar($apx->lang->get('HEADLINE_ARCHIVE') . ': ' . getcalmonth($month) . ' ' . $year);
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(); }
if ($_REQUEST['start_day'] && $_REQUEST['start_month'] && $_REQUEST['start_year'] && $_REQUEST['end_day'] && $_REQUEST['end_month'] && $_REQUEST['end_year']) { $where .= iif($where, ' AND ') . "starttime BETWEEN '" . (mktime(0, 0, 0, intval($_REQUEST['start_month']), intval($_REQUEST['start_day']), intval($_REQUEST['start_year'])) + TIMEDIFF) . "' AND '" . (mktime(0, 0, 0, intval($_REQUEST['end_month']), intval($_REQUEST['end_day']) + 1, intval($_REQUEST['end_year'])) - 1 + TIMEDIFF) . "'"; } //Keine Suchkriterien vorhanden if (!$where) { message($apx->lang->get('CORE_BACK'), 'javascript:history.back();'); require 'lib/_end.php'; } else { $data = $db->fetch("SELECT id FROM " . PRE . "_links WHERE " . $where); $resultIds = get_ids($data, 'id'); //Keine Ergebnisse if (!$resultIds) { message($apx->lang->get('MSG_NORESULT'), 'javascript:history.back();'); require 'lib/_end.php'; } $searchid = saveSearchResult('links', $resultIds); header("HTTP/1.1 301 Moved Permanently"); header('Location: ' . str_replace('&', '&', mklink('links.php?action=search&searchid=' . $searchid, 'links.html?action=search&searchid=' . $searchid))); } } require 'lib/_end.php'; } ///////////////////////////////////////////////////////////////////////////////////////// KATEGORIEN DURCHSUCHEN //Sprachpaket $apx->lang->drop('list'); $apx->lang->drop('search'); //Verwendete Variablen auslesen $parse = $apx->tmpl->used_vars('index'); //Kategorie auslesen $catinfo = array(); if ($_REQUEST['catid']) {
function eshow() { global $set, $db, $apx, $html; //Suche durchführen if ($_REQUEST['item']) { $where = " AND email LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; $data = $db->fetch("SELECT id FROM " . PRE . "_newsletter_emails WHERE 1 " . $where); $ids = get_ids($data, 'id'); $ids[] = -1; $searchid = saveSearchResult('admin_newsletter_email', $ids, $_REQUEST['item']); header("HTTP/1.1 301 Moved Permanently"); header('Location: action.php?action=newsletter.eshow&what=' . $_REQUEST['what'] . '&searchid=' . $searchid); return; } //Suchergebnis? $resultFilter = ''; if ($_REQUEST['searchid']) { $searchRes = getSearchResult('admin_newsletter_email', $_REQUEST['searchid']); if ($searchRes) { list($resultIds, $resultMeta) = $searchRes; $_REQUEST['item'] = $resultMeta; $resultFilter = " AND id IN (" . implode(', ', $resultIds) . ")"; } else { $_REQUEST['searchid'] = ''; } } quicklink('newsletter.eadd'); $layerdef[] = array('LAYER_ALL', 'action.php?action=newsletter.eshow', !$_REQUEST['what']); $layerdef[] = array('LAYER_INACTIVE', 'action.php?action=newsletter.eshow&what=inactive', $_REQUEST['what'] == 'inactive'); //Layer Header ausgeben $html->layer_header($layerdef); $apx->tmpl->assign('WHAT', $_REQUEST['what']); $apx->tmpl->assign('ITEM', compatible_hsc($_REQUEST['item'])); $apx->tmpl->parse('esearch'); //Inaktive Adressen if ($_REQUEST['what'] == 'inactive') { list($count) = $db->first("\n\t\t\tSELECT count(DISTINCT ne.id)\n\t\t\tFROM " . PRE . "_newsletter_emails AS ne\n\t\t\tJOIN " . PRE . "_newsletter_emails_cat AS nec ON ne.id=nec.eid\n\t\t\tWHERE nec.active=0 " . $resultFilter); pages('action.php?action=newsletter.eshow&what=inactive&sortby=' . $_REQUEST['sortby'], $count); $data = $db->fetch("\n\t\t\tSELECT DISTINCT ne.id, ne.email\n\t\t\tFROM " . PRE . "_newsletter_emails AS ne\n\t\t\tJOIN " . PRE . "_newsletter_emails_cat AS nec ON ne.id=nec.eid\n\t\t\tWHERE nec.active=0 " . $resultFilter . "\n\t\t\tORDER BY ne.email\n\t\t\tASC " . getlimit($set['epp'])); $this->eshow_print($data); save_index($_SERVER['REQUEST_URI']); } else { list($count) = $db->first("\n\t\t\tSELECT count(id)\n\t\t\tFROM " . PRE . "_newsletter_emails\n\t\t\tWHERE 1 " . $resultFilter); pages('action.php?action=newsletter.eshow&sortby=' . $_REQUEST['sortby'], $count); $data = $db->fetch("\n\t\t\tSELECT id,email\n\t\t\tFROM " . PRE . "_newsletter_emails\n\t\t\tWHERE 1 " . $resultFilter . "\n\t\t\tORDER BY email ASC\n\t\t\t" . getlimit($set['epp'])); $this->eshow_print($data); save_index($_SERVER['REQUEST_URI']); } //Layer-Footer ausgeben $html->layer_footer(); }
if ($_REQUEST['start_day'] && $_REQUEST['start_month'] && $_REQUEST['start_year'] && $_REQUEST['end_day'] && $_REQUEST['end_month'] && $_REQUEST['end_year']) { $where .= iif($where, ' AND ') . "starttime BETWEEN '" . (mktime(0, 0, 0, intval($_REQUEST['start_month']), intval($_REQUEST['start_day']), intval($_REQUEST['start_year'])) + TIMEDIFF) . "' AND '" . (mktime(0, 0, 0, intval($_REQUEST['end_month']), intval($_REQUEST['end_day']) + 1, intval($_REQUEST['end_year'])) - 1 + TIMEDIFF) . "'"; } //Keine Suchkriterien vorhanden if (!$where) { message($apx->lang->get('CORE_BACK'), 'javascript:history.back();'); require 'lib/_end.php'; } else { $data = $db->fetch("SELECT id FROM " . PRE . "_downloads WHERE " . $where); $resultIds = get_ids($data, 'id'); //Keine Ergebnisse if (!$resultIds) { message($apx->lang->get('MSG_NORESULT'), 'javascript:history.back();'); require 'lib/_end.php'; } $searchid = saveSearchResult('downloads', $resultIds); header("HTTP/1.1 301 Moved Permanently"); header('Location: ' . str_replace('&', '&', mklink('downloads.php?action=search&searchid=' . $searchid, 'downloads.html?action=search&searchid=' . $searchid))); } } require 'lib/_end.php'; } ///////////////////////////////////////////////////////////////////////////////////////// KATEGORIEN DURCHSUCHEN //Sprachpaket $apx->lang->drop('list'); $apx->lang->drop('search'); //Verwendete Variablen auslesen $parse = $apx->tmpl->used_vars('index'); //Kategorie auslesen $catinfo = array(); if ($_REQUEST['catid']) {
if (count($unittypes) > 0 && count($unittypes) < 3) { $where .= iif($where, ' AND ') . 'type IN (' . implode(',', $unittypes) . ')'; } //Keine Suchkriterien vorhanden if (!$where) { message($apx->lang->get('CORE_BACK'), 'javascript:history.back();'); require 'lib/_end.php'; } else { $data = $db->fetch("SELECT id FROM " . PRE . "_products_units WHERE " . $where); $resultIds = get_ids($data, 'id'); //Keine Ergebnisse if (!$resultIds) { message($apx->lang->get('MSG_NORESULT'), 'javascript:history.back();'); require 'lib/_end.php'; } $searchid = saveSearchResult('products_manu', $resultIds); header("HTTP/1.1 301 Moved Permanently"); header('Location: ' . str_replace('&', '&', mklink('manufacturers.php?action=search&searchid=' . $searchid, 'manufacturers.html?action=search&searchid=' . $searchid))); } } require 'lib/_end.php'; } ////////////////////////////////////////////////////////////////////////////////////////// HERSTELLER-LISTE $apx->lang->drop('manusearch'); //Verwendete Variablen auslesen $parse = $apx->tmpl->used_vars('manufacturers_index'); $where = ''; if (!$_REQUEST['letter']) { $_REQUEST['letter'] = '0'; } //Buchstaben-Liste
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(); }
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']); }