Beispiel #1
0
 function show()
 {
     global $set, $db, $apx, $html;
     quicklink('contact.add');
     $orderdef[0] = 'title';
     $orderdef['title'] = array('title', 'ASC', 'COL_TITLE');
     $orderdef['email'] = array('email', 'ASC', 'COL_EMAIL');
     $col[] = array('ID', 3, 'align="center"');
     $col[] = array('COL_TITLE', 50, 'class="title"');
     $col[] = array('COL_EMAIL', 47, '');
     list($count) = $db->first("SELECT count(id) FROM " . PRE . "_contact");
     pages('action.php?action=contact.show&sortby=' . $_REQUEST['sortby'], $count);
     $data = $db->fetch("SELECT id,title,email FROM " . PRE . "_contact " . getorder($orderdef) . getlimit());
     if (count($data)) {
         foreach ($data as $res) {
             ++$i;
             $tabledata[$i]['COL1'] = $res['id'];
             $tabledata[$i]['COL2'] = replace($res['title']);
             $tabledata[$i]['COL3'] = replace($res['email']);
             //Optionen
             if ($apx->user->has_right('contact.edit')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'contact.edit', 'id=' . $res['id'], $apx->lang->get('CORE_EDIT'));
             }
             if ($apx->user->has_right('contact.del')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', 'contact.del', 'id=' . $res['id'], $apx->lang->get('CORE_DEL'));
             }
         }
     }
     $apx->tmpl->assign('TABLE', $tabledata);
     $html->table($col);
     orderstr($orderdef, 'action.php?action=contact.show');
     save_index($_SERVER['REQUEST_URI']);
 }
Beispiel #2
0
 function icons()
 {
     global $set, $apx, $db, $html;
     //Aktionen
     if ($_REQUEST['do'] == 'add') {
         return $this->icons_add();
     }
     if ($_REQUEST['do'] == 'del') {
         return $this->icons_del();
     }
     $apx->tmpl->parse('addicons');
     $col[] = array('ICON', 100);
     $icons = $set['forum']['icons'];
     $icons = array_sort($icons, 'ord', 'ASC');
     $count = count($icons);
     foreach ($icons as $key => $info) {
         ++$i;
         $tabledata[$i]['COL1'] = '<img src="' . iif(substr($info['file'], 0, 1) == '/', $info['file'], '../forum/' . $info['file']) . '" alt="" />';
         $tabledata[$i]['ID'] = 'node:' . $key;
         $tabledata[$i]['OPTIONS'] = optionHTMLOverlay('del.gif', 'forum.icons', 'do=del&id=' . $key, $apx->lang->get('CORE_DEL'));
         /*if ( $i!=1 ) $tabledata[$i]['OPTIONS'].=optionHTML('moveup.gif', 'forum.icons', 'do=move&direction=up&id='.$key.'&sectoken='.$apx->session->get('sectoken'), $apx->lang->get('MOVEUP'));
         		else $tabledata[$i]['OPTIONS'].='<img src="design/ispace_small.gif" alt="" />';
         		if ( $i!=$count ) $tabledata[$i]['OPTIONS'].=optionHTML('movedown.gif', 'forum.icons', 'do=move&direction=down&id='.$key.'&sectoken='.$apx->session->get('sectoken'), $apx->lang->get('MOVEDOWN'));
         		else $tabledata[$i]['OPTIONS'].='<img src="design/ispace_small.gif" alt="" />';*/
     }
     echo '<div class="listview" id="list">';
     $apx->tmpl->assign('TABLE', $tabledata);
     $html->table($col);
     echo '</div>';
     $apx->tmpl->parse('icons_js');
 }
Beispiel #3
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);
 }
Beispiel #4
0
 function show()
 {
     global $set, $db, $apx, $html;
     quicklink('poll.add');
     $orderdef[0] = 'addtime';
     $orderdef['question'] = array('question', 'ASC', 'COL_QUESTION');
     $orderdef['addtime'] = array('addtime', 'DESC', 'COL_ADDTIME');
     $orderdef['starttime'] = array('starttime', 'DESC', 'COL_STARTTIME');
     $orderdef['endtime'] = array('endtime', 'DESC', 'COL_ENDTIME');
     $col[] = array('', 1, 'align="center"');
     $col[] = array('COL_QUESTION', 60, 'class="title"');
     $col[] = array('COL_STARTTIME', 20, 'align="center"');
     $col[] = array('COL_ENDTIME', 20, 'align="center"');
     list($count) = $db->first("SELECT count(id) FROM " . PRE . "_poll");
     pages('action.php?action=poll.show&amp;sortby=' . $_REQUEST['sortby'], $count);
     $data = $db->fetch("SELECT id,secid,question,addtime,starttime,endtime,days,allowcoms FROM " . PRE . "_poll " . getorder($orderdef) . getlimit());
     if (count($data)) {
         foreach ($data as $res) {
             ++$i;
             if (!$res['starttime']) {
                 $tabledata[$i]['COL1'] = '<img src="design/reddot.gif" alt="' . $apx->lang->get('CORE_INACTIVE') . '" title="' . $apx->lang->get('CORE_INACTIVE') . '" />';
             } elseif ($res['endtime'] < time()) {
                 $tabledata[$i]['COL1'] = '<img src="design/greendotcross.gif" alt="' . $apx->lang->get('CORE_INACTIVE') . '" title="' . $apx->lang->get('CORE_INACTIVE') . '" />';
             } elseif ($res['starttime'] > time()) {
                 $tabledata[$i]['COL1'] = '<img src="design/greendotwait.gif" alt="' . $apx->lang->get('CORE_ACTIVE') . '" title="' . $apx->lang->get('CORE_ACTIVE') . '" />';
             } else {
                 $tabledata[$i]['COL1'] = '<img src="design/greendot.gif" alt="' . $apx->lang->get('CORE_ACTIVE') . '" title="' . $apx->lang->get('CORE_ACTIVE') . '" />';
             }
             $tmp = unserialize_section($res['secid']);
             $question = shorttext(strip_tags($res['question']), 60);
             $link = mklink('poll.php?id=' . $res['id'], 'poll,' . $res['id'] . urlformat($res['question']) . '.html', iif($set['main']['forcesection'], iif(unserialize_section($res['secid']) == array('all'), $apx->section_default, array_shift($tmp)), 0));
             $tabledata[$i]['COL2'] = '<a href="' . $link . '" target="_blank">' . $question . '</a>';
             if ($res['starttime']) {
                 $tabledata[$i]['COL3'] = mkdate($res['starttime'], '<br />');
             }
             if ($res['starttime']) {
                 $tabledata[$i]['COL4'] = mkdate($res['starttime'] + $res['days'] * 24 * 3600, '<br />');
             }
             //Optionen
             if ($apx->user->has_right('poll.edit')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'poll.edit', 'id=' . $res['id'], $apx->lang->get('CORE_EDIT'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             if ($apx->user->has_right('poll.del')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', 'poll.del', 'id=' . $res['id'], $apx->lang->get('CORE_DEL'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             if ((!$res['starttime'] || $res['endtime'] < time()) && $apx->user->has_right('poll.enable')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('enable.gif', 'poll.enable', 'id=' . $res['id'], $apx->lang->get('CORE_ENABLE'));
             } elseif ($res['starttime'] && $apx->user->has_right('poll.disable')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('disable.gif', 'poll.disable', 'id=' . $res['id'], $apx->lang->get('CORE_DISABLE'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             //Kommentare
             if ($apx->is_module('comments')) {
                 $tabledata[$i]['OPTIONS'] .= '&nbsp;';
                 list($comments) = $db->first("SELECT count(mid) FROM " . PRE . "_comments WHERE ( module='poll' AND mid='" . $res['id'] . "' )");
                 if ($comments && ($apx->is_module('comments') && $set['poll']['coms']) && $res['allowcoms'] && $apx->user->has_right('comments.show')) {
                     $tabledata[$i]['OPTIONS'] .= optionHTML('comments.gif', 'comments.show', 'module=poll&mid=' . $res['id'], $apx->lang->get('COMMENTS'));
                 } else {
                     $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
                 }
             }
         }
     }
     $apx->tmpl->assign('TABLE', $tabledata);
     $html->table($col);
     orderstr($orderdef, 'action.php?action=poll.show');
     save_index($_SERVER['REQUEST_URI']);
 }
Beispiel #5
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);
 }
Beispiel #6
0
 function show()
 {
     global $set, $db, $apx, $html;
     //Layer generieren
     if (!$this->mid) {
         $data = $db->fetch("SELECT module FROM " . PRE . "_ratings GROUP BY module ORDER BY module ASC");
         if (count($data)) {
             foreach ($data as $res) {
                 if (!$apx->is_module($res['module'])) {
                     continue;
                 }
                 ++$mi;
                 if ($mi == 1 && !$this->module) {
                     $this->module = $res['module'];
                 }
                 $commodules[] = $res['module'];
             }
         }
         if (!is_array($commodules)) {
             return;
         }
         foreach ($apx->modules as $module => $trash) {
             if ($module == 'ratings') {
                 continue;
             }
             if (!in_array($module, $commodules) && $_REQUEST['module'] != $module) {
                 continue;
             }
             $layerdef[] = array('MODULENAME_' . strtoupper($module), 'action.php?action=ratings.show&amp;module=' . $module, $this->module == $module);
         }
         $html->layer_header($layerdef);
     }
     $orderdef[0] = 'time';
     $orderdef['rating'] = array('rating', 'ASC', 'COL_RATING');
     $orderdef['name'] = array('ip', 'ASC', 'COL_IP');
     $orderdef['time'] = array('time', 'DESC', 'COL_TIME');
     $col[] = array('COL_RATING', 20, 'align="center"');
     $col[] = array('COL_IP', 35, 'align="center"');
     $col[] = array('COL_TIME', 45, 'align="center"');
     list($count) = $db->first("SELECT count(id) FROM " . PRE . "_ratings WHERE ( module='" . $this->module . "' " . iif($this->mid, "AND mid='" . $this->mid . "'") . " )");
     pages('action.php?action=ratings.show&amp;module=' . $this->module . '&amp;mid=' . $this->mid . '&amp;sortby=' . $_REQUEST['sortby'], $count);
     $data = $db->fetch("SELECT id,ip,rating,time FROM " . PRE . "_ratings WHERE ( module='" . $this->module . "' " . iif($this->mid, "AND mid='" . $this->mid . "'") . " ) " . getorder($orderdef) . getlimit());
     if (count($data)) {
         foreach ($data as $res) {
             ++$i;
             $tabledata[$i]['ID'] = $res['id'];
             $tabledata[$i]['COL1'] = $res['rating'];
             $tabledata[$i]['COL2'] = $res['ip'];
             $tabledata[$i]['COL3'] = mkdate($res['time']);
             //Optionen
             if ($apx->user->has_right('ratings.del')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', 'ratings.del', 'module=' . $this->module . '&mid=' . $this->mid . '&id=' . $res['id'], $apx->lang->get('CORE_DEL'));
             }
         }
     }
     $multiactions = array();
     if ($apx->user->has_right('ratings.del')) {
         $multiactions[] = array($apx->lang->get('CORE_DEL'), 'action.php?action=ratings.del&module=' . $this->module . '&mid=' . $this->mid, false);
     }
     $apx->tmpl->assign('TABLE', $tabledata);
     $html->table($col, $multiactions);
     orderstr($orderdef, 'action.php?action=ratings.show&amp;module=' . $this->module . '&amp;mid=' . $this->mid);
     //Layer-Footer ausgeben
     if (!$this->mid) {
         $html->layer_footer();
     }
     save_index($_SERVER['REQUEST_URI']);
 }
Beispiel #7
0
 function show()
 {
     global $set, $db, $apx, $html;
     //Struktur reparieren
     if ($_REQUEST['repair']) {
         $this->cat->repair();
         echo 'Repair done!';
         return;
     }
     quicklink('faq.add');
     //DnD-Hinweis
     if ($apx->user->has_right('faq.edit')) {
         echo '<p class="hint">' . $apx->lang->get('USEDND') . '</p>';
     }
     $col[] = array('', 1, '');
     $col[] = array('COL_QUESTION', 80, 'class="title"');
     $col[] = array('COL_HITS', 20, 'align="center"');
     $prefix = array();
     $data = $this->cat->getTree(array('*'));
     if (count($data)) {
         //Ausgabe erfolgt
         foreach ($data as $res) {
             ++$i;
             if ($res['starttime']) {
                 $tabledata[$i]['COL1'] = '<img src="design/greendot.gif" alt="' . $apx->lang->get('CORE_ACTIVE') . '" title="' . $apx->lang->get('CORE_ACTIVE') . '" />';
             } else {
                 $tabledata[$i]['COL1'] = '<img src="design/reddot.gif" alt="' . $apx->lang->get('CORE_INACTIVE') . '" title="' . $apx->lang->get('CORE_INACTIVE') . '" />';
             }
             $link = mklink('faq.php?id=' . $res['id'], 'faq,' . $res['id'] . urlformat($res['question']) . '.html');
             $tabledata[$i]['COL2'] = '<a href="' . $link . '" target="_blank">' . replace($res['question']) . '</a>';
             $tabledata[$i]['COL3'] = number_format($res['hits'], 0, '', '.');
             $tabledata[$i]['CLASS'] = 'l' . ($res['level'] - 1) . ($res['children'] ? ' haschildren' : '') . ($res['level'] > 1 ? ' hidden' : '');
             $tabledata[$i]['ID'] = 'node:' . $res['id'];
             //Optionen
             if ($apx->user->has_right('faq.edit')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'faq.edit', 'id=' . $res['id'], $apx->lang->get('CORE_EDIT'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             if ($apx->user->has_right('faq.del')) {
                 $tabledata[$i]['OPTIONS'] .= '<span class="ifhasnochildren">' . optionHTMLOverlay('del.gif', 'faq.del', 'id=' . $res['id'], $apx->lang->get('CORE_DEL')) . '</span><span class="ifhaschildren"><img alt="" src="design/ispace.gif"/></span>';
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             if ($apx->user->has_right('faq.enable') && !$res['starttime']) {
                 $tabledata[$i]['OPTIONS'] .= optionHTML('enable.gif', 'faq.enable', 'id=' . $res['id'] . '&sectoken=' . $apx->session->get('sectoken'), $apx->lang->get('CORE_ENABLE'));
             } elseif ($apx->user->has_right('faq.disable') && $res['starttime']) {
                 $tabledata[$i]['OPTIONS'] .= optionHTML('disable.gif', 'faq.disable', 'id=' . $res['id'] . '&sectoken=' . $apx->session->get('sectoken'), $apx->lang->get('CORE_DISABLE'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             /*$tabledata[$i]['OPTIONS'].='&nbsp;';
             		if ( $apx->user->has_right('faq.move') && $follow[$res['id']]['prev'] ) $tabledata[$i]['OPTIONS'].=optionHTML('moveup.gif', 'faq.move', 'direction=up&id='.$res['id'].'&sectoken='.$apx->session->get('sectoken'), $apx->lang->get('MOVEUP'));
             		else $tabledata[$i]['OPTIONS'].='<img src="design/ispace_small.gif" alt="" />';
             		
             		if ( $apx->user->has_right('faq.move') && $follow[$res['id']]['next'] ) $tabledata[$i]['OPTIONS'].=optionHTML('movedown.gif', 'faq.move', 'direction=down&id='.$res['id'].'&sectoken='.$apx->session->get('sectoken'), $apx->lang->get('MOVEDOWN'));
             		else $tabledata[$i]['OPTIONS'].='<img src="design/ispace_small.gif" alt="" />';*/
         }
     }
     $apx->tmpl->assign('TABLE', $tabledata);
     echo '<div class="treeview" id="tree">';
     $html->table($col);
     echo '</div>';
     $open = $apx->session->get('faq_open');
     $open = dash_unserialize($open);
     $opendata = array();
     foreach ($open as $catid) {
         $opendata[] = array('ID' => $catid);
     }
     $apx->tmpl->assign('OPEN', $opendata);
     $apx->tmpl->assign('EDIT_ALLOWED', $apx->user->has_Right('faq.edit'));
     $apx->tmpl->parse('show_js');
     save_index($_SERVER['REQUEST_URI']);
 }
Beispiel #8
0
 function catshow()
 {
     global $set, $db, $apx, $html;
     //Struktur reparieren
     if ($_REQUEST['repair']) {
         $this->cat->repair();
         echo 'Repair done!';
         return;
     }
     quicklink('videos.catadd');
     //DnD-Hinweis
     if ($apx->user->has_right('videos.edit')) {
         echo '<p class="hint">' . $apx->lang->get('USEDND') . '</p>';
     }
     $col[] = array('ID', 0, 'align="center"');
     $col[] = array('COL_CATNAME', 75, 'class="title"');
     $col[] = array('COL_VIDEOS', 25, 'align="center"');
     $data = $this->cat->getTree(array('title', 'open'));
     if (count($data)) {
         //Ausgabe erfolgt
         foreach ($data as $res) {
             ++$i;
             if ($res['open']) {
                 list($videos) = $db->first("SELECT count(id) FROM " . PRE . "_videos WHERE catid='" . $res['id'] . "'");
             }
             $tabledata[$i]['COL1'] = $res['id'];
             $tabledata[$i]['COL2'] = replace($res['title']);
             $tabledata[$i]['COL3'] = iif(isset($videos), $videos, '&nbsp;');
             $tabledata[$i]['CLASS'] = 'l' . ($res['level'] - 1) . ($res['children'] ? ' haschildren' : '') . ($res['level'] > 1 ? ' hidden' : '') . ($res['iscat'] ? ' dark' : '');
             $tabledata[$i]['ID'] = 'node:' . $res['id'];
             //Optionen
             if ($apx->user->has_right('videos.catedit')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'videos.catedit', 'id=' . $res['id'], $apx->lang->get('CORE_EDIT'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             if ($apx->user->has_right('videos.catdel') && !$videos) {
                 $tabledata[$i]['OPTIONS'] .= '<span class="ifhasnochildren">' . optionHTMLOverlay('del.gif', 'videos.catdel', 'id=' . $res['id'], $apx->lang->get('CORE_DEL')) . '</span><span class="ifhaschildren"><img alt="" src="design/ispace.gif"/></span>';
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             if ($apx->user->has_right('videos.catclean') && $videos) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('clean.gif', 'videos.catclean', 'id=' . $res['id'], $apx->lang->get('CLEAN'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             //Anordnen nur bei Unterkategorien
             /*$tabledata[$i]['OPTIONS'].='&nbsp;';
             		if ( $apx->user->has_right('videos.catmove') && $follow[$res['id']]['prev'] ) $tabledata[$i]['OPTIONS'].=optionHTML('moveup.gif', 'videos.catmove', 'direction=up&id='.$res['id'].'&sectoken='.$apx->session->get('sectoken'), $apx->lang->get('MOVEUP'));
             		else $tabledata[$i]['OPTIONS'].='<img src="design/ispace_small.gif" alt="" style="vertical-align:middle;" />';
             		if ( $apx->user->has_right('videos.catmove') && $follow[$res['id']]['next'] ) $tabledata[$i]['OPTIONS'].=optionHTML('movedown.gif', 'videos.catmove', 'direction=down&id='.$res['id'].'&sectoken='.$apx->session->get('sectoken'), $apx->lang->get('MOVEDOWN'));
             		else $tabledata[$i]['OPTIONS'].='<img src="design/ispace_small.gif" alt="" style="vertical-align:middle;" />';
             		*/
             unset($videos);
         }
     }
     $apx->tmpl->assign('TABLE', $tabledata);
     //Mit Unter-Kategorien
     echo '<div class="treeview" id="tree">';
     $html->table($col);
     echo '</div>';
     $open = $apx->session->get('videos_cat_open');
     $open = dash_unserialize($open);
     $opendata = array();
     foreach ($open as $catid) {
         $opendata[] = array('ID' => $catid);
     }
     $apx->tmpl->assign('OPEN', $opendata);
     $apx->tmpl->assign('EDIT_ALLOWED', $apx->user->has_Right('videos.edit'));
     $apx->tmpl->parse('catshow_js');
     save_index($_SERVER['REQUEST_URI']);
 }
Beispiel #9
0
 function show()
 {
     global $set, $db, $apx, $html;
     quicklink('affiliates.add');
     //DnD-Hinweis
     if ($set['affiliates']['orderby'] == 1 && $apx->user->has_right('articles.edit')) {
         echo '<p class="hint">' . $apx->lang->get('USEDND') . '</p>';
     }
     if ($set['affiliates']['orderby'] != 1) {
         $orderdef[0] = 'title';
         $orderdef['title'] = array('title', 'ASC', 'COL_TITLE');
         $orderdef['hits'] = array('hits', 'ASC', 'COL_HITS');
     }
     $col[] = array('&nbsp;', 1, '');
     $col[] = array('COL_TITLE', 50, 'class="title"');
     $col[] = array('COL_IMAGE', 30, 'align="center"');
     $col[] = array('COL_HITS', 20, 'align="center"');
     $data = $db->fetch("SELECT id,title,link,image,hits,active FROM " . PRE . "_affiliates " . iif(is_array($orderdef), getorder($orderdef), " ORDER BY ord ASC"));
     $count = count($data);
     if ($count) {
         foreach ($data as $res) {
             ++$i;
             $size = @getimagesize(BASEDIR . getpath('uploads') . $res['image']);
             if ($size[0] && $size[0] > 300) {
                 $imageWidth = 300;
             }
             if ($res['active']) {
                 $tabledata[$i]['COL1'] = '<img src="design/greendot.gif" alt="' . $apx->lang->get('CORE_ACTIVE') . '" title="' . $apx->lang->get('CORE_ACTIVE') . '" />';
             } else {
                 $tabledata[$i]['COL1'] = '<img src="design/reddot.gif" alt="' . $apx->lang->get('CORE_INACTIVE') . '" title="' . $apx->lang->get('CORE_INACTIVE') . '" />';
             }
             $tabledata[$i]['COL2'] = '<a href="../misc.php?action=redirect&amp;url=' . urlencode($res['link']) . '" target="_blank">' . replace($res['title']) . '</a>';
             $tabledata[$i]['COL3'] = iif($res['image'], '<img src="../' . getpath('uploads') . $res['image'] . '" width="' . $imageWidth . '" alt="" />', '&nbsp;');
             $tabledata[$i]['COL4'] = number_format($res['hits'], 0, '', '.');
             $tabledata[$i]['ID'] = 'node:' . $res['id'];
             //Optionen
             if ($apx->user->has_right('affiliates.edit')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'affiliates.edit', 'id=' . $res['id'], $apx->lang->get('CORE_EDIT'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             if ($apx->user->has_right('affiliates.del')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', 'affiliates.del', 'id=' . $res['id'], $apx->lang->get('CORE_DEL'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             if ($res['active'] && $apx->user->has_right('affiliates.disable')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTML('disable.gif', 'affiliates.disable', 'id=' . $res['id'] . '&sectoken=' . $apx->session->get('sectoken'), $apx->lang->get('CORE_ENABLE'));
             } elseif (!$res['active'] && $apx->user->has_right('affiliates.enable')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTML('enable.gif', 'affiliates.enable', 'id=' . $res['id'] . '&sectoken=' . $apx->session->get('sectoken'), $apx->lang->get('CORE_DISABLE'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
         }
     }
     $apx->tmpl->assign('TABLE', $tabledata);
     if ($set['affiliates']['orderby'] == 1 && $apx->user->has_right('articles.edit')) {
         echo '<div class="listview" id="list">';
         $html->table($col);
         echo '</div>';
         $apx->tmpl->parse('show_js');
     } else {
         $html->table($col);
     }
     orderstr($orderdef, 'action.php?action=affiliates.show');
     save_index($_SERVER['REQUEST_URI']);
 }
Beispiel #10
0
 function sshow()
 {
     global $set, $db, $apx, $html;
     quicklink('news.sadd');
     $col[] = array('COL_TITLE', 50, '');
     $col[] = array('COL_LINK', 50, '');
     $orderdef[0] = 'title';
     $orderdef['title'] = array('title', 'ASC', 'SORT_TITLE');
     $data = $db->fetch("SELECT * FROM " . PRE . "_news_sources" . getorder($orderdef));
     $imax = count($data);
     if ($imax) {
         foreach ($data as $res) {
             ++$i;
             $tabledata[$i]['COL1'] = replace($res['title']);
             $tabledata[$i]['COL2'] = '<a href="../misc.php?action=redirect&amp;url=' . urlencode($res['link']) . '" target="_blank">' . shorttext($res['link'], 40) . '</a>';
             //Optionen
             if ($apx->user->has_right('news.sedit')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'news.sedit', 'id=' . $res['id'], $apx->lang->get('CORE_EDIT'));
             }
             if ($apx->user->has_right('news.sdel')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', 'news.sdel', 'id=' . $res['id'], $apx->lang->get('CORE_DEL'));
             }
         }
     }
     $apx->tmpl->assign('TABLE', $tabledata);
     $html->table($col);
     orderstr($orderdef, 'action.php?action=news.sshow');
     save_index($_SERVER['REQUEST_URI']);
 }
Beispiel #11
0
 function rules()
 {
     global $set, $apx, $db, $html;
     quicklink('mediamanager.radd', 'action.php', 'module=' . $this->module);
     $orderdef[0] = 'extension';
     $orderdef['extension'] = array('extension', 'ASC', 'SORT_EXTENSION');
     $orderdef['name'] = array('name', 'ASC', 'SORT_NAME');
     $col[] = array('', 1, 'align="center"');
     $col[] = array('COL_EXTENSION', 20, 'align="center"');
     $col[] = array('COL_NAME', 80, 'class="title"');
     $data = $db->fetch("SELECT id,extension,name FROM " . PRE . "_mediarules " . getorder($orderdef));
     if (count($data)) {
         foreach ($data as $res) {
             ++$i;
             if (file_exists("design/mm/" . strtolower($res['extension']) . ".gif")) {
                 $tabledata[$i]['COL1'] = '<img src="design/mm/' . strtolower($res['extension']) . '.gif" alt="' . strtoupper($res['extension']) . '" title="' . strtoupper($res['extension']) . '" />';
             } else {
                 $tabledata[$i]['COL1'] = '<img src="design/mm/blank.gif" alt="' . strtoupper($res['extension']) . '" title="' . strtoupper($res['extension']) . '" />';
             }
             $tabledata[$i]['COL2'] = replace(strtoupper($res['extension']));
             $tabledata[$i]['COL3'] = replace($res['name']);
             //Optionen
             if ($apx->user->has_right("mediamanager.redit")) {
                 $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'mediamanager.redit', 'id=' . $res['id'] . '&module=' . $this->module, $apx->lang->get('CORE_EDIT'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             if ($apx->user->has_right("mediamanager.rdel")) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', 'mediamanager.rdel', 'id=' . $res['id'] . '&module=' . $this->module, $apx->lang->get('CORE_DEL'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
         }
     }
     $apx->tmpl->assign('TABLE', $tabledata);
     $html->table($col);
     orderstr($orderdef, 'action.php?action=mediamanager.rules');
     save_index($_SERVER['REQUEST_URI']);
 }
Beispiel #12
0
 function catshow()
 {
     global $set, $db, $apx, $html;
     quicklink('glossar.catadd');
     $col[] = array('ID', 3, 'align="center"');
     $col[] = array('COL_CATNAME', 72, 'class="title"');
     $col[] = array('COL_ENTRIES', 25, 'align="center"');
     $orderdef[0] = 'title';
     $orderdef['title'] = array('title', 'ASC', 'COL_CATNAME');
     list($count) = $db->first("SELECT count(id) FROM " . PRE . "_glossar_cat");
     pages('action.php?action=glossar.catshow', $count);
     $data = $db->fetch("SELECT * FROM " . PRE . "_glossar_cat " . getorder($orderdef) . getlimit());
     if (count($data)) {
         //Ausgabe erfolgt
         foreach ($data as $res) {
             ++$i;
             list($entries) = $db->first("SELECT count(id) FROM " . PRE . "_glossar WHERE catid='" . $res['id'] . "'");
             $tabledata[$i]['COL1'] = $res['id'];
             $tabledata[$i]['COL2'] = $space[$res['id']] . ' ' . replace($res['title']);
             $tabledata[$i]['COL3'] = $entries;
             //Optionen
             if ($apx->user->has_right('glossar.catedit')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'glossar.catedit', 'id=' . $res['id'], $apx->lang->get('CORE_EDIT'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             if ($apx->user->has_right('glossar.catdel') && !$entries && !$res['children']) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', 'glossar.catdel', 'id=' . $res['id'], $apx->lang->get('CORE_DEL'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             if ($apx->user->has_right('glossar.catclean') && $entries) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('clean.gif', 'glossar.catclean', 'id=' . $res['id'], $apx->lang->get('CLEAN'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             unset($entries);
         }
     }
     $apx->tmpl->assign('TABLE', $tabledata);
     $html->table($col);
     orderstr($orderdef, 'action.php?action=glossar.catshow');
     save_index($_SERVER['REQUEST_URI']);
 }
Beispiel #13
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);
 }
Beispiel #14
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);
 }
Beispiel #15
0
 function gshow()
 {
     global $set, $apx, $db, $html;
     quicklink('user.gadd');
     $orderdef[0] = 'group';
     $orderdef['group'] = array('name', 'ASC', 'COL_GROUP');
     $col[] = array('COL_GROUP', 75, 'class="title"');
     $col[] = array('COL_USERS', 25, 'align="center"');
     $data = $db->fetch("SELECT a.*,count(b.groupid) AS count FROM " . PRE . "_user_groups AS a LEFT JOIN " . PRE . "_user AS b USING(groupid) GROUP BY a.groupid " . getorder($orderdef));
     if (count($data)) {
         foreach ($data as $res) {
             ++$obj;
             $tabledata[$obj]['COL1'] = replace($res['name']);
             $tabledata[$obj]['COL2'] = replace($res['count']);
             //Optionen
             if ($apx->user->has_right('user.gedit')) {
                 $tabledata[$obj]['OPTIONS'] .= optionHTML('edit.gif', 'user.gedit', 'id=' . $res['groupid'], $apx->lang->get('CORE_EDIT'));
             } else {
                 $tabledata[$obj]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             if ($res['groupid'] > 3 && $apx->user->has_right('user.gdel') && !$res['count']) {
                 $tabledata[$obj]['OPTIONS'] .= optionHTMLOverlay('del.gif', 'user.gdel', 'id=' . $res['groupid'], $apx->lang->get('CORE_DEL'));
             } else {
                 $tabledata[$obj]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             if ($apx->user->has_right('user.gclean') && $res['count']) {
                 $tabledata[$obj]['OPTIONS'] .= optionHTMLOverlay('clean.gif', 'user.gclean', 'id=' . $res['groupid'], $apx->lang->get('CLEAN'));
             } else {
                 $tabledata[$obj]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
         }
     }
     $apx->tmpl->assign('TABLE', $tabledata);
     $html->table($col);
     orderstr($orderdef, 'action.php?action=user.gshow');
     save_index($_SERVER['REQUEST_URI']);
 }
Beispiel #16
0
 function systems()
 {
     global $set, $db, $apx, $html;
     //Funktionen
     if ($_REQUEST['do'] == 'add') {
         return $this->systems_add();
     } elseif ($_REQUEST['do'] == 'edit') {
         return $this->systems_edit();
     } elseif ($_REQUEST['do'] == 'del') {
         return $this->systems_del();
     }
     echo '<p class="slink">&raquo; <a href="action.php?action=products.systems&amp;do=add">' . $apx->lang->get('ADDSYSTEM') . '</a></p>';
     $col[] = array('TITLE', 100, 'class="title"');
     echo '<p class="hint">' . $apx->lang->get('INFOTEXT') . '</p>';
     $data = $db->fetch("SELECT * FROM " . PRE . "_products_groups WHERE grouptype='system' ORDER BY title ASC");
     if (count($data)) {
         foreach ($data as $res) {
             ++$i;
             $tabledata[$i]['COL1'] = $res['title'];
             //Optionen
             $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'products.systems', 'do=edit&id=' . $res['id'], $apx->lang->get('CORE_EDIT'));
             $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', 'products.systems', 'do=del&id=' . $res['id'], $apx->lang->get('CORE_DEL'));
         }
     }
     $apx->tmpl->assign('TABLE', $tabledata);
     $html->table($col);
 }
Beispiel #17
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');
 }
Beispiel #18
0
 function pshow()
 {
     global $set, $db, $apx, $html;
     $_REQUEST['id'] = (int) $_REQUEST['id'];
     if (!$_REQUEST['id']) {
         die('missing ID!');
     }
     quicklink('gallery.padd', 'action.php', 'id=' . $_REQUEST['id']);
     $orderdef[0] = 'time';
     $orderdef['time'] = array('id', 'DESC', 'SORT_ADDTIME');
     $orderdef['caption'] = array('caption', 'ASC', 'COL_CAPTION');
     $orderdef['hits'] = array('hits', 'DESC', 'COL_HITS');
     $col[] = array('&nbsp;', 1, '');
     $col[] = array('&nbsp;', 1, '');
     $col[] = array('&nbsp;', 1, '');
     $col[] = array('COL_THUMBNAIL', 20, 'align="center"');
     $col[] = array('COL_CAPTION', 70, 'class="title"');
     $col[] = array('COL_HITS', 10, 'align="center"');
     list($title) = $db->first("SELECT title FROM " . PRE . "_gallery WHERE ( id='" . $_REQUEST['id'] . "' ) LIMIT 1");
     echo '<h2>' . $apx->lang->get('GALLERY') . ': ' . $title . '</h2>';
     list($count) = $db->first("SELECT count(id) FROM " . PRE . "_gallery_pics WHERE ( galid='" . $_REQUEST['id'] . "')");
     pages('action.php?action=gallery.pshow&amp;id=' . $_REQUEST['id'] . '&amp;sortby=' . $_REQUEST['sortby'], $count);
     //Preview-Bild
     list($previewpic) = $db->first("SELECT preview FROM " . PRE . "_gallery WHERE ( id='" . $_REQUEST['id'] . "') LIMIT 1");
     $data = $db->fetch("SELECT * FROM " . PRE . "_gallery_pics WHERE galid='" . $_REQUEST['id'] . "' " . getorder($orderdef) . getlimit());
     if (count($data)) {
         foreach ($data as $res) {
             ++$i;
             //Aktiv-Anzeige
             if ($res['active']) {
                 $tabledata[$i]['COL1'] = '<img src="design/greendot.gif" alt="' . $apx->lang->get('CORE_ACTIVE') . '" title="' . $apx->lang->get('CORE_ACTIVE') . '" />';
             } else {
                 $tabledata[$i]['COL1'] = '<img src="design/reddot.gif" alt="' . $apx->lang->get('CORE_INACTIVE') . '" title="' . $apx->lang->get('CORE_INACTIVE') . '" />';
             }
             //Vorschau-Bild
             if ($previewpic == $res['thumbnail']) {
                 $tabledata[$i]['COL2'] = '<img src="design/previewicon.gif" alt="' . $apx->lang->get('IS_PREVIEW') . '" title="' . $apx->lang->get('IS_PREVIEW') . '" />';
             } else {
                 $tabledata[$i]['COL2'] = '&nbsp;';
             }
             //POTW
             if ($res['potw']) {
                 $tabledata[$i]['COL3'] = '<img src="design/default.gif" alt="' . $apx->lang->get('IS_POTW') . '" title="' . $apx->lang->get('IS_POTW') . '" />';
             } else {
                 $tabledata[$i]['COL3'] = '&nbsp;';
             }
             $caption = shorttext(strip_tags($res['caption']), 50);
             $tabledata[$i]['ID'] = $res['id'];
             $tabledata[$i]['COL4'] = '<a href="../' . getpath('uploads') . $res['picture'] . '" target="_blank"><img src="../' . getpath('uploads') . $res['thumbnail'] . '" alt="thumbnail" /></a>';
             $tabledata[$i]['COL5'] = iif($caption, $caption, '&nbsp;');
             $tabledata[$i]['COL6'] = number_format($res['hits'], 0, '', '.');
             //Optionen
             if ($apx->user->has_right('gallery.pedit')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('edit.gif', 'gallery.pedit', 'id=' . $res['id'] . '&gid=' . intval($_REQUEST['id']), $apx->lang->get('CORE_EDIT'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             if ($apx->user->has_right('gallery.pmove')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('move.gif', 'gallery.pmove', 'id=' . $res['id'] . '&gid=' . intval($_REQUEST['id']), $apx->lang->get('MOVE'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             if ($apx->user->has_right('gallery.pdel')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', 'gallery.pdel', 'id=' . $res['id'] . '&gid=' . intval($_REQUEST['id']), $apx->lang->get('CORE_DEL'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             if ($res['active'] && $apx->user->has_right('gallery.pdisable') && !$res['potw'] && !$res['preview']) {
                 $tabledata[$i]['OPTIONS'] .= optionHTML('disable.gif', 'gallery.pdisable', 'id=' . $res['id'] . '&gid=' . intval($_REQUEST['id']) . '&sectoken=' . $apx->session->get('sectoken'), $apx->lang->get('CORE_DISABLE'));
             } elseif (!$res['active'] && $apx->user->has_right('gallery.penable')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTML('enable.gif', 'gallery.penable', 'id=' . $res['id'] . '&gid=' . intval($_REQUEST['id']) . '&sectoken=' . $apx->session->get('sectoken'), $apx->lang->get('CORE_ENABLE'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             $tabledata[$i]['OPTIONS'] .= '<br />';
             if ($res['active'] && !$res['potw'] && $apx->user->has_right('gallery.potw')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('potw.gif', 'gallery.potw', 'id=' . $res['id'] . '&gid=' . intval($_REQUEST['id']), $apx->lang->get('POTW'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             if ($res['active'] && $previewpic != $res['thumbnail'] && $apx->user->has_right('gallery.preview')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('previewpic.gif', 'gallery.preview', 'id=' . $res['id'] . '&gid=' . intval($_REQUEST['id']), $apx->lang->get('PREVIEW'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             //Kommentare + Bewertungen
             if ($apx->is_module('comments')) {
                 list($comments) = $db->first("SELECT count(id) FROM " . PRE . "_comments WHERE ( module='gallery' AND mid='" . $res['id'] . "' )");
                 if ($comments && ($apx->is_module('comments') && $set['gallery']['coms']) && $res['allowcoms'] && $apx->user->has_right('comments.show')) {
                     $tabledata[$i]['OPTIONS'] .= optionHTML('comments.gif', 'comments.show', 'module=gallery&mid=' . $res['id'], $apx->lang->get('COMMENTS') . ' (' . $comments . ')');
                 } else {
                     $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
                 }
             }
             if ($apx->is_module('ratings')) {
                 list($ratings) = $db->first("SELECT count(id) FROM " . PRE . "_ratings WHERE ( module='gallery' AND mid='" . $res['id'] . "' )");
                 if ($ratings && ($apx->is_module('ratings') && $set['gallery']['ratings']) && $res['allowrating'] && $apx->user->has_right('ratings.show')) {
                     $tabledata[$i]['OPTIONS'] .= optionHTML('ratings.gif', 'ratings.show', 'module=gallery&mid=' . $res['id'], $apx->lang->get('RATINGS') . ' (' . $ratings . ')');
                 } else {
                     $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
                 }
             }
         }
     }
     $multiactions = array();
     if ($apx->user->has_right('gallery.pmove')) {
         $multiactions[] = array($apx->lang->get('MOVE'), 'action.php?action=gallery.pmove&gid=' . intval($_REQUEST['id']), true);
     }
     if ($apx->user->has_right('gallery.pdel')) {
         $multiactions[] = array($apx->lang->get('CORE_DEL'), 'action.php?action=gallery.pdel&gid=' . intval($_REQUEST['id']), false);
     }
     if ($apx->user->has_right('gallery.penable')) {
         $multiactions[] = array($apx->lang->get('CORE_ENABLE'), 'action.php?action=gallery.penable&gid=' . intval($_REQUEST['id']), false);
     }
     if ($apx->user->has_right('gallery.pdisable')) {
         $multiactions[] = array($apx->lang->get('CORE_DISABLE'), 'action.php?action=gallery.pdisable&gid=' . intval($_REQUEST['id']), false);
     }
     $apx->tmpl->assign('TABLE', $tabledata);
     $html->table($col, $multiactions);
     orderstr($orderdef, 'action.php?action=gallery.pshow&amp;id=' . $_REQUEST['id']);
     save_index($_SERVER['REQUEST_URI']);
 }