function get_gallery_list($selected = 0) { global $set, $db, $apx; $list = '<option value=""></option>'; if ($set['gallery']['subgals']) { require_once BASEDIR . 'lib/class.recursivetree.php'; $tree = new RecursiveTree(PRE . '_gallery', 'id'); $data = $tree->getTree(array('title'), null, "'" . time() . "' BETWEEN starttime AND endtime " . section_filter(true, 'secid')); if (!count($data)) { return ''; } foreach ($data as $res) { $list .= '<option value="' . $res['id'] . '"' . iif($selected == $res['id'], ' selected="selected"') . '>' . str_repeat(' ', $res['level'] - 1) . replace(strip_tags($res['title'])) . '</option>'; } } else { $data = $db->fetch("SELECT id,title FROM " . PRE . "_gallery WHERE '" . time() . "' BETWEEN starttime AND endtime " . section_filter(true, 'secid') . " ORDER BY title ASC"); if (!count($data)) { return ''; } foreach ($data as $res) { $list .= '<option value="' . $res['id'] . '"' . iif($selected == $res['id'], ' selected="selected"') . '>' . replace(strip_tags($res['title'])) . '</option>'; } } return $list; }
function articles_catinfo($id = false) { global $set, $db, $apx, $user; //Eine Kategorie if (is_int($id) || is_string($id)) { $id = (int) $id; if (isset($catinfo[$id])) { return $catinfo[$id]; } $res = $db->first("SELECT id,title,icon,open FROM " . PRE . "_articles_cat WHERE ( id='" . $id . "' ) LIMIT 1", 1); $catinfo[$id] = $res; $catinfo[$id]['link'] = mklink('articles.php?catid=' . $res['id'], 'articles,0,' . $res['id'] . ',1.html'); return $catinfo[$id]; } elseif (is_array($id)) { if (!count($id)) { return array(); } $data = $db->fetch("SELECT id,title,icon,open FROM " . PRE . "_articles_cat WHERE id IN (" . implode(',', $id) . ")"); if (!count($data)) { return array(); } foreach ($data as $res) { $catinfo[$res['id']] = $res; $catinfo[$res['id']]['link'] = mklink('articles.php?catid=' . $res['id'], 'articles,0,' . $res['id'] . ',1.html'); } return $catinfo; } else { if ($set['articles']['subcats']) { require_once BASEDIR . 'lib/class.recursivetree.php'; $tree = new RecursiveTree(PRE . '_articles_cat', 'id'); $data = $tree->getTree(array('title', 'icon', 'open')); } else { $data = $db->fetch("SELECT * FROM " . PRE . "_articles_cat ORDER BY title ASC"); } if (!count($data)) { return array(); } foreach ($data as $res) { $catinfo[$res['id']] = $res; $catinfo[$res['id']]['link'] = mklink('articles.php?catid=' . $res['id'], 'articles,0,' . $res['id'] . ',1.html'); } return $catinfo; } }
function gallery_choose() { global $set, $db, $apx, $user; $tmpl = new tengine(); $apx->lang->drop('func_choose', 'gallery'); if ($set['gallery']['subgals']) { require_once BASEDIR . 'lib/class.recursivetree.php'; $tree = new RecursiveTree(PRE . '_gallery', 'id'); $data = $tree->getTree(array('title'), null, "'" . time() . "' BETWEEN starttime AND endtime"); } else { $data = $db->fetch("SELECT id,title FROM " . PRE . "_gallery WHERE ( ( '" . time() . "' BETWEEN starttime AND endtime ) " . section_filter() . " ) ORDER BY title ASC"); } if (count($data)) { foreach ($data as $res) { ++$i; $tabledata[$i]['ID'] = $res['id']; $tabledata[$i]['TITLE'] = strip_tags($res['title']); $tabledata[$i]['LEVEL'] = iif($res['level'], $res['level'], 1); } } $tmpl->assign('GALLERY', $tabledata); $tmpl->assign('POSTTO', mklink('gallery.php', 'gallery.html')); $tmpl->parse('functions/choose', 'gallery'); }
} //Captcha löschen if ($set['links']['captcha'] && !$user->info['userid']) { $captcha->remove(); } $db->dinsert(PRE . '_links', 'userid,secid,send_username,send_email,send_ip,catid,title,url,text,addtime'); message($apx->lang->get('MSG_OK'), mklink('links.php', 'links.html')); } //SCRIPT BEENDEN require 'lib/_end.php'; } //////////////////////////////////////////////////////////////////////////////////////////////////////// //Kategorien auflisten require_once BASEDIR . 'lib/class.recursivetree.php'; $tree = new RecursiveTree(PRE . '_links_cat', 'id'); $data = $tree->getTree(array('title', 'open')); if (count($data)) { foreach ($data as $res) { ++$i; $catdata[$i]['ID'] = $res['id']; $catdata[$i]['TITLE'] = $res['title']; $catdata[$i]['LEVEL'] = $res['level']; $catdata[$i]['OPEN'] = $res['open']; } } //Captcha erstellen if ($set['links']['captcha'] && !$user->info['userid']) { require BASEDIR . 'lib/class.captcha.php'; $captcha = new captcha(); $captchacode = $captcha->generate(); }
function calendar_events_categories($catid = false, $template = 'categories') { global $set, $db, $apx, $user; $tmpl = new tengine(); $catid = (int) $catid; if ($set['calendar']['subcats']) { if ($catid) { require_once BASEDIR . 'lib/class.recursivetree.php'; $tree = new RecursiveTree(PRE . '_calendar_cat', 'id'); $data = $tree->getTree(array('title'), $catid); } else { require_once BASEDIR . 'lib/class.recursivetree.php'; $tree = new RecursiveTree(PRE . '_calendar_cat', 'id'); $data = $tree->getTree(array('title')); } } else { $data = $db->fetch("SELECT * FROM " . PRE . "_calendar_cat ORDER BY title ASC"); } if (count($data)) { foreach ($data as $cat) { ++$i; //Kategorie-Link if (isset($cat['link'])) { $link = $cat['link']; } else { $link = mklink('events.php?catid=' . $res['id'], 'events.html?catid=' . $res['id']); } $catdata[$i]['ID'] = $cat['id']; $catdata[$i]['TITLE'] = $cat['title']; $catdata[$i]['LEVEL'] = $cat['level']; $catdata[$i]['ICON'] = $cat['icon']; $catdata[$i]['LINK'] = $link; } } $tmpl->assign('CATEGORY', $catdata); $tmpl->parse('functions/' . $template, 'calendar'); }
} } $apx->tmpl->assign('CATEGORY', $catdata); $apx->tmpl->assign('CATID', $catinfo['id']); $apx->tmpl->assign('CATTITLE', $catinfo['title']); $apx->tmpl->assign('CATTEXT', $catinfo['text']); $apx->tmpl->assign('CATICON', $catinfo['icon']); $apx->tmpl->assign('CATLINK', mklink('videos.php?catid=' . $catinfo['catid'], 'videos,' . $catinfo['catid'] . ',1' . urlformat($catinfo['title']) . '.html')); //Pfad if (in_array('PATH', $parse)) { $apx->tmpl->assign('PATH', videos_path($_REQUEST['catid'])); } //Suchbox $catdata = array(); if (in_array('SEARCH_CATEGORY', $parse)) { $data = $tree->getTree(array('title')); if (count($data)) { foreach ($data as $res) { ++$i; $catdata[$i]['ID'] = $res['id']; $catdata[$i]['TITLE'] = $res['title']; $catdata[$i]['LEVEL'] = $res['level']; } } } $postto = mklink('videos.php', 'videos.html'); $apx->tmpl->assign('SEARCH_POSTTO', $postto); $apx->tmpl->assign('SEARCH_CATEGORY', $catdata); /////////////////////////////////////////////////// //Parings ausführen, wenn keine Kategorie gewählt// ///////////////////////////////////////////////////
$apx->module('faq'); $apx->lang->drop('faq'); headline($apx->lang->get('HEADLINE'), mklink('faq.php', 'faq.html')); titlebar($apx->lang->get('HEADLINE')); $_REQUEST['id'] = (int) $_REQUEST['id']; //////////////////////////////////////////////////////////////////////////////////////////////////////// require_once BASEDIR . 'lib/class.recursivetree.php'; $tree = new RecursiveTree(PRE . '_faq', 'id'); if ($_REQUEST['id']) { $db->query("UPDATE " . PRE . "_faq SET hits=hits+1 WHERE id='" . $_REQUEST['id'] . "' LIMIT 1"); $node = $tree->getNode($_REQUEST['id'], array('*')); if (!$node || !$user->is_team_member() && $node['starttime'] == 0) { filenotfound(); } $node['level'] = 0; $subData = $tree->getTree(array('*'), $_REQUEST['id'], "starttime!='0'"); $data = array_merge(array($node), $subData); } else { $data = $tree->getTree(array('*'), null, "starttime!='0'"); } $first = null; if (count($data)) { foreach ($data as $res) { ++$i; if (!$first) { $first = $res; } //Link $link = mklink('faq.php?id=' . $res['id'], 'faq,' . $res['id'] . urlformat($res['question']) . '.html'); //Nummer $prefixstring = '';
function downloads_categories($catid = false, $template = 'categories') { global $set, $db, $apx, $user; $tmpl = new tengine(); $catid = (int) $catid; //Eine bestimmte Kategorie if ($catid) { require_once BASEDIR . 'lib/class.recursivetree.php'; $tree = new RecursiveTree(PRE . '_downloads_cat', 'id'); $data = $tree->getTree(array('*'), $catid); } else { require_once BASEDIR . 'lib/class.recursivetree.php'; $tree = new RecursiveTree(PRE . '_downloads_cat', 'id'); $data = $tree->getTree(array('*')); } foreach ($data as $cat) { ++$i; $catdata[$i]['ID'] = $cat['id']; $catdata[$i]['TITLE'] = $cat['title']; $catdata[$i]['ICON'] = $cat['icon']; $catdata[$i]['LEVEL'] = $cat['level']; $catdata[$i]['LINK'] = mklink('downloads.php?catid=' . $id, 'downloads,' . $cat['id'] . ',1' . urlformat($cat['title']) . '.html'); } $tmpl->assign('CATEGORY', $catdata); $tmpl->parse('functions/' . $template, 'downloads'); }
} //Captcha löschen if ($set['calendar']['captcha'] && !$user->info['userid']) { $captcha->remove(); } $db->dinsert(PRE . '_calendar_events', 'userid,secid,send_username,send_email,send_ip,catid,title,text,location,location_link,addtime,startday,starttime,endday,endtime,active'); message($apx->lang->get('MSG_OK'), mklink('events.php', 'events.html')); } //SCRIPT BEENDEN require 'lib/_end.php'; } //////////////////////////////////////////////////////////////////////////////////////////////////////// if ($set['calendar']['subcats']) { require_once BASEDIR . 'lib/class.recursivetree.php'; $tree = new RecursiveTree(PRE . '_calendar_cat', 'id'); $data = $tree->getTree(array('*')); } else { $data = $db->fetch("SELECT * FROM " . PRE . "_calendar_cat ORDER BY title ASC"); } if (count($data)) { foreach ($data as $cat) { ++$i; $catdata[$i]['ID'] = $cat['id']; $catdata[$i]['TITLE'] = $cat['title']; $catdata[$i]['LEVEL'] = $cat['level']; } } //Captcha erstellen if ($set['calendar']['captcha'] && !$user->info['userid']) { require BASEDIR . 'lib/class.captcha.php'; $captcha = new captcha();
function news_tree($catid) { global $set, $db, $apx, $user; static $saved; $catid = (int) $catid; $catid = (int) $catid; if (!$catid) { return array(); } if (!$set['news']['subcats']) { return array($catid); } if (isset($saved[$catid])) { return $saved[$catid]; } require_once BASEDIR . 'lib/class.recursivetree.php'; $tree = new RecursiveTree(PRE . '_news_cat', 'id'); $data = $tree->getTree(array('title', 'open')); $cattree = $tree->getChildrenIds($catid); $cattree[] = $catid; $saved[$catid] = $cattree; return $cattree; }
function news_categories($catid = false, $template = 'categories') { global $set, $db, $apx, $user; $tmpl = new tengine(); $catid = (int) $catid; //Eine bestimmte Kategorie if ($catid && $set['news']['subcats']) { require_once BASEDIR . 'lib/class.recursivetree.php'; $tree = new RecursiveTree(PRE . '_news_cat', 'id'); $data = $tree->getTree(array('*'), $catid); } else { $data = news_catinfo(); } foreach ($data as $cat) { ++$i; //Kategorie-Link if (isset($cat['link'])) { $link = $cat['link']; } else { $link = mklink('news.php?catid=' . $res['id'], 'news,' . $res['id'] . ',1.html'); } $catdata[$i]['ID'] = $cat['id']; $catdata[$i]['TITLE'] = $cat['title']; $catdata[$i]['ICON'] = $cat['icon']; $catdata[$i]['LINK'] = $link; $catdata[$i]['LEVEL'] = $cat['level']; } $tmpl->assign('CATEGORY', $catdata); $tmpl->parse('functions/' . $template, 'news'); }
function forum_readout($forum = false) { global $set, $db, $apx, $forum_inheritfields; require_once BASEDIR . 'lib/class.recursivetree.php'; $tree = new RecursiveTree(PRE . '_forums', 'forumid'); $data = $tree->getTree(array('*'), $forum ? $forum : null); $lastlevel = 0; $handdown = array(); //Parent-Forum auslesen if ($forum) { $parentinfo = forum_info($forum); $inheritData = array(); foreach ($forum_inheritfields as $fieldname) { $inheritData[$fieldname] = $parentinfo[$fieldname]; } $handdown[] = $inheritData; } foreach ($data as $key => $res) { //Moderatoren $res['moderator'] = dash_unserialize($res['moderator']); //Vererbbare Daten entfernen, wenn vorheriges = aktuelles Level if ($lastlevel == $res['level']) { array_pop($handdown); } //Rechte vererben if ($res['inherit']) { $res = array_merge($res, $handdown[count($handdown) - 1]); } //Vererbbare Rechte $inheritData = array(); foreach ($forum_inheritfields as $fieldname) { $inheritData[$fieldname] = $res[$fieldname]; } $inheritData['password_fromid'] = $res['password_fromid'] ? $res['password_fromid'] : $res['forumid']; $handdown[] = $inheritData; //Daten speichern $data[$key] = $res; $lastlevel = $res['level']; } return $data; }
function navi_breadcrumb($nid = 1, $template = 'breadcrumb') { global $set, $db, $apx; $nid = (int) $nid; if (!$nid) { return; } $tmpl = new tengine(); require_once BASEDIR . 'lib/class.recursivetree.php'; $tree = new RecursiveTree(PRE . '_navi', 'id'); $data = $tree->getTree(array('*'), null, "nid='" . $nid . "'"); $selected = navi_get_selected($data); $selectedPath = null; $path = array(); $selectedNodeLevel = 0; foreach ($data as $res) { if (in_array($res['id'], $selected)) { //Tiefere Pfadteile entfernen $dellevel = $res['level']; while (isset($path[$dellevel])) { unset($path[$dellevel]); ++$dellevel; } //Node zum Pfad hinzufügen $path[$res['level']] = $res; //Dieser Pfad ist länger als der bisherige längste if ($res['level'] > $selectedNodeLevel) { $selectedPath = $path; $selectedNodeLevel = $res['level']; } } } if (count($selectedPath)) { foreach ($selectedPath as $res) { ++$i; $tabledata[$i]['ID'] = $res['id']; $tabledata[$i]['LEVEL'] = $res['level']; $tabledata[$i]['CHILDREN'] = $res['children']; $tabledata[$i]['TEXT'] = $res['text']; $tabledata[$i]['LINK'] = $res['link']; $tabledata[$i]['POPUP'] = $res['link_popup']; $tabledata[$i]['CODE'] = $res['code']; $tabledata[$i]['SELECTED'] = true; } } $tmpl->assign('NAVI', $tabledata); $tmpl->parse($template, 'navi'); }