本文整理汇总了PHP中get_ids函数的典型用法代码示例。如果您正苦于以下问题:PHP get_ids函数的具体用法?PHP get_ids怎么用?PHP get_ids使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_ids函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: render_word
function render_word($dbc, $db_name, $name, $with_def = false)
{
$ids = get_ids($dbc, $name);
if (count($ids) != 0) {
$id = $ids[0];
return render_value($dbc, $db_name, $db_name . ':o' . $id, $with_def);
} else {
return $name;
}
}
示例3: poll_match_tags
function poll_match_tags($items)
{
global $set, $db, $apx, $user;
if (!is_array($items)) {
return array();
}
$result = array();
foreach ($items as $item) {
$data = $db->fetch("\n\t\t\tSELECT DISTINCT at.id\n\t\t\tFROM " . PRE . "_poll_tags AS at\n\t\t\tLEFT JOIN " . PRE . "_tags AS t USING(tagid)\n\t\t\tWHERE t.tag LIKE '%" . addslashes_like($item) . "%'\n\t\t");
$result[$item] = get_ids($data, 'id');
}
return $result;
}
示例4: get_buddies
function get_buddies()
{
global $db;
if (!$this->info['userid']) {
return array();
}
if (isset($this->info['friends'])) {
return $this->info['friends'];
}
$data = $db->fetch("SELECT friendid FROM " . PRE . "_user_friends WHERE userid='" . $this->info['userid'] . "'");
$this->info['friends'] = get_ids($data, 'friendid');
return $this->info['friends'];
}
示例5: vbthreads_open_forums
function vbthreads_open_forums($forumids)
{
global $set, $db, $apx, $user;
$forumdb = $user->getForumConn();
//Forum-Liste
if (is_array($forumids) && count($forumids)) {
$data = $forumdb->fetch("SELECT a.forumid AS id FROM " . VBPRE . "forum AS a LEFT JOIN " . VBPRE . "forumpermission AS b ON a.forumid=b.forumid WHERE ( a.forumid IN (" . implode(',', $forumids) . ") AND usergroupid IS NULL ) ");
} elseif (is_int($forumids) && $forumids != 0) {
$data = $forumdb->fetch("SELECT a.forumid AS id FROM " . VBPRE . "forum AS a LEFT JOIN " . VBPRE . "forumpermission AS b ON a.forumid=b.forumid WHERE ( parentlist REGEXP '" . addslashes("(^|,)" . $forumids . "(,|\$)") . "' AND usergroupid IS NULL ) ");
} else {
$data = $forumdb->fetch("SELECT a.forumid AS id FROM " . VBPRE . "forum AS a LEFT JOIN " . VBPRE . "forumpermission AS b ON a.forumid=b.forumid WHERE usergroupid IS NULL ");
}
$forums = get_ids($data);
return $forums;
}
示例6: 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');
}
示例7: forum_allowed_forums
function forum_allowed_forums($inforumid = array(), $notforumid = array())
{
static $readable;
require_once BASEDIR . getmodulepath('forum') . 'basics.php';
//Erlaubte Foren auslesen
if (!isset($readable)) {
$readable_info = forum_get_readable();
$readable = get_ids($readable_info, 'forumid');
}
$ids = $readable;
//Gewünschte Foren ermitteln
if (is_array($inforumid) && count($inforumid)) {
$ids = array_intersect($ids, $inforumid);
}
if (is_array($notforumid) && count($notforumid)) {
$ids = array_diff($ids, $notforumid);
}
return $ids;
}
示例8: build_query
function build_query($dbc, $user_search, $active_relation, $count_only = false)
{
if ($count_only) {
$search_query = "SELECT count(*) as count FROM graph";
} else {
$search_query = "SELECT * FROM graph";
}
$clean_search = str_replace(',', ' ', $user_search);
$search_words = explode(' ', $clean_search);
$final_search_words = array();
if (count($search_words) > 0) {
foreach ($search_words as $word) {
if (!empty($word)) {
//$final_search_words[] = $word;
foreach (get_ids($dbc, $word) as $id) {
$final_search_words[] = PREFIX . $id;
}
$final_search_words[] = $word;
}
}
}
//print_r($final_search_words);
if (isset($active_relation)) {
$where_clause_1 = "property='" . $active_relation . "'";
}
if (count($final_search_words) > 0) {
$subject = generate_where_clause($final_search_words, 'subject');
$object = generate_where_clause($final_search_words, 'value');
//$predicate = generate_where_clause($final_search_words, 'property');
$where_clause_2 = $subject . ' OR ' . $object;
}
if (isset($where_clause_1) && isset($where_clause_2)) {
$search_query .= " WHERE {$where_clause_1} and ({$where_clause_2})";
} elseif (isset($where_clause_2)) {
$search_query .= " WHERE {$where_clause_2}";
} elseif (isset($where_clause_1)) {
$search_query .= " WHERE {$where_clause_1}";
}
$search_query .= " ORDER BY subject desc";
return $search_query;
}
示例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: 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;
}
示例11: clean
function clean()
{
global $set, $db, $apx;
$_REQUEST['id'] = (int) $_REQUEST['id'];
if (!$_REQUEST['id']) {
die('missing ID!');
}
$_POST['moveto'] = (int) $_POST['moveto'];
$finfo = $this->cat->getNode($_REQUEST['id'], explode(',', 'threads,posts,lastposter,lastposter_userid,lastposttime'));
if ($_POST['send'] == 1 && $_POST['moveto'] >= 0) {
if (!checkToken()) {
printInvalidToken();
} else {
//Nur was machen, wenn das Zielforum ein anderes ist
if (intval($_POST['moveto']) && $_POST['moveto'] != $_REQUEST['id']) {
//Lastpost überschreiben oder nicht?
$setvalues = "threads=threads+" . $finfo['threads'] . ",posts=posts+" . $finfo['posts'] . ",";
$setvalues .= "lastposter=IF(lastposttime<'" . $finfo['lastposttime'] . "','" . $finfo['lastposter'] . "',lastposter),lastposter_userid=IF(lastposttime<'" . $finfo['lastposttime'] . "','" . $finfo['lastposter_userid'] . "',lastposter_userid),lastposttime=IF(lastposttime<'" . $finfo['lastposttime'] . "','" . $finfo['lastposttime'] . "',lastposttime)";
//Postings und Threads aktualisieren
$db->query("UPDATE " . PRE . "_forums SET " . $setvalues . " WHERE forumid='" . $_POST['moveto'] . "' LIMIT 1");
$db->query("UPDATE " . PRE . "_forums SET threads=0,posts=0,lastposter='',lastposter_userid='',lastposttime=0 WHERE forumid='" . $_REQUEST['id'] . "' LIMIT 1");
$db->query("UPDATE " . PRE . "_forum_threads SET forumid='" . $_POST['moveto'] . "' WHERE forumid='" . $_REQUEST['id'] . "'");
logit('FORUM_CLEAN', 'ID #' . $_REQUEST['id']);
//Forum löschen
if ($_POST['delforum'] && !$finfo['children']) {
$this->cat->deleteNode($_REQUEST['id']);
logit('FORUM_DEL', "ID #" . $_REQUEST['id']);
}
} elseif (!intval($_POST['moveto'])) {
//Themen und unwiderruflich Beiträge löschen
$threaddata = $db->fetch("SELECT threadid FROM " . PRE . "_forum_threads WHERE forumid='" . $_REQUEST['id'] . "'");
$threadIds = get_ids($threaddata, 'threadid');
if ($threadIds) {
//Anhänge löschen
$data = $db->fetch("\n\t\t\t\t\t\tSELECT a.id, a.file\n\t\t\t\t\t\tFROM " . PRE . "_forum_attachments AS a\n\t\t\t\t\t\tLEFT JOIN " . PRE . "_forum_posts AS p USING(postid)\n\t\t\t\t\t\tWHERE p.threadid IN (" . implode(',', $threadIds) . ")\n\t\t\t\t\t");
$attIds = get_ids($data, 'id');
if (count($data)) {
foreach ($data as $res) {
if (file_exists(BASEDIR . getpath('uploads') . $res['file'])) {
@unlink(BASEDIR . getpath('uploads') . $res['file']);
}
}
$db->query("DELETE FROM " . PRE . "_forum_attachments WHERE id IN (" . implode(',', $attIds) . ")");
}
$db->query("DELETE FROM " . PRE . "_forum_threads WHERE threadid IN (" . implode(',', $threadIds) . ")");
$db->query("DELETE FROM " . PRE . "_forum_posts WHERE threadid IN (" . implode(',', $threadIds) . ")");
$db->query("DELETE FROM " . PRE . "_forum_index WHERE threadid IN (" . implode(',', $threadIds) . ")");
}
//Forum aktualisieren
$db->query("UPDATE " . PRE . "_forums SET threads=0,posts=0,lastposter='',lastposter_userid='',lastposttime=0 WHERE forumid='" . $_REQUEST['id'] . "' LIMIT 1");
//Forum löschen
if ($_POST['delforum']) {
$this->cat->deleteNode($_REQUEST['id']);
logit('FORUM_DEL', "ID #" . $_REQUEST['id']);
}
}
logit('FORUM_CLEAN', "ID #" . $_REQUEST['id']);
printJSRedirect(get_index('forum.show'));
}
} else {
//Foren auflisten
$data = $this->cat->getTree(array('title', 'iscat', 'link'));
if (count($data)) {
foreach ($data as $res) {
if ($res['level'] > 1) {
$space = str_repeat(' ', $res['level'] - 1);
} else {
$space = '';
}
if ($res['iscat']) {
$style = ' style="background:#EAEAEA;color:#2B2B2B;" disabled="disabled"';
} else {
$style = '';
}
$forumlist .= '<option value="' . iif(!$res['iscat'] && !$res['link'], $res['forumid'], '-1') . '"' . $style . '' . iif($_POST['moveto'] == $res['forumid'], ' selected="selected"') . '>' . $space . replace($res['title']) . '</option>';
}
}
list($title) = $db->first("SELECT title FROM " . PRE . "_forums WHERE forumid='" . $_REQUEST['id'] . "' LIMIT 1");
$apx->tmpl->assign('ID', $_REQUEST['id']);
$apx->tmpl->assign('TITLE', compatible_hsc($title));
$apx->tmpl->assign('DELFORUM', (int) $_POST['delforum']);
$apx->tmpl->assign('DELABLE', $finfo['children'] == '|');
$apx->tmpl->assign('FORUMLIST', $forumlist);
tmessageOverlay('clean');
}
}
示例12: array
if ($username == 'ALL') {
$ids = array('ALL');
} else {
$ids = get_ids('SELECT cal_id FROM webcal_entry ' . " WHERE cal_create_by = '{$username}' {$tail}");
}
} elseif ($end_date) {
if ($username != 'ALL') {
$tail = " AND we.cal_create_by = '{$username}' {$tail}";
} else {
$tail = '';
$ALL = 1;
// Need this to tell get_ids to ignore participant check
}
$E_ids = get_ids('SELECT we.cal_id FROM webcal_entry we, webcal_entry_user weu ' . "WHERE cal_type = 'E' AND cal_date < '{$end_date}' {$tail}", $ALL);
$M_ids = get_ids('SELECT DISTINCT(we.cal_id) FROM webcal_entry we,
webcal_entry_user weu, webcal_entry_repeats wer
WHERE we.cal_type = \'M\'
AND we.cal_id = wer.cal_id AND we.cal_id = wer.cal_id ' . "AND cal_end IS NOT NULL AND cal_end < '{$end_date}' {$tail}", $ALL);
$ids = array_merge($E_ids, $M_ids);
}
//echo "event ids: <ul><li>" . implode ( "</li><li>", $ids ) . "</li></ul>\n";
if (count($ids) > 0) {
purge_events($ids);
} else {
echo translate('None');
}
echo '<h2>...' . translate('Finished') . ".</h2>\n";
?>
<form><input type="button" value="<?php
etranslate('Back');
?>
"
示例13: news_print
function news_print($data, $template)
{
global $set, $db, $apx, $user;
$tmpl = new tengine();
$apx->lang->drop('func', 'news');
//Verwendete Variablen auslesen
$parse = $apx->tmpl->used_vars($template, 'news');
//Kategorien auslesen
if (in_array('NEWS.CATID', $parse) || 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']) {
$username = $res['username'];
$email = iif(!$res['pub_hidemail'], $res['email']);
} else {
$username = $res['send_username'];
$email = $res['send_email'];
}
//Datehead
if ($laststamp != date('Y/m/d', $res['starttime'] - TIMEDIFF)) {
$tabledata[$i]['DATEHEAD'] = $res['starttime'];
}
//Links
if (in_array('NEWS.RELATED', $parse)) {
$tabledata[$i]['RELATED'] = news_links($res['links']);
}
//Text
$text = '';
if (in_array('NEWS.TEXT', $parse)) {
$text = mediamanager_inline($res['text']);
if ($apx->is_module('glossar')) {
$text = glossar_highlight($text);
}
}
//Teaser
$teaser = '';
if (in_array('NEWS.TEASER', $parse) && $set['news']['teaser']) {
$teaser = mediamanager_inline($res['teaser']);
if ($apx->is_module('glossar')) {
$teaser = glossar_highlight($teaser);
}
}
//Tags
if (in_array('NEWS.TAG', $parse) || in_array('NEWS.TAG_IDS', $parse) || in_array('NEWS.KEYWORDS', $parse)) {
list($tagdata, $tagids, $keywords) = news_tags($res['id']);
}
$tabledata[$i]['ID'] = $res['id'];
$tabledata[$i]['SECID'] = $res['secid'];
$tabledata[$i]['TITLE'] = $res['title'];
$tabledata[$i]['SUBTITLE'] = $res['subtitle'];
$tabledata[$i]['LINK'] = $link;
$tabledata[$i]['TEASER'] = $teaser;
$tabledata[$i]['TEXT'] = $text;
$tabledata[$i]['TIME'] = $res['starttime'];
$tabledata[$i]['PICTURE'] = $picture;
$tabledata[$i]['PICTURE_POPUP'] = $picture_popup;
$tabledata[$i]['PICTURE_POPUPPATH'] = $picture_popuppath;
$tabledata[$i]['USERID'] = $res['userid'];
$tabledata[$i]['USERNAME'] = replace($username);
$tabledata[$i]['EMAIL'] = replace($email);
$tabledata[$i]['EMAIL_ENCRYPTED'] = replace(cryptMail($email));
$tabledata[$i]['HITS'] = number_format($res['hits'], 0, '', '.');
$tabledata[$i]['TOP'] = $res['top'];
$tabledata[$i]['RESTRICTED'] = $res['restricted'];
//Tags
$tabledata[$i]['TAG'] = $tagdata;
$tabledata[$i]['TAG_IDS'] = $tagids;
$tabledata[$i]['KEYWORDS'] = $keywords;
//Kategorie
$tabledata[$i]['CATID'] = $res['catid'];
$tabledata[$i]['CATTITLE'] = $catinfo[$res['catid']]['title'];
$tabledata[$i]['CATICON'] = $catinfo[$res['catid']]['icon'];
$tabledata[$i]['CATLINK'] = $catinfo[$res['catid']]['link'];
//Produkt
$tabledata[$i]['PRODUCT_ID'] = $res['prodid'];
//Galerie
if ($apx->is_module('gallery') && $res['galid']) {
$galinfo = gallery_info($res['galid']);
$tabledata[$i]['GALLERY_ID'] = $galinfo['id'];
$tabledata[$i]['GALLERY_TITLE'] = $galinfo['title'];
$tabledata[$i]['GALLERY_LINK'] = mklink('gallery.php?id=' . $galinfo['id'], 'gallery,list' . $galinfo['id'] . ',1' . urlformat($galinfo['title']) . '.html');
}
//Kommentare
if ($apx->is_module('comments') && $set['news']['coms'] && $res['allowcoms']) {
require_once BASEDIR . getmodulepath('comments') . 'class.comments.php';
if (!isset($coms)) {
$coms = new comments('news', $res['id']);
} else {
$coms->mid = $res['id'];
}
//.........这里部分代码省略.........
示例14: edit
//.........这里部分代码省略.........
}
if (!checkToken()) {
infoInvalidToken();
} elseif (!$_POST['question'] || !$_POST['days'] || $ac < 2) {
infoNotComplete();
} else {
for ($i = 1; $i <= 20; $i++) {
if ($_POST['a' . $i] && $_POST['color' . $i]) {
$qcache[] = array($_POST['a' . $i], $_POST['color' . $i], $_POST['a' . $i . '_c']);
}
}
for ($i = 1; $i <= 20; $i++) {
$_POST['a' . $i] = $qcache[$i - 1][0];
$_POST['color' . $i] = $qcache[$i - 1][1];
$_POST['a' . $i . '_c'] = $qcache[$i - 1][2];
}
$_POST['secid'] = serialize_section($_POST['secid']);
//Veröffentlichung
if ($apx->user->has_right('poll.enable') && isset($_POST['t_day_1'])) {
$_POST['starttime'] = maketime(1);
$_POST['endtime'] = maketime(2);
if ($_POST['starttime']) {
if (!$_POST['endtime'] || $_POST['endtime'] <= $_POST['starttime']) {
$_POST['endtime'] = 3000000000;
}
$addfields = ',starttime,endtime';
}
}
$db->dupdate(PRE . '_poll', 'secid,question,meta_description,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,color1,color2,color3,color4,color5,color6,color7,color8,color9,color10,color11,color12,color13,color14,color15,color16,color17,color18,color19,color20,a1_c,a2_c,a3_c,a4_c,a5_c,a6_c,a7_c,a8_c,a9_c,a10_c,a11_c,a12_c,a13_c,a14_c,a15_c,a16_c,a17_c,a18_c,a19_c,a20_c,days,multiple,searchable,allowcoms' . $addfields, "WHERE ( id='" . $_REQUEST['id'] . "' ) LIMIT 1");
logit('POLL_EDIT', 'ID #' . $_REQUEST['id']);
//Tags
$db->query("DELETE FROM " . PRE . "_poll_tags WHERE id='" . $_REQUEST['id'] . "'");
$tagids = produceTagIds($_POST['tags']);
foreach ($tagids as $tagid) {
$db->query("INSERT IGNORE INTO " . PRE . "_poll_tags VALUES('" . $_REQUEST['id'] . "', '" . $tagid . "')");
}
printJSRedirect(get_index('poll.show'));
}
} else {
$res = $db->first("SELECT * FROM " . PRE . "_poll WHERE ( id='" . $_REQUEST['id'] . "' ) LIMIT 1");
foreach ($res as $key => $val) {
$_POST[$key] = $val;
}
$_POST['secid'] = unserialize_section($_POST['secid']);
//Veröffentlichung
if ($res['starttime']) {
maketimepost(1, $res['starttime']);
if ($res['endtime'] < 2147483647) {
maketimepost(2, $res['endtime']);
}
}
//Sektionen auflisten
if (is_array($apx->sections) && count($apx->sections)) {
$seclist = '<option value="all" style="font-weight:bold;"' . iif(in_array('all', $_POST['secid']), ' selected="selected"') . '>' . $apx->lang->get('ALLSEC') . '</option>';
foreach ($apx->sections as $id => $info) {
$seclist .= '<option value="' . $id . '"' . iif(in_array($id, $_POST['secid']), ' selected="selected"') . '>' . replace($info['title']) . '</option>';
}
}
//Antwortmöglichkeiten
for ($i = 1; $i <= 20; $i++) {
if ($i > 1 && !$_POST['a' . $i]) {
continue;
}
$answerdata[$i]['TEXT'] = compatible_hsc($_POST['a' . $i]);
$answerdata[$i]['VOTES'] = intval($_POST['a' . $i . '_c']);
$answerdata[$i]['COLOR'] = iif($_POST['color' . $i], $_POST['color' . $i], $this->colors[0]);
$answerdata[$i]['DISPLAY'] = 1;
}
//Felder auffüllen
while (count($answerdata) < 20) {
$answerdata[] = array('COLOR' => $this->colors[0]);
}
//Veröffentlichung
if ($apx->user->has_right('poll.enable') && isset($_POST['t_day_1'])) {
$apx->tmpl->assign('STARTTIME', choosetime(1, 0, maketime(1)));
$apx->tmpl->assign('ENDTIME', choosetime(2, 1, maketime(2)));
}
//Farben
foreach ($this->colors as $color) {
$colordata[]['ID'] = $color;
}
//Tags
$tags = array();
$tagdata = $db->fetch("\n\t\t\tSELECT t.tag\n\t\t\tFROM " . PRE . "_poll_tags AS n\n\t\t\tLEFT JOIN " . PRE . "_tags AS t USING(tagid)\n\t\t\tWHERE n.id='" . $_REQUEST['id'] . "'\n\t\t\tORDER BY t.tag ASC\n\t\t");
$tags = get_ids($tagdata, 'tag');
$_POST['tags'] = implode(', ', $tags);
$apx->tmpl->assign('COLOR', $colordata);
$apx->tmpl->assign('ANSWER', $answerdata);
$apx->tmpl->assign('ID', $_REQUEST['id']);
$apx->tmpl->assign('SECLIST', $seclist);
$apx->tmpl->assign('QUESTION', compatible_hsc($_POST['question']));
$apx->tmpl->assign('DAYS', intval($_POST['days']));
$apx->tmpl->assign('META_DESCRIPTION', compatible_hsc($_POST['meta_description']));
$apx->tmpl->assign('TAGS', compatible_hsc($_POST['tags']));
$apx->tmpl->assign('MULTIPLE', (int) $_POST['multiple']);
$apx->tmpl->assign('ALLOWCOMS', (int) $_POST['allowcoms']);
$apx->tmpl->assign('SEARCHABLE', (int) $_POST['searchable']);
$apx->tmpl->parse('edit');
}
}
示例15: products_print
function products_print($data, $template)
{
global $set, $db, $apx, $user;
$tmpl = new tengine();
$apx->lang->drop('fields', 'products');
//Verwendet Variablen auslesen
$parse = $apx->tmpl->used_vars($template, 'products');
$ids = get_ids($data, 'id');
$types = get_ids($data, 'type');
if (count($data)) {
$unitvars = array('PRODUCT.DEVELOPER', 'PRODUCT.DEVELOPER_WEBSITE', 'PRODUCT.DEVELOPER_LINK', 'PRODUCT.PUBLISHER', 'PRODUCT.PUBLISHER_WEBSITE', 'PRODUCT.PUBLISHER_LINK', 'PRODUCT.MANUFACTURER', 'PRODUCT.MANUFACTURER_WEBSITE', 'PRODUCT.MANUFACTURER_LINK', 'PRODUCT.STUDIO', 'PRODUCT.STUDIO_WEBSITE', 'PRODUCT.STUDIO_LINK', 'PRODUCT.LABEL', 'PRODUCT.LABEL_WEBSITE', 'PRODUCT.LABEL_LINK', 'PRODUCT.ARTIST', 'PRODUCT.ARTIST_WEBSITE', 'PRODUCT.ARTIST_LINK', 'PRODUCT.AUTHOR', 'PRODUCT.AUTHOR_WEBSITE', 'PRODUCT.AUTHOR_LINK');
//Einheiten auslesen
$unitinfo = array();
if (in_template($unitvars, $parse)) {
$unitids = array_merge(get_ids($data, 'manufacturer'), get_ids($data, 'publisher'));
$unitinfo = $db->fetch_index("SELECT id,title,website FROM " . PRE . "_products_units WHERE id IN (" . implode(',', $unitids) . ")", 'id');
}
//Gruppen auslesen
$groupinfo = array();
$groups = array();
/*if ( in_template(array('PRODUCT.MEDIA'),$parse) ) $groups = array_merge($groups,get_ids($data,'media'));
if ( in_array('PRODUCT.GENRE',$parse) ) $groups = array_merge($groups,get_ids($data,'genre'));
if ( in_array('game',$types) && in_template(array('PRODUCT.RELEASE.SYSTEM','PRODUCT.RELEASE.SYSTEM_ICON','PRODUCT.SYSTEM'),$parse) ) {
if ( count($groups)==0 ) $groups = array(0);
$groupinfo = $db->fetch_index("SELECT id,title,icon FROM ".PRE."_products_groups WHERE id IN (".implode(',',$groups).") OR grouptype='system'",'id');
}
elseif ( in_array('movie',$types) && in_template(array('PRODUCT.RELEASE.MEDIA','PRODUCT.RELEASE.MEDIA_ICON','PRODUCT.MEDIA'),$parse) ) {
if ( count($groups)==0 ) $groups = array(0);
$groupinfo = $db->fetch_index("SELECT id,title,icon FROM ".PRE."_products_groups WHERE id IN (".implode(',',$groups).") OR grouptype='media'",'id');
}
elseif ( count($groups) ) {
$groupinfo = $db->fetch_index("SELECT id,title,icon FROM ".PRE."_products_groups WHERE id IN (".implode(',',$groups).")",'id');
}*/
$groupinfo = $db->fetch_index("SELECT id,title,icon FROM " . PRE . "_products_groups", 'id');
//Veröffentlichungs-Daten auslesen
$releaseinfo = array();
if (in_array('PRODUCT.RELEASE', $parse)) {
$releasedata = $db->fetch("SELECT prodid,system,data,stamp FROM " . PRE . "_products_releases WHERE prodid IN (" . implode(',', $ids) . ") ORDER BY stamp ASC");
if (count($releasedata)) {
foreach ($releasedata as $relres) {
$info = unserialize($relres['data']);
$releasedate = products_format_release($info);
$relentry = array('stamp' => $relres['stamp'], 'DATE' => $releasedate, 'SYSTEM' => $groupinfo[$relres['system']]['title'], 'SYSTEM_ICON' => $groupinfo[$relres['system']]['icon'], 'MEDIA' => $groupinfo[$relres['system']]['title'], 'MEDIA_ICON' => $groupinfo[$relres['system']]['icon']);
$releaseinfo[$relres['prodid']][] = $relentry;
}
}
}
//Produkte auflisten
foreach ($data as $res) {
++$i;
//Link
$link = mklink('products.php?id=' . $res['id'], 'products,id' . $res['id'] . urlformat($res['title']) . '.html');
//Produktbild
if (in_array('PRODUCT.PICTURE', $parse) || in_array('PRODUCT.PICTURE_POPUP', $parse) || in_array('PRODUCT.PICTURE_POPUPPATH', $parse)) {
list($picture, $picture_popup, $picture_popuppath) = products_pic($res['picture']);
}
//Teaserbild
if (in_array('PRODUCT.TEASERPIC', $parse) || in_array('PRODUCT.TEASERPIC_POPUP', $parse) || in_array('PRODUCT.TEASERPIC_POPUPPATH', $parse)) {
list($teaserpic, $teaserpic_popup, $teaserpic_popuppath) = products_pic($res['teaserpic']);
}
//Text
$text = '';
if (in_array('PRODUCT.TEXT', $parse)) {
$text = mediamanager_inline($res['text']);
if ($apx->is_module('glossar')) {
$text = glossar_highlight($text);
}
}
//Datehead
if ($laststamp != date('Y/m/d', $res['addtime'] - TIMEDIFF)) {
$tabledata[$i]['DATEHEAD'] = $res['addtime'];
}
//Tags
if (in_array('PRODUCT.TAG', $parse) || in_array('PRODUCT.TAG_IDS', $parse) || in_array('PRODUCT.KEYWORDS', $parse)) {
list($tagdata, $tagids, $keywords) = products_tags($res['id']);
}
//Standard-Platzhalter
$tabledata[$i]['ID'] = $res['id'];
$tabledata[$i]['TYPE'] = $res['type'];
$tabledata[$i]['LINK'] = $link;
$tabledata[$i]['TITLE'] = $res['title'];
$tabledata[$i]['TEXT'] = $text;
$tabledata[$i]['TIME'] = $res['addtime'];
$tabledata[$i]['WEBSITE'] = $res['website'];
$tabledata[$i]['BUYLINK'] = $res['buylink'];
$tabledata[$i]['PRICE'] = $res['price'];
$tabledata[$i]['HITS'] = $res['hits'];
$tabledata[$i]['PICTURE'] = $picture;
$tabledata[$i]['PICTURE_POPUP'] = $picture_popup;
$tabledata[$i]['PICTURE_POPUPPATH'] = $picture_popuppath;
$tabledata[$i]['TEASERPIC'] = $teaserpic;
$tabledata[$i]['TEASERPIC_POPUP'] = $teaserpic_popup;
$tabledata[$i]['TEASERPIC_POPUPPATH'] = $teaserpic_popuppath;
$tabledata[$i]['PRODUCT_ID'] = $res['prodid'];
$tabledata[$i]['RECOMMENDED_PRICE'] = $res['recprice'];
$tabledata[$i]['GUARANTEE'] = $res['guarantee'];
//Sammlung
if ($user->info['userid']) {
if (!products_in_coll($res['id'])) {
$tabledata[$i]['LINK_COLLECTION_ADD'] = mklink('products.php?id=' . $res['id'] . '&addcoll=1', 'products,id' . $res['id'] . urlformat($res['title']) . '.html?addcoll=1');
//.........这里部分代码省略.........