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 nodemoved() { global $apx, $set; if (!checkToken()) { return; } if (!$apx->user->has_right('news.catedit') || !$set['news']['subcats']) { return; } $id = (int) $_REQUEST['id']; $newparent = (int) $_REQUEST['parentid']; $beforeid = (int) $_REQUEST['before']; $afterid = (int) $_REQUEST['after']; if (!$id) { return; } require_once BASEDIR . 'lib/class.recursivetree.php'; $tree = new RecursiveTree(PRE . '_news_cat', 'id'); //In einen Knoten verschieben if (!$beforeid && !$afterid) { $tree->moveNode($id, $newparent); } elseif ($beforeid) { $tree->moveNodeBefore($id, $newparent, $beforeid); } elseif ($afterid) { $tree->moveNodeAfter($id, $newparent, $afterid); } }
function calendar_tree($catid) { global $set, $db, $apx, $user; static $saved; $catid = (int) $catid; $catid = (int) $catid; if (!$catid) { return array(); } if (!$set['calendar']['subcats']) { return array($catid); } if (isset($saved[$catid])) { return $saved[$catid]; } $cattree = array(); require_once BASEDIR . 'lib/class.recursivetree.php'; $tree = new RecursiveTree(PRE . '_calendar_cat', 'id'); $cattree = $tree->getChildrenIds($catid); $cattree[] = $catid; $saved[$catid] = $cattree; return $cattree; }
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'); }
require 'lib/_end.php'; } ///////////////////////////////////////////////////////////////////////////////////////// KATEGORIEN DURCHSUCHEN //Sprachpaket $apx->lang->drop('list'); $apx->lang->drop('search'); //Verwendete Variablen auslesen $parse = $apx->tmpl->used_vars('index'); //Kategorie auslesen $catinfo = array(); if ($_REQUEST['catid']) { $catinfo = $db->first("SELECT id, title, text, icon, open FROM " . PRE . "_videos_cat WHERE id='" . $_REQUEST['catid'] . "' LIMIT 1"); } //Tree-Manager require_once BASEDIR . 'lib/class.recursivetree.php'; $tree = new RecursiveTree(PRE . '_videos_cat', 'id'); //KATEGORIEN if ($_REQUEST['catid']) { $wholetree = array($_REQUEST['catid']); $data = $tree->getLevel(array('title', 'text', 'icon', 'open'), $_REQUEST['catid']); } else { $wholetree = array(); $data = $tree->getLevel(array('title', 'text', 'icon', 'open')); } if (count($data)) { //Kategorien auflisten $catdata = array(); foreach ($data as $res) { ++$i; //Link $link = mklink('videos.php?catid=' . $res['id'], 'videos,' . $res['id'] . ',1' . urlformat($res['title']) . '.html');
| DO NOT REMOVE ANY COPYRIGHTS WITHOUT PERMISSION! | | SOFTWARE BELONGS TO ITS AUTHORS! | \***************************************************************/ define('APXRUN', true); //////////////////////////////////////////////////////////////////////////////////////////////////////// require 'lib/_start.php'; //////////////////////////////////////////////////////////// SYSTEMSTART /// //////////////////////////////////////////////////////////////////////////////////////////////////////// $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) {
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'); }
sendmail($set['calendar']['mailonnew'], 'SENDEVENT', $input); } //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';
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 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'); }
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 setGalleryUpdatetime($galId) { global $db; require_once BASEDIR . 'lib/class.recursivetree.php'; $tree = new RecursiveTree(PRE . '_gallery', 'id'); $gallery = $tree->getNode($galId); if (!$gallery) { return; } $updateIds = array_merge($gallery['parents'], array($gallery['id'])); foreach ($updateIds as $id) { $gallery = $tree->getNode($id); $searchIds = array_merge($gallery['children'], array($gallery['id'])); list($updatetime) = $db->first("\n\t\t\tSELECT max(addtime)\n\t\t\tFROM " . PRE . "_gallery_pics\n\t\t\tWHERE galid IN (" . implode(',', $searchIds) . ") AND active=1\n\t\t"); $db->query("\n\t\t\tUPDATE " . PRE . "_gallery\n\t\t\tSET lastupdate='" . $updatetime . "'\n\t\t\tWHERE id='" . $id . "'\n\t\t\tLIMIT 1\n\t\t"); } }
} } if (!$_REQUEST['letter']) { $_REQUEST['letter'] = 0; } //Seitenzahlen if ($set['gallery']['subgals']) { list($count) = $db->first("SELECT count(id) FROM " . PRE . "_gallery WHERE ( '" . time() . "' BETWEEN starttime AND endtime AND parents='|' " . section_filter() . " )"); } else { list($count) = $db->first("SELECT count(id) FROM " . PRE . "_gallery WHERE ( ( '" . time() . "' BETWEEN starttime AND endtime ) " . $where . " " . section_filter() . " )"); } pages(mklink('gallery.php' . iif($_REQUEST['letter'], '?letter=' . $_REQUEST['letter']), 'gallery,' . $_REQUEST['letter'] . ',{P}.html'), $count, $set['gallery']['listepp']); //Galerie sortieren nach if ($set['gallery']['subgals']) { require_once BASEDIR . 'lib/class.recursivetree.php'; $tree = new RecursiveTree(PRE . '_gallery', 'id'); $data = $tree->getLevel(array('*'), 0, "'" . time() . "' BETWEEN starttime AND endtime " . section_filter(true, 'secid')); } else { if ($_REQUEST['letter']) { $orderby = 'title ASC'; } elseif ($set['gallery']['ordergal'] == 2) { $orderby = 'title ASC'; } elseif ($set['gallery']['ordergal'] == 3) { $orderby = 'lft ASC'; } else { $orderby = 'starttime DESC'; } $data = $db->fetch("SELECT *,1 AS level FROM " . PRE . "_gallery WHERE ( '" . time() . "' BETWEEN starttime AND endtime " . $where . " " . section_filter() . " ) ORDER BY " . $orderby . " " . iif($set['gallery']['listepp'], getlimit($set['gallery']['listepp']))); } //Galerien auslesen, die veröffentlicht sind if ($set['gallery']['subgals']) {
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 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'); }
sendmail($set['links']['mailonnew'], 'SENDLINK', $input); } //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 gallery_path($id) { global $set, $db, $apx, $user; $id = (int) $id; if (!$id) { return ''; } require_once BASEDIR . 'lib/class.recursivetree.php'; $tree = new RecursiveTree(PRE . '_gallery', 'id'); $data = $tree->getPathTo(array('title'), $id); if (!count($data)) { return array(); } foreach ($data as $res) { ++$i; $pathdata[$i]['TITLE'] = $res['title']; $pathdata[$i]['LINK'] = mklink('gallery.php?id=' . $res['id'], 'gallery,list' . $res['id'] . ',1' . urlformat($res['title']) . '.html'); } return $pathdata; }