Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 function icons_del()
 {
     global $set, $apx, $db;
     $_REQUEST['id'] = (int) $_REQUEST['id'];
     if ($_POST['send']) {
         if (!checkToken()) {
             printInvalidToken();
         } else {
             unset($set['forum']['icons'][$_REQUEST['id']]);
             $db->query("UPDATE " . PRE . "_config SET value='" . addslashes(serialize($set['forum']['icons'])) . "' WHERE module='forum' AND varname='icons' LIMIT 1");
             logit('FORUM_ICONSDEL', $_REQUEST['id']);
             printJSRedirect('action.php?action=forum.icons');
         }
     } else {
         tmessageOverlay('icondel', array('ID' => $_REQUEST['id']));
     }
 }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
0
 function enable()
 {
     global $set, $db, $apx;
     $_REQUEST['id'] = (int) $_REQUEST['id'];
     if (!$_REQUEST['id']) {
         die('missing ID!');
     }
     if ($_POST['send'] == 1) {
         $starttime = maketime(1);
         $endtime = maketime(2);
         if (!$endtime || $endtime <= $starttime) {
             $endtime = 3000000000;
         }
         $db->query("UPDATE " . PRE . "_poll SET starttime='" . $starttime . "',endtime='" . $endtime . "' WHERE ( id='" . $_REQUEST['id'] . "' ) LIMIT 1");
         logit('POLL_ENABLE', 'ID #' . $_REQUEST['id']);
         printJSRedirect(get_index('poll.show'));
     } else {
         list($title) = $db->first("SELECT question FROM " . PRE . "_poll WHERE id='" . $_REQUEST['id'] . "' LIMIT 1");
         $apx->tmpl->assign('ID', $_REQUEST['id']);
         $apx->tmpl->assign('TITLE', compatible_hsc($title));
         $apx->tmpl->assign('STARTTIME', choosetime(1, 0, time()));
         $apx->tmpl->assign('ENDTIME', choosetime(2, 1));
         tmessageOverlay('enable', $input);
     }
 }
Exemplo n.º 5
0
 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']));
     }
 }
Exemplo n.º 6
0
 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']), '/');
     }
 }
Exemplo n.º 7
0
 function cfg()
 {
     global $set, $db, $apx;
     if ($_POST['send'] == 1) {
         $invalid = array();
         if ($_POST['ffmpeg'] && !$this->validateExecPath('ffmpeg', $_POST['ffmpeg'])) {
             $invalid[] = 'FFmpeg';
         }
         if ($_POST['flvtool2'] && !$this->validateExecPath('flvtool2', $_POST['flvtool2'])) {
             $invalid[] = 'FLVTool2';
         }
         if ($_POST['mencoder'] && !$this->validateExecPath('mencoder', $_POST['mencoder'])) {
             $invalid[] = 'MEncoder';
         }
         if (!$_POST['ffmpeg'] || !$_POST['flvtool2']) {
             info($apx->lang->get('CORE_BACK'));
         } elseif ($invalid) {
             info($apx->lang->get('INFO_INVALID') . implode(', ', $invalid));
         } else {
             $db->query("UPDATE " . PRE . "_config SET value='" . addslashes($_POST['ffmpeg']) . "' WHERE module='videos' AND varname='ffmpeg' LIMIT 1");
             $db->query("UPDATE " . PRE . "_config SET value='" . addslashes($_POST['flvtool2']) . "' WHERE module='videos' AND varname='flvtool2' LIMIT 1");
             $db->query("UPDATE " . PRE . "_config SET value='" . addslashes($_POST['mencoder']) . "' WHERE module='videos' AND varname='mencoder' LIMIT 1");
             logit('VIDEOS_CFG');
             printJSRedirect('action.php?action=videos.cfg');
         }
     } else {
         if (!function_exists('exec')) {
             message($apx->lang->get('MSG_EXEC_DISABLED'));
             return;
         }
         $apx->tmpl->assign('FFMPEG', compatible_hsc($set['videos']['ffmpeg']));
         $apx->tmpl->assign('FLVTOOL2', compatible_hsc($set['videos']['flvtool2']));
         $apx->tmpl->assign('MENCODER', compatible_hsc($set['videos']['mencoder']));
         $apx->tmpl->parse('cfg');
     }
 }
Exemplo n.º 8
0
 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']));
         }
     }
 }
Exemplo n.º 9
0
 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');
 }
Exemplo n.º 10
0
 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;
 }
Exemplo n.º 11
0
 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 . "_links SET catid='" . intval($_POST['moveto']) . "' WHERE catid='" . $_REQUEST['id'] . "'");
             logit('LINKS_CATCLEAN', "ID #" . $_REQUEST['id']);
             //Kategorie löschen
             if ($_POST['delcat']) {
                 $this->cat->deleteNode($_REQUEST['id']);
                 logit('LINKS_CATDEL', "ID #" . $_REQUEST['id']);
             }
             printJSRedirect(get_index('links.catshow'));
             return;
         }
     }
     $data = $this->cat->getTree(array('title', 'open'));
     if (count($data)) {
         foreach ($data as $res) {
             if ($res['level']) {
                 $space = str_repeat('&nbsp;&nbsp;', $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 . "_links_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');
 }
Exemplo n.º 12
0
 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);
 }
Exemplo n.º 13
0
 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);
 }
Exemplo n.º 14
0
 function sendpm()
 {
     global $set, $db, $apx;
     //Senden durchführen
     if ($_REQUEST['doit']) {
         $this->sendpm_exec();
         return;
     }
     //Gruppen selected
     if (!is_array($_POST['groupid']) || $_POST['groupid'][0] == 'all') {
         $_POST['groupid'] = array('all');
     }
     //Daten speichern
     if ($_POST['send']) {
         if (!checkToken()) {
             infoInvalidToken();
         } elseif (!$_POST['subject'] || !$_POST['text'] || !count($_POST['groupid'])) {
             infoNotComplete();
         } else {
             $groups = array();
             if ($_POST['groupid'][0] != 'all') {
                 $groups = array_map('intval', $_POST['groupid']);
             }
             $data = array('subject' => $_POST['subject'], 'text' => $_POST['text'], 'groups' => $groups);
             $db->query("UPDATE " . PRE . "_config SET value='" . addslashes(serialize($data)) . "' WHERE module='user' AND varname='sendpm_data' LIMIT 1");
             //die('action.php?action=user.sendpm&doit=1');
             printJSRedirect('action.php?action=user.sendpm&doit=1&sectoken=' . $apx->session->get('sectoken'));
         }
     } else {
         //Sektionen auflisten
         $grouplist = '<option value="all"' . iif($_POST['groupid'][0] == 'all', 'selected="selected"') . ' style="font-weight:bold;">' . $apx->lang->get('ALL') . '</option>';
         $data = $db->fetch("SELECT groupid,name FROM " . PRE . "_user_groups ORDER BY name ASC");
         if (count($data)) {
             foreach ($data as $res) {
                 $grouplist .= '<option value="' . $res['groupid'] . '"' . iif(in_array($res['groupid'], $_POST['groupid']), ' selected="selected"') . '>' . replace($res['name']) . '</option>';
             }
         }
         $apx->tmpl->assign('GROUP', $grouplist);
         $apx->tmpl->assign('SUBJECT', compatible_hsc($_POST['subject']));
         $apx->tmpl->assign('TEXT', compatible_hsc($_POST['text']));
         $apx->tmpl->parse('sendpm');
     }
 }
Exemplo n.º 15
0
 function del()
 {
     global $set, $db, $apx;
     $_REQUEST['id'] = (int) $_REQUEST['id'];
     if (!$_REQUEST['id']) {
         die('missing ID!');
     }
     if ($_POST['send'] == 1) {
         if (!checkToken()) {
             infoInvalidToken();
         } else {
             list($image) = $db->first("SELECT image FROM " . PRE . "_affiliates WHERE id='" . $_REQUEST['id'] . "' LIMIT 1");
             require BASEDIR . 'lib/class.mediamanager.php';
             $mm = new mediamanager();
             $mm->deletefile($image);
             $db->query("DELETE FROM " . PRE . "_affiliates WHERE id='" . $_REQUEST['id'] . "' LIMIT 1");
             logit('AFFILIATES_DEL', 'ID #' . $_REQUEST['id']);
             printJSRedirect(get_index('affiliates.show'));
         }
     } else {
         list($title) = $db->first("SELECT title FROM " . PRE . "_affiliates WHERE id='" . $_REQUEST['id'] . "' LIMIT 1");
         $apx->tmpl->assign('MESSAGE', $apx->lang->get('MSG_TEXT', array('TITLE' => compatible_hsc($title))));
         tmessageOverlay('del', array('ID' => $_REQUEST['id']));
     }
 }
Exemplo n.º 16
0
 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');
 }
Exemplo n.º 17
0
 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'] . ' -&gt; ' . $_REQUEST['id']);
             printJSRedirect(get_index('gallery.pshow'));
         }
     } else {
         $input['ID'] = $_REQUEST['id'];
         $input['GID'] = $_REQUEST['gid'];
         tmessageOverlay('preview', $input);
     }
 }