function togglestate() { global $apx, $db, $set; $id = (int) $_REQUEST['id']; $status = (int) $_REQUEST['status']; if (!$id) { terminate(); } $open = $apx->session->get('news_cat_open'); $open = array_map('intval', dash_unserialize($open)); if (!is_array($open)) { $open = array(); } if ($status) { if (!in_array($id, $open)) { $open[] = $id; } } else { $index = array_search($id, $open); if ($index !== false) { unset($open[$index]); } } $apx->session->set('news_cat_open', dash_serialize($open)); }
function forum_get_readable($maxlevel = 999999999, $parents = '|', $inherit = array(), $level = 1) { global $set, $db, $apx, $inheritfields; $forumlist = array(); $data = $db->fetch("SELECT forumid,inherit,moderator,right_read,forumid AS password_fromid,children FROM " . PRE . "_forums WHERE parents='" . addslashes($parents) . "' ORDER BY ord ASC"); if (!count($data)) { return array(); } //Für jedes Forum Unterforen auslesen foreach ($data as $res) { $res['level'] = $level; $res['moderator'] = dash_unserialize($res['moderator']); if ($res['inherit']) { $res = array_merge($res, $inherit); } //Rechte erben $foruminfo = $res; //Rechte prüfen if (!forum_access_read($res)) { $foruminfo['forumid'] = 0; } $forumlist[] = $foruminfo; //Vererbbare Rechte nach unten weitergeben $handdown['right_read'] = $res['right_read']; //Unterforen auslesen if ($level < $maxlevel && $res['children'] && $res['children'] != '|') { $forumlist = array_merge($forumlist, forum_get_readable($maxlevel, $parents . $res['forumid'] . '|', $handdown, $level + 1)); } } return $forumlist; }
function getTwitterSectionTitle($secid) { global $apx; if ($secid == 'all') { return $apx->lang->get('ALL'); } $secids = dash_unserialize($secid); if (count($secids) == 1) { return $apx->sections[$secids[0]]['title']; } else { return $apx->lang->get('MULTI'); } }
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'); }
//config Update updateConfig('newsletter', "\n\t\t\t\tINSERT INTO `apx_config` (`module`, `varname`, `type`, `addnl`, `value`, `tab`, `lastchange`, `ord`) VALUES\n\t\t\t\t('newsletter', 'regcode', 'switch', '', '1', '', 1206302365, 1000),\n\t\t\t\t('newsletter', 'sig_text', 'string', 'MULTILINE', '', '', 1206302365, 2000),\n\t\t\t\t('newsletter', 'sig_html', 'string', 'MULTILINE', '', '', 1206302365, 3000),\n\t\t\t\t('newsletter', 'categories', 'array', 'BLOCK', 'a:0:{}', '', 0, 4000);\n\t\t\t"); case 110: //zu 1.1.1 $mysql = "\n\t\t\t\tCREATE TABLE `apx_newsletter_emails_cat` (\n\t\t\t\t `eid` int(10) unsigned NOT NULL,\n\t\t\t\t `catid` int(10) unsigned NOT NULL,\n\t\t\t\t `active` tinyint(1) unsigned NOT NULL,\n\t\t\t\t `html` tinyint(1) unsigned NOT NULL,\n\t\t\t\t `incode` varchar(10) NOT NULL,\n\t\t\t\t `outcode` varchar(10) NOT NULL,\n\t\t\t\t PRIMARY KEY (`eid`,`catid`),\n\t\t\t\t KEY `active` (`active`)\n\t\t\t\t) ENGINE=MyISAM ;\n\t\t\t"; $queries = split_sql($mysql); foreach ($queries as $query) { $db->query($query); } $catinfo = $set['newsletter']['categories']; if (!is_array($catinfo)) { $catinfo = array(); } $allIds = array_keys($catinfo); //Catids in eigene Tabelle schreiben $data = $db->fetch("\n\t\t\t\tSELECT id, catids, regcode, html\n\t\t\t\tFROM " . PRE . "_newsletter_emails\n\t\t\t"); foreach ($data as $res) { //Kategorie-IDs if ($res['catids'] == 'all') { $ids = $allIds; } else { $ids = dash_unserialize($res['catids']); } //Eintragen foreach ($ids as $id) { $db->query("\n\t\t\t\t\t\tINSERT INTO " . PRE . "_newsletter_emails_cat\n\t\t\t\t\t\t(eid, catid, active, html, incode) VALUES\n\t\t\t\t\t\t('" . $res['id'] . "', '" . $id . "', '" . ($res['regcode'] ? 0 : 1) . "', '" . $res['html'] . "', '" . addslashes($res['regcode']) . "')\n\t\t\t\t\t"); } } $db->query("ALTER TABLE " . PRE . "_newsletter_emails DROP regcode, DROP catids, DROP html"); } }
$forumdata['LASTPOST_USERNAME'] = replace($res['lastposter']); $forumdata['LASTPOST_USERID'] = $res['lastposter_userid']; $forumdata['LASTPOST_TIME'] = $res['lastposttime']; $forumdata['LASTPOST_LINK'] = 'thread.php?id=' . $res['lastthread'] . '&goto=lastpost'; $forumdata['LASTPOST_ICON'] = $icon; } return $forumdata; } //Forum-Liste abarbeiten $forumRec = array(); if (count($data)) { //Erzeuge eine rekursive Datenstruktur $superForum = array(); foreach ($data as $key => $res) { $right_visible = dash_unserialize($res['right_visible']); $right_read = dash_unserialize($res['right_read']); //Foren, die der Benutzer nicht lesen darf überspringen if (!forum_access_visible($res)) { continue; } //Level 1 Foren in die Liste schreiben if ($res['level'] == 1) { $forumRec[] =& $data[$key]; } //Letztes Forum pro Level merken $superForum[$res['level']] =& $data[$key]; //Beim übergeordneten Forum hinzufügen if (isset($superForum[$res['level'] - 1])) { $superForum[$res['level'] - 1]['subforums'][] =& $data[$key]; } }
function show() { global $set, $db, $apx, $html; //Struktur reparieren if ($_REQUEST['repair']) { $this->cat->repair(); echo 'Repair done!'; return; } quicklink('faq.add'); //DnD-Hinweis if ($apx->user->has_right('faq.edit')) { echo '<p class="hint">' . $apx->lang->get('USEDND') . '</p>'; } $col[] = array('', 1, ''); $col[] = array('COL_QUESTION', 80, 'class="title"'); $col[] = array('COL_HITS', 20, 'align="center"'); $prefix = array(); $data = $this->cat->getTree(array('*')); if (count($data)) { //Ausgabe erfolgt foreach ($data as $res) { ++$i; if ($res['starttime']) { $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') . '" />'; } $link = mklink('faq.php?id=' . $res['id'], 'faq,' . $res['id'] . urlformat($res['question']) . '.html'); $tabledata[$i]['COL2'] = '<a href="' . $link . '" target="_blank">' . replace($res['question']) . '</a>'; $tabledata[$i]['COL3'] = number_format($res['hits'], 0, '', '.'); $tabledata[$i]['CLASS'] = 'l' . ($res['level'] - 1) . ($res['children'] ? ' haschildren' : '') . ($res['level'] > 1 ? ' hidden' : ''); $tabledata[$i]['ID'] = 'node:' . $res['id']; //Optionen if ($apx->user->has_right('faq.edit')) { $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'faq.edit', 'id=' . $res['id'], $apx->lang->get('CORE_EDIT')); } else { $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />'; } if ($apx->user->has_right('faq.del')) { $tabledata[$i]['OPTIONS'] .= '<span class="ifhasnochildren">' . optionHTMLOverlay('del.gif', 'faq.del', 'id=' . $res['id'], $apx->lang->get('CORE_DEL')) . '</span><span class="ifhaschildren"><img alt="" src="design/ispace.gif"/></span>'; } else { $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />'; } if ($apx->user->has_right('faq.enable') && !$res['starttime']) { $tabledata[$i]['OPTIONS'] .= optionHTML('enable.gif', 'faq.enable', 'id=' . $res['id'] . '§oken=' . $apx->session->get('sectoken'), $apx->lang->get('CORE_ENABLE')); } elseif ($apx->user->has_right('faq.disable') && $res['starttime']) { $tabledata[$i]['OPTIONS'] .= optionHTML('disable.gif', 'faq.disable', 'id=' . $res['id'] . '§oken=' . $apx->session->get('sectoken'), $apx->lang->get('CORE_DISABLE')); } else { $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />'; } /*$tabledata[$i]['OPTIONS'].=' '; if ( $apx->user->has_right('faq.move') && $follow[$res['id']]['prev'] ) $tabledata[$i]['OPTIONS'].=optionHTML('moveup.gif', 'faq.move', 'direction=up&id='.$res['id'].'§oken='.$apx->session->get('sectoken'), $apx->lang->get('MOVEUP')); else $tabledata[$i]['OPTIONS'].='<img src="design/ispace_small.gif" alt="" />'; if ( $apx->user->has_right('faq.move') && $follow[$res['id']]['next'] ) $tabledata[$i]['OPTIONS'].=optionHTML('movedown.gif', 'faq.move', 'direction=down&id='.$res['id'].'§oken='.$apx->session->get('sectoken'), $apx->lang->get('MOVEDOWN')); else $tabledata[$i]['OPTIONS'].='<img src="design/ispace_small.gif" alt="" />';*/ } } $apx->tmpl->assign('TABLE', $tabledata); echo '<div class="treeview" id="tree">'; $html->table($col); echo '</div>'; $open = $apx->session->get('faq_open'); $open = dash_unserialize($open); $opendata = array(); foreach ($open as $catid) { $opendata[] = array('ID' => $catid); } $apx->tmpl->assign('OPEN', $opendata); $apx->tmpl->assign('EDIT_ALLOWED', $apx->user->has_Right('faq.edit')); $apx->tmpl->parse('show_js'); save_index($_SERVER['REQUEST_URI']); }
function edit_book($info) { global $set, $db, $apx; $thistype = 'book'; //Aktualisieren if ($_POST['send'] == 2) { if (!checkToken()) { infoInvalidToken(); } elseif (!$_POST['title'] || !$_POST['text']) { infoNotComplete(); } elseif (!$this->update_pic()) { /*DO NOTHING*/ } elseif (!$this->update_teaserpic()) { /*DO NOTHING*/ } else { //Website-URLs clean if (substr($_POST['website'], 0, 4) == 'www.') { $_POST['website'] = 'http://' . $_POST['website']; } $_POST['picture'] = $this->picpath; $_POST['teaserpic'] = $this->teaserpicpath; $_POST['media'] = dash_serialize(array_map('intval', $_POST['media'])); $db->dupdate(PRE . '_products', 'prodid,title,text,meta_description,picture,teaserpic,website,manufacturer,publisher,isbn,genre,media,custom1,custom2,custom3,custom4,custom5,custom6,custom7,custom8,custom9,custom10,buylink,price,recprice,guarantee,allowcoms,allowrating,restricted,top,searchable', "WHERE id='" . $_REQUEST['id'] . "' LIMIT 1"); logit('PRODUCTS_EDIT', 'ID #' . $_REQUEST['id']); //Release eintragen $db->query("DELETE FROM " . PRE . "_products_releases WHERE prodid='" . $_REQUEST['id'] . "'"); for ($i = 1; $i <= 10; $i++) { if (!isset($_POST['release'][$i])) { continue; } $element = $_POST['release'][$i]; if ($element['year']) { list($reldata, $relstamp, $relsystem) = $this->generate_release($element); $db->query("INSERT INTO " . PRE . "_products_releases (prodid,system,data,stamp) VALUES ('" . $_REQUEST['id'] . "','" . $relsystem . "','" . addslashes(serialize($reldata)) . "','" . $relstamp . "')"); } } //Tags $db->query("DELETE FROM " . PRE . "_products_tags WHERE id='" . $_REQUEST['id'] . "'"); $tagids = produceTagIds($_POST['tags']); foreach ($tagids as $tagid) { $db->query("INSERT IGNORE INTO " . PRE . "_products_tags VALUES('" . $_REQUEST['id'] . "', '" . $tagid . "')"); } printJSRedirect(get_index('products.show')); } } else { //Variablen freigeben foreach ($info as $key => $value) { $_POST[$key] = $value; } //Media $_POST['media'] = dash_unserialize($info['media']); if (!is_array($_POST['media'])) { $_POST['media'] = array(); } //Releases auslesen $_POST['release'] = array(); $data = $db->fetch("SELECT system,data FROM " . PRE . "_products_releases WHERE prodid='" . $_REQUEST['id'] . "' ORDER BY ord ASC"); if (count($data)) { $ri = 1; foreach ($data as $res) { $res['data'] = unserialize($res['data']); if (is_array($res['data'])) { $_POST['release'][$ri] = $res['data']; $_POST['release'][$ri]['system'] = $res['system']; ++$ri; } } } //Benutzerdefinierte Felder for ($i = 1; $i <= 10; $i++) { $fieldname = $set['products']['custom_' . $thistype][$i - 1]; $apx->tmpl->assign('CUSFIELD' . $i . '_NAME', replace($fieldname)); $apx->tmpl->assign('CUSTOM' . $i, compatible_hsc($_POST['custom' . $i])); } //Bild $picture = ''; if ($info['picture']) { $picturepath = $info['picture']; $poppicpath = str_replace('-thumb.', '.', $picturepath); if (file_exists(BASEDIR . getpath('uploads') . $poppicpath)) { $picture = '../' . getpath('uploads') . $poppicpath; } else { $picture = '../' . getpath('uploads') . $picturepath; } } //Bild $teaserpic = ''; if ($info['teaserpic']) { $teaserpicpath = $info['teaserpic']; $poppicpath = str_replace('-thumb.', '.', $teaserpicpath); if (file_exists(BASEDIR . getpath('uploads') . $poppicpath)) { $teaserpic = '../' . getpath('uploads') . $poppicpath; } else { $teaserpic = '../' . getpath('uploads') . $teaserpicpath; } } //Tags $tags = array(); $tagdata = $db->fetch("\n\t\t\tSELECT t.tag\n\t\t\tFROM " . PRE . "_products_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('ACTION', 'edit'); $apx->tmpl->assign('ID', $_REQUEST['id']); $apx->tmpl->assign('PRODID', intval($_POST['prodid'])); $apx->tmpl->assign('TITLE', compatible_hsc($_POST['title'])); $apx->tmpl->assign('TEXT', compatible_hsc($_POST['text'])); $apx->tmpl->assign('META_DESCRIPTION', compatible_hsc($_POST['meta_description'])); $apx->tmpl->assign('PICTURE', $picture); $apx->tmpl->assign('TEASERPIC', $teaserpic); $apx->tmpl->assign('PIC_COPY', compatible_hsc($_POST['pic_copy'])); $apx->tmpl->assign('TEASERPIC_COPY', compatible_hsc($_POST['teaserpic_copy'])); $apx->tmpl->assign('WEBSITE', compatible_hsc($_POST['website'])); $apx->tmpl->assign('TAGS', compatible_hsc($_POST['tags'])); $apx->tmpl->assign('MANUFACTURER', $this->get_units($_POST['manufacturer'], iif($set['products']['filtermanu'], 'person'))); $apx->tmpl->assign('PUBLISHER', $this->get_units($_POST['publisher'], iif($set['products']['filtermanu'], 'company'))); $apx->tmpl->assign('ISBN', compatible_hsc($_POST['isbn'])); $apx->tmpl->assign('GENRELIST', $this->get_genre($thistype, $_POST['genre'])); $apx->tmpl->assign('MEDIALIST', $this->get_media($thistype, $_POST['media'])); $apx->tmpl->assign('RELEASE', $this->get_release($thistype)); $apx->tmpl->assign('BUYLINK', compatible_hsc($_POST['buylink'])); $apx->tmpl->assign('PRICE', compatible_hsc($_POST['price'])); $apx->tmpl->assign('RECPRICE', compatible_hsc($_POST['recprice'])); $apx->tmpl->assign('GUARANTEE', compatible_hsc($_POST['guarantee'])); $apx->tmpl->assign('ALLOWCOMS', (int) $_POST['allowcoms']); $apx->tmpl->assign('ALLOWRATING', (int) $_POST['allowrating']); $apx->tmpl->assign('RESTRICTED', (int) $_POST['restricted']); $apx->tmpl->assign('TOP', (int) $_POST['top']); $apx->tmpl->assign('SEARCHABLE', (int) $_POST['searchable']); $apx->tmpl->parse('add_edit_' . $thistype); } }
$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'];
function show() { global $set, $db, $apx, $html; //Struktur reparieren if ($_REQUEST['repair']) { $this->cat->repair(); echo 'Repair done!'; return; } $col[] = array('ID', 0, 'align="center"'); $col[] = array('COL_TITLE', 70, 'class="title"'); $col[] = array('COL_THREADS', 15, 'align="center"'); $col[] = array('COL_POSTS', 15, 'align="center"'); //Foren auslesen $data = $this->cat->getTree(array('iscat', 'title', 'posts', 'threads')); //Forum erstellen if ($apx->user->has_right('forum.add')) { if (count($data)) { foreach ($data as $res) { $space = str_repeat(' ', $res['level'] - 1); if ($res['iscat']) { $style = ' style="background:#EAEAEA"'; } else { $style = ''; } $forumlist .= '<option value="' . $res['forumid'] . '"' . $style . '>' . $space . replace($res['title']) . '</option>'; } } $apx->tmpl->assign('FORUMLIST', $forumlist); } if (count($data)) { foreach ($data as $res) { ++$i; $res['children'] = dash_unserialize($res['children']); $link = mklink($set['forum']['directory'] . '/forum.php?id=' . $res['forumid'], $set['forum']['directory'] . '/forum,' . $res['forumid'] . ',1' . urlformat($res['title']) . '.html'); $tabledata[$i]['COL1'] = $res['forumid']; $tabledata[$i]['COL2'] = '<a href="' . $link . '" target="_blank">' . replace($res['title']) . '</a>'; $tabledata[$i]['COL3'] = number_format($res['threads'], 0, '', '.'); $tabledata[$i]['COL4'] = number_format($res['posts'], 0, '', '.'); $tabledata[$i]['CLASS'] = 'l' . ($res['level'] - 1) . ($res['children'] ? ' haschildren' : '') . ($res['level'] > 1 ? ' hidden' : '') . ($res['iscat'] ? ' dark' : ''); $tabledata[$i]['ID'] = 'node:' . $res['forumid']; //Optionen if ($apx->user->has_right('forum.edit')) { $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'forum.edit', 'id=' . $res['forumid'], $apx->lang->get('CORE_EDIT')); } else { $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />'; } if ($apx->user->has_right('forum.del') && !$res['posts']) { $tabledata[$i]['OPTIONS'] .= '<span class="ifhasnochildren">' . optionHTMLOverlay('del.gif', 'forum.del', 'id=' . $res['forumid'], $apx->lang->get('CORE_DEL')) . '</span><span class="ifhaschildren"><img alt="" src="design/ispace.gif"/></span>'; } else { $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />'; } if ($apx->user->has_right('forum.clean') && $res['posts']) { $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('clean.gif', 'forum.clean', 'id=' . $res['forumid'], $apx->lang->get('CLEAN')); } else { $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />'; } //Anordnen nur bei Unterkategorien /* $tabledata[$i]['OPTIONS'].=' '; if ( $apx->user->has_right('forum.move') && $follow[$res['forumid']]['prev'] ) $tabledata[$i]['OPTIONS'].=optionHTML('moveup.gif', 'forum.move', 'direction=up&id='.$res['forumid'].'§oken='.$apx->session->get('sectoken'), $apx->lang->get('MOVEUP')); else $tabledata[$i]['OPTIONS'].='<img src="design/ispace_small.gif" alt="" />'; if ( $apx->user->has_right('forum.move') && $follow[$res['forumid']]['next'] ) $tabledata[$i]['OPTIONS'].=optionHTML('movedown.gif', 'forum.move', 'direction=down&id='.$res['forumid'].'§oken='.$apx->session->get('sectoken'), $apx->lang->get('MOVEDOWN')); else $tabledata[$i]['OPTIONS'].='<img src="design/ispace_small.gif" alt="" />'; */ } } $apx->tmpl->parse('show_add'); $apx->tmpl->assign('TABLE', $tabledata); echo '<div class="treeview" id="tree">'; $html->table($col); echo '</div>'; $open = $apx->session->get('forum_open'); $open = dash_unserialize($open); $opendata = array(); foreach ($open as $catid) { $opendata[] = array('ID' => $catid); } $apx->tmpl->assign('OPEN', $opendata); $apx->tmpl->assign('EDIT_ALLOWED', $apx->user->has_Right('forum.edit')); $apx->tmpl->parse('show_js'); }
//////////////////////////////////////////////////////////////////////////////////////////////////////// require '../lib/_start.php'; ///////////////////////////////////////////////////////// SYSTEMSTART /// require 'lib/_start.php'; ///////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////// $_REQUEST['search'] = (int) $_REQUEST['search']; //////////////////////////////////////////////////////////////////////////////// SUCHERGEBNISSE ANZEIGEN if ($_REQUEST['search']) { $search = $db->first("SELECT * FROM " . PRE . "_forum_search WHERE id='" . $_REQUEST['search'] . "' AND hash='" . addslashes($_REQUEST['hash']) . "' LIMIT 1"); if (!$search['id']) { require 'lib/_end.php'; require '../lib/_end.php'; } //Unserialize $search['result'] = dash_unserialize($search['result']); $highlight = unserialize($search['highlight']); $ignored = unserialize($search['ignored']); if (!is_array($highlight)) { $highlight = array(); } if (!is_array($ignored)) { $ignored = array(); } $search['highlight'] = urlencode(implode('+', $highlight)); $apx->lang->drop('searchresult'); //BEITRÄGE if ($search['display'] == 'posts') { $apx->lang->drop('thread'); //Seitenzahlen list($count) = $db->first("SELECT count(postid) FROM " . PRE . "_forum_posts WHERE ( del=0 AND postid IN (" . implode(',', $search['result']) . ") )");
function get_modlist() { global $set, $db, $apx; $data = $db->fetch("SELECT moderator FROM " . PRE . "_forums WHERE moderator!=''"); if (!count($data)) { return array(); } $modlist = ''; foreach ($data as $res) { $modlist .= $res['moderator']; } $modlist = preg_replace('#\\|{2,}#', '|', $modlist); $mods = dash_unserialize($modlist); $mods = array_unique($mods); return $mods; }
function catclean() { global $set, $db, $apx; $_REQUEST['id'] = (int) $_REQUEST['id']; if (!$_REQUEST['id']) { die('missing ID!'); } if ($_POST['send'] == 1) { if ($_POST['delcat']) { $nodeInfo = $this->cat->getNode($_REQUEST['id']); if ($nodeInfo['children']) { $_POST['delcat'] = 0; } } if (!checkToken()) { printInvalidToken(); } elseif ($_POST['id'] && $_POST['moveto']) { $db->query("UPDATE " . PRE . "_videos SET catid='" . intval($_POST['moveto']) . "' WHERE catid='" . $_REQUEST['id'] . "'"); logit('VIDEOS_CATCLEAN', "ID #" . $_REQUEST['id']); //Kategorie löschen if ($_POST['delcat']) { $this->cat->deleteNode($_REQUEST['id']); logit('VIDEOS_CATDEL', "ID #" . $_REQUEST['id']); } printJSRedirect(get_index('videos.catshow')); return; } } $data = $this->cat->getTree(array('title', 'open')); if (count($data)) { foreach ($data as $res) { if ($res['level']) { $space = str_repeat(' ', $res['level'] - 1); } if ($res['id'] != $_REQUEST['id'] && $res['open']) { $catlist .= '<option value="' . $res['id'] . '" ' . iif($_POST['moveto'] == $res['id'], ' selected="selected"') . ' style="color:green;">' . $space . replace($res['title']) . '</option>'; } else { $catlist .= '<option value="" disabled="disabled" style="color:grey;">' . $space . replace($res['title']) . '</option>'; } } } list($title, $children) = $db->first("SELECT title,children FROM " . PRE . "_videos_cat WHERE id='" . $_REQUEST['id'] . "' LIMIT 1"); $children = dash_unserialize($children); $apx->tmpl->assign('ID', $_REQUEST['id']); $apx->tmpl->assign('TITLE', compatible_hsc($title)); $apx->tmpl->assign('DELCAT', (int) $_POST['delcat']); $apx->tmpl->assign('DELETEABLE', !$children); $apx->tmpl->assign('CATLIST', $catlist); tmessageOverlay('catclean'); }
$gallery = $db->first("SELECT * FROM " . PRE . "_gallery WHERE ( id='" . $_REQUEST['id'] . "' " . section_filter() . " " . iif(!$user->is_team_member(), " AND ( '" . time() . "' BETWEEN starttime AND endtime ) ") . " ) LIMIT 1"); if (!$gallery['id']) { filenotfound(); } //$gallery['parents'] = dash_unserialize($gallery['parents']); $gallery['children'] = dash_unserialize($gallery['children']); //Altersabfrage if ($gallery['restricted']) { checkage(); } //Passwortschutz if ($gallery['password']) { $password = $gallery['password']; $pwdid = $gallery['id']; } else { $parentIds = dash_unserialize($gallery['parents']); if ($parentIds) { list($pwdid, $password) = $db->first("SELECT id,password FROM " . PRE . "_gallery WHERE id='" . $parentIds[0] . "' LIMIT 1"); } } if ($password && $password == $_POST['password']) { setcookie('gallery_pwd_' . $pwdid, $_POST['password'], time() + 1 * 24 * 3600); } elseif ($password && $_COOKIE['gallery_pwd_' . $pwdid] != $password) { tmessage('pwdrequired', array('ID' => $_REQUEST['id'], 'PIC' => $_REQUEST['pic'])); } //Headline + Titlebar headline(strip_tags($gallery['title']), mklink('gallery.php?id=' . $_REQUEST['id'] . '&p=' . $_REQUEST['p'], 'gallery,list' . $_REQUEST['id'] . ',' . iif($_REQUEST['p'], $_REQUEST['p'], 1) . urlformat($gallery['title']) . '.html')); titlebar($apx->lang->get('HEADLINE') . ': ' . strip_tags($gallery['title'])); //Unter-Galerien auslesen, die veröffentlicht sind if ($set['gallery']['subgals'] && $gallery['children']) { $openData = $db->fetch("SELECT id FROM " . PRE . "_gallery WHERE id IN (" . implode(', ', $gallery['children']) . ") AND '" . time() . "' BETWEEN starttime AND endtime");
function forum_info($forumid, $norights = false) { global $set, $db, $apx, $forum_rightfields, $forumcache; $forumid = (int) $forumid; if (!$forumid) { return array(); } //Cache if (isset($forumcache[$forumid])) { return $forumcache[$forumid]; } //Foren-Infos auslesen $info = $db->first("SELECT *,forumid AS password_fromid FROM " . PRE . "_forums WHERE forumid='" . $forumid . "' LIMIT 1"); if (!$info['forumid']) { return array(); } $info['moderator'] = dash_unserialize($info['moderator']); //Info zurückgeben, wenn keine Rechte vererbt werden if (!$info['inherit'] || $norights) { return $info; } //Vererbte Eigenschaften auslesen $parentlist = dash_unserialize($info['parents']); if (!count($parentlist)) { return $info; } $data = $db->fetch("SELECT " . implode(',', $forum_rightfields) . ",forumid AS password_fromid,stylesheet,inherit FROM " . PRE . "_forums WHERE forumid IN (" . implode(',', $parentlist) . ") ORDER BY parents DESC", 1); if (count($data)) { foreach ($data as $res) { if (!$res['inherit']) { $info = array_merge($info, $res); //Rechte einfügen break; } } } $forumcache[$info['forumid']] = $info; return $info; //Info zurückgeben }
//Kein Zugang if (!$access) { tmessage('noright', array(), false, false); } } //Lastvisit für dieses Thema bestimmen $lastvisit = max(array($user->info['forum_lastonline'], announcement_readtime($anninfo['id']))); announcement_isread($anninfo['id']); ///////////////////////////////////////////////////////////////////////////////////////// BEITRAG //Userinfo auslesen if ($anninfo['userid']) { $userdat = $db->first("SELECT a.userid,a.username,a.groupid,a.reg_time,a.forum_posts,a.avatar,a.avatar_title,a.signature,a.homepage,a.city,a.icq,a.aim,a.yim,a.msn,a.skype,a.forum_lastactive,a.pub_invisible,a.custom1,a.custom2,a.custom3,a.custom4,a.custom5,a.custom6,a.custom7,a.custom8,a.custom9,a.custom10,b.gtype FROM " . PRE . "_user AS a LEFT JOIN " . PRE . "_user_groups AS b USING(groupid) WHERE a.userid='" . $anninfo['userid'] . "' LIMIT 1"); } else { $userdat = array(); } $mods = dash_unserialize($foruminfo['moderator']); //Text $text = forum_replace($anninfo['text'], true, true); //Benutzerkennzeichen $siganture = $avatar = $avatar_title = ''; if ($anninfo['userid']) { if ($anninfo['allowsig']) { $signature = $user->mksig($userdat); } if ($userdat['avatar']) { $avatar = $user->mkavatar($userdat); $avatar_title = $user->mkavtitle($userdat); } } //Rang $rankinfo = get_rank($userdat);
function removeChildren($nodeIds, $childIds) { global $db; if (!$childIds || !$nodeIds) { return; } $query = $db->query("\n\t\t\tSELECT " . $this->primary . ", children\n\t\t\tFROM " . $this->table . "\n\t\t\tWHERE " . $this->primary . " IN (" . implode(', ', $nodeIds) . ")\n\t\t"); while ($res = $query->fetch_array()) { $children = dash_unserialize($res['children']); $children = array_diff($children, $childIds); $db->query("\n\t\t\t\tUPDATE " . $this->table . "\n\t\t\t\tSET children='" . dash_serialize($children) . "'\n\t\t\t\tWHERE " . $this->primary . "=" . $res[$this->primary] . "\n\t\t\t\tLIMIT 1\n\t\t\t"); } }
function show() { global $set, $db, $apx, $html; //Struktur reparieren if ($_REQUEST['repair']) { $this->cat->repair(); echo 'Repair done!'; return; } quicklink('navi.add', 'action.php', 'nid=' . $_REQUEST['nid']); $_REQUEST['nid'] = (int) $_REQUEST['nid']; if (!$_REQUEST['nid']) { $_REQUEST['nid'] = 1; } $navidata = array(); foreach ($set['navi']['groups'] as $id => $title) { $navidata[] = array('ID' => $id, 'TITLE' => compatible_hsc($title), 'SELECTED' => $_REQUEST['nid'] == $id); } $apx->tmpl->assign('NAVI', $navidata); $apx->tmpl->parse('show_choose'); //DnD-Hinweis if ($apx->user->has_right('navi.edit')) { echo '<p class="hint">' . $apx->lang->get('USEDND') . '</p>'; } $col[] = array('ID', 0, 'align="center"'); $col[] = array('COL_TEXT', 100, 'class="title"'); $data = $this->cat->getTree(array('text'), null, "nid='" . $_REQUEST['nid'] . "'"); if (count($data)) { //Ausgabe erfolgt foreach ($data as $res) { ++$i; if ($res['level'] == 1) { ++$tree; } $tabledata[$i]['COL1'] = $res['id']; $tabledata[$i]['COL2'] = $space[$res['id']] . ' ' . replace(shorttext($res['text'], 100)); $tabledata[$i]['CLASS'] = 'l' . ($res['level'] - 1) . ($res['children'] ? ' haschildren' : '') . ($res['level'] > 1 ? ' hidden' : ''); $tabledata[$i]['ID'] = 'node:' . $res['id']; //Optionen if ($apx->user->has_right('navi.edit')) { $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'navi.edit', 'id=' . $res['id'], $apx->lang->get('CORE_EDIT')); } else { $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />'; } if ($apx->user->has_right('navi.del')) { $tabledata[$i]['OPTIONS'] .= '<span class="ifhasnochildren">' . optionHTMLOverlay('del.gif', 'navi.del', 'id=' . $res['id'], $apx->lang->get('CORE_DEL')) . '</span><span class="ifhaschildren"><img alt="" src="design/ispace.gif"/></span>'; } else { $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />'; } /*$tabledata[$i]['OPTIONS'].=' '; if ( $apx->user->has_right('navi.move') && $follow[$res['id']]['prev'] ) $tabledata[$i]['OPTIONS'].=optionHTML('moveup.gif', 'navi.move', 'direction=up&id='.$res['id'].'§oken='.$apx->session->get('sectoken'), $apx->lang->get('MOVEUP')); else $tabledata[$i]['OPTIONS'].='<img src="design/ispace_small.gif" alt="" />'; if ( $apx->user->has_right('navi.move') && $follow[$res['id']]['next'] ) $tabledata[$i]['OPTIONS'].=optionHTML('movedown.gif', 'navi.move', 'direction=down&id='.$res['id'].'§oken='.$apx->session->get('sectoken'), $apx->lang->get('MOVEDOWN')); else $tabledata[$i]['OPTIONS'].='<img src="design/ispace_small.gif" alt="" />';*/ } } $apx->tmpl->assign('TABLE', $tabledata); echo '<div class="treeview" id="tree">'; $html->table($col); echo '</div>'; $open = $apx->session->get('navi_open'); $open = dash_unserialize($open); $opendata = array(); foreach ($open as $catid) { $opendata[] = array('ID' => $catid); } $apx->tmpl->assign('OPEN', $opendata); $apx->tmpl->assign('EDIT_ALLOWED', $apx->user->has_Right('navi.edit')); $apx->tmpl->parse('show_js'); save_index($_SERVER['REQUEST_URI']); }
$groupdata = array(); } $lastgroup = $res['groupid']; $groupdata[$i] = createTeamData($res, $parse); } } //Letzte Gruppe einfügen if ($groupdata) { $tabledata[$gi]['USER'] = $groupdata; } //Forum-Moderatoren if ($apx->is_module('forum')) { $data = $db->fetch("\n\t\tSELECT moderator FROM " . PRE . "_forums\n\t\tWHERE moderator!='' AND moderator!='|'\n\t"); $modIds = array(); foreach ($data as $res) { $modIds = array_merge($modIds, dash_unserialize($res['moderator'])); } if ($modIds) { $data = $db->fetch("\n\t\t\tSELECT u.userid,u.username,u.email,u.groupid,u.reg_time,u.realname,u.gender,u.city,u.plz,u.country,u.city,u.lastactive,u.pub_invisible,u.avatar,u.avatar_title,u.birthday,u.pub_hidemail,u.custom1,u.custom2,u.custom3,u.custom4,u.custom5,u.custom6,u.custom7,u.custom8,u.custom9,u.custom10\n\t\t\tFROM " . PRE . "_user AS u\n\t\t\tWHERE u.active=1 AND u.userid IN (" . implode(',', $modIds) . ")\n\t\t\tORDER BY u.username ASC\n\t\t"); } $groupdata = array(); foreach ($data as $res) { $groupdata[] = createTeamData($res, $parse); } ++$gi; $tabledata[$gi]['ID'] = 0; $tabledata[$gi]['TITLE'] = $apx->lang->get('FORUM_MOD'); $tabledata[$gi]['ISADMIN'] = false; $tabledata[$gi]['USER'] = $groupdata; } $apx->tmpl->assign('GROUP', $tabledata);
function show() { global $set, $db, $apx, $html; //Struktur reparieren if ($_REQUEST['repair'] && $set['gallery']['subgals']) { $this->cat->repair(); echo 'Repair done!'; return; } //Suche durchführen if (!$set['gallery']['subgals'] && $_REQUEST['item']) { $where = ''; //Suchbegriff if ($_REQUEST['item']) { $where .= " AND title LIKE '%" . addslashes_like($_REQUEST['item']) . "%'"; } $data = $db->fetch("SELECT id FROM " . PRE . "_gallery WHERE 1 " . $where); $ids = get_ids($data, 'id'); $ids[] = -1; $searchid = saveSearchResult('admin_gallery', $ids, array('item' => $_REQUEST['item'])); header("HTTP/1.1 301 Moved Permanently"); header('Location: action.php?action=gallery.show&what=' . $_REQUEST['what'] . '&searchid=' . $searchid); return; } quicklink('gallery.add'); //DnD-Hinweis if ($apx->user->has_right('gallery.edit') && ($set['gallery']['subgals'] || $set['gallery']['ordergal'] == 3)) { echo '<p class="hint">' . $apx->lang->get('USEDND') . '</p>'; } $orderdef[0] = 'title'; $orderdef['title'] = array('title', 'ASC', 'COL_TITLE'); $orderdef['addtime'] = array('addtime', 'DESC', 'SORT_ADDTIME'); $orderdef['starttime'] = array('starttime', 'DESC', 'COL_STARTTIME'); //Suchergebnis? $resultFilter = ''; if (!$set['gallery']['subgals'] && $_REQUEST['searchid']) { $searchRes = getSearchResult('admin_gallery', $_REQUEST['searchid']); if ($searchRes) { list($resultIds, $resultMeta) = $searchRes; $_REQUEST['item'] = $resultMeta['item']; $resultFilter = " AND a.id IN (" . implode(', ', $resultIds) . ")"; } else { $_REQUEST['searchid'] = ''; } } $col[] = array(' ', 0, ''); $col[] = array('ID', 0, 'align="center"'); $col[] = array('COL_TITLE', 60, 'class="title"'); $col[] = array('COL_STARTTIME', 25, 'align="center"'); $col[] = array('COL_COUNT', 15, 'align="center"'); if (!$set['gallery']['subgals']) { $apx->tmpl->assign('ITEM', compatible_hsc($_REQUEST['item'])); $apx->tmpl->parse('search'); letters('action.php?action=gallery.show' . iif($_REQUEST['searchid'], '&searchid=' . $_REQUEST['searchid'])); if ($_REQUEST['letter'] == 'spchar') { $where = " AND title NOT REGEXP(\"^[a-zA-Z]\") "; } elseif ($_REQUEST['letter']) { $where = " AND title LIKE '" . addslashes($_REQUEST['letter']) . "%' "; } list($count) = $db->first("SELECT count(id) FROM " . PRE . "_gallery AS a WHERE 1 " . $resultFilter . $where . section_filter(true, 'secid')); pages('action.php?action=gallery.show' . iif($_REQUEST['searchid'], '&searchid=' . $_REQUEST['searchid']) . '&sortby=' . $_REQUEST['sortby'] . '&letter=' . $_REQUEST['letter'], $count); //Orderby if ($set['gallery']['ordergal'] == 3) { $sortby = ' ORDER BY ord ASC '; $orderdef = array(); } else { $sortby = getorder($orderdef); } $data = $db->fetch("SELECT id,secid,title,starttime,endtime FROM " . PRE . "_gallery AS a WHERE 1 " . $resultFilter . $where . section_filter(true, 'secid') . $sortby . getlimit()); } else { $data = $this->cat->getTree(array('*'), null, section_filter(false, 'secid')); } if (count($data)) { //Untergalerien? if ($set['gallery']['subgals']) { list($space, $follow) = parse_tree($data); $isactive[0] = true; //Root ist immer aktiv ;) } $i = ($_REQUEST['p'] - 1) * $set['admin_epp']; foreach ($data as $res) { ++$i; if ($res['level'] == 1) { ++$tree; } $isactive[$res['level']] = $res['starttime']; if (!$res['starttime']) { $tabledata[$i]['COL1'] = '<img src="design/reddot.gif" alt="' . $apx->lang->get('CORE_INACTIVE') . '" title="' . $apx->lang->get('CORE_INACTIVE') . '" />'; } elseif ($res['endtime'] < time()) { $tabledata[$i]['COL1'] = '<img src="design/greendotcross.gif" alt="' . $apx->lang->get('CORE_INACTIVE') . '" title="' . $apx->lang->get('CORE_INACTIVE') . '" />'; } elseif ($res['starttime'] > time()) { $tabledata[$i]['COL1'] = '<img src="design/greendotwait.gif" alt="' . $apx->lang->get('CORE_ACTIVE') . '" title="' . $apx->lang->get('CORE_ACTIVE') . '" />'; } else { $tabledata[$i]['COL1'] = '<img src="design/greendot.gif" alt="' . $apx->lang->get('CORE_ACTIVE') . '" title="' . $apx->lang->get('CORE_ACTIVE') . '" />'; } $tmp = unserialize_section($res['secid']); $title = replace(strip_tags($res['title'])); $link = mklink('gallery.php?id=' . $res['id'], 'gallery,list' . $res['id'] . ',1' . urlformat($res['title']) . '.html', iif($set['main']['forcesection'], iif(unserialize_section($res['secid']) == array('all'), $apx->section_default, array_shift($tmp)), 0)); list($pics) = $db->first("SELECT count(id) FROM " . PRE . "_gallery_pics WHERE galid='" . $res['id'] . "'"); list($activepics) = $db->first("SELECT count(id) FROM " . PRE . "_gallery_pics WHERE ( galid='" . $res['id'] . "' AND active='1' )"); $tabledata[$i]['COL2'] = $res['id']; $tabledata[$i]['COL3'] = '<a href="' . $link . '" target="_blank">' . $title . '</a>'; $tabledata[$i]['COL4'] = iif($res['starttime'], mkdate($res['starttime'], '<br />'), ' '); $tabledata[$i]['COL5'] = number_format($pics, 0, '', '.'); $tabledata[$i]['CLASS'] = 'l' . ($res['level'] - 1) . ($res['children'] ? ' haschildren' : '') . ($res['level'] > 1 ? ' hidden' : ''); $tabledata[$i]['ID'] = 'node:' . $res['id']; //Optionen if ($apx->user->has_right('gallery.edit')) { $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'gallery.edit', 'id=' . $res['id'], $apx->lang->get('CORE_EDIT')); } else { $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />'; } if ($apx->user->has_right('gallery.del')) { $tabledata[$i]['OPTIONS'] .= '<span class="ifhasnochildren">' . optionHTMLOverlay('del.gif', 'gallery.del', 'id=' . $res['id'], $apx->lang->get('CORE_DEL')) . '</span><span class="ifhaschildren"><img alt="" src="design/ispace.gif"/></span>'; } else { $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />'; } if ((!$res['starttime'] || $res['endtime'] < time()) && $apx->user->has_right('gallery.enable') && (!$set['gallery']['subgals'] || $isactive[$res['level'] - 1])) { $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('enable.gif', 'gallery.enable', 'id=' . $res['id'], $apx->lang->get('CORE_ENABLE')); } elseif ($res['starttime'] && $apx->user->has_right('gallery.disable')) { $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('disable.gif', 'gallery.disable', 'id=' . $res['id'], $apx->lang->get('CORE_DISABLE')); } else { $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />'; } $tabledata[$i]['OPTIONS'] .= ' '; if ($apx->user->has_right('gallery.pshow')) { $tabledata[$i]['OPTIONS'] .= optionHTML('pic.gif', 'gallery.pshow', 'id=' . $res['id'], $apx->lang->get('SHOWPICS')); } if ($apx->user->has_right('gallery.padd')) { $tabledata[$i]['OPTIONS'] .= optionHTML('picadd.gif', 'gallery.padd', 'id=' . $res['id'], $apx->lang->get('ADDPICS')); } //Kommentare + Bewertungen if ($apx->is_module('comments')) { $tabledata[$i]['OPTIONS'] .= ' '; list($comments) = $db->first("SELECT count(id) FROM " . PRE . "_comments WHERE ( module='galleryself' AND mid='" . $res['id'] . "' )"); if ($comments && $set['gallery']['galcoms'] && $res['allowcoms'] && $apx->user->has_right('comments.show')) { $tabledata[$i]['OPTIONS'] .= optionHTML('comments.gif', 'comments.show', 'module=galleryself&mid=' . $res['id'], $apx->lang->get('COMMENTS') . ' (' . $comments . ')'); } else { $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />'; } } //Anordnen: Untergalerien /*if ( $set['gallery']['subgals'] ) { $tabledata[$i]['OPTIONS'].=' '; if ( $apx->user->has_right('gallery.move') && $follow[$res['id']]['prev'] ) $tabledata[$i]['OPTIONS'].=optionHTML('moveup.gif', 'gallery.move', 'direction=up&id='.$res['id'].'§oken='.$apx->session->get('sectoken'), $apx->lang->get('MOVEUP')); else $tabledata[$i]['OPTIONS'].='<img src="design/ispace_small.gif" alt="" style="vertical-align:middle;" />'; if ( $apx->user->has_right('gallery.move') && $follow[$res['id']]['next'] ) $tabledata[$i]['OPTIONS'].=optionHTML('movedown.gif', 'gallery.move', 'direction=down&id='.$res['id'].'§oken='.$apx->session->get('sectoken'), $apx->lang->get('MOVEDOWN')); else $tabledata[$i]['OPTIONS'].='<img src="design/ispace_small.gif" alt="" style="vertical-align:middle;" />'; } //Anordnen: Einfach elseif ( !$set['gallery']['subgals'] && $set['gallery']['ordergal']==3 ) { $tabledata[$i]['OPTIONS'].=' '; if ( $apx->user->has_right('gallery.move') && $i!=1 ) $tabledata[$i]['OPTIONS'].=optionHTML('moveup.gif', 'gallery.move', 'direction=up&id='.$res['id'].'§oken='.$apx->session->get('sectoken'), $apx->lang->get('MOVEUP')); else $tabledata[$i]['OPTIONS'].='<img src="design/ispace_small.gif" alt="" style="vertical-align:middle;" />'; if ( $apx->user->has_right('gallery.move') && $i!=$count ) $tabledata[$i]['OPTIONS'].=optionHTML('movedown.gif', 'gallery.move', 'direction=down&id='.$res['id'].'§oken='.$apx->session->get('sectoken'), $apx->lang->get('MOVEDOWN')); else $tabledata[$i]['OPTIONS'].='<img src="design/ispace_small.gif" alt="" style="vertical-align:middle;" />'; }*/ if ($res['level'] == 1) { ++$pdone[0]; } else { ++$pdone[$tree][$res['level']]; } } } $apx->tmpl->assign('TABLE', $tabledata); if ($set['gallery']['subgals']) { echo '<div class="treeview" id="tree">'; $html->table($col); echo '</div>'; $open = $apx->session->get('gallery_open'); $open = dash_unserialize($open); $opendata = array(); foreach ($open as $catid) { $opendata[] = array('ID' => $catid); } $apx->tmpl->assign('OPEN', $opendata); $apx->tmpl->assign('EDIT_ALLOWED', $apx->user->has_Right('gallery.edit')); $apx->tmpl->parse('show_js'); } elseif ($set['gallery']['ordergal'] == 3) { echo '<div class="listview" id="list">'; $html->table($col); echo '</div>'; $apx->tmpl->parse('show_listjs'); } else { $html->table($col); orderstr($orderdef, 'action.php?action=gallery.show' . iif($_REQUEST['searchid'], '&searchid=' . $_REQUEST['searchid']) . '&letter=' . $_REQUEST['letter']); } save_index($_SERVER['REQUEST_URI']); }