本文整理汇总了PHP中section_filter函数的典型用法代码示例。如果您正苦于以下问题:PHP section_filter函数的具体用法?PHP section_filter怎么用?PHP section_filter使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了section_filter函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_gallery_list
function get_gallery_list($selected = 0)
{
global $set, $db, $apx;
$list = '<option value=""></option>';
if ($set['gallery']['subgals']) {
require_once BASEDIR . 'lib/class.recursivetree.php';
$tree = new RecursiveTree(PRE . '_gallery', 'id');
$data = $tree->getTree(array('title'), null, "'" . time() . "' BETWEEN starttime AND endtime " . section_filter(true, 'secid'));
if (!count($data)) {
return '';
}
foreach ($data as $res) {
$list .= '<option value="' . $res['id'] . '"' . iif($selected == $res['id'], ' selected="selected"') . '>' . str_repeat(' ', $res['level'] - 1) . replace(strip_tags($res['title'])) . '</option>';
}
} else {
$data = $db->fetch("SELECT id,title FROM " . PRE . "_gallery WHERE '" . time() . "' BETWEEN starttime AND endtime " . section_filter(true, 'secid') . " ORDER BY title ASC");
if (!count($data)) {
return '';
}
foreach ($data as $res) {
$list .= '<option value="' . $res['id'] . '"' . iif($selected == $res['id'], ' selected="selected"') . '>' . replace(strip_tags($res['title'])) . '</option>';
}
}
return $list;
}
示例2: search_gallery
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;
}
示例3: content_showcomments
function content_showcomments($id)
{
global $set, $db, $apx, $user;
$res = $db->first("SELECT allowcoms FROM " . PRE . "_content WHERE ( id='" . $id . "' AND active='1' " . section_filter() . " ) LIMIT 1");
if (!$apx->is_module('comments') || !$set['content']['coms'] || !$res['allowcoms']) {
return;
}
require_once BASEDIR . getmodulepath('comments') . 'class.comments.php';
$coms = new comments('content', $id);
$coms->assign_comments();
$apx->tmpl->parse('comments', 'comments');
require 'lib/_end.php';
}
示例4: search_poll
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;
}
示例5: misc_articlesfeed
function misc_articlesfeed()
{
global $set, $db, $apx;
$apx->tmpl->loaddesign('blank');
header('Content-type: application/rss+xml');
//Verwendete Variablen
$parse = $apx->tmpl->used_vars('rss', 'articles');
//Baum holen, wenn nur eine bestimmte Kategorie gezeigt werden soll
$cattree = articles_tree($_REQUEST['catid']);
$data = $db->fetch("SELECT a.id,a.type,a.catid,a.title,a.subtitle,a.teaser,a.starttime,a.top,b.username,b.email,b.pub_hidemail FROM " . PRE . "_articles AS a LEFT JOIN " . PRE . "_user AS b USING (userid) WHERE ( " . time() . " BETWEEN starttime AND endtime " . iif(count($cattree), "AND catid IN (" . @implode(',', $cattree) . ")") . " " . section_filter() . " ) ORDER BY starttime DESC LIMIT 20");
//Kategorien auslesen
$catinfo = articles_catinfo(get_ids($data, 'catid'));
if (count($data)) {
foreach ($data as $res) {
++$i;
//Wohin soll verlinkt werden?
if ($res['type'] == 'normal') {
$link2file = 'articles';
} else {
$link2file = $res['type'] . 's';
}
//Link
$link = mklink($link2file . '.php?id=' . $res['id'], $link2file . ',id' . $res['id'] . ',0' . urlformat($res['title']) . '.html');
//Text: Teaser oder Artikelseite
if ($res['teaser'] && $set['articles']['teaser']) {
$text = $res['teaser'];
} else {
list($text) = $db->first("SELECT text FROM " . PRE . "_articles_pages WHERE artid='" . $res['id'] . "' ORDER BY ord ASC LIMIT 1");
$text = $text;
}
$tabledata[$i]['ID'] = $res['id'];
$tabledata[$i]['TITLE'] = rss_replace($res['title']);
$tabledata[$i]['SUBTITLE'] = rss_replace($res['subtitle']);
$tabledata[$i]['TIME'] = date('r', $res['starttime']);
//Kein TIMEDIFF weil Zeitverschiebung mit angegeben!
$tabledata[$i]['TEXT'] = rss_replace(preg_replace('#{IMAGE\\(([0-9]+)\\)}#s', '', $text));
$tabledata[$i]['CATTITLE'] = rss_replace($catinfo[$res['catid']]['title']);
$tabledata[$i]['LINK'] = HTTP_HOST . $link;
$tabledata[$i]['USERNAME'] = replace($res['username']);
$tabledata[$i]['EMAIL'] = replace(iif(!$res['pub_hidemail'], $res['email']));
$tabledata[$i]['EMAIL_ENCRYPTED'] = replace(iif(!$res['pub_hidemail'], cryptMail($res['email'])));
$tabledata[$i]['TOP'] = $res['top'];
}
}
$apx->tmpl->assign('WEBSITENAME', $set['main']['websitename']);
$apx->tmpl->assign('ARTICLE', $tabledata);
$apx->tmpl->parse('rss', 'articles');
}
示例6: teaser_show
function teaser_show($count = 0, $start = 0, $group = 0, $template = 'teaser')
{
global $set, $db, $apx;
$count = (int) $count;
$start = (int) $start;
$group = (int) $group;
$tmpl = new tengine();
$groupfilter = '';
if ($group) {
$groupfilter = " AND `group`='" . $group . "'";
}
if ($set['teaser']['orderby'] == 1) {
$data = $db->fetch("SELECT id,title,text,link,image,hits FROM " . PRE . "_teaser WHERE '" . time() . "' BETWEEN starttime AND endtime " . $groupfilter . section_filter() . " ORDER BY ord ASC" . iif($count, " LIMIT " . iif($start, $start . ',') . $count));
} elseif ($set['teaser']['orderby'] == 2) {
$data = $db->fetch("SELECT id,title,text,link,image,hits FROM " . PRE . "_teaser WHERE '" . time() . "' BETWEEN starttime AND endtime " . $groupfilter . section_filter() . " ORDER BY addtime DESC" . iif($count, " LIMIT " . iif($start, $start . ',') . $count));
} else {
$data = $db->fetch("SELECT id,title,text,link,image,hits FROM " . PRE . "_teaser WHERE '" . time() . "' BETWEEN starttime AND endtime" . $groupfilter . section_filter());
if (count($data)) {
srand((double) microtime() * 1000000);
shuffle($data);
if ($count) {
foreach ($data as $res) {
++$ii;
$newdata[] = $res;
if ($ii == $count) {
break;
}
}
$data = $newdata;
unset($newdata);
}
}
}
if (count($data)) {
$apx->lang->drop('teaser', 'teaser');
foreach ($data as $res) {
++$i;
$affdata[$i]['TITLE'] = $res['title'];
$affdata[$i]['TEXT'] = $res['text'];
$affdata[$i]['URL'] = $res['link'];
$affdata[$i]['IMAGE'] = iif($res['image'], HTTPDIR . getpath('uploads') . $res['image']);
$affdata[$i]['HITS'] = number_format($res['hits'], 0, '', '.');
$affdata[$i]['LINK'] = HTTPDIR . 'misc.php?action=teaserlink&id=' . $res['id'];
}
}
$tmpl->assign('TEASER', $affdata);
$tmpl->parse($template, 'teaser');
}
示例7: search_content
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;
}
示例8: search_videos
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;
}
示例9: misc_linksfeed
function misc_linksfeed()
{
global $set, $db, $apx;
$apx->tmpl->loaddesign('blank');
header('Content-type: application/rss+xml');
//Baum holen, wenn nur eine bestimmte Kategorie gezeigt werden soll
$cattree = links_tree($_REQUEST['catid']);
$data = $db->fetch("SELECT a.id,a.catid,a.title,a.text,a.starttime,a.top,b.username,b.email,b.pub_hidemail FROM " . PRE . "_links AS a LEFT JOIN " . PRE . "_user AS b USING (userid) WHERE ( ( '" . time() . "' BETWEEN starttime AND endtime ) " . iif(count($cattree), "AND catid IN (" . @implode(',', $cattree) . ")") . " " . section_filter() . " ) ORDER BY starttime DESC LIMIT 20");
if (count($data)) {
//Kategorien auslesen
$catids = get_ids($data, 'catid');
if (count($catids)) {
$catdata = $db->fetch("SELECT id,title FROM " . PRE . "_links_cat WHERE id IN (" . implode(',', $catids) . ")");
if (count($catdata)) {
foreach ($catdata as $catres) {
$catinfo[$catres['id']] = $catres;
}
}
}
foreach ($data as $res) {
++$i;
//Link
$link = mklink('links.php?id=' . $res['id'], 'links,id' . $res['id'] . urlformat($res['title']) . '.html');
$tabledata[$i]['ID'] = $res['id'];
$tabledata[$i]['TITLE'] = rss_replace($res['title']);
$tabledata[$i]['URL'] = $res['url'];
$tabledata[$i]['TIME'] = date('r', $res['starttime']);
//Kein TIMEDIFF weil Zeitverschiebung mit angegeben!
$tabledata[$i]['TEXT'] = rss_replace(preg_replace('#{IMAGE\\(([0-9]+)\\)}#s', '', $res['text']));
$tabledata[$i]['CATTITLE'] = rss_replace($catinfo[$res['catid']]['title']);
$tabledata[$i]['LINK'] = HTTP_HOST . $link;
$tabledata[$i]['TOP'] = $res['top'];
}
}
$apx->tmpl->assign('WEBSITENAME', $set['main']['websitename']);
$apx->tmpl->assign('LINK', $tabledata);
$apx->tmpl->parse('rss', 'links');
}
示例10: misc_galleryfeed
function misc_galleryfeed()
{
global $set, $db, $apx;
$apx->tmpl->loaddesign('blank');
header('Content-type: application/rss+xml');
$data = $db->fetch("SELECT id,title,description,starttime FROM " . PRE . "_gallery WHERE ( ( '" . time() . "' BETWEEN starttime AND endtime ) " . section_filter() . " ) ORDER BY starttime DESC LIMIT 20");
if (count($data)) {
foreach ($data as $res) {
++$i;
//Link
$link = mklink('gallery.php?id=' . $res['id'], 'gallery,list' . $res['id'] . ',1' . urlformat($res['title']) . '.html');
$tabledata[$i]['ID'] = $res['id'];
$tabledata[$i]['TITLE'] = rss_replace($res['title']);
$tabledata[$i]['TIME'] = date('r', $res['starttime']);
//Kein TIMEDIFF weil Zeitverschiebung mit angegeben!
$tabledata[$i]['DESCRIPTION'] = rss_replace($res['description']);
$tabledata[$i]['LINK'] = HTTP_HOST . $link;
}
}
$apx->tmpl->assign('WEBSITENAME', $set['main']['websitename']);
$apx->tmpl->assign('GALLERY', $tabledata);
$apx->tmpl->parse('rss', 'gallery');
}
示例11: search_calendar
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;
}
示例12: search_articles
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;
}
示例13: show
//.........这里部分代码省略.........
$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();
}
示例14: headline
$apx->tmpl->parse('detail');
require 'lib/_end.php';
}
//////////////////////////////////////////////////////////////////////////////////////////////////////// NEWS AUFLISTEN
//Titelleiste
headline($apx->lang->get('HEADLINE'), mklink('news.php', 'news.html'));
titlebar($apx->lang->get('HEADLINE'));
//Verwendete Variablen auslesen
$parse = $apx->tmpl->used_vars('index');
//Kategorie-Baum holen
$cattree = news_tree($_REQUEST['catid']);
//Seitenzahlen generieren
list($count) = $db->first("SELECT count(id) FROM " . PRE . "_news WHERE ( " . time() . " BETWEEN starttime AND endtime " . iif(count($cattree), ' AND catid IN (' . @implode(',', $cattree) . ') ') . section_filter() . ")");
pages(mklink('news.php?catid=' . $_REQUEST['catid'], 'news,' . $_REQUEST['catid'] . ',{P}.html'), $count, $set['news']['epp']);
//News ausgeben
$data = $db->fetch("SELECT a.*,IF(a.sticky>=" . time() . ",1,0) AS sticky,b.userid,b.username,b.email,b.pub_hidemail FROM " . PRE . "_news AS a LEFT JOIN " . PRE . "_user AS b USING(userid) WHERE ( " . time() . " BETWEEN starttime AND endtime " . iif(count($cattree), ' AND catid IN (' . @implode(',', $cattree) . ') ') . section_filter() . ") ORDER BY sticky DESC,starttime DESC " . getlimit($set['news']['epp']));
//Kategorien auslesen
if (in_array('NEWS.CATTITLE', $parse) || in_array('NEWS.CATICON', $parse) || in_array('NEWS.CATLINK', $parse)) {
$catinfo = news_catinfo(get_ids($data, 'catid'));
}
if (count($data)) {
foreach ($data as $res) {
++$i;
//Link
$link = mklink('news.php?id=' . $res['id'], 'news,id' . $res['id'] . urlformat($res['title']) . '.html');
//Newspic
if (in_array('NEWS.PICTURE', $parse) || in_array('NEWS.PICTURE_POPUP', $parse) || in_array('NEWS.PICTURE_POPUPPATH', $parse)) {
list($picture, $picture_popup, $picture_popuppath) = news_newspic($res['newspic']);
}
//Username + eMail
if ($res['userid']) {
示例15: gallery_active
function gallery_active($secid = false, $prodid = false)
{
global $db;
$secid = (int) $secid;
$prodid = (int) $prodid;
$saved = array();
if ($secid < 0) {
$data = $db->fetch("SELECT id FROM " . PRE . "_gallery WHERE ( ( '" . time() . "' BETWEEN starttime AND endtime ) AND password='' " . iif($prodid, " AND prodid='" . $prodid . "' ") . " )");
} elseif ($secid) {
$data = $db->fetch("SELECT id FROM " . PRE . "_gallery WHERE ( ( '" . time() . "' BETWEEN starttime AND endtime ) AND password='' " . iif($prodid, " AND prodid='" . $prodid . "' ") . " AND ( secid LIKE '%|" . $secid . "|%' OR secid='all' ) )");
} else {
$data = $db->fetch("SELECT id FROM " . PRE . "_gallery WHERE ( ( '" . time() . "' BETWEEN starttime AND endtime ) " . iif($prodid, " AND prodid='" . $prodid . "' ") . " " . section_filter() . " )");
}
if (!count($data)) {
return array(-1);
}
foreach ($data as $res) {
$saved[] = $res['id'];
}
return $saved;
}