function search_gallery($items, $conn) { global $set, $db, $apx, $user; require_once BASEDIR . getmodulepath('gallery') . 'functions.php'; //Suchstring generieren $tagmatches = gallery_match_tags($items); foreach ($items as $item) { $tagmatch = array_shift($tagmatches); $search1[] = "caption LIKE '" . addslashes_like($item) . "'"; $search2[] = " ( " . iif($tagmatch, " id IN (" . implode(',', $tagmatch) . ") OR ") . " title LIKE '%" . addslashes_like($item) . "%' OR description LIKE '%" . addslashes_like($item) . "%' ) "; } $searchstring1 = implode($conn, $search1); $searchstring2 = implode($conn, $search2); //Bilder durchsuchen $data = $db->fetch("SELECT galid FROM " . PRE . "_gallery_pics WHERE ( active='1' AND ( " . $searchstring1 . " ) ) GROUP BY galid"); $galids = get_ids($data, 'galid'); if (count($galids)) { $picres = " id IN (" . @implode(',', $galids) . ") OR "; } //Ergebnisse $data = $db->fetch("SELECT id,title FROM " . PRE . "_gallery WHERE ( searchable='1' AND '" . time() . "' BETWEEN starttime AND endtime " . section_filter() . " AND ( " . $picres . " ( " . $searchstring2 . " ) ) ) ORDER BY title ASC"); if (count($data)) { foreach ($data as $res) { ++$i; $result[$i]['TITLE'] = strip_tags($res['title']); $result[$i]['LINK'] = mklink('gallery.php?id=' . $res['id'], 'gallery,list' . $res['id'] . ',1' . urlformat($res['title']) . '.html'); } } return $result; }
function 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; } }
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; }
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']; }
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; }
function misc_articlesfeed() { global $set, $db, $apx; $apx->tmpl->loaddesign('blank'); header('Content-type: application/rss+xml'); //Verwendete Variablen $parse = $apx->tmpl->used_vars('rss', 'articles'); //Baum holen, wenn nur eine bestimmte Kategorie gezeigt werden soll $cattree = articles_tree($_REQUEST['catid']); $data = $db->fetch("SELECT a.id,a.type,a.catid,a.title,a.subtitle,a.teaser,a.starttime,a.top,b.username,b.email,b.pub_hidemail FROM " . PRE . "_articles AS a LEFT JOIN " . PRE . "_user AS b USING (userid) WHERE ( " . time() . " BETWEEN starttime AND endtime " . iif(count($cattree), "AND catid IN (" . @implode(',', $cattree) . ")") . " " . section_filter() . " ) ORDER BY starttime DESC LIMIT 20"); //Kategorien auslesen $catinfo = articles_catinfo(get_ids($data, 'catid')); if (count($data)) { foreach ($data as $res) { ++$i; //Wohin soll verlinkt werden? if ($res['type'] == 'normal') { $link2file = 'articles'; } else { $link2file = $res['type'] . 's'; } //Link $link = mklink($link2file . '.php?id=' . $res['id'], $link2file . ',id' . $res['id'] . ',0' . urlformat($res['title']) . '.html'); //Text: Teaser oder Artikelseite if ($res['teaser'] && $set['articles']['teaser']) { $text = $res['teaser']; } else { list($text) = $db->first("SELECT text FROM " . PRE . "_articles_pages WHERE artid='" . $res['id'] . "' ORDER BY ord ASC LIMIT 1"); $text = $text; } $tabledata[$i]['ID'] = $res['id']; $tabledata[$i]['TITLE'] = rss_replace($res['title']); $tabledata[$i]['SUBTITLE'] = rss_replace($res['subtitle']); $tabledata[$i]['TIME'] = date('r', $res['starttime']); //Kein TIMEDIFF weil Zeitverschiebung mit angegeben! $tabledata[$i]['TEXT'] = rss_replace(preg_replace('#{IMAGE\\(([0-9]+)\\)}#s', '', $text)); $tabledata[$i]['CATTITLE'] = rss_replace($catinfo[$res['catid']]['title']); $tabledata[$i]['LINK'] = HTTP_HOST . $link; $tabledata[$i]['USERNAME'] = replace($res['username']); $tabledata[$i]['EMAIL'] = replace(iif(!$res['pub_hidemail'], $res['email'])); $tabledata[$i]['EMAIL_ENCRYPTED'] = replace(iif(!$res['pub_hidemail'], cryptMail($res['email']))); $tabledata[$i]['TOP'] = $res['top']; } } $apx->tmpl->assign('WEBSITENAME', $set['main']['websitename']); $apx->tmpl->assign('ARTICLE', $tabledata); $apx->tmpl->parse('rss', 'articles'); }
function 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; }
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; }
function misc_linksfeed() { global $set, $db, $apx; $apx->tmpl->loaddesign('blank'); header('Content-type: application/rss+xml'); //Baum holen, wenn nur eine bestimmte Kategorie gezeigt werden soll $cattree = links_tree($_REQUEST['catid']); $data = $db->fetch("SELECT a.id,a.catid,a.title,a.text,a.starttime,a.top,b.username,b.email,b.pub_hidemail FROM " . PRE . "_links AS a LEFT JOIN " . PRE . "_user AS b USING (userid) WHERE ( ( '" . time() . "' BETWEEN starttime AND endtime ) " . iif(count($cattree), "AND catid IN (" . @implode(',', $cattree) . ")") . " " . section_filter() . " ) ORDER BY starttime DESC LIMIT 20"); if (count($data)) { //Kategorien auslesen $catids = get_ids($data, 'catid'); if (count($catids)) { $catdata = $db->fetch("SELECT id,title FROM " . PRE . "_links_cat WHERE id IN (" . implode(',', $catids) . ")"); if (count($catdata)) { foreach ($catdata as $catres) { $catinfo[$catres['id']] = $catres; } } } foreach ($data as $res) { ++$i; //Link $link = mklink('links.php?id=' . $res['id'], 'links,id' . $res['id'] . urlformat($res['title']) . '.html'); $tabledata[$i]['ID'] = $res['id']; $tabledata[$i]['TITLE'] = rss_replace($res['title']); $tabledata[$i]['URL'] = $res['url']; $tabledata[$i]['TIME'] = date('r', $res['starttime']); //Kein TIMEDIFF weil Zeitverschiebung mit angegeben! $tabledata[$i]['TEXT'] = rss_replace(preg_replace('#{IMAGE\\(([0-9]+)\\)}#s', '', $res['text'])); $tabledata[$i]['CATTITLE'] = rss_replace($catinfo[$res['catid']]['title']); $tabledata[$i]['LINK'] = HTTP_HOST . $link; $tabledata[$i]['TOP'] = $res['top']; } } $apx->tmpl->assign('WEBSITENAME', $set['main']['websitename']); $apx->tmpl->assign('LINK', $tabledata); $apx->tmpl->parse('rss', 'links'); }
function search_articles($items, $conn) { global $set, $db, $apx, $user; require_once BASEDIR . getmodulepath('articles') . 'functions.php'; //Suchstrings generieren $tagmatches = articles_match_tags($items); foreach ($items as $item) { $tagmatch = array_shift($tagmatches); $search1[] = "( title LIKE '%" . addslashes_like($item) . "%' OR text LIKE '%" . addslashes_like($item) . "%' ) "; $search2[] = "( " . iif($tagmatch, " id IN (" . implode(',', $tagmatch) . ") OR ") . " title LIKE '%" . addslashes_like($item) . "%' OR subtitle LIKE '%" . addslashes_like($item) . "%' OR teaser LIKE '%" . addslashes_like($item) . "%' ) "; } $searchstring1 = "( " . implode($conn, $search1) . " )"; $searchstring2 = "( " . implode($conn, $search2) . " )"; //Seiten durchsuchen $data = $db->fetch("SELECT artid FROM " . PRE . "_articles_pages WHERE ( " . $searchstring1 . " ) GROUP BY artid"); $artids = get_ids($data, 'artid'); if (count($artids)) { $pageres = "id IN (" . @implode(',', $artids) . ") OR"; } //Artikel durchsuchen $data = $db->fetch("SELECT id,type,title,subtitle FROM " . PRE . "_articles WHERE ( searchable='1' AND '" . time() . "' BETWEEN starttime AND endtime " . section_filter() . " AND ( " . $pageres . " " . $searchstring2 . " ) ) ORDER BY starttime DESC"); if (count($data)) { foreach ($data as $res) { ++$i; //Wohin soll verlinkt werden? if ($res['type'] == 'normal') { $link2file = 'articles'; } else { $link2file = $res['type'] . 's'; } $link = mklink($link2file . '.php?id=' . $res['id'], $link2file . ',id' . $res['id'] . ',0' . urlformat($res['title']) . '.html'); $result[$i]['TITLE'] = strip_tags($res['title']) . iif($res['subtitle'], ' - ' . strip_tags($res['subtitle'])); $result[$i]['LINK'] = $link; } } return $result; }
function 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'); } }
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'); ?> "
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']; } $link = mklink('news.php?id=' . $res['id'], 'news,id' . $res['id'] . urlformat($res['title']) . '.html'); $tabledata[$i]['COMMENT_COUNT'] = $coms->count(); $tabledata[$i]['COMMENT_LINK'] = $coms->link($link); $tabledata[$i]['DISPLAY_COMMENTS'] = 1; if (in_template(array('NEWS.COMMENT_LAST_USERID', 'NEWS.COMMENT_LAST_NAME', 'NEWS.COMMENT_LAST_TIME'), $parse)) { $tabledata[$i]['COMMENT_LAST_USERID'] = $coms->last_userid(); $tabledata[$i]['COMMENT_LAST_NAME'] = $coms->last_name(); $tabledata[$i]['COMMENT_LAST_TIME'] = $coms->last_time(); } } //Bewertungen if ($apx->is_module('ratings') && $set['news']['ratings'] && $res['allowrating']) { require_once BASEDIR . getmodulepath('ratings') . 'class.ratings.php'; if (!isset($rate)) { $rate = new ratings('news', $res['id']); } else { $rate->mid = $res['id']; } $tabledata[$i]['RATING'] = $rate->display(); $tabledata[$i]['RATING_VOTES'] = $rate->count(); $tabledata[$i]['DISPLAY_RATING'] = 1; } $laststamp = date('Y/m/d', $res['starttime'] - TIMEDIFF); } } $tmpl->assign('NEWS', $tabledata); $tmpl->parse($template, 'news'); }
function edit() { global $set, $db, $apx; $_REQUEST['id'] = (int) $_REQUEST['id']; if (!$_REQUEST['id']) { die('missing ID!'); } //Sektions-Liste if (!is_array($_POST['secid']) || $_POST['secid'][0] == 'all') { $_POST['secid'] = array('all'); } if ($_POST['send']) { //Mindestens zwei Felder belegt? for ($i = 1; $i <= 20; $i++) { if ($_POST['a' . $i]) { ++$ac; } if ($ac == 2) { break; } } 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'); } }
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'); } else { $tabledata[$i]['LINK_COLLECTION_REMOVE'] = mklink('products.php?id=' . $res['id'] . '&removecoll=1', 'products,id' . $res['id'] . urlformat($res['title']) . '.html?removecoll=1'); } } //Tags $tabledata[$i]['TAG'] = $tagdata; $tabledata[$i]['TAG_IDS'] = $tagids; $tabledata[$i]['KEYWORDS'] = $keywords; //NORMAL if ($res['type'] == 'normal') { $manulink = mklink('manufacturers.php?id=' . $res['manufacturer'], 'manufacturers,id' . $res['manufacturer'] . urlformat($unitinfo[$res['manufacturer']]['title']) . '.html'); $tabledata[$i]['MANUFACTURER'] = $unitinfo[$res['manufacturer']]['title']; $tabledata[$i]['MANUFACTURER_WEBSITE'] = $unitinfo[$res['manufacturer']]['website']; $tabledata[$i]['MANUFACTURER_LINK'] = $manulink; } elseif ($res['type'] == 'game') { //System-Liste $systemdata = array(); if (in_array('PRODUCT.SYSTEM', $parse)) { $systems = dash_unserialize($res['systems']); if (!is_array($systems)) { $systems = array(); } foreach ($systems as $sysid) { ++$ii; $systemdata[$ii]['TITLE'] = $groupinfo[$sysid]['title']; $systemdata[$ii]['ICON'] = $groupinfo[$sysid]['icon']; } } //Media-Liste $media = dash_unserialize($res['media']); if (!is_array($media)) { $media = array(); } $mediadata = array(); foreach ($media as $medid) { ++$ii; $mediadata[$ii]['TITLE'] = $groupinfo[$medid]['title']; $mediadata[$ii]['ICON'] = $groupinfo[$medid]['icon']; } $manulink = mklink('manufacturers.php?id=' . $res['manufacturer'], 'manufacturers,id' . $res['manufacturer'] . urlformat($unitinfo[$res['manufacturer']]['title']) . '.html'); $publink = mklink('manufacturers.php?id=' . $res['publisher'], 'manufacturers,id' . $res['publisher'] . urlformat($unitinfo[$res['publisher']]['title']) . '.html'); $tabledata[$i]['DEVELOPER'] = $unitinfo[$res['manufacturer']]['title']; $tabledata[$i]['DEVELOPER_WEBSITE'] = $unitinfo[$res['manufacturer']]['website']; $tabledata[$i]['DEVELOPER_LINK'] = $manulink; $tabledata[$i]['PUBLISHER'] = $unitinfo[$res['publisher']]['title']; $tabledata[$i]['PUBLISHER_WEBSITE'] = $unitinfo[$res['publisher']]['website']; $tabledata[$i]['PUBLISHER_LINK'] = $publink; $tabledata[$i]['USK'] = $res['sk']; $tabledata[$i]['GENRE'] = $groupinfo[$res['genre']]['title']; $tabledata[$i]['MEDIA'] = $mediadata; $tabledata[$i]['SYSTEM'] = $systemdata; $tabledata[$i]['REQUIREMENTS'] = $res['requirements']; } elseif ($res['type'] == 'hardware') { $manulink = mklink('manufacturers.php?id=' . $res['manufacturer'], 'manufacturers,id' . $res['manufacturer'] . urlformat($unitinfo[$res['manufacturer']]['title']) . '.html'); $tabledata[$i]['MANUFACTURER'] = $unitinfo[$res['manufacturer']]['title']; $tabledata[$i]['MANUFACTURER_WEBSITE'] = $unitinfo[$res['manufacturer']]['website']; $tabledata[$i]['MANUFACTURER_LINK'] = $manulink; $tabledata[$i]['EQUIPMENT'] = $res['equipment']; } elseif ($res['type'] == 'software') { //Media-Liste $media = dash_unserialize($res['media']); if (!is_array($media)) { $media = array(); } $mediadata = array(); foreach ($media as $medid) { ++$ii; $mediadata[$ii]['TITLE'] = $groupinfo[$medid]['title']; $mediadata[$ii]['ICON'] = $groupinfo[$medid]['icon']; } $manulink = mklink('manufacturers.php?id=' . $res['manufacturer'], 'manufacturers,id' . $res['manufacturer'] . urlformat($unitinfo[$res['manufacturer']]['title']) . '.html'); $tabledata[$i]['MANUFACTURER'] = $unitinfo[$res['manufacturer']]['title']; $tabledata[$i]['MANUFACTURER_WEBSITE'] = $unitinfo[$res['manufacturer']]['website']; $tabledata[$i]['MANUFACTURER_LINK'] = $manulink; $tabledata[$i]['OS'] = $res['os']; $tabledata[$i]['LANGUAGES'] = $res['languages']; $tabledata[$i]['REQUIREMENTS'] = $res['requirements']; $tabledata[$i]['LICENSE'] = $res['license']; $tabledata[$i]['VERSION'] = $res['version']; $tabledata[$i]['MEDIA'] = $mediadata; } elseif ($res['type'] == 'music') { //Media-Liste $media = dash_unserialize($res['media']); if (!is_array($media)) { $media = array(); } $mediadata = array(); foreach ($media as $medid) { ++$ii; $mediadata[$ii]['TITLE'] = $groupinfo[$medid]['title']; $mediadata[$ii]['ICON'] = $groupinfo[$medid]['icon']; } $manulink = mklink('manufacturers.php?id=' . $res['manufacturer'], 'manufacturers,id' . $res['manufacturer'] . urlformat($unitinfo[$res['manufacturer']]['title']) . '.html'); $publink = mklink('manufacturers.php?id=' . $res['publisher'], 'manufacturers,id' . $res['publisher'] . urlformat($unitinfo[$res['publisher']]['title']) . '.html'); $tabledata[$i]['ARTIST'] = $unitinfo[$res['manufacturer']]['title']; $tabledata[$i]['ARTIST_WEBSITE'] = $unitinfo[$res['manufacturer']]['website']; $tabledata[$i]['ARTIST_LINK'] = $manulink; $tabledata[$i]['LABEL'] = $unitinfo[$res['publisher']]['title']; $tabledata[$i]['LABEL_WEBSITE'] = $unitinfo[$res['publisher']]['website']; $tabledata[$i]['LABEL_LINK'] = $publink; $tabledata[$i]['FSK'] = $res['sk']; $tabledata[$i]['GENRE'] = $groupinfo[$res['genre']]['title']; $tabledata[$i]['MEDIA'] = $mediadata; } elseif ($res['type'] == 'movie') { //Media-Liste $media = dash_unserialize($res['media']); if (!is_array($media)) { $media = array(); } $mediadata = array(); foreach ($media as $medid) { ++$ii; $mediadata[$ii]['TITLE'] = $groupinfo[$medid]['title']; $mediadata[$ii]['ICON'] = $groupinfo[$medid]['icon']; } $publink = mklink('manufacturers.php?id=' . $res['publisher'], 'manufacturers,id' . $res['publisher'] . urlformat($unitinfo[$res['publisher']]['title']) . '.html'); $tabledata[$i]['STUDIO'] = $unitinfo[$res['publisher']]['title']; $tabledata[$i]['STUDIO_WEBSITE'] = $unitinfo[$res['publisher']]['website']; $tabledata[$i]['STUDIO_LINK'] = $publink; $tabledata[$i]['REGISSEUR'] = $res['regisseur']; $tabledata[$i]['ACTORS'] = $res['actors']; $tabledata[$i]['LENGTH'] = $res['length']; $tabledata[$i]['FSK'] = $res['sk']; $tabledata[$i]['GENRE'] = $groupinfo[$res['genre']]['title']; $tabledata[$i]['MEDIA'] = $mediadata; } elseif ($res['type'] == 'book') { //Media-Liste $media = dash_unserialize($res['media']); if (!is_array($media)) { $media = array(); } $mediadata = array(); foreach ($media as $medid) { ++$ii; $mediadata[$ii]['TITLE'] = $groupinfo[$medid]['title']; $mediadata[$ii]['ICON'] = $groupinfo[$medid]['icon']; } $manulink = mklink('manufacturers.php?id=' . $res['manufacturer'], 'manufacturers,id' . $res['manufacturer'] . urlformat($unitinfo[$res['manufacturer']]['title']) . '.html'); $publink = mklink('manufacturers.php?id=' . $res['publisher'], 'manufacturers,id' . $res['publisher'] . urlformat($unitinfo[$res['publisher']]['title']) . '.html'); $tabledata[$i]['AUTHOR'] = $unitinfo[$res['manufacturer']]['title']; $tabledata[$i]['AUTHOR_WEBSITE'] = $unitinfo[$res['manufacturer']]['website']; $tabledata[$i]['AUTHOR_LINK'] = $manulink; $tabledata[$i]['PUBLISHER'] = $unitinfo[$res['publisher']]['title']; $tabledata[$i]['PUBLISHER_WEBSITE'] = $unitinfo[$res['publisher']]['website']; $tabledata[$i]['PUBLISHER_LINK'] = $publink; $tabledata[$i]['GENRE'] = $groupinfo[$res['genre']]['title']; $tabledata[$i]['MEDIA'] = $mediadata; $tabledata[$i]['ISBN'] = $res['isbn']; } //Benutzerdefinierte Felder for ($ii = 1; $ii <= 10; $ii++) { $tabledata[$i]['CUSTOM' . $ii . '_NAME'] = replace($set['products']['custom_' . $res['type']][$ii - 1]); $tabledata[$i]['CUSTOM' . $ii] = $res['custom' . $ii]; } //Veröffentlichung if (in_array('PRODUCT.RELEASE', $parse)) { if ($res['releasestamp']) { $temprel = $releaseinfo[$res['id']]; foreach ($temprel as $rel) { if ($rel['stamp'] != $res['releasestamp']) { continue; } ++$ii; $tabledata[$i]['RELEASE'][$ii] = $rel; } } else { $tabledata[$i]['RELEASE'] = $releaseinfo[$res['id']]; } } //Kommentare if ($apx->is_module('comments') && $set['products']['coms'] && $res['allowcoms']) { require_once BASEDIR . getmodulepath('comments') . 'class.comments.php'; if (!isset($coms)) { $coms = new comments('products', $res['id']); } else { $coms->mid = $res['id']; } $link = mklink('products.php?id=' . $res['id'], 'products,id' . $res['id'] . urlformat($res['title']) . '.html'); $tabledata[$i]['COMMENT_COUNT'] = $coms->count(); $tabledata[$i]['COMMENT_LINK'] = $coms->link($link); $tabledata[$i]['DISPLAY_COMMENTS'] = 1; if (in_template(array('PRODUCT.COMMENT_LAST_USERID', 'PRODUCT.COMMENT_LAST_NAME', 'PRODUCT.COMMENT_LAST_TIME'), $parse)) { $tabledata[$i]['COMMENT_LAST_USERID'] = $coms->last_userid(); $tabledata[$i]['COMMENT_LAST_NAME'] = $coms->last_name(); $tabledata[$i]['COMMENT_LAST_TIME'] = $coms->last_time(); } } //Bewertungen if ($apx->is_module('ratings') && $set['products']['ratings'] && $res['allowrating']) { require_once BASEDIR . getmodulepath('ratings') . 'class.ratings.php'; if (!isset($rate)) { $rate = new ratings('products', $res['id']); } else { $rate->mid = $res['id']; } $tabledata[$i]['RATING'] = $rate->display(); $tabledata[$i]['RATING_VOTES'] = $rate->count(); $tabledata[$i]['DISPLAY_RATING'] = 1; } $laststamp = date('Y/m/d', $res['addtime'] - TIMEDIFF); } } $tmpl->assign('PRODUCT', $tabledata); $tmpl->parse($template, 'products'); }
tmessage('noright', array(), false, false); } //AKTION AUSFÜHREN if ($_POST['send'] && $_POST['id']) { /* Postingzahlen der Benutzer nicht verringern => Postings wurden vielleicht gar nicht gezählt $data=$db->fetch("SELECT count(postid) AS posts,userid FROM ".PRE."_forum_posts WHERE ( threadid='".$threadinfo['threadid']."' AND userid!=0 AND del=0 )"); if ( count($data) ) { foreach ( $data AS $res ) { $db->query("UPDATE ".PRE."_user SET forum_posts=forum_posts-".$res['posts']." WHERE userid='".$res['userid']."' LIMIT 1"); } }*/ //Thema und Beiträge löschen if ($_POST['realdel'] && $user->info['userid'] && ($user->is_admin() || in_array($user->info['userid'], $foruminfo['moderator']))) { //Anhänge löschen $data = $db->fetch("\n\t\t\t\tSELECT a.id, a.file\n\t\t\t\tFROM " . PRE . "_forum_attachments AS a\n\t\t\t\tLEFT JOIN " . PRE . "_forum_posts AS p USING(postid)\n\t\t\t\tWHERE p.threadid='" . $threadinfo['threadid'] . "'\n\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) . ")"); } //SQL löschen $db->query("DELETE FROM " . PRE . "_forum_threads WHERE threadid='" . $threadinfo['threadid'] . "' LIMIT 1"); $db->query("DELETE FROM " . PRE . "_forum_threads WHERE moved='" . $threadinfo['threadid'] . "' LIMIT 1"); $db->query("DELETE FROM " . PRE . "_forum_posts WHERE threadid='" . $threadinfo['threadid'] . "'"); } else { $db->query("UPDATE " . PRE . "_forum_threads SET del=1 WHERE threadid='" . $threadinfo['threadid'] . "' LIMIT 1"); $db->query("DELETE FROM " . PRE . "_forum_threads WHERE moved='" . $threadinfo['threadid'] . "' LIMIT 1");
} } //Produkte auslesen if ($_REQUEST['sortby'] == 'release.ASC' || $_REQUEST['sortby'] == 'release.DESC') { $data = $db->fetch("SELECT a.*,min(stamp) AS minrelease,IF(b.prodid IS NULL,0,1) AS isset FROM " . PRE . "_products_coll AS pc JOIN " . PRE . "_products AS a ON pc.prodid=a.id LEFT JOIN " . PRE . "_products_releases AS b ON a.id=b.prodid WHERE pc.userid='" . $userid . "' AND a.active='1' " . $where . " GROUP BY a.id " . getorder($orderdef, 'isset DESC', 1) . " " . getlimit($set['products']['epp'])); } else { $data = $db->fetch("SELECT a.* FROM " . PRE . "_products_coll AS pc JOIN " . PRE . "_products AS a ON pc.prodid=a.id WHERE pc.userid='" . $userid . "' AND active='1' " . $where . getorder($orderdef) . getlimit($set['products']['epp'])); } $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','PRODUCT.MEDIA_ICON'),$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'); }
function links_print($data, $template) { global $set, $db, $apx, $user; $tmpl = new tengine(); $apx->lang->drop('global', 'links'); //Verwendete Variablen auslesen $parse = $apx->tmpl->used_vars($template, 'links'); //Kategorien auslesen if (in_array('LINK.CATTITLE', $parse) || in_array('LINK.CATTEXT', $parse) || in_array('LINK.CATICON', $parse) || in_array('LINK.CATLINK', $parse)) { $catids = get_ids($data, 'catid'); if (count($catids)) { $catdata = $db->fetch("SELECT id,title,text,icon FROM " . PRE . "_links_cat WHERE id IN (" . implode(',', $catids) . ")"); if (count($catdata)) { foreach ($catdata as $catres) { $catinfo[$catres['id']] = $catres; } } } } if (count($data)) { foreach ($data as $res) { ++$i; //Dateillink $link = mklink('links.php?id=' . $res['id'], 'links,id' . $res['id'] . urlformat($res['title']) . '.html'); //Neu? if ($res['starttime'] + $set['links']['new'] * 24 * 3600 >= time()) { $new = 1; } else { $new = 0; } //Goto-Link $gotolink = 'misc.php?action=gotolink&id=' . $res['id'] . iif($apx->section_id(), '&sec=' . $apx->section_id()); //Linkpic if (in_array('LINK.PICTURE', $parse) || in_array('LINK.PICTURE_POPUP', $parse) || in_array('LINK.PICTURE_POPUPPATH', $parse)) { list($picture, $picture_popup, $picture_popuppath) = links_linkpic($res['linkpic']); } //Username + eMail if ($res['userid']) { $author = $res['username']; $author_email = iif(!$res['pub_hidemail'], $res['email']); } else { $author = $res['send_username']; $author_email = $res['send_email']; } //Text $text = ''; if (in_array('LINK.TEXT', $parse)) { $text = mediamanager_inline($res['text']); if ($apx->is_module('glossar')) { $text = glossar_highlight($text); } } //Datehead if ($laststamp != date('Y/m/d', $res['starttime'] - TIMEDIFF)) { $tabledata[$i]['DATEHEAD'] = $res['starttime']; } //Tags if (in_array('LINK.TAG', $parse) || in_array('LINK.TAG_IDS', $parse) || in_array('LINK.KEYWORDS', $parse)) { list($tagdata, $tagids, $keywords) = links_tags($res['id']); } $tabledata[$i]['ID'] = $res['id']; $tabledata[$i]['TITLE'] = $res['title']; $tabledata[$i]['URL'] = $res['url']; $tabledata[$i]['TEXT'] = $text; $tabledata[$i]['LINK'] = $link; $tabledata[$i]['PICTURE'] = $picture; $tabledata[$i]['PICTURE_POPUP'] = $picture_popup; $tabledata[$i]['PICTURE_POPUPPATH'] = $picture_popuppath; $tabledata[$i]['HITS'] = number_format($res['hits'], 0, '', '.'); $tabledata[$i]['TIME'] = $res['starttime']; $tabledata[$i]['TOP'] = $res['top']; $tabledata[$i]['RESTRICTED'] = $res['restricted']; $tabledata[$i]['NEW'] = $new; $tabledata[$i]['GOTO'] = $gotolink; //Tags $tabledata[$i]['TAG'] = $tagdata; $tabledata[$i]['TAG_IDS'] = $tagids; $tabledata[$i]['KEYWORDS'] = $keywords; //Autor $tabledata[$i]['USERID'] = $res['userid']; $tabledata[$i]['USERNAME'] = replace($author); $tabledata[$i]['EMAIL'] = replace($author_email); $tabledata[$i]['EMAIL_ENCRYPTED'] = replace(cryptMail($author_email)); //Kategorien $tabledata[$i]['CATID'] = $res['catid']; $tabledata[$i]['CATTITLE'] = $catinfo[$res['catid']]['title']; $tabledata[$i]['CATTEXT'] = $catinfo[$res['catid']]['text']; $tabledata[$i]['CATICON'] = $catinfo[$res['catid']]['icon']; $tabledata[$i]['CATLINK'] = mklink('links.php?catid=' . $res['catid'], 'links,' . $res['catid'] . ',1' . urlformat($catinfo[$res['catid']]['title']) . '.html'); //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['links']['coms'] && $res['allowcoms']) { require_once BASEDIR . getmodulepath('comments') . 'class.comments.php'; if (!isset($coms)) { $coms = new comments('links', $res['id']); } else { $coms->mid = $res['id']; } $link = mklink('links.php?id=' . $res['id'], 'links,id' . $res['id'] . urlformat($res['title']) . '.html'); $tabledata[$i]['COMMENT_COUNT'] = $coms->count(); $tabledata[$i]['COMMENT_LINK'] = $coms->link($link); $tabledata[$i]['DISPLAY_COMMENTS'] = 1; if (in_template(array('LINK.COMMENT_LAST_USERID', 'LINK.COMMENT_LAST_NAME', 'LINK.COMMENT_LAST_TIME'), $parse)) { $tabledata[$i]['COMMENT_LAST_USERID'] = $coms->last_userid(); $tabledata[$i]['COMMENT_LAST_NAME'] = $coms->last_name(); $tabledata[$i]['COMMENT_LAST_TIME'] = $coms->last_time(); } } //Bewertungen if ($apx->is_module('ratings') && $set['links']['ratings'] && $res['allowrating']) { require_once BASEDIR . getmodulepath('ratings') . 'class.ratings.php'; if (!isset($rate)) { $rate = new ratings('links', $res['id']); } else { $rate->mid = $res['id']; } $tabledata[$i]['RATING'] = $rate->display(); $tabledata[$i]['RATING_VOTES'] = $rate->count(); $tabledata[$i]['DISPLAY_RATING'] = 1; } $laststamp = date('Y/m/d', $res['starttime'] - TIMEDIFF); } } $tmpl->assign('LINK', $tabledata); $tmpl->parse($template, 'links'); }
$orderdef[0] = 'title'; } $orderdef['title'] = array('a.title', 'ASC'); $orderdef['date'] = array('a.starttime', 'DESC'); $orderdef['hits'] = array('a.hits', 'DESC'); $orderdef['user'] = array('b.username', 'ASC'); if ($apx->is_module('ratings')) { $orderdef['rating'] = array('c.rating', 'DESC'); } //Videos Select if ($apx->is_module('ratings') && ($_REQUEST['sortby'] == 'rating.ASC' || $_REQUEST['sortby'] == 'rating.DESC')) { $data = $db->fetch("SELECT a.*,b.username,b.email,b.pub_hidemail,avg(c.rating) AS rating FROM " . PRE . "_videos AS a LEFT JOIN " . PRE . "_user AS b USING(userid) LEFT JOIN " . PRE . "_ratings AS c ON ( c.module='videos' AND a.id=c.mid ) WHERE ( a.status='finished' AND ( '" . time() . "' BETWEEN starttime AND endtime ) AND " . $filter . " " . section_filter() . " ) GROUP BY a.id " . getorder($orderdef) . getlimit($set['videos']['epp'])); } else { $data = $db->fetch("SELECT *,b.username,b.email,b.pub_hidemail FROM " . PRE . "_videos AS a LEFT JOIN " . PRE . "_user AS b USING(userid) WHERE ( a.status='finished' AND ( '" . time() . "' BETWEEN starttime AND endtime ) AND " . $filter . " " . section_filter() . " ) " . getorder($orderdef) . getlimit($set['videos']['epp'])); } $catids = get_ids($data, 'catid'); //Kategorien auslesen, falls notwendig $catinfo = array(); if (count($catids) && in_template(array('VIDEO.CATTITLE', 'VIDEO.CATTEXT', 'VIDEO.CATICON'), $parse)) { $catinfo = videos_catinfo($catids); } if (count($data)) { foreach ($data as $res) { ++$i; //Link $link = mklink('videos.php?id=' . $res['id'], 'videos,id' . $res['id'] . urlformat($res['title']) . '.html'); //Teaserbild if (in_array('VIDEO.PICTURE', $parse) || in_array('VIDEO.PICTURE_POPUP', $parse) || in_array('VIDEO.PICTURE_POPUPPATH', $parse)) { list($picture, $picture_popup, $picture_popuppath) = videos_teaserpic($res['teaserpic']); } //Dateigröße auslesen
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(); }
$docs = $row['DOCS']; $subject = $row['SUBJECT']; $predicate = $row['PREDICATE']; $predicates = array(); $can_preds = explode('|', $predicate); foreach ($can_preds as $can_pred) { if ($can_pred != '') { $predicates[] = $can_pred; } } $object = $row['OBJECT']; $value = $row['VALUE']; $distance = $row['DISTANCE']; $frequency = $row['FREQUENCY']; $subject_ids = get_ids($dbc, $row['SUBJECT']); $object_ids = get_ids($dbc, $row['OBJECT']); } ?> <img width ="100%" src ="img/sad_workspace_logo.jpg"></img> <nav class="navbar navbar-default" role="navigation"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="relation.php?db_name=<?php echo $db_name; ?>
//////////////////////////////////////////////////////////////////////////////////////////////////////// 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']) { $username = $res['username']; $email = iif(!$res['pub_hidemail'], $res['email']); } else {
$link_sendmail = iif(($user->info['userid'] || $set['user']['sendmail_guests']) && $user->info['userid'] != $_REQUEST['id'], mklink('user.php?action=newmail&touser='******'userid'], 'user,newmail,' . $res['userid'] . '.html')); $link_ignore = iif($user->info['userid'] && $user->info['userid'] != $_REQUEST['id'] && !$user->ignore($res['userid'], $reason), mklink('user.php?action=ignorelist&add=1&username='******'username']), 'user,ignorelist.html?add=1&username='******'username']))); $apx->tmpl->assign('LINK_BUDDY', $link_buddy); $apx->tmpl->assign('LINK_SENDPM', $link_sendpm); $apx->tmpl->assign('LINK_SENDEMAIL', $link_sendmail); $apx->tmpl->assign('LINK_IGNORE', $link_ignore); //Links zu anderen Funktionen user_assign_profile_links($apx->tmpl, $res); //Inhalt melden $link_report = "javascript:popupwin('user.php?action=report&contentid=profile:" . $_REQUEST['id'] . "',500,300);"; $apx->tmpl->assign('LINK_REPORT', $link_report); //Buddyliste $userdata = array(); if ($res['pub_showbuddies'] && in_array('BUDDY', $parse)) { $data = $db->fetch("SELECT friendid FROM " . PRE . "_user_friends WHERE userid='" . $res['userid'] . "'"); $buddies = get_ids($data, 'friendid'); if (count($buddies)) { $data = $db->fetch("SELECT userid,username,groupid,reg_time,realname,gender,city,plz,country,city,lastactive,pub_invisible,avatar,avatar_title,birthday,pub_hidemail FROM " . PRE . "_user WHERE userid IN (" . implode(',', $buddies) . ") ORDER BY username ASC"); if (count($data)) { foreach ($data as $res) { ++$i; $age = 0; if ($res['birthday']) { $bd = explode('-', $res['birthday']); $birthday = intval($bd[0]) . '. ' . getcalmonth($bd[1]) . iif($bd[2], ' ' . $bd[2]); if ($bd[2]) { $age = date('Y') - $bd[2]; if (intval(sprintf('%02d%02d', $bd[1], $bd[0])) > intval(date('md'))) { $age -= 1; } }
function downloads_print($data, $template) { global $set, $db, $apx, $user; $tmpl = new tengine(); $apx->lang->drop('global', 'downloads'); //Verwendete Variablen auslesen $parse = $apx->tmpl->used_vars($template, 'downloads'); //Kategorien auslesen if (in_array('DOWNLOAD.CATTITLE', $parse) || in_array('DOWNLOAD.CATTEXT', $parse) || in_array('DOWNLOAD.CATICON', $parse) || in_array('DOWNLOAD.CATLINK', $parse)) { $catids = get_ids($data, 'catid'); if (count($catids)) { $catdata = $db->fetch("SELECT id,title,text,icon FROM " . PRE . "_downloads_cat WHERE id IN (" . implode(',', $catids) . ")"); if (count($catdata)) { foreach ($catdata as $catres) { $catinfo[$catres['id']] = $catres; } } } } //User auslesen $userinfo = array(); if (in_template(array('DOWNLOAD.UPLOADER', 'DOWNLOAD.UPLOADER_EMAIL', 'DOWNLOAD.UPLOADER_EMAIL_ENCRYPTED'), $parse)) { $userids = get_ids($data, 'userid'); if ($userids) { $userinfo = $db->fetch_index("\n\t\t\t\tSELECT userid, username, email, pub_hidemail\n\t\t\t\tFROM " . PRE . "_user\n\t\t\t\tWHERE userid IN (" . implode(',', $userids) . ")\n\t\t\t", 'userid'); } } if (count($data)) { foreach ($data as $res) { ++$i; //Link $link = mklink('downloads.php?id=' . $res['id'], 'downloads,id' . $res['id'] . urlformat($res['title']) . '.html'); //Teaserbild if (in_array('DOWNLOAD.TEASERPIC', $parse) || in_array('DOWNLOAD.TEASERPIC_POPUP', $parse) || in_array('DOWNLOAD.TEASERPIC_POPUPPATH', $parse)) { list($picture, $picture_popup, $picture_popuppath) = downloads_teaserpic($res['teaserpic']); } //Dateigröße auslesen if (in_array('DOWNLOAD.SIZE', $parse)) { $thefsize = downloads_filesize($res); } //Download-Link if (!$set['downloads']['regonly'] && !$res['regonly'] || $user->info['userid']) { $sechash = md5($_SERVER['HTTP_HOST'] . $res['file'] . date('Y/m/d', time() - TIMEDIFF)); $dllink = 'misc.php?action=downloadfile&id=' . $res['id'] . '&sechash=' . $sechash . iif($apx->section_id(), '&sec=' . $apx->section_id()); } else { $dllink = mklink('user.php', 'user.html'); } //Bilder if (in_array('DOWNLOAD.PICTURE', $parse)) { $picdata = downloads_pictures($res['pictures']); } //Neu? if ($res['addtime'] + $set['downloads']['new'] * 24 * 3600 >= time()) { $new = 1; } else { $new = 0; } //Username + eMail if ($res['userid']) { $userdata = $userinfo[$res['userid']]; $uploader = $userdata['username']; $uploader_email = iif(!$userdata['pub_hidemail'], $userdata['email']); } else { $uploader = $res['send_username']; $uploader_email = $res['send_email']; } //Datehead if ($laststamp != date('Y/m/d', $res['starttime'] - TIMEDIFF)) { $tabledata[$i]['DATEHEAD'] = $res['starttime']; } //Text $text = ''; if (in_array('DOWNLOAD.TEXT', $parse)) { $text = mediamanager_inline($res['text']); if ($apx->is_module('glossar')) { $text = glossar_highlight($text); } } //Tags if (in_array('DOWNLOAD.TAG', $parse) || in_array('DOWNLOAD.TAG_IDS', $parse) || in_array('DOWNLOAD.KEYWORDS', $parse)) { list($tagdata, $tagids, $keywords) = downloads_tags($res['id']); } $tabledata[$i]['ID'] = $res['id']; $tabledata[$i]['SECID'] = $res['secid']; $tabledata[$i]['TITLE'] = $res['title']; $tabledata[$i]['TEXT'] = $text; $tabledata[$i]['LINK'] = $link; $tabledata[$i]['TEASERPIC'] = $picture; $tabledata[$i]['TEASERPIC_POPUP'] = $picture_popup; $tabledata[$i]['TEASERPIC_POPUPPATH'] = $picture_popuppath; $tabledata[$i]['SIZE'] = downloads_getsize($thefsize); $tabledata[$i]['FORMAT'] = downloads_getformat($res); $tabledata[$i]['HITS'] = number_format($res['hits'], 0, '', '.'); $tabledata[$i]['TIME'] = $res['starttime']; $tabledata[$i]['PICTURE'] = $picdata; $tabledata[$i]['TOP'] = $res['top']; $tabledata[$i]['RESTRICTED'] = $res['restricted']; $tabledata[$i]['NEW'] = $new; $tabledata[$i]['DOWNLOADLINK'] = $dllink; //Tags $tabledata[$i]['TAG'] = $tagdata; $tabledata[$i]['TAG_IDS'] = $tagids; $tabledata[$i]['KEYWORDS'] = $keywords; //Kategorien $tabledata[$i]['CATID'] = $res['catid']; $tabledata[$i]['CATTITLE'] = $catinfo[$res['catid']]['title']; $tabledata[$i]['CATTEXT'] = $catinfo[$res['catid']]['text']; $tabledata[$i]['CATICON'] = $catinfo[$res['catid']]['icon']; $tabledata[$i]['CATLINK'] = mklink('downloads.php?catid=' . $res['catid'], 'downloads,' . $res['catid'] . ',1' . urlformat($catinfo[$res['catid']]['title']) . '.html'); //Produkt $tabledata[$i]['PRODUCT_ID'] = $res['prodid']; //Uploader $tabledata[$i]['UPLOADER_ID'] = $res['userid']; $tabledata[$i]['UPLOADER'] = replace($uploader); $tabledata[$i]['UPLOADER_EMAIL'] = replace($uploader_email); $tabledata[$i]['UPLOADER_EMAIL_ENCRYPTED'] = replace(cryptMail($uploader_email)); //Autor $tabledata[$i]['AUTHOR'] = replace($res['author']); $tabledata[$i]['AUTHOR_LINK'] = replace($res['author_link']); //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['downloads']['coms'] && $res['allowcoms']) { require_once BASEDIR . getmodulepath('comments') . 'class.comments.php'; if (!isset($coms)) { $coms = new comments('downloads', $res['id']); } else { $coms->mid = $res['id']; } $link = mklink('downloads.php?id=' . $res['id'], 'downloads,id' . $res['id'] . urlformat($res['title']) . ',1.html'); $tabledata[$i]['COMMENT_COUNT'] = $coms->count(); $tabledata[$i]['COMMENT_LINK'] = $coms->link($link); $tabledata[$i]['DISPLAY_COMMENTS'] = 1; if (in_template(array('DOWNLOAD.COMMENT_LAST_USERID', 'DOWNLOAD.COMMENT_LAST_NAME', 'DOWNLOAD.COMMENT_LAST_TIME'), $parse)) { $tabledata[$i]['COMMENT_LAST_USERID'] = $coms->last_userid(); $tabledata[$i]['COMMENT_LAST_NAME'] = $coms->last_name(); $tabledata[$i]['COMMENT_LAST_TIME'] = $coms->last_time(); } } //Bewertungen if ($apx->is_module('ratings') && $set['downloads']['ratings'] && $res['allowrating']) { require_once BASEDIR . getmodulepath('ratings') . 'class.ratings.php'; if (!isset($rate)) { $rate = new ratings('downloads', $res['id']); } else { $rate->mid = $res['id']; } $tabledata[$i]['RATING'] = $rate->display(); $tabledata[$i]['RATING_VOTES'] = $rate->count(); $tabledata[$i]['DISPLAY_RATING'] = 1; } $laststamp = date('Y/m/d', $res['starttime'] - TIMEDIFF); } } $tmpl->assign('DOWNLOAD', $tabledata); $tmpl->parse($template, 'downloads'); }
function gallery() { global $set, $apx, $db, $html; $_REQUEST['userid'] = (int) $_REQUEST['userid']; //AKTIONEN if ($_REQUEST['do'] == 'edit') { return $this->gallery_edit(); } elseif ($_REQUEST['do'] == 'del') { return $this->gallery_del(); } elseif ($_REQUEST['do'] == 'pics') { return $this->gallery_pics(); } $orderdef[0] = 'update'; $orderdef['name'] = array('title', 'ASC', 'COL_TITLE'); $orderdef['addtime'] = array('addtime', 'DESC', 'COL_ADDTIME'); $orderdef['update'] = array('lastupdate', 'DESC', 'COL_LASTUPDATE'); if ($_REQUEST['userid']) { $col[] = array('COL_TITLE', 60, ''); $col[] = array('COL_PICS', 10, 'align="center"'); $col[] = array('COL_ADDTIME', 15, 'align="center"'); $col[] = array('COL_LASTUPDATE', 15, 'align="center"'); } else { $col[] = array('COL_TITLE', 40, 'class="title"'); $col[] = array('COL_PICS', 10, 'align="center"'); $col[] = array('COL_ADDTIME', 15, 'align="center"'); $col[] = array('COL_LASTUPDATE', 15, 'align="center"'); $col[] = array('COL_OWNER', 20, 'align="center"'); } //Benuternamen als Titel ausgeben if ($_REQUEST['userid']) { list($username) = $db->first("SELECT username FROM " . PRE . "_user WHERE userid='" . $_REQUEST['userid'] . "' LIMIT 1"); echo '<h2>' . $apx->lang->get('GALLERYOF') . ' ' . $username . '</h2>'; } if ($_REQUEST['userid']) { $ownerfilter = " AND owner='" . $_REQUEST['userid'] . "' "; } else { $ownerfilter = ''; } list($count) = $db->first("SELECT count(id) FROM " . PRE . "_user_gallery WHERE 1 " . $ownerfilter); pages('action.php?action=gallery.show&sortby=' . $_REQUEST['sortby'], $count); $data = $db->fetch("SELECT id,title,addtime,lastupdate,owner,allowcoms FROM " . PRE . "_user_gallery WHERE 1 " . $ownerfilter . " " . getorder($orderdef) . getlimit()); if (count($data)) { //Owner-Namen auslesen if (!$_REQUEST['userid']) { $userids = get_ids($data, 'owner'); $usernames = $db->fetch_index("SELECT userid,username FROM " . PRE . "_user WHERE userid IN (" . implode(',', $userids) . ")", 'userid'); } foreach ($data as $res) { ++$i; //Anzahl Bilder list($pics) = $db->first("SELECT count(*) FROM " . PRE . "_user_pictures WHERE galid='" . $res['id'] . "'"); $link = mklink('user.php?action=gallery&id=' . $res['owner'] . '&galid=' . $res['id'], 'user,gallery,' . $res['owner'] . ',' . $res['id'] . ',0.html', iif($set['main']['forcesection'], $apx->section_default, 0)); $tabledata[$i]['COL1'] = '<a href="' . $link . '" target="_blank">' . replace($res['title']) . '</a>'; $tabledata[$i]['COL2'] = number_format($pics, 0, ',', '.'); $tabledata[$i]['COL3'] = mkdate($res['addtime'], '<br />'); $tabledata[$i]['COL4'] = mkdate($res['lastupdate'], '<br />'); if (!$_REQUEST['userid']) { $ownername = $usernames[$res['owner']]['username']; $ownerprofile = mklink('user.php?action=profile&id=' . $res['owner'], 'user,profile,' . $res['owner'] . urlformat($res['username']) . '.html', iif($set['main']['forcesection'], $apx->section_default, 0)); $tabledata[$i]['COL5'] = '<a href="' . $ownerprofile . '" target="_blank">' . replace($ownername) . '</a>'; } $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'user.gallery', 'userid=' . $_REQUEST['userid'] . '&do=edit&id=' . $res['id'], $apx->lang->get('CORE_EDIT')); $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', 'user.gallery', 'userid=' . $_REQUEST['userid'] . '&do=del&id=' . $res['id'], $apx->lang->get('CORE_DEL')); $tabledata[$i]['OPTIONS'] .= optionHTML('pic.gif', 'user.gallery', 'userid=' . $_REQUEST['userid'] . '&do=pics&galid=' . $res['id'], $apx->lang->get('SHOWPICS')); '<a href="action.php?action=user.gallery&userid=' . $_REQUEST['userid'] . '&do=pics&galid=' . $res['id'] . '"><img src="design/pic.gif" title="' . $apx->lang->get('SHOWPICS') . '" alt="' . $apx->lang->get('SHOWPICS') . '" style="vertical-align:middle;" /></a>'; //Kommentare + Bewertungen if ($apx->is_module('comments')) { $tabledata[$i]['OPTIONS'] .= ' '; list($comments) = $db->first("SELECT count(id) FROM " . PRE . "_comments WHERE ( module='usergallery' AND mid='" . $res['id'] . "' )"); if ($comments && $apx->is_module('comments') && $res['allowcoms'] && $apx->user->has_right('comments.show')) { $tabledata[$i]['OPTIONS'] .= optionHTML('comments.gif', 'comments.show', 'module=usergallery&mid=' . $res['id'], $apx->lang->get('COMMENTS') . ' (' . $comments . ')'); } else { $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />'; } } } } $apx->tmpl->assign('TABLE', $tabledata); $html->table($col, $factions); orderstr($orderdef, 'action.php?action=user.gallery&userid=' . $_REQUEST['userid']); save_index($_SERVER['REQUEST_URI']); }
function calendar_print($data, $template) { global $set, $db, $apx, $user; $tmpl = new tengine(); $parse = $tmpl->used_vars($template, 'calendar'); //Kategorie-Info $catids = get_ids($data, 'catid'); $catdata = array(); if (count($catids)) { $catdata = $db->fetch_index("SELECT * FROM " . PRE . "_calendar_cat WHERE id IN (" . implode(',', $catids) . ")", 'id'); } //Termine auflisten if (count($data)) { foreach ($data as $res) { ++$i; $event = array(); //Kategorie-Info $catinfo = $catdata[$res['catid']]; //Link zum Termin $link = mklink('events.php?id=' . $res['id'], 'events,id' . $res['id'] . urlformat($res['title']) . '.html'); //Aufmacher $picture = $picture_popup = ''; if (in_template(array('EVENT.PICTURE', 'EVENT.PICTURE_POPUP', 'EVENT.PICTURE_POPUPPATH'), $parse)) { list($picture, $picture_popup, $picture_popuppath) = calendar_pic($res['picture']); } //Start berechnen $startday = $starttime = $endday = $endtime = 0; if (in_template(array('EVENT.STARTDAY', 'EVENT.STARTTIME'), $parse)) { $startday = calendar_stamp2time($res['startday']); if ($res['starttime'] != -1) { $time_comp = calendar_explode_stamp($res['startday']); $tmpstamp = sprintf('%04d', $res['starttime']); $time_comp['hour'] = substr($tmpstamp, 0, 2); $time_comp['minute'] = substr($tmpstamp, 2, 2); $starttime = mktime($time_comp['hour'], $time_comp['minute'], 0, $time_comp['month'], $time_comp['day'], $time_comp['year']) + TIMEDIFF; } } //Ende berechnen (falls nötig) if (in_template(array('EVENT.ENDDAY', 'EVENT.ENDTIME'), $parse)) { if ($res['endday'] != $res['startday'] || $res['endtime'] != -1) { $endday = calendar_stamp2time($res['endday']); if ($res['endtime'] != -1) { $time_comp = calendar_explode_stamp($res['endday']); $tmpstamp = sprintf('%04d', $res['endtime']); $time_comp['hour'] = substr($tmpstamp, 0, 2); $time_comp['minute'] = substr($tmpstamp, 2, 2); $endtime = mktime($time_comp['hour'], $time_comp['minute'], 0, $time_comp['month'], $time_comp['day'], $time_comp['year']) + TIMEDIFF; } } } //Username + eMail if ($res['userid']) { $username = $res['username']; $email = iif(!$res['pub_hidemail'], $res['email']); } else { $username = $res['send_username']; $email = $res['send_email']; } //Text $eventtext = ''; if (in_array('EVENT.TEXT', $parse)) { $eventtext = mediamanager_inline($res['text']); if ($apx->is_module('glossar')) { $eventtext = glossar_highlight($eventtext); } } //Datehead if ($laststamp != $res['startday']) { $event['DATEHEAD'] = $startday; } //Tags if (in_array('EVENT.TAG', $parse) || in_array('EVENT.TAG_IDS', $parse) || in_array('EVENT.KEYWORDS', $parse)) { list($tagdata, $tagids, $keywords) = calendar_tags($res['id']); } $event['ID'] = $res['id']; $event['TITLE'] = $res['title']; $event['TEXT'] = $eventtext; $event['LINK'] = $link; $event['LOCATION'] = compatible_hsc($res['location']); $event['LOCATION_LINK'] = compatible_hsc($res['location_link']); $event['PRIORITY'] = $res['priority']; $event['RESTRICTED'] = $res['restricted']; $event['PRIVATE'] = $res['private']; $event['HITS'] = $res['hits']; $event['RELATED'] = calendar_links($res['links']); $event['PICTURE'] = $picture; $event['PICTURE_POPUP'] = $picture_popup; $event['PICTURE_POPUPPATH'] = $picture_popuppath; $event['STARTDAY'] = $startday; $event['STARTTIME'] = $starttime; $event['ENDDAY'] = $endday; $event['ENDTIME'] = $endtime; $event['USERID'] = $res['userid']; $event['USERNAME'] = replace($username); $event['EMAIL'] = replace($email); $event['EMAIL_ENCRYPTED'] = replace(cryptMail($email)); $event['CATID'] = $res['catid']; $event['CATTITLE'] = $catinfo['title']; $event['CATICON'] = $catinfo['icon']; //Tags $event['TAG'] = $tagdata; $event['TAG_IDS'] = $tagids; $event['KEYWORDS'] = $keywords; //Galerie if ($apx->is_module('gallery') && $res['galid'] && !$res['private'] && in_template(array('EVENT.GALLERY_ID', 'EVENT.GALLERY_TITLE', 'EVENT.GALLERY_LINK'), $parse)) { $galinfo = gallery_info($res['galid']); $event['GALLERY_ID'] = $galinfo['id']; $event['GALLERY_TITLE'] = $galinfo['title']; $event['GALLERY_LINK'] = mklink('gallery.php?id=' . $galinfo['id'], 'gallery,list' . $galinfo['id'] . ',1' . urlformat($galinfo['title']) . '.html'); } //Kommentare if ($apx->is_module('comments') && $set['calendar']['coms'] && $res['allowcoms']) { require_once BASEDIR . getmodulepath('comments') . 'class.comments.php'; if (!isset($coms)) { $coms = new comments('calendar', $res['id']); } else { $coms->mid = $res['id']; } $link = mklink('events.php?id=' . $res['id'], 'events,id' . $res['id'] . urlformat($res['title']) . '.html'); $event['COMMENT_COUNT'] = $coms->count(); $event['COMMENT_LINK'] = $coms->link($link); $event['DISPLAY_COMMENTS'] = 1; if (in_template(array('EVENT.COMMENT_LAST_USERID', 'EVENT.COMMENT_LAST_NAME', 'EVENT.COMMENT_LAST_TIME'), $parse)) { $event['COMMENT_LAST_USERID'] = $coms->last_userid(); $event['COMMENT_LAST_NAME'] = $coms->last_name(); $event['COMMENT_LAST_TIME'] = $coms->last_time(); } } $eventdata[$i] = $event; $laststamp = $res['startday']; } } $tmpl->assign('EVENT', $eventdata); $tmpl->parse($template, 'calendar'); }
<?php $apx->lang->drop('ignorelist'); headline($apx->lang->get('HEADLINE_IGNORELIST'), str_replace('&', '&', $_SERVER['REQUEST_URI'])); titlebar($apx->lang->get('HEADLINE_IGNORELIST')); $_REQUEST['del'] = (int) $_REQUEST['del']; if ($_REQUEST['add']) { if ($_POST['send']) { if (!$_POST['username']) { message('back'); } else { list($userid) = $db->first("SELECT userid FROM " . PRE . "_user WHERE LOWER(username)='" . addslashes(strtolower($_POST['username'])) . "'"); $data = $db->fetch("SELECT ignored FROM " . PRE . "_user_ignore WHERE userid='" . $user->info['userid'] . "'"); $existing = get_ids($data, 'ignored'); if (!$userid) { message($apx->lang->get('MSG_NOMATCH'), 'back'); } elseif (in_array($userid, $existing)) { message($apx->lang->get('MSG_EXISTS'), 'back'); } elseif ($userid == $user->info['userid']) { message($apx->lang->get('MSG_NOTSELF'), 'back'); } else { $db->query("INSERT INTO " . PRE . "_user_ignore (userid,ignored,reason) VALUES ('" . $user->info['userid'] . "','" . $userid . "','" . addslashes($_POST['reason']) . "')"); $goto = mklink('user.php?action=ignorelist', 'user,ignorelist.html'); message($apx->lang->get('MSG_ADD_OK'), $goto); } } } else { tmessage('addignore', array('USERNAME' => compatible_hsc($_REQUEST['username']))); } } elseif ($_REQUEST['del']) { if ($_POST['del']) {
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']); }
$db->query($query); } case 110: //zu 1.1.1 //Indizes entfernen clearIndices(PRE . '_forum_threads'); $mysql = "\n\t\t\t\tALTER TABLE `apx_forum_threads` ADD INDEX ( `forumid` , `del` ) ;\n\t\t\t"; $queries = split_sql($mysql); foreach ($queries as $query) { $db->query($query); } case 111: //zu 1.2.0 //Beiträge gelöschter Themen als nicht-gelöscht markieren $data = $db->fetch("SELECT threadid FROM " . PRE . "_forum_threads WHERE del!=0"); $threadIds = get_ids($data, 'threadid'); if ($threadIds) { $db->query("UPDATE " . PRE . "_forum_posts SET del=0 WHERE threadid IN (" . implode(',', $threadIds) . ")"); } $mysql = "\n\t\t\t\tALTER TABLE `apx_forums` ADD `stylesheet` TINYTEXT NOT NULL AFTER `inherit` ;\n\t\t\t\tALTER TABLE `apx_forum_threads` ADD `prefix` INT( 11 ) UNSIGNED NOT NULL AFTER `forumid` ;\n\t\t\t\tALTER TABLE `apx_forum_attachments` ADD `thumbnail` TINYTEXT NOT NULL AFTER `file` ; \n\t\t\t\tALTER TABLE `apx_forums` ADD `lastpost` INT( 11 ) UNSIGNED NOT NULL AFTER `children` ;\n\t\t\t\tALTER TABLE `apx_forums` ADD `lastthread` INT( 11 ) UNSIGNED NOT NULL AFTER `lastposttime` , ADD `lastthread_title` TINYTEXT NOT NULL AFTER `lastthread`, ADD `lastthread_icon` INT( 11 ) NOT NULL DEFAULT '-1' AFTER `lastthread_title` , ADD `lastthread_prefix` INT( 11 ) UNSIGNED NOT NULL AFTER `lastthread_icon` ;\n\t\t\t\t\n\t\t\t\tINSERT INTO `apx_cron` VALUES ('clean', 'forum', '86400', '1268002800', '');\n\t\t\t\t\n\t\t\t\tCREATE TABLE `apx_forum_activity` (\n\t\t\t\t `userid` int(11) unsigned NOT NULL,\n\t\t\t\t `ip` int(11) unsigned NOT NULL,\n\t\t\t\t `type` enum('forum','thread') NOT NULL,\n\t\t\t\t `id` int(11) unsigned NOT NULL,\n\t\t\t\t `time` int(11) unsigned NOT NULL,\n\t\t\t\t `invisible` tinyint(1) unsigned NOT NULL,\n\t\t\t\t PRIMARY KEY (`userid`,`ip`,`type`,`id`)\n\t\t\t\t) ENGINE=MyISAM;\n\t\t\t\t\n\t\t\t\tCREATE TABLE `apx_forum_anndisplay` (\n\t\t\t\t `id` int(11) unsigned NOT NULL,\n\t\t\t\t `forumid` int(11) unsigned NOT NULL,\n\t\t\t\t PRIMARY KEY (`id`,`forumid`)\n\t\t\t\t) ENGINE=MyISAM;\n\t\t\t\t\n\t\t\t\tCREATE TABLE `apx_forum_announcements` (\n\t\t\t\t `id` int(11) unsigned NOT NULL auto_increment,\n\t\t\t\t `userid` int(11) unsigned NOT NULL,\n\t\t\t\t `title` varchar(255) NOT NULL default '',\n\t\t\t\t `text` text NOT NULL,\n\t\t\t\t `addtime` int(11) unsigned NOT NULL,\n\t\t\t\t `starttime` int(11) unsigned NOT NULL,\n\t\t\t\t `endtime` int(11) unsigned NOT NULL,\n\t\t\t\t `views` int(11) unsigned NOT NULL default '0',\n\t\t\t\t PRIMARY KEY (`id`),\n\t\t\t\t KEY `starttime` (`starttime`,`endtime`)\n\t\t\t\t) ENGINE=MyISAM ;\n\t\t\t\t\n\t\t\t\tCREATE TABLE `apx_forum_prefixes` (\n\t\t\t\t `prefixid` int(11) unsigned NOT NULL auto_increment,\n\t\t\t\t `forumid` int(11) unsigned NOT NULL,\n\t\t\t\t `title` tinytext NOT NULL,\n\t\t\t\t `code` tinytext NOT NULL,\n\t\t\t\t PRIMARY KEY (`prefixid`)\n\t\t\t\t) ENGINE=MyISAM ;\n\t\t\t"; $queries = split_sql($mysql); foreach ($queries as $query) { $db->query($query); } //Anhänge aktualisieren $attachments = ''; $data = $db->fetch("\n\t\t\t\tSELECT id, file FROM\n\t\t\t\t" . PRE . "_forum_attachments\n\t\t\t"); if (count($data)) { require BASEDIR . 'lib/class.mediamanager.php'; require BASEDIR . 'lib/class.image.php'; $mm = new mediamanager();
sendmail($email, 'SENDENTRY', $input); } } //Weiterleitung message($apx->lang->get('MSG_OK'), mklink('user.php?action=guestbook&id=' . $_REQUEST['id'], 'user,guestbook,' . $_REQUEST['id'] . ',1.html')); } } else { //Seitenzahlen list($count) = $db->first("SELECT count(id) FROM " . PRE . "_user_guestbook WHERE owner='" . $_REQUEST['id'] . "'"); pages(mklink('user.php?action=guestbook&id=' . $_REQUEST['id'], 'user,guestbook,' . $_REQUEST['id'] . ',{P}.html'), $count, $set['user']['guestbook_epp']); //Einträge auslesen $tabledata = array(); $data = $db->fetch("SELECT * FROM " . PRE . "_user_guestbook WHERE owner='" . $_REQUEST['id'] . "' ORDER BY time DESC " . getlimit($set['user']['guestbook_epp'])); $entrynumber = $count - ($_REQUEST['p'] - 1) * $set['user']['guestbook_epp']; //Benutzer-Info $userids = get_ids($data, 'userid'); $userinfo = array(); if (count($userids)) { $userinfo = $user->get_info_multi($userids, 'username,email,pub_hidemail,homepage,avatar,avatar_title,signature,lastactive,pub_invisible'); } if (count($data)) { foreach ($data as $res) { ++$i; //Benutzer $tabledata[$i]['USERID'] = $res['userid']; $tabledata[$i]['NAME'] = replace($userinfo[$res['userid']]['username']); $tabledata[$i]['EMAIL'] = replace(iif(!$userinfo[$res['userid']]['pub_hidemail'], $userinfo[$res['userid']]['email'])); $tabledata[$i]['EMAIL_ENCRYPTED'] = replace(iif(!$userinfo[$res['userid']]['pub_hidemail'], cryptMail($userinfo[$res['userid']]['email']))); $tabledata[$i]['HOMEPAGE'] = replace($userinfo[$res['userid']]['homepage']); $tabledata[$i]['AVATAR'] = $user->mkavatar($userinfo[$res['userid']]); $tabledata[$i]['AVATAR_TITLE'] = $user->mkavtitle($userinfo[$res['userid']]);