function group() { global $set, $db, $apx, $html; $_REQUEST['id'] = (int) $_REQUEST['id']; $data = $set['banner']['groups']; //Kategorie löschen if ($_REQUEST['do'] == 'del' && isset($data[$_REQUEST['id']])) { list($count) = $db->first("SELECT count(*) FROM " . PRE . "_banner WHERE " . PRE . "_banner.group='" . $id . "'"); if (!$count) { if (isset($_POST['id'])) { if (!checkToken()) { infoInvalidToken(); } else { unset($data[$_REQUEST['id']]); $db->query("UPDATE " . PRE . "_config SET value='" . addslashes(serialize($data)) . "' WHERE module='banner' AND varname='groups' LIMIT 1"); logit('BANNER_CATDEL', $_REQUEST['id']); printJSReload(); } } else { $apx->tmpl->assign('MESSAGE', $apx->lang->get('MSG_TEXT', array('TITLE' => compatible_hsc($data[$_REQUEST['id']])))); tmessageOverlay('catdel', array('ID' => $_REQUEST['id'])); } return; } } elseif ($_REQUEST['do'] == 'edit' && isset($data[$_REQUEST['id']])) { if (isset($_POST['title'])) { if (!checkToken()) { infoInvalidToken(); } elseif (!$_POST['title']) { infoNotComplete(); } else { $data[$_REQUEST['id']] = $_POST['title']; $db->query("UPDATE " . PRE . "_config SET value='" . addslashes(serialize($data)) . "' WHERE module='banner' AND varname='groups' LIMIT 1"); logit('BANNER_CATEDIT', $_REQUEST['id']); printJSRedirect('action.php?action=banner.group'); return; } } else { $_POST['title'] = $data[$_REQUEST['id']]; $apx->tmpl->assign('TITLE', $_POST['title']); $apx->tmpl->assign('ACTION', 'edit'); $apx->tmpl->assign('ID', $_REQUEST['id']); $apx->tmpl->parse('catadd_catedit'); } } elseif ($_REQUEST['do'] == 'add') { if ($_POST['send']) { if (!checkToken()) { printInvalidToken(); } elseif (!$_POST['title']) { infoNotComplete(); } else { if (!count($data)) { $data[1] = $_POST['title']; } else { $data[] = $_POST['title']; } $db->query("UPDATE " . PRE . "_config SET value='" . addslashes(serialize($data)) . "' WHERE module='banner' AND varname='groups' LIMIT 1"); logit('BANNER_CATADD', array_key_max($data)); printJSRedirect('action.php?action=banner.group'); return; } } } else { $apx->tmpl->assign('ACTION', 'add'); $apx->tmpl->parse('catadd_catedit'); } $col[] = array('ID', 1, 'align="center"'); $col[] = array('COL_TITLE', 80, 'class="title"'); $col[] = array('COL_BANNERS', 20, 'align="center"'); //AUSGABE asort($data); foreach ($data as $id => $res) { ++$i; list($count) = $db->first("SELECT count(*) FROM " . PRE . "_banner WHERE " . PRE . "_banner.group='" . $id . "'"); $tabledata[$i]['COL1'] = $id; $tabledata[$i]['COL2'] = $res; $tabledata[$i]['COL3'] = $count; $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'banner.group', 'do=edit&id=' . $id, $apx->lang->get('CORE_EDIT')); if (!$count) { $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', 'banner.group', 'do=del&id=' . $id, $apx->lang->get('CORE_DEL')); } else { $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />'; } } $apx->tmpl->assign('TABLE', $tabledata); $html->table($col); }
function resync() { global $set, $apx, $db; if ($_REQUEST['send']) { if (!checkToken()) { printInvalidToken(); } else { @set_time_limit(600); //Thread- und Beitragszahlen berichtigen $data = $db->fetch("\n\t\t\t\tSELECT forumid\n\t\t\t\tFROM " . PRE . "_forums\n\t\t\t"); if (count($data)) { foreach ($data as $res) { $forumid = $res['forumid']; $forumThreads = 0; $forumPosts = 0; $forumLastpost = array(); $forumLastthread = array(); //Threads auslesen $threaddata = $db->fetch("\n\t\t\t\t\t\tSELECT threadid, prefix, title, icon, del\n\t\t\t\t\t\tFROM " . PRE . "_forum_threads\n\t\t\t\t\t\tWHERE del=0 AND moved=0 AND forumid='" . $forumid . "'\n\t\t\t\t\t"); if (count($threaddata)) { foreach ($threaddata as $tres) { $threadid = $tres['threadid']; list($threadPosts) = $db->first("\n\t\t\t\t\t\t\t\tSELECT count(postid)\n\t\t\t\t\t\t\t\tFROM " . PRE . "_forum_posts\n\t\t\t\t\t\t\t\tWHERE del=0 AND threadid='" . $threadid . "'\n\t\t\t\t\t\t\t"); $threadLastpost = $db->first("\n\t\t\t\t\t\t\t\tSELECT postid, userid, username, time\n\t\t\t\t\t\t\t\tFROM " . PRE . "_forum_posts\n\t\t\t\t\t\t\t\tWHERE del=0 AND threadid='" . $threadid . "'\n\t\t\t\t\t\t\t\tORDER BY time DESC\n\t\t\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\t\t"); $db->query("\n\t\t\t\t\t\t\t\tUPDATE " . PRE . "_forum_threads\n\t\t\t\t\t\t\t\tSET\n\t\t\t\t\t\t\t\t\tposts='" . $threadPosts . "',\n\t\t\t\t\t\t\t\t\tlastpost='" . $threadLastpost['postid'] . "',\n\t\t\t\t\t\t\t\t\tlastposter='" . addslashes($threadLastpost['username']) . "',\n\t\t\t\t\t\t\t\t\tlastposter_userid='" . $threadLastpost['userid'] . "',\n\t\t\t\t\t\t\t\t\tlastposttime='" . $threadLastpost['time'] . "'\n\t\t\t\t\t\t\t\tWHERE threadid='" . $threadid . "'\n\t\t\t\t\t\t\t"); //Themen/Beiträge im Forum if (!$tres['del']) { ++$forumThreads; } $forumPosts += $threadPosts; //Lastpost im Forum if (!$forumLastpost || $forumLastpost['time'] < $threadLastpost['time']) { $forumLastthread = $tres; $forumLastpost = $threadLastpost; } } } //Forum aktualisieren $db->query("\n\t\t\t\t\t\tUPDATE " . PRE . "_forums\n\t\t\t\t\t\tSET\n\t\t\t\t\t\t\tthreads='" . $forumThreads . "',\n\t\t\t\t\t\t\tposts='" . $forumPosts . "',\n\t\t\t\t\t\t\tlastpost='" . $forumLastpost['postid'] . "',\n\t\t\t\t\t\t\tlastposter='" . addslashes($forumLastpost['username']) . "',\n\t\t\t\t\t\t\tlastposter_userid='" . $forumLastpost['userid'] . "',\n\t\t\t\t\t\t\tlastposttime='" . $forumLastpost['time'] . "',\n\t\t\t\t\t\t\tlastthread='" . $forumLastthread['threadid'] . "',\n\t\t\t\t\t\t\tlastthread_title='" . addslashes($forumLastthread['title']) . "',\n\t\t\t\t\t\t\tlastthread_icon='" . addslashes($forumLastthread['icon']) . "',\n\t\t\t\t\t\t\tlastthread_prefix='" . addslashes($forumLastthread['prefix']) . "'\n\t\t\t\t\t\tWHERE forumid='" . $forumid . "'\n\t\t\t\t\t\tLIMIT 1"); } } logit('FORUM_RESYNC'); message($apx->lang->get('MSG_OK')); } } else { tmessage('resync'); } }
function group() { global $set, $db, $apx, $html; $_REQUEST['id'] = (int) $_REQUEST['id']; $data = $set['content']['groups']; //Kategorie löschen if ($_REQUEST['do'] == 'del' && isset($data[$_REQUEST['id']])) { list($count) = $db->first("SELECT count(*) FROM " . PRE . "_content WHERE catid='" . $_REQUEST['id'] . "'"); if (!$count) { if (isset($_POST['id'])) { if (!checkToken()) { infoInvalidToken(); } else { unset($data[$_REQUEST['id']]); $db->query("UPDATE " . PRE . "_config SET value='" . addslashes(serialize($data)) . "' WHERE module='content' AND varname='groups' LIMIT 1"); logit('CONTENT_CATDEL', $_REQUEST['id']); printJSReload(); } } else { $apx->tmpl->assign('MESSAGE', $apx->lang->get('MSG_TEXT', array('TITLE' => compatible_hsc($data[$_REQUEST['id']])))); tmessageOverlay('catdel', array('ID' => $_REQUEST['id'])); } } return; } //Kategorie leeren if ($_REQUEST['do'] == 'clean' && isset($data[$_REQUEST['id']])) { if ($_POST['id'] && $_POST['moveto']) { if (!checkToken()) { infoInvalidToken(); } else { $db->query("UPDATE " . PRE . "_content SET catid='" . intval($_POST['moveto']) . "' WHERE catid='" . $_REQUEST['id'] . "'"); logit('CONTENT_CATCLEAN', "ID #" . $_REQUEST['id']); //Kategorie löschen if ($_POST['delcat']) { unset($data[$_REQUEST['id']]); $db->query("UPDATE " . PRE . "_config SET value='" . addslashes(serialize($data)) . "' WHERE module='content' AND varname='groups' LIMIT 1"); logit('CONTENT_CATDEL', $_REQUEST['id']); } printJSReload(); return; } } else { //Kategorien auflisten $catlist = ''; $data = $set['content']['groups']; if (count($data)) { foreach ($data as $id => $title) { if ($id == $_REQUEST['id']) { continue; } $catlist .= '<option value="' . $id . '"' . iif($_REQUEST['catid'] == $id, ' selected="selected"') . '>' . replace($title) . '</option>'; } } $apx->tmpl->assign('ID', $_REQUEST['id']); $apx->tmpl->assign('TITLE', compatible_hsc($data[$_REQUEST['id']])); $apx->tmpl->assign('DELCAT', (int) $_POST['delcat']); $apx->tmpl->assign('CATLIST', $catlist); tmessageOverlay('catclean'); } return; } elseif ($_REQUEST['do'] == 'edit' && isset($data[$_REQUEST['id']])) { if (isset($_POST['title'])) { if (!checkToken()) { infoInvalidToken(); } elseif (!$_POST['title']) { info('back'); } else { $data[$_REQUEST['id']] = $_POST['title']; $db->query("UPDATE " . PRE . "_config SET value='" . addslashes(serialize($data)) . "' WHERE module='content' AND varname='groups' LIMIT 1"); logit('CONTENT_CATEDIT', $_REQUEST['id']); printJSRedirect('action.php?action=content.group'); return; } } else { $_POST['title'] = $data[$_REQUEST['id']]; $apx->tmpl->assign('TITLE', $_POST['title']); $apx->tmpl->assign('ACTION', 'edit'); $apx->tmpl->assign('ID', $_REQUEST['id']); $apx->tmpl->parse('catadd_catedit'); } } elseif ($_REQUEST['do'] == 'add') { if ($_POST['send']) { if (!checkToken()) { printInvalidToken(); } elseif (!$_POST['title']) { info('back'); } else { if (!count($data)) { $data[1] = $_POST['title']; } else { $data[] = $_POST['title']; } $db->query("UPDATE " . PRE . "_config SET value='" . addslashes(serialize($data)) . "' WHERE module='content' AND varname='groups' LIMIT 1"); logit('CONTENT_CATADD', array_key_max($data)); printJSRedirect('action.php?action=content.group'); return; } } } else { $apx->tmpl->assign('ACTION', 'add'); $apx->tmpl->parse('catadd_catedit'); } $col[] = array('ID', 1, 'align="center"'); $col[] = array('COL_TITLE', 80, 'class="title"'); $col[] = array('COL_CONTENTS', 20, 'align="center"'); //AUSGABE asort($data); foreach ($data as $id => $res) { ++$i; list($count) = $db->first("SELECT count(*) FROM " . PRE . "_content WHERE catid='" . $id . "'"); $tabledata[$i]['COL1'] = $id; $tabledata[$i]['COL2'] = $res; $tabledata[$i]['COL3'] = $count; $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'content.group', 'do=edit&id=' . $id, $apx->lang->get('CORE_EDIT')); if (!$count) { $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', 'content.group', 'do=del&id=' . $id, $apx->lang->get('CORE_DEL')); } else { $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />'; } if ($count) { $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('clean.gif', 'content.group', 'do=clean&id=' . $id, $apx->lang->get('CLEAN')); } else { $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />'; } } $apx->tmpl->assign('TABLE', $tabledata); $html->table($col); }
function disable() { global $set, $db, $apx; $_REQUEST['id'] = (int) $_REQUEST['id']; if (!$_REQUEST['id']) { die('missing ID!'); } if ($_POST['send']) { if (!checkToken()) { printInvalidToken(); } else { $db->query("UPDATE " . PRE . "_poll SET starttime='0',endtime='0' WHERE ( id='" . $_REQUEST['id'] . "' ) LIMIT 1"); logit('POLL_DISABLE', 'ID #' . $_REQUEST['id']); printJSReload(); } } else { list($title) = $db->first("SELECT question FROM " . PRE . "_poll WHERE id='" . $_REQUEST['id'] . "' LIMIT 1"); $apx->tmpl->assign('MESSAGE', $apx->lang->get('MSG_TEXT', array('TITLE' => compatible_hsc($title)))); tmessageOverlay('disable', array('ID' => $_REQUEST['id'])); } }
function disable() { global $set, $db, $apx; $_REQUEST['id'] = (int) $_REQUEST['id']; if (!$_REQUEST['id']) { die('missing ID!'); } if (!checkToken()) { printInvalidToken(); } else { //Kindknoten ebenfalls deaktivieren $cattree = $this->cat->getChildrenIds($_REQUEST['id']); $cattree[] = $_REQUEST['id']; $db->query("UPDATE " . PRE . "_faq SET starttime='0' WHERE id IN (" . implode(', ', $cattree) . ")"); foreach ($cattree as $catid) { logit('FAQ_DISABLE', 'ID #' . $catid); } header("HTTP/1.1 301 Moved Permanently"); header('Location: ' . get_index('faq.show')); } }
function del() { global $set, $db, $apx; $_REQUEST['id'] = (int) $_REQUEST['id']; if (!$_REQUEST['id']) { die('missing ID!'); } if ($_POST['send'] == 1) { if (!checkToken()) { printInvalidToken(); } else { $db->query("DELETE FROM " . PRE . "_contact WHERE id='" . $_REQUEST['id'] . "' LIMIT 1"); logit('CONTACT_DEL', 'ID #' . $_REQUEST['id']); printJSRedirect(get_index('contact.show')); } } else { list($title) = $db->first("SELECT title FROM " . PRE . "_contact WHERE id='" . $_REQUEST['id'] . "' LIMIT 1"); $apx->tmpl->assign('MESSAGE', $apx->lang->get('MSG_TEXT', array('TITLE' => compatible_hsc($title)))); tmessageOverlay('deltitle', array('ID' => $_REQUEST['id']), '/'); } }
function disable() { global $set, $db, $apx; $_REQUEST['id'] = (int) $_REQUEST['id']; if (!$_REQUEST['id']) { die('missing ID!'); } if (!checkToken()) { printInvalidToken(); } else { $db->query("UPDATE " . PRE . "_affiliates SET active='0' WHERE id='" . $_REQUEST['id'] . "' LIMIT 1"); logit('AFFILIATES_DISABLE', 'ID #' . $_REQUEST['id']); header('Location: ' . get_index('affiliates.show')); } }
function del() { global $set, $db, $apx; //Mehrere if (is_array($_REQUEST['multiid'])) { if (!checkToken()) { printInvalidToken(); } else { $cache = array_map('intval', $_REQUEST['multiid']); if (!count($cache)) { header("HTTP/1.1 301 Moved Permanently"); header('Location: ' . get_index('ratings.show')); return; } if (count($cache)) { $db->query("DELETE FROM " . PRE . "_ratings WHERE ( module='" . $this->module . "' AND id IN (" . implode(',', $cache) . ") )"); foreach ($cache as $id) { logit('RATINGS_DEL', 'ID #' . $id); } } header("HTTP/1.1 301 Moved Permanently"); header('Location: ' . get_index('ratings.show')); } } else { $_REQUEST['id'] = (int) $_REQUEST['id']; if (!$_REQUEST['id']) { die('missing ID!'); } if ($_POST['send'] == 1) { if (!checkToken()) { printInvalidToken(); } else { $db->query("DELETE FROM " . PRE . "_ratings WHERE ( id='" . $_REQUEST['id'] . "' AND module='" . $this->module . "' ) LIMIT 1"); logit('RATINGS_DEL', 'ID #' . $_REQUEST['id']); printJSRedirect(get_index('ratings.show')); } } else { tmessageOverlay('del', array('ID' => $_REQUEST['id'])); } } }
function inline_del() { global $set, $apx, $db; $_REQUEST['id'] = (int) $_REQUEST['id']; if (!$_REQUEST['id']) { return; } if (!checkToken()) { printInvalidToken(); exit; } list($picture, $popup) = $db->first("SELECT picture,popup FROM " . PRE . "_inlinescreens WHERE ( module='" . addslashes($_REQUEST['module']) . "' AND id='" . $_REQUEST['id'] . "' ) LIMIT 1"); if ($picture && file_exists(BASEDIR . getpath('uploads') . $picture)) { $this->mm->deletefile($picture); } if ($popup && file_exists(BASEDIR . getpath('uploads') . $popup)) { $this->mm->deletefile($popup); } $db->query("DELETE FROM " . PRE . "_inlinescreens WHERE ( module='" . addslashes($_REQUEST['module']) . "' AND id='" . $_REQUEST['id'] . "' )"); printJSRedirect('action.php?action=mediamanager.inline&module=' . $_REQUEST['module'] . '&mid=' . $_REQUEST['mid'] . '&hash=' . $_REQUEST['hash'] . '&fields=' . $_REQUEST['fields']); exit; }
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'); }
function catclean() { global $set, $db, $apx; $_REQUEST['id'] = (int) $_REQUEST['id']; if (!$_REQUEST['id']) { die('missing ID!'); } if ($_POST['send'] == 1) { if (!checkToken()) { printInvalidToken(); } elseif ($_POST['id'] && $_POST['moveto']) { $db->query("UPDATE " . PRE . "_glossar SET catid='" . intval($_POST['moveto']) . "' WHERE catid='" . $_REQUEST['id'] . "'"); logit('GLOSSAR_CATCLEAN', "ID #" . $_REQUEST['id']); //Kategorie löschen if ($_POST['delcat']) { $db->query("DELETE FROM " . PRE . "_glossar_cat WHERE id='" . $_REQUEST['id'] . "' LIMIT 1"); logit('GLOSSAR_CATDEL', "ID #" . $_REQUEST['id']); } printJSRedirect(get_index('glossar.catshow')); return; } } //Andere Kategorien auflisten $data = $db->fetch("SELECT id,title FROM " . PRE . "_glossar_cat WHERE id!='" . $_REQUEST['id'] . "' ORDER BY title ASC"); if (count($data)) { foreach ($data as $res) { $catlist .= '<option value="' . $res['id'] . '" ' . iif($_POST['moveto'] == $res['id'], ' selected="selected"') . '>' . replace($res['title']) . '</option>'; } } list($title) = $db->first("SELECT title FROM " . PRE . "_glossar_cat WHERE id='" . $_REQUEST['id'] . "' LIMIT 1"); $apx->tmpl->assign('TITLE', compatible_hsc($title)); $apx->tmpl->assign('ID', $_REQUEST['id']); $apx->tmpl->assign('DELCAT', (int) $_POST['delcat']); $apx->tmpl->assign('CATLIST', $catlist); tmessageOverlay('catclean'); }
function group() { global $set, $db, $apx, $html; $_REQUEST['id'] = (int) $_REQUEST['id']; $data = $set['navi']['groups']; //Kategorie löschen if ($_REQUEST['do'] == 'del' && isset($data[$_REQUEST['id']])) { list($count) = $db->first("SELECT count(*) FROM " . PRE . "_navi WHERE nid='" . $id . "'"); if (!$count) { if (isset($_POST['id'])) { if (!checkToken()) { infoInvalidToken(); } else { //Navigationspunkte löschen $queryData = $db->fetch("SELECT id FROM " . PRE . "_navi WHERE nid='" . $_REQUEST['id'] . "' AND parents='|'"); foreach ($queryData as $res) { $this->cat->deleteSubtree($res['id']); } //Navigation löschen unset($data[$_REQUEST['id']]); $db->query("UPDATE " . PRE . "_config SET value='" . addslashes(serialize($data)) . "' WHERE module='navi' AND varname='groups' LIMIT 1"); logit('NAVI_CATDEL', $_REQUEST['id']); printJSReload(); } } else { $apx->tmpl->assign('MESSAGE', $apx->lang->get('MSG_TEXT', array('TITLE' => compatible_hsc($data[$_REQUEST['id']])))); tmessageOverlay('catdel', array('ID' => $_REQUEST['id'])); } return; } } elseif ($_REQUEST['do'] == 'edit' && isset($data[$_REQUEST['id']])) { if (isset($_POST['title'])) { if (!checkToken()) { infoInvalidToken(); } elseif (!$_POST['title']) { info('back'); } else { $data[$_REQUEST['id']] = $_POST['title']; $db->query("UPDATE " . PRE . "_config SET value='" . addslashes(serialize($data)) . "' WHERE module='navi' AND varname='groups' LIMIT 1"); logit('NAVI_CATEDIT', $_REQUEST['id']); printJSRedirect('action.php?action=navi.group'); return; } } else { $_POST['title'] = $data[$_REQUEST['id']]; $apx->tmpl->assign('TITLE', $_POST['title']); $apx->tmpl->assign('ACTION', 'edit'); $apx->tmpl->assign('ID', $_REQUEST['id']); $apx->tmpl->parse('catadd_catedit'); } } elseif ($_REQUEST['do'] == 'add') { if ($_POST['send']) { if (!checkToken()) { printInvalidToken(); } elseif (!$_POST['title']) { info('back'); } else { if (!count($data)) { $data[1] = $_POST['title']; } else { $data[] = $_POST['title']; } $db->query("UPDATE " . PRE . "_config SET value='" . addslashes(serialize($data)) . "' WHERE module='navi' AND varname='groups' LIMIT 1"); logit('NAVI_CATADD', array_key_max($data)); printJSRedirect('action.php?action=navi.group'); return; } } } else { $apx->tmpl->assign('ACTION', 'add'); $apx->tmpl->parse('catadd_catedit'); } $col[] = array('ID', 1, 'align="center"'); $col[] = array('COL_TITLE', 80, 'class="title"'); $col[] = array('COL_ENTRIES', 20, 'align="center"'); //AUSGABE asort($data); foreach ($data as $id => $res) { ++$i; list($count) = $db->first("SELECT count(*) FROM " . PRE . "_navi WHERE nid='" . $id . "'"); $tabledata[$i]['COL1'] = $id; $tabledata[$i]['COL2'] = $res; $tabledata[$i]['COL3'] = $count; $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'navi.group', 'do=edit&id=' . $id, $apx->lang->get('CORE_EDIT')); $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', 'navi.group', 'do=del&id=' . $id, $apx->lang->get('CORE_DEL')); } $apx->tmpl->assign('TABLE', $tabledata); $html->table($col); }
function catshow() { global $set, $db, $apx, $html; $_REQUEST['id'] = (int) $_REQUEST['id']; $data = $set['newsletter']['categories']; //Kategorie löschen if ($_REQUEST['do'] == 'del' && isset($data[$_REQUEST['id']])) { if (isset($_POST['id'])) { if (!checkToken()) { printInvalidToken(); } else { unset($data[$_REQUEST['id']]); $db->query("UPDATE " . PRE . "_config SET value='" . addslashes(serialize($data)) . "' WHERE module='newsletter' AND varname='categories' LIMIT 1"); logit('NEWSLETTER_CATDEL', $_REQUEST['id']); printJSRedirect('action.php?action=newsletter.catshow'); } } else { tmessageOverlay('catdel', array('ID' => $_REQUEST['id'])); } return; } elseif ($_REQUEST['do'] == 'edit' && isset($data[$_REQUEST['id']])) { if ($_POST['send']) { if (!checkToken()) { infoInvalidToken(); } elseif (!$_POST['title']) { infoNotComplete(); } else { $data[$_REQUEST['id']] = $_POST['title']; $db->query("UPDATE " . PRE . "_config SET value='" . addslashes(serialize($data)) . "' WHERE module='newsletter' AND varname='categories' LIMIT 1"); logit('NEWSLETTER_CATEDIT', $_REQUEST['id']); printJSRedirect('action.php?action=newsletter.catshow'); } } else { $_POST['title'] = $data[$_REQUEST['id']]; $apx->tmpl->assign('TITLE', $_POST['title']); $apx->tmpl->assign('ACTION', 'edit'); $apx->tmpl->assign('ID', $_REQUEST['id']); $apx->tmpl->parse('catadd_catedit'); } } elseif ($_REQUEST['do'] == 'add') { if ($_POST['send']) { if (!checkToken()) { infoInvalidToken(); } elseif (!$_POST['title']) { infoNotComplete(); } else { $data[] = $_POST['title']; $db->query("UPDATE " . PRE . "_config SET value='" . addslashes(serialize($data)) . "' WHERE module='newsletter' AND varname='categories' LIMIT 1"); logit('NEWSLETTER_CATADD', array_key_max($data)); printJSRedirect('action.php?action=newsletter.catshow'); } } return; } else { $apx->tmpl->assign('ACTION', 'add'); $apx->tmpl->parse('catadd_catedit'); } ////////// AUFLISTUNG $col[] = array('COL_TITLE', 100, 'class="title"'); asort($data); if (count($data)) { foreach ($data as $id => $name) { ++$i; $tabledata[$i]['COL1'] = replace($name); $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'newsletter.catshow', 'do=edit&id=' . $id, $apx->lang->get('CORE_EDIT')); $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', 'newsletter.catshow', 'do=del&id=' . $id, $apx->lang->get('CORE_DEL')); } } $apx->tmpl->assign('TABLE', $tabledata); $html->table($col); }
function sendpm_exec() { global $apx, $db, $set; //Token prüfen if (!checkToken()) { printInvalidToken(); return; } //FORWARDER if (!isset($_REQUEST['done'])) { tmessage('sending', array('FORWARDER' => 'action.php?action=user.sendpm&doit=1&sectoken=' . $apx->session->get('sectoken') . '&done=0')); return; } //VARS $done = (int) $_REQUEST['done']; $countPerCall = 50; @set_time_limit(600); //Newsletter-Info auslesen $newsletter = $set['user']['sendpm_data']; if (!isset($newsletter['text'])) { die('no valid newsletter!'); } $newsletter['text_clear'] = $newsletter['text']; while (preg_match('#\\[([a-z0-9]+)(=.*?)?\\](.*?)\\[/\\1\\]#si', $newsletter['text_clear'])) { $text = preg_replace('#\\[([a-z0-9]+)(=.*?)?\\](.*?)\\[/\\1\\]#si', '\\3', $newsletter['text_clear']); } //SEND NEWSLETTER if (is_array($newsletter['groups']) && count($newsletter['groups'])) { $data = $db->fetch("SELECT userid, email, pub_poppm, pub_mailpm FROM " . PRE . "_user WHERE active=1 AND reg_key='' AND groupid IN (" . implode(',', $newsletter['groups']) . ") ORDER BY email ASC LIMIT " . $done . "," . $countPerCall); } else { $data = $db->fetch("SELECT userid, email, pub_poppm, pub_mailpm FROM " . PRE . "_user WHERE active=1 AND reg_key='' ORDER BY email ASC LIMIT " . $done . "," . $countPerCall); } if (count($data)) { foreach ($data as $res) { ++$i; $this->sendpm_send($res, $newsletter['subject'], $newsletter['text'], $newsletter['text_clear']); } ////// FORWARDER //Vorgang beendet if ($i < $countPerCall) { $db->query("UPDATE " . PRE . "_config SET value='' WHERE module='user' AND varname='sendpm_data' LIMIT 1"); logit('USER_SENDPM'); message($apx->lang->get('MSG_OK')); return; } else { tmessage('sending', array('FORWARDER' => 'action.php?action=user.sendpm&doit=1&sectoken=' . $apx->session->get('sectoken') . '&done=' . ($done + $countPerCall))); return; } } else { $db->query("UPDATE " . PRE . "_config SET value='' WHERE module='user' AND varname='sendpm_data' LIMIT 1"); logit('USER_SENDPM'); message($apx->lang->get('MSG_OK')); return; } }
function systems_del() { global $set, $db, $apx; $_REQUEST['id'] = (int) $_REQUEST['id']; if (!$_REQUEST['id']) { die('missing ID!'); } if ($_POST['send'] == 1) { if (!checkToken()) { printInvalidToken(); } else { $db->query("DELETE FROM " . PRE . "_products_groups WHERE grouptype='system' AND id='" . $_REQUEST['id'] . "'"); logit('PRODUCTS_SYSTEMS_DEL', 'ID #' . $_REQUEST['id']); printJSRedirect(get_index('products.systems')); } } else { list($title) = $db->first("SELECT title FROM " . PRE . "_products_groups WHERE id='" . $_REQUEST['id'] . "' LIMIT 1"); $apx->tmpl->assign('MESSAGE', $apx->lang->get('DEL_TEXT', array('TITLE' => compatible_hsc($title)))); tmessageOverlay('sysdel', array('ID' => $_REQUEST['id'])); } }
function blockcontent() { global $set, $db, $apx, $html; $_REQUEST['key'] = (int) $_REQUEST['key']; //IP löschen if ($_REQUEST['do'] == 'del') { if ($_POST['send']) { if (!checkToken()) { printInvalidToken(); } else { unset($set['guestbook']['blockstring'][$_REQUEST['id']]); $db->query("UPDATE " . PRE . "_config SET value='" . addslashes(serialize($set['guestbook']['blockstring'])) . "' WHERE module='guestbook' AND varname='blockstring' LIMIT 1"); printJSRedirect('action.php?action=guestbook.blockcontent'); } } else { $apx->tmpl->assign('MESSAGE', $apx->lang->get('MSG_DEL', array('TITLE' => compatible_hsc($set['guestbook']['blockstring'][$_REQUEST['id']])))); tmessageOverlay('contentdel', array('ID' => $_REQUEST['id'])); } return; } elseif ($_REQUEST['do'] == 'add') { if (!checkToken()) { printInvalidToken(); } elseif (!$_POST['string']) { infoNotComplete(); } else { $set['guestbook']['blockstring'][] = $_POST['string']; $db->query("UPDATE " . PRE . "_config SET value='" . addslashes(serialize($set['guestbook']['blockstring'])) . "' WHERE module='guestbook' AND varname='blockstring' LIMIT 1"); printJSRedirect('action.php?action=guestbook.blockcontent'); } return; } quicklink_index('guestbook.show'); quicklink_out(); //AUFLISTUNG BEGINNT $strings = $set['guestbook']['blockstring']; if (!is_array($strings)) { $strings = array(); } $strings = array_sort($strings, 0, 'asc'); $col[] = array('TITLE_GUESTBOOK_BLOCKCONTENT', 100, 'class="title"'); foreach ($strings as $i => $res) { $tabledata[$i]['COL1'] = $res; $tabledata[$i]['OPTIONS'] = optionHTMLOverlay('del.gif', 'guestbook.blockcontent', 'do=del&id=' . $i, $apx->lang->get('CORE_DEL')); } $apx->tmpl->assign('TABLE', $tabledata); $html->table($col); $apx->tmpl->parse('blockcontent'); }
function preview() { global $set, $db, $apx; $_REQUEST['id'] = (int) $_REQUEST['id']; $_REQUEST['gid'] = (int) $_REQUEST['gid']; if (!$_REQUEST['id']) { die('missing ID!'); } if (!$_REQUEST['gid']) { die('missing gallery ID!'); } //AKTIV-CHECK list($thumb, $active) = $db->first("SELECT thumbnail,active FROM " . PRE . "_gallery_pics WHERE ( id='" . $_REQUEST['id'] . "' AND galid='" . $_REQUEST['gid'] . "' ) LIMIT 1"); if (!$active) { message($apx->lang->get('MSG_NOTACTIVE')); return; } if ($_POST['send']) { if (!checkToken()) { printInvalidToken(); } else { $db->query("UPDATE " . PRE . "_gallery SET preview='" . $thumb . "' WHERE id='" . $_REQUEST['gid'] . "' LIMIT 1"); logit('GALLERY_PREVIEW', 'ID #' . $_REQUEST['galid'] . ' -> ' . $_REQUEST['id']); printJSRedirect(get_index('gallery.pshow')); } } else { $input['ID'] = $_REQUEST['id']; $input['GID'] = $_REQUEST['gid']; tmessageOverlay('preview', $input); } }