示例#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']);
 }
示例#2
0
<?php

$apx->lang->drop('friends');
headline($apx->lang->get('HEADLINE_FRIENDS'), str_replace('&', '&amp;', $_SERVER['REQUEST_URI']));
titlebar($apx->lang->get('HEADLINE_FRIENDS'));
//Seitenzahlen
list($count) = $db->first("SELECT count(userid) FROM " . PRE . "_user WHERE ( active='1' " . $where . " )");
$pagelink = mklink('user.php?action=list&amp;sortby=' . $_REQUEST['sortby'] . '&amp;letter=' . $_REQUEST['letter'], 'user,list,' . $_REQUEST['letter'] . ',{P}.html' . iif($_REQUEST['sortby'], '?sortby=' . $_REQUEST['sortby']));
pages($pagelink, $count, $set['user']['friendsepp']);
//Buddyliste
$userdata = array();
$buddies = $user->get_buddies();
if (count($buddies)) {
    $data = $db->fetch("SELECT userid,username,groupid,realname,gender,city,plz,country,city,lastactive,pub_invisible,avatar,avatar_title,custom1,custom2,custom3,custom4,custom5,custom6,custom7,custom8,custom9,custom10 FROM " . PRE . "_user WHERE userid IN (" . implode(',', $buddies) . ") ORDER BY username ASC" . getlimit($set['user']['friendsepp']));
    if (count($data)) {
        foreach ($data as $res) {
            ++$i;
            $userdata[$i]['ID'] = $res['userid'];
            $userdata[$i]['USERID'] = $res['userid'];
            $userdata[$i]['USERNAME'] = replace($res['username']);
            $userdata[$i]['GROUPID'] = $res['groupid'];
            $userdata[$i]['ONLINE'] = iif(!$res['pub_invisible'] && $res['lastactive'] + $set['user']['timeout'] * 60 >= time(), 1, 0);
            $userdata[$i]['REALNAME'] = replace($res['realname']);
            $userdata[$i]['GENDER'] = $res['gender'];
            $userdata[$i]['CITY'] = replace($res['city']);
            $userdata[$i]['PLZ'] = replace($res['plz']);
            $userdata[$i]['COUNTRY'] = $res['country'];
            $userdata[$i]['LASTACTIVE'] = $res['lastactive'];
            $userdata[$i]['AVATAR'] = $user->mkavatar($res);
            $userdata[$i]['AVATAR_TITLE'] = $user->mkavtitle($res);
            //Custom-Felder
示例#3
0
 function gallery_pics()
 {
     global $set, $apx, $db, $html;
     $_REQUEST['userid'] = (int) $_REQUEST['userid'];
     $_REQUEST['galid'] = (int) $_REQUEST['galid'];
     if (!$_REQUEST['galid']) {
         die('missing GALID!');
     }
     //AKTIONEN
     if ($_REQUEST['do2'] == 'edit') {
         return $this->gallery_pics_edit();
     } elseif ($_REQUEST['do2'] == 'del') {
         return $this->gallery_pics_del();
     }
     $orderdef[0] = 'time';
     $orderdef['time'] = array('id', 'DESC', 'COL_ADDTIME');
     $orderdef['caption'] = array('caption', 'ASC', 'COL_CAPTION');
     $col[] = array('COL_THUMBNAIL', 20, 'align="center"');
     $col[] = array('COL_CAPTION', 80, '');
     list($id, $title) = $db->first("SELECT id,title FROM " . PRE . "_user_gallery WHERE id='" . $_REQUEST['galid'] . "' LIMIT 1");
     if (!$id) {
         return;
     }
     echo '<h2>' . $apx->lang->get('GALLERY') . ': ' . $title . '</h2>';
     list($count) = $db->first("SELECT count(id) FROM " . PRE . "_user_pictures WHERE galid='" . $_REQUEST['galid'] . "'");
     pages('action.php?action=user.gallery&amp;userid=' . $_REQUEST['userid'] . '&amp;do=pics&amp;galid=' . $_REQUEST['galid'] . '&amp;sortby=' . $_REQUEST['sortby'], $count);
     //Bilder auslesen
     $data = $db->fetch("SELECT * FROM " . PRE . "_user_pictures WHERE galid='" . $_REQUEST['galid'] . "' " . getorder($orderdef) . getlimit());
     if (count($data)) {
         foreach ($data as $res) {
             ++$i;
             $caption = shorttext(strip_tags($res['caption']), 50);
             $tabledata[$i]['COL1'] = '<a href="../' . getpath('uploads') . $res['picture'] . '" target="_blank"><img src="../' . getpath('uploads') . $res['thumbnail'] . '" alt="thumbnail" /></a>';
             $tabledata[$i]['COL2'] = iif($caption, $caption, '&nbsp;');
             $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('edit.gif', 'user.gallery', 'userid=' . $_REQUEST['userid'] . '&do=pics&galid=' . $_REQUEST['galid'] . '&do2=edit&id=' . $res['id'], $apx->lang->get('CORE_EDIT'));
             $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', 'user.gallery', 'userid=' . $_REQUEST['userid'] . '&do=pics&galid=' . $_REQUEST['galid'] . '&do2=del&id=' . $res['id'], $apx->lang->get('CORE_DEL'));
         }
     }
     $apx->tmpl->assign('TABLE', $tabledata);
     $html->table($col);
     orderstr($orderdef, 'action.php?action=user.gallery&amp;userid=' . $_REQUEST['userid'] . '&amp;do=pics&amp;galid=' . $_REQUEST['galid']);
     save_index($_SERVER['REQUEST_URI']);
 }
示例#4
0
 function show()
 {
     global $set, $db, $apx, $html;
     quicklink('banner.add');
     //Gruppen-Auswahl
     $_REQUEST['gid'] = (int) $_REQUEST['gid'];
     $groupdata = array();
     foreach ($set['banner']['groups'] as $id => $title) {
         $groupdata[] = array('ID' => $id, 'TITLE' => compatible_hsc($title), 'SELECTED' => $_REQUEST['gid'] == $id);
     }
     $apx->tmpl->assign('GROUP', $groupdata);
     $apx->tmpl->parse('show_choose');
     $orderdef[0] = 'partner';
     $orderdef['partner'] = array('partner', 'ASC', 'COL_PARTNER');
     $orderdef['views'] = array('views', 'ASC', 'COL_VIEWS');
     $orderdef['group'] = array('a.group', 'ASC', 'COL_GROUP');
     $col[] = array('', 1, '');
     $col[] = array('COL_PARTNER', 40, 'class="title"');
     $col[] = array('COL_PERIOD', 25, 'align="center"');
     $col[] = array('COL_VIEWS', 15, 'align="center"');
     $col[] = array('COL_GROUP', 20, 'align="center"');
     list($count) = $db->first("SELECT count(id) FROM " . PRE . "_banner WHERE 1 " . iif($_REQUEST['gid'], "AND `group`=" . $_REQUEST['gid']));
     pages('action.php?action=banner.show&amp;sortby=' . $_REQUEST['sortby'] . iif($_REQUEST['gid'], '&amp;gid=' . $_REQUEST['gid']), $count);
     $data = $db->fetch("SELECT * FROM " . PRE . "_banner AS a WHERE 1 " . iif($_REQUEST['gid'], "AND `group`=" . $_REQUEST['gid']) . 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') . '" />';
             }
             $period = '';
             if ($res['starttime']) {
                 $period = $apx->lang->get('FROM') . ': ' . mkdate($res['starttime']);
                 if ($res['endtime'] != 3000000000) {
                     $period .= '<br />' . $apx->lang->get('TILL') . ': ' . mkdate($res['endtime']);
                 }
             }
             $tabledata[$i]['COL2'] = replace($res['partner']);
             $tabledata[$i]['COL3'] = $period;
             $tabledata[$i]['COL4'] = number_format($res['views'], 0, '', '.') . iif($res['limit'], ' / ' . number_format($res['limit'], 0, '', '.'));
             $tabledata[$i]['COL5'] = $set['banner']['groups'][$res['group']];
             //Limit erreicht?
             if ($res['limit'] && $res['views'] >= $res['limit']) {
                 $tabledata[$i]['COL4'] = '<span style="color:red;">' . $tabledata[$i]['COL4'] . '</span>';
             }
             //Optionen
             if ($apx->user->has_right('banner.edit')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'banner.edit', 'id=' . $res['id'], $apx->lang->get('CORE_EDIT'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             if ($apx->user->has_right('banner.del')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', 'banner.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('banner.enable')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('enable.gif', 'banner.enable', 'id=' . $res['id'], $apx->lang->get('CORE_ENABLE'));
             } elseif ($res['starttime'] && $apx->user->has_right('banner.disable')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('disable.gif', 'banner.disable', 'id=' . $res['id'], $apx->lang->get('CORE_DISABLE'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
         }
     }
     $apx->tmpl->assign('TABLE', $tabledata);
     $html->table($col);
     orderstr($orderdef, "action.php?action=banner.show");
     save_index($_SERVER['REQUEST_URI']);
 }
示例#5
0
 function show()
 {
     global $set, $db, $apx, $html;
     //Suche durchführen
     if ($_REQUEST['item'] && ($_REQUEST['title'] || $_REQUEST['text']) || $_REQUEST['secid'] || $_REQUEST['catid'] || $_REQUEST['userid']) {
         $where = '';
         $_REQUEST['secid'] = (int) $_REQUEST['secid'];
         $_REQUEST['catid'] = (int) $_REQUEST['catid'];
         $_REQUEST['userid'] = (int) $_REQUEST['userid'];
         //Suche wird ausgeführt...
         if ($_REQUEST['title']) {
             $sc[] = "title LIKE '%" . addslashes_like($_REQUEST['item']) . "%'";
         }
         if ($_REQUEST['text']) {
             $sc[] = "text LIKE '%" . addslashes_like($_REQUEST['item']) . "%'";
         }
         if (is_array($sc)) {
             $where .= ' AND ( ' . implode(' OR ', $sc) . ' )';
         }
         //Sektion
         if (!$apx->session->get('section') && $_REQUEST['secid']) {
             $where .= " AND ( secid LIKE '%|" . $_REQUEST['secid'] . "|%' OR secid='all' ) ";
         }
         //Kategorie
         if ($_REQUEST['catid']) {
             $where .= " AND catid='" . $_REQUEST['catid'] . "' ";
         }
         //Benutzer
         if ($_REQUEST['userid']) {
             $where .= " AND userid='" . $_REQUEST['userid'] . "' ";
         }
         $data = $db->fetch("SELECT id FROM " . PRE . "_content WHERE 1 " . $where);
         $ids = get_ids($data, 'id');
         $ids[] = -1;
         $searchid = saveSearchResult('admin_content', $ids, array('title' => $_REQUEST['title'], 'text' => $_REQUEST['text'], 'item' => $_REQUEST['item'], 'catid' => $_REQUEST['catid'], 'secid' => $_REQUEST['secid'], 'userid' => $_REQUEST['userid']));
         header("HTTP/1.1 301 Moved Permanently");
         header('Location: action.php?action=content.show&searchid=' . $searchid);
         return;
     }
     //Vorgaben
     $_REQUEST['title'] = 1;
     $_REQUEST['text'] = 1;
     quicklink('content.add');
     $orderdef[0] = 'time';
     $orderdef['title'] = array('a.title', 'ASC', 'COL_TITLE');
     $orderdef['user'] = array('b.username', 'ASC', 'COL_USER');
     $orderdef['time'] = array('a.time', 'DESC', 'COL_ADDTIME');
     $orderdef['lastchange'] = array('a.lastchange', 'DESC', 'COL_LASTCHANGE');
     $orderdef['hits'] = array('a.hits', 'DESC', 'COL_HITS');
     $col[] = array('', 1, 'align="center"');
     $col[] = array('COL_TITLE', 50, 'class="title"');
     $col[] = array('COL_USER', 20, 'align="center"');
     $col[] = array('COL_LASTCHANGE', 20, 'align="center"');
     $col[] = array('COL_HITS', 10, 'align="center"');
     //Suchergebnis?
     $resultFilter = '';
     if ($_REQUEST['searchid']) {
         $searchRes = getSearchResult('admin_content', $_REQUEST['searchid']);
         if ($searchRes) {
             list($resultIds, $resultMeta) = $searchRes;
             $_REQUEST['item'] = $resultMeta['item'];
             $_REQUEST['title'] = $resultMeta['title'];
             $_REQUEST['text'] = $resultMeta['text'];
             $_REQUEST['catid'] = $resultMeta['catid'];
             $_REQUEST['secid'] = $resultMeta['secid'];
             $_REQUEST['userid'] = $resultMeta['userid'];
             $resultFilter = " AND a.id IN (" . implode(', ', $resultIds) . ")";
         } else {
             $_REQUEST['searchid'] = '';
         }
     }
     //Sektionen auflisten
     $seclist = '';
     if (is_array($apx->sections) && count($apx->sections)) {
         foreach ($apx->sections as $res) {
             $seclist .= '<option value="' . $res['id'] . '"' . iif($_REQUEST['secid'] == $res['id'], ' selected="selected"') . '>' . replace($res['title']) . '</option>';
         }
     }
     //Kategorien auflisten
     $catlist = '';
     $data = $set['content']['groups'];
     if (count($data)) {
         foreach ($data as $id => $title) {
             $catlist .= '<option value="' . $id . '"' . iif($_REQUEST['catid'] == $id, ' selected="selected"') . '>' . replace($title) . '</option>';
         }
     }
     //Benutzer auflisten
     $userlist = '';
     $data = $db->fetch("SELECT b.userid,b.username FROM " . PRE . "_content AS a LEFT JOIN " . PRE . "_user AS b USING (userid) WHERE a.userid!=0 GROUP BY userid ORDER BY username ASC");
     if (count($data)) {
         foreach ($data as $res) {
             $userlist .= '<option value="' . $res['userid'] . '"' . iif($_REQUEST['userid'] == $res['userid'], ' selected="selected"') . '>' . replace($res['username']) . '</option>';
         }
     }
     $apx->tmpl->assign('ITEM', compatible_hsc($_REQUEST['item']));
     $apx->tmpl->assign('STITLE', (int) $_REQUEST['title']);
     $apx->tmpl->assign('STEXT', (int) $_REQUEST['text']);
     $apx->tmpl->assign('SECLIST', $seclist);
     $apx->tmpl->assign('CATLIST', $catlist);
     $apx->tmpl->assign('USERLIST', $userlist);
     $apx->tmpl->assign('EXTENDED', $searchRes);
     $apx->tmpl->parse('search');
     list($count) = $db->first("SELECT count(id) FROM " . PRE . "_content AS a WHERE 1 " . $resultFilter . section_filter());
     pages('action.php?action=content.show&amp;sortby=' . $_REQUEST['sortby'] . iif($_REQUEST['searchid'], '&amp;searchid=' . $_REQUEST['searchid']), $count);
     $data = $db->fetch("SELECT a.id,a.secid,a.title,a.lastchange,a.allowcoms,a.allowrating,a.active,a.hits,b.userid,b.username FROM " . PRE . "_content AS a LEFT JOIN " . PRE . "_user AS b USING(userid) WHERE 1 " . $resultFilter . section_filter(true, 'a.secid') . " " . getorder($orderdef) . getlimit());
     if (count($data)) {
         foreach ($data as $res) {
             ++$i;
             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') . '" />';
             }
             $title = $res['title'];
             $title = strip_tags($title);
             //$title=str_replace('=>','»',$title);
             $title = str_replace('->', '»', $title);
             $title = shorttext($title, 40);
             $title = replace($title);
             $temp = explode('->', $res['title']);
             $tmp = unserialize_section($res['secid']);
             $link = mklink('content.php?id=' . $res['id'], 'content,' . $res['id'] . urlformat(array_pop($temp)) . '.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">' . $title . '</a>';
             $tabledata[$i]['COL3'] = replace($res['username']);
             $tabledata[$i]['COL4'] = mkdate($res['lastchange'], '<br />');
             $tabledata[$i]['COL5'] = $res['hits'];
             //Optionen
             if ($apx->user->has_right('content.edit') && ($res['userid'] == $apx->user->info['userid'] || $apx->user->has_spright('content.edit'))) {
                 $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'content.edit', 'id=' . $res['id'], $apx->lang->get('CORE_EDIT'));
             }
             if ($apx->user->has_right('content.del') && ($res['userid'] == $apx->user->info['userid'] || $apx->user->has_spright('content.del'))) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', 'content.del', 'id=' . $res['id'], $apx->lang->get('CORE_DEL'));
             }
             if ($res['active'] && $apx->user->has_right('content.disable') && ($res['userid'] == $apx->user->info['userid'] || $apx->user->has_spright('content.disable'))) {
                 $tabledata[$i]['OPTIONS'] .= optionHTML('disable.gif', 'content.disable', 'id=' . $res['id'] . '&sectoken=' . $apx->session->get('sectoken'), $apx->lang->get('CORE_DISABLE'));
             } elseif (!$res['active'] && $apx->user->has_right('content.enable') && ($res['userid'] == $apx->user->info['userid'] || $apx->user->has_spright('content.enable'))) {
                 $tabledata[$i]['OPTIONS'] .= optionHTML('enable.gif', 'content.enable', 'id=' . $res['id'] . '&sectoken=' . $apx->session->get('sectoken'), $apx->lang->get('CORE_ENABLE'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             //Kommentare + Bewertungen
             if ($apx->is_module('comments') || $apx->is_module('ratings')) {
                 $tabledata[$i]['OPTIONS'] .= '&nbsp;';
             }
             if ($apx->is_module('comments')) {
                 list($comments) = $db->first("SELECT count(id) FROM " . PRE . "_comments WHERE ( module='content' AND mid='" . $res['id'] . "' )");
                 if ($comments && ($apx->is_module('comments') && $set['content']['coms']) && $res['allowcoms'] && $apx->user->has_right('comments.show')) {
                     $tabledata[$i]['OPTIONS'] .= optionHTML('comments.gif', 'comments.show', 'module=content&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='content' AND mid='" . $res['id'] . "' )");
                 if ($ratings && ($apx->is_module('ratings') && $set['content']['ratings']) && $res['allowrating'] && $apx->user->has_right('ratings.show')) {
                     $tabledata[$i]['OPTIONS'] .= optionHTML('ratings.gif', 'ratings.show', 'module=content&mid=' . $res['id'], $apx->lang->get('RATINGS') . ' (' . $ratings . ')');
                 } else {
                     $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
                 }
             }
         }
     }
     $apx->tmpl->assign('TABLE', $tabledata);
     $html->table($col);
     orderstr($orderdef, 'action.php?action=content.show' . iif($_REQUEST['searchid'], '&amp;searchid=' . $_REQUEST['searchid']));
     save_index($_SERVER['REQUEST_URI']);
 }
示例#6
0
             if ($picids) {
                 $wherearr[] = 'p.picid IN (' . $picids . ')';
             }
             $albumids = getdotstring($_POST['network'][$key]['albumid'], 'int');
             if ($albumids) {
                 $wherearr[] = 'p.albumid IN (' . $albumids . ')';
             }
             $uids = getdotstring($_POST['network'][$key]['uid'], 'int');
             if ($uids) {
                 $wherearr[] = 'p.uid IN (' . $uids . ')';
             }
             if ($wherearr) {
                 $sql['where'] = 'WHERE ' . implode(' AND ', $wherearr);
             }
             $sql['order'] = 'ORDER BY p.dateline DESC';
             $sql['limit'] = getlimit($_POST['network'][$key]['start'], $_POST['network'][$key]['limit']);
             break;
     }
     $sqlstring = implode(' ', $sql);
     $_POST['network'][$key]['sql'] = $sqlstring;
     $network[$key] = $_POST['network'][$key];
 } else {
     $network[$key] = array();
     $network[$key]['usedefault'] = 1;
 }
 foreach (array('space', 'doing', 'blog', 'album', 'share', 'mtag', 'slide', 'blogfrom') as $val) {
     $sql = '';
     $sql = $val != 'blogfrom' ? trim($network[$val]['sql']) : $network[$val];
     $networkcache[$val] = empty($sql) ? '' : $sql;
 }
 include_once S_ROOT . './source/function_cache.php';
示例#7
0
} elseif ($_REQUEST['do'] == 'del') {
    $_REQUEST['id'] = (int) $_REQUEST['id'];
    if (!$_REQUEST['id']) {
        die('missing ID!');
    }
    if ($_POST['send']) {
        $db->query("DELETE FROM " . PRE . "_user_blog WHERE id='" . $_REQUEST['id'] . "' AND userid='" . $user->info['userid'] . "' LIMIT 1");
        message($apx->lang->get('MSG_DEL_OK'), mklink('user.php?action=myblog', 'user,myblog.html'));
    } else {
        tmessage('delblog', array('ID' => $_REQUEST['id']));
    }
    require 'lib/_end.php';
}
//ÜBERSICHT
list($count) = $db->first("SELECT count(id) FROM " . PRE . "_user_blog WHERE userid='" . $user->info['userid'] . "'");
pages(mklink('user.php?action=myblog', 'user,myblog.html'), $count, 20);
//Einträge auslesen
$data = $db->fetch("SELECT id,title,time FROM " . PRE . "_user_blog WHERE userid='" . $user->info['userid'] . "' ORDER BY time DESC" . getlimit(20));
if (count($data)) {
    foreach ($data as $res) {
        ++$i;
        $tabledata[$i]['ID'] = $res['id'];
        $tabledata[$i]['TITLE'] = replace($res['title']);
        $tabledata[$i]['TIME'] = $res['time'];
        $tabledata[$i]['LINK_EDIT'] = mklink('user.php?action=myblog&amp;do=edit&amp;id=' . $res['id'], 'user,myblog.html?do=edit&amp;id=' . $res['id']);
        $tabledata[$i]['LINK_DEL'] = mklink('user.php?action=myblog&amp;do=del&amp;id=' . $res['id'], 'user,myblog.html?do=del&amp;id=' . $res['id']);
    }
}
$apx->tmpl->assign('ENTRY', $tabledata);
$apx->tmpl->assign('LINK_NEW', mklink('user.php?action=myblog&amp;do=add', 'user,myblog.html?do=add'));
$apx->tmpl->parse('myblog');
示例#8
0
 function display()
 {
     global $db, $apx, $user, $set;
     $apx->lang->drop('comments', 'comments');
     $page = $this->getpage(array('p'));
     //Seitenzahlen
     list($count) = $db->first("SELECT count(id) FROM " . PRE . "_comments WHERE ( module='" . addslashes($this->module) . "' AND mid='" . $this->mid . "' AND active='1' )");
     pages($page, $count, $this->set['epp'], 'comp', 'COMMENT');
     //Sortierreihenfolge
     if ($this->set['order'] == 1) {
         $order = "a.time ASC";
     } else {
         $order = "a.time DESC";
     }
     //Kommentare auslesen
     $data = $db->fetch("SELECT a.* FROM " . PRE . "_comments AS a WHERE ( module='" . addslashes($this->module) . "' AND a.mid='" . $this->mid . "' AND a.active='1' ) ORDER BY " . $order . " " . getlimit($this->set['epp'], 'comp'));
     if (!count($data)) {
         return;
     }
     //Nummerierungs-Anfang
     if ($this->set['epp']) {
         if ($this->set['order'] == 0) {
             $entrynumber = $count - ($_REQUEST['comp'] - 1) * $this->set['epp'];
         } else {
             $entrynumber = 1 + ($_REQUEST['comp'] - 1) * $this->set['epp'];
         }
     } else {
         if ($this->set['order'] == 0) {
             $entrynumber = $count;
         } else {
             $entrynumber = 1;
         }
     }
     foreach ($data as $res) {
         ++$i;
         if ($res['userid'] && !isset($userinfo[$res['userid']])) {
             $userinfo[$res['userid']] = $user->get_info($res['userid'], 'username,email,pub_hidemail,homepage,avatar,avatar_title,signature,lastactive,pub_invisible,custom1,custom2,custom3,custom4,custom5,custom6,custom7,custom8,custom9,custom10');
         }
         if ($res['userid'] && $userinfo[$res['userid']]) {
             $tabledata[$i]['USERID'] = $res['userid'];
             $tabledata[$i]['NAME'] = replace($userinfo[$res['userid']]['username']);
             $tabledata[$i]['EMAIL'] = replace(iif(!$userinfo[$res['userid']]['pub_hidemail'], $userinfo[$res['userid']]['email']));
             $tabledata[$i]['EMAIL_ENCRYPTED'] = replace(iif(!$userinfo[$res['userid']]['pub_hidemail'], cryptMail($userinfo[$res['userid']]['email'])));
             $tabledata[$i]['HOMEPAGE'] = replace($userinfo[$res['userid']]['homepage']);
             $tabledata[$i]['AVATAR'] = $user->mkavatar($userinfo[$res['userid']]);
             $tabledata[$i]['AVATAR_TITLE'] = $user->mkavtitle($userinfo[$res['userid']]);
             $tabledata[$i]['SIGNATURE'] = $user->mksig($userinfo[$res['userid']]);
             $tabledata[$i]['ONLINE'] = iif(!$userinfo[$res['userid']]['pub_invisible'] && $userinfo[$res['userid']]['lastactive'] + $set['user']['timeout'] * 60 >= time(), 1, 0);
             $tabledata[$i]['ISONLINE'] = $tabledata[$i]['ONLINE'];
             //Custom-Felder
             for ($ii = 1; $ii <= 10; $ii++) {
                 $tabledata[$i]['CUSTOM' . $ii . '_NAME'] = $set['user']['cusfield_names'][$ii - 1];
                 $tabledata[$i]['CUSTOM' . $ii] = compatible_hsc($userinfo[$res['userid']]['custom' . $ii]);
             }
         } else {
             $tabledata[$i]['NAME'] = replace($res['username']);
             $tabledata[$i]['EMAIL'] = replace($res['email']);
             $tabledata[$i]['EMAIL_ENCRYPTED'] = replace(cryptMail($res['email']));
             $tabledata[$i]['HOMEPAGE'] = replace($res['homepage']);
         }
         //Text
         $text = $res['text'];
         if ($this->set['badwords']) {
             $text = badwords($text);
         }
         $text = replace($text, 1);
         if ($this->set['breakline']) {
             $text = wordwrapHTML($text, $this->set['breakline'], "\n");
         }
         if ($this->set['allowsmilies']) {
             $text = dbsmilies($text);
         }
         if ($this->set['allowcode']) {
             $text = dbcodes($text);
         }
         //Titel
         $title = $res['title'];
         if ($this->set['breakline']) {
             $title = wordwrap($title, $this->set['breakline'], "\n", 1);
         }
         if ($this->set['badwords']) {
             $title = badwords($title);
         }
         $title = replace($title);
         $tabledata[$i]['TEXT'] = $text;
         $tabledata[$i]['TITLE'] = $title;
         $tabledata[$i]['TIME'] = $res['time'];
         $tabledata[$i]['NUMBER'] = $entrynumber;
         //Admin-Links
         if ($_COOKIE[$set['main']['cookie_pre'] . '_admin_userid'] && $_COOKIE[$set['main']['cookie_pre'] . '_admin_password']) {
             $tabledata[$i]['EDITLINK'] = HTTPDIR . 'admin/action.php?action=comments.edit&amp;module=' . $this->module . '&amp;mid=' . $this->mid . '&amp;id=' . $res['id'] . '&amp;outer=1';
             $tabledata[$i]['DELETELINK'] = HTTPDIR . 'admin/action.php?action=comments.del&amp;module=' . $this->module . '&amp;mid=' . $this->mid . '&amp;id=' . $res['id'] . '&amp;outer=1';
         }
         //Melden
         $link_report = "javascript:popupwin('misc.php?action=comments_report&amp;id=" . $res['id'] . "&amp;url='+escape(window.location.href),500,300);";
         $tabledata[$i]['REPORTLINK'] = $link_report;
         //Kommentarnummer
         if ($this->set['order'] == 0) {
             --$entrynumber;
         } else {
             ++$entrynumber;
         }
     }
     return $tabledata;
 }
示例#9
0
//Galerie sortieren nach
if ($set['gallery']['subgals']) {
    require_once BASEDIR . 'lib/class.recursivetree.php';
    $tree = new RecursiveTree(PRE . '_gallery', 'id');
    $data = $tree->getLevel(array('*'), 0, "'" . time() . "' BETWEEN starttime AND endtime " . section_filter(true, 'secid'));
} else {
    if ($_REQUEST['letter']) {
        $orderby = 'title ASC';
    } elseif ($set['gallery']['ordergal'] == 2) {
        $orderby = 'title ASC';
    } elseif ($set['gallery']['ordergal'] == 3) {
        $orderby = 'lft ASC';
    } else {
        $orderby = 'starttime DESC';
    }
    $data = $db->fetch("SELECT *,1 AS level FROM " . PRE . "_gallery WHERE ( '" . time() . "' BETWEEN starttime AND endtime " . $where . " " . section_filter() . " ) ORDER BY " . $orderby . " " . iif($set['gallery']['listepp'], getlimit($set['gallery']['listepp'])));
}
//Galerien auslesen, die veröffentlicht sind
if ($set['gallery']['subgals']) {
    $openData = $db->fetch("SELECT id FROM " . PRE . "_gallery WHERE '" . time() . "' BETWEEN starttime AND endtime");
    $openIds = get_ids($openData);
}
//Galerien auflisten
if (count($data)) {
    foreach ($data as $res) {
        ++$i;
        if ($set['gallery']['subgals']) {
            $subtreeIds = array_merge($res['children'], array($res['id']));
            $subtreeIds = array_intersect($subtreeIds, $openIds);
        } else {
            $subtreeIds = array($res['id']);
示例#10
0
 function show()
 {
     global $set, $db, $apx, $html;
     quicklink('teaser.add');
     //Gruppen-Auswahl
     $_REQUEST['gid'] = (int) $_REQUEST['gid'];
     $groupdata = array();
     foreach ($set['teaser']['groups'] as $id => $title) {
         $groupdata[] = array('ID' => $id, 'TITLE' => compatible_hsc($title), 'SELECTED' => $_REQUEST['gid'] == $id);
     }
     $apx->tmpl->assign('GROUP', $groupdata);
     $apx->tmpl->parse('show_choose');
     //DnD-Hinweis
     if ($set['teaser']['orderby'] == 1 && $apx->user->has_right('articles.edit')) {
         echo '<p class="hint">' . $apx->lang->get('USEDND') . '</p>';
     }
     if ($set['teaser']['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', 40, 'align="center"');
     $col[] = array('COL_HITS', 10, 'align="center"');
     list($count) = $db->first("SELECT count(id) FROM " . PRE . "_teaser WHERE 1 " . iif($_REQUEST['gid'], "AND `group`=" . $_REQUEST['gid']));
     pages('action.php?action=teaser.show&amp;sortby=' . $_REQUEST['sortby'] . iif($_REQUEST['gid'], '&amp;gid=' . $_REQUEST['gid']), $count);
     $data = $db->fetch("SELECT id,title,link,image,hits,starttime,endtime FROM " . PRE . "_teaser WHERE 1 " . iif($_REQUEST['gid'], "AND `group`=" . $_REQUEST['gid']) . section_filter() . " " . iif(is_array($orderdef), getorder($orderdef), " ORDER BY ord ASC") . getlimit());
     $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['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') . '" />';
             }
             $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]['COL5'] = number_format($res['hits'], 0, '', '.');
             $tabledata[$i]['ID'] = 'node:' . $res['id'];
             //Optionen
             if ($apx->user->has_right('teaser.edit')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'teaser.edit', 'id=' . $res['id'], $apx->lang->get('CORE_EDIT'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             if ($apx->user->has_right('teaser.del')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', 'teaser.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()) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('enable.gif', 'teaser.enable', 'id=' . $res['id'], $apx->lang->get('CORE_ENABLE'));
             } elseif ($res['starttime'] && $apx->user->has_right('teaser.disable')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('disable.gif', 'teaser.disable', 'id=' . $res['id'], $apx->lang->get('CORE_DISABLE'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
         }
     }
     $apx->tmpl->assign('TABLE', $tabledata);
     if ($set['teaser']['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=teaser.show' . iif($_REQUEST['gid'], '&amp;gid=' . $_REQUEST['gid']));
     save_index($_SERVER['REQUEST_URI']);
 }
示例#11
0
 $parse = $apx->tmpl->used_vars('archive_index');
 //Headline
 $month = substr($_REQUEST['month'], 0, 2);
 $year = substr($_REQUEST['month'], 2);
 headline(getcalmonth($month) . ' ' . $year, mklink('articlearchive.php?month=' . $month . $year, 'articlearchive,' . $month . ',' . $year . ',1.html'));
 titlebar($apx->lang->get('HEADLINE_ARCHIVE') . ': ' . getcalmonth($month) . ' ' . $year);
 //Seitenzahlen generieren
 list($count) = $db->first("SELECT count(id) FROM " . PRE . "_articles WHERE ( ( ( " . time() . " BETWEEN starttime AND endtime ) AND starttime BETWEEN '" . (mktime(0, 0, 0, intval($month), 1, intval($year)) + TIMEDIFF) . "' AND '" . (mktime(0, 0, 0, intval($month + 1), 1, intval($year)) - 1 + TIMEDIFF) . "' ) " . $filter . " " . section_filter() . " )");
 pages(mklink('articlearchive.php?month=' . $_REQUEST['month'], 'articlearchive,' . $month . ',' . $year . ',{P}.html'), $count, $set['articles']['archiveepp']);
 //Artikel ausgeben
 if ($set['articles']['archiveentrysort'] == 1) {
     $orderby = ' starttime DESC ';
 } else {
     $orderby = ' starttime ASC';
 }
 $data = $db->fetch("SELECT a.*,b.userid,b.username,b.email,b.pub_hidemail FROM " . PRE . "_articles AS a LEFT JOIN " . PRE . "_user AS b USING(userid) WHERE ( ( ( " . time() . " BETWEEN starttime AND endtime ) AND starttime BETWEEN '" . (mktime(0, 0, 0, intval($month), 1, intval($year)) + TIMEDIFF) . "' AND '" . (mktime(0, 0, 0, intval($month + 1), 1, intval($year)) - 1 + TIMEDIFF) . "' ) " . $filter . " " . section_filter() . " ) ORDER BY " . $orderby . " " . getlimit($set['articles']['archiveepp']));
 $data = articles_extend_data($data, $parse);
 //Datensatz erweitern durch Preview/Review-Daten
 //Kategorien auslesen
 if (in_array('ARTICLE.CATTITLE', $parse) || in_array('ARTICLE.CATICON', $parse) || in_array('ARTICLE.CATLINK', $parse)) {
     $catinfo = articles_catinfo(get_ids($data, 'catid'));
 }
 if (count($data)) {
     foreach ($data as $res) {
         ++$i;
         //Wohin soll verlinkt werden?
         if ($res['type'] == 'normal') {
             $link2file = 'articles';
         } else {
             $link2file = $res['type'] . 's';
         }
示例#12
0
         $letterfilter = " AND title NOT REGEXP(\"^[a-zA-Z]\")";
     } else {
         $letterfilter = " AND title LIKE '" . $_REQUEST['letter'] . "%'";
     }
 }
 //Kategorie-Info auslesen
 $catinfo = $db->first("SELECT * FROM " . PRE . "_glossar_cat WHERE id='" . $_REQUEST['catid'] . "' LIMIT 1");
 $catlink = mklink('glossar.php?catid=' . $catinfo['id'], 'glossar,' . $catinfo['id'] . ',0,1' . urlformat($catinfo['title']) . '.html');
 //Headline
 headline($catinfo['title'], $catlink);
 titlebar($apx->lang->get('HEADLINE') . ': ' . $catinfo['title']);
 //Seitenzahlen
 list($count) = $db->first("SELECT count(id) FROM " . PRE . "_glossar WHERE ( catid='" . $_REQUEST['catid'] . "' AND starttime!=0 " . $letterfilter . " )");
 pages(mklink('glossar.php?catid=' . $catinfo['id'] . '&amp;letter=' . $_REQUEST['letter'], 'glossar,' . $catinfo['id'] . ',' . $_REQUEST['letter'] . ',{P}' . urlformat($catinfo['title']) . '.html'), $count, $set['glossar']['epp']);
 //Begriffe auslesen
 $data = $db->fetch("SELECT * FROM " . PRE . "_glossar WHERE ( catid='" . $_REQUEST['catid'] . "' AND starttime!=0 " . $letterfilter . " ) ORDER BY title ASC " . getlimit($set['glossar']['epp']));
 $index = array();
 if (count($data)) {
     //Nach Buchstaben sortieren
     $letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ#';
     for ($i = 0; $i < strlen($letters); $i++) {
         $index[$letters[$i]] = array();
     }
     foreach ($data as $res) {
         $letter = glossar_letter($res['title']);
         $index[$letter][] = $res;
     }
     //Index erstellen
     foreach ($index as $letter => $data) {
         //Link: Nur Begriffe mit diesem Buchstaben
         $letterlink = mklink('glossar.php?catid=' . $_REQUEST['catid'] . '&amp;letter=' . iif($letter == '#', 'spchar', strtolower($letter)), 'glossar,' . $_REQUEST['catid'] . ',' . iif($letter == '#', 'spchar', strtolower($letter)) . ',1' . urlformat($catinfo['title']) . '.html');
示例#13
0
 $apx->tmpl->assign('TITLE', $gallery['title']);
 $apx->tmpl->assign('DESCRIPTION', $gallery['description']);
 $apx->tmpl->assign('TIME', $gallery['time']);
 $apx->tmpl->assign('LASTUPDATE', $gallery['lastupdate']);
 $apx->tmpl->assign('COUNT', $images);
 //Kommentare
 if ($apx->is_module('comments') && $gallery['allowcoms']) {
     require_once BASEDIR . getmodulepath('comments') . 'class.comments.php';
     $coms = new comments('usergallery', $gallery['id']);
     $coms->assign_comments($parse);
 }
 //Seitenzahlen
 list($count) = $db->first("SELECT count(id) FROM " . PRE . "_user_pictures WHERE galid='" . $galid . "'");
 pages(mklink('user.php?action=gallery&amp;id=' . $_REQUEST['id'] . '&amp;galid=' . $galid, 'user,gallery,' . $_REQUEST['id'] . ',' . $galid . ',{P}.html'), $count, $set['user']['gallery_epp']);
 //Einträge auslesen
 $data = $db->fetch("SELECT * FROM " . PRE . "_user_pictures WHERE galid='" . $galid . "' ORDER BY addtime DESC" . getlimit($set['user']['gallery_epp']));
 if (count($data)) {
     foreach ($data as $res) {
         ++$i;
         $size = getimagesize(BASEDIR . getpath('uploads') . $res['picture']);
         $tabledata[$i]['ID'] = $res['id'];
         $tabledata[$i]['IMAGE'] = HTTPDIR . getpath('uploads') . $res['thumbnail'];
         $tabledata[$i]['FULLSIZE'] = HTTPDIR . getpath('uploads') . $res['picture'];
         $tabledata[$i]['LINK'] = "javascript:popuppic('misc.php?action=picture&amp;pic=" . $res['picture'] . "','" . $size[0] . "','" . $size[1] . "');";
         $tabledata[$i]['CAPTION'] = replace($res['caption']);
     }
 }
 //Verstoß melden
 $link_report = "javascript:popupwin('user.php?action=report&amp;contentid=gallery:" . $_REQUEST['galid'] . "',500,300);";
 $apx->tmpl->assign('LINK_REPORT', $link_report);
 $apx->tmpl->assign('PICTURE', $tabledata);
示例#14
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']);
 }
示例#15
0
//Seitenzahlen
list($count) = $db->first("SELECT count(userid) FROM " . PRE . "_user WHERE ( active='1' " . $where . " )");
$pagelink = mklink('user.php?action=list&amp;sortby=' . $_REQUEST['sortby'] . '&amp;letter=' . $_REQUEST['letter'], 'user,list,' . $_REQUEST['letter'] . ',{P}.html' . iif($_REQUEST['sortby'], '?sortby=' . $_REQUEST['sortby']));
pages($pagelink, $count, $set['user']['userlistepp']);
//Orderby
$orderdef[0] = 'username';
$orderdef['regdate'] = array('reg_time', 'DESC');
$orderdef['username'] = array('username', 'ASC');
if ($apx->is_module('forum')) {
    $orderdef['forumposts'] = array('forum_posts', 'DESC');
}
$fields = 'userid,username,email,groupid,reg_time,realname,gender,city,plz,country,city,lastactive,pub_invisible,avatar,avatar_title,birthday,pub_hidemail,custom1,custom2,custom3,custom4,custom5,custom6,custom7,custom8,custom9,custom10';
if ($apx->is_module('forum')) {
    $fields .= ',forum_posts';
}
$data = $db->fetch("SELECT " . $fields . " FROM " . PRE . "_user WHERE ( active='1' " . $where . " ) " . getorder($orderdef) . " " . getlimit($set['user']['userlistepp']));
if (count($data)) {
    foreach ($data as $res) {
        ++$i;
        $age = 0;
        if ($res['birthday']) {
            $bd = explode('-', $res['birthday']);
            $birthday = intval($bd[0]) . '. ' . getcalmonth($bd[1]) . iif($bd[2], ' ' . $bd[2]);
            if ($bd[2]) {
                $age = date('Y') - $bd[2];
                if (intval(sprintf('%02d%02d', $bd[1], $bd[0])) > intval(date('md'))) {
                    $age -= 1;
                }
            }
        }
        $tabledata[$i]['ID'] = $res['userid'];
示例#16
0
            list($sendmail, $email) = $db->first("SELECT pub_gbmail,email FROM " . PRE . "_user WHERE userid='" . $_REQUEST['id'] . "' LIMIT 1");
            if ($sendmail) {
                $input = array('URL' => HTTP, 'USERNAME' => $user->info['username'], 'GOTO' => HTTP_HOST . mklink('user.php?action=guestbook&id=' . $_REQUEST['id'], 'user,guestbook,' . $_REQUEST['id'] . ',1.html'));
                sendmail($email, 'SENDENTRY', $input);
            }
        }
        //Weiterleitung
        message($apx->lang->get('MSG_OK'), mklink('user.php?action=guestbook&amp;id=' . $_REQUEST['id'], 'user,guestbook,' . $_REQUEST['id'] . ',1.html'));
    }
} else {
    //Seitenzahlen
    list($count) = $db->first("SELECT count(id) FROM " . PRE . "_user_guestbook WHERE owner='" . $_REQUEST['id'] . "'");
    pages(mklink('user.php?action=guestbook&amp;id=' . $_REQUEST['id'], 'user,guestbook,' . $_REQUEST['id'] . ',{P}.html'), $count, $set['user']['guestbook_epp']);
    //Einträge auslesen
    $tabledata = array();
    $data = $db->fetch("SELECT * FROM " . PRE . "_user_guestbook WHERE owner='" . $_REQUEST['id'] . "' ORDER BY time DESC " . getlimit($set['user']['guestbook_epp']));
    $entrynumber = $count - ($_REQUEST['p'] - 1) * $set['user']['guestbook_epp'];
    //Benutzer-Info
    $userids = get_ids($data, 'userid');
    $userinfo = array();
    if (count($userids)) {
        $userinfo = $user->get_info_multi($userids, 'username,email,pub_hidemail,homepage,avatar,avatar_title,signature,lastactive,pub_invisible');
    }
    if (count($data)) {
        foreach ($data as $res) {
            ++$i;
            //Benutzer
            $tabledata[$i]['USERID'] = $res['userid'];
            $tabledata[$i]['NAME'] = replace($userinfo[$res['userid']]['username']);
            $tabledata[$i]['EMAIL'] = replace(iif(!$userinfo[$res['userid']]['pub_hidemail'], $userinfo[$res['userid']]['email']));
            $tabledata[$i]['EMAIL_ENCRYPTED'] = replace(iif(!$userinfo[$res['userid']]['pub_hidemail'], cryptMail($userinfo[$res['userid']]['email'])));
示例#17
0
$orderdef[0] = 'title';
$orderdef['title'] = array('title', 'ASC');
$orderdef['release'] = array('minrelease', 'ASC');
//Standardsortierung
if (!$_REQUEST['sortby']) {
    if ($set['products']['sortby'] == 1) {
        $_REQUEST['sortby'] = 'title.ASC';
    } else {
        $_REQUEST['sortby'] = 'release.ASC';
    }
}
//Produkte auslesen
if ($_REQUEST['sortby'] == 'release.ASC' || $_REQUEST['sortby'] == 'release.DESC') {
    $data = $db->fetch("SELECT a.*,min(stamp) AS minrelease,IF(b.prodid IS NULL,0,1) AS isset FROM " . PRE . "_products_coll AS pc JOIN " . PRE . "_products AS a ON pc.prodid=a.id LEFT JOIN " . PRE . "_products_releases AS b ON a.id=b.prodid WHERE pc.userid='" . $userid . "' AND a.active='1' " . $where . " GROUP BY a.id " . getorder($orderdef, 'isset DESC', 1) . " " . getlimit($set['products']['epp']));
} else {
    $data = $db->fetch("SELECT a.* FROM " . PRE . "_products_coll AS pc JOIN " . PRE . "_products AS a ON pc.prodid=a.id WHERE pc.userid='" . $userid . "' AND active='1' " . $where . getorder($orderdef) . getlimit($set['products']['epp']));
}
$ids = get_ids($data, 'id');
$types = get_ids($data, 'type');
if (count($data)) {
    $unitvars = array('PRODUCT.DEVELOPER', 'PRODUCT.DEVELOPER_WEBSITE', 'PRODUCT.DEVELOPER_LINK', 'PRODUCT.PUBLISHER', 'PRODUCT.PUBLISHER_WEBSITE', 'PRODUCT.PUBLISHER_LINK', 'PRODUCT.MANUFACTURER', 'PRODUCT.MANUFACTURER_WEBSITE', 'PRODUCT.MANUFACTURER_LINK', 'PRODUCT.STUDIO', 'PRODUCT.STUDIO_WEBSITE', 'PRODUCT.STUDIO_LINK', 'PRODUCT.LABEL', 'PRODUCT.LABEL_WEBSITE', 'PRODUCT.LABEL_LINK', 'PRODUCT.ARTIST', 'PRODUCT.ARTIST_WEBSITE', 'PRODUCT.ARTIST_LINK', 'PRODUCT.AUTHOR', 'PRODUCT.AUTHOR_WEBSITE', 'PRODUCT.AUTHOR_LINK');
    //Einheiten auslesen
    $unitinfo = array();
    if (in_template($unitvars, $parse)) {
        $unitids = array_merge(get_ids($data, 'manufacturer'), get_ids($data, 'publisher'));
        $unitinfo = $db->fetch_index("SELECT id,title,website FROM " . PRE . "_products_units WHERE id IN (" . implode(',', $unitids) . ")", 'id');
    }
    //Gruppen auslesen
    $groupinfo = array();
    $groups = array();
    /*if ( in_template(array('PRODUCT.MEDIA','PRODUCT.MEDIA_ICON'),$parse) ) $groups = array_merge($groups,get_ids($data,'media'));
示例#18
0
 function catshow()
 {
     global $set, $db, $apx, $html;
     //Struktur reparieren
     if ($_REQUEST['repair'] && $set['news']['subcats']) {
         $this->cat->repair();
         echo 'Repair done!';
         return;
     }
     quicklink('news.catadd');
     //DnD-Hinweis
     if ($set['news']['subcats'] && $apx->user->has_right('news.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_NEWS', 25, 'align="center"');
     if ($set['news']['subcats']) {
         $data = $this->cat->getTree(array('title', 'open'));
     } else {
         $orderdef[0] = 'title';
         $orderdef['title'] = array('title', 'ASC', 'COL_CATNAME');
         list($count) = $db->first("SELECT count(id) FROM " . PRE . "_news_cat");
         pages('action.php?action=news.catshow', $count);
         $data = $db->fetch("SELECT * FROM " . PRE . "_news_cat " . getorder($orderdef) . getlimit());
     }
     if (count($data)) {
         //Ausgabe erfolgt
         foreach ($data as $res) {
             ++$i;
             if ($res['open']) {
                 list($news) = $db->first("SELECT count(id) FROM " . PRE . "_news WHERE catid='" . $res['id'] . "'");
             }
             $tabledata[$i]['COL1'] = $res['id'];
             $tabledata[$i]['COL2'] = replace($res['title']);
             $tabledata[$i]['COL3'] = iif(isset($news), $news, '&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('news.catedit')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'news.catedit', 'id=' . $res['id'], $apx->lang->get('CORE_EDIT'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             if ($apx->user->has_right('news.catdel') && !$news) {
                 $tabledata[$i]['OPTIONS'] .= '<span class="ifhasnochildren">' . optionHTMLOverlay('del.gif', 'news.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('news.catclean') && $news) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('clean.gif', 'news.catclean', 'id=' . $res['id'], $apx->lang->get('CLEAN'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             //Anordnen nur bei Unterkategorien
             /*if ( $set['news']['subcats'] ) {
             			$tabledata[$i]['OPTIONS'].='&nbsp;';
             			if ( $apx->user->has_right('news.catmove') && $follow[$res['id']]['prev'] ) $tabledata[$i]['OPTIONS'].=optionHTML('moveup.gif', 'news.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('news.catmove') && $follow[$res['id']]['next'] ) $tabledata[$i]['OPTIONS'].=optionHTML('movedown.gif', 'news.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($news);
         }
     }
     $apx->tmpl->assign('TABLE', $tabledata);
     //Mit Unter-Kategorien
     if ($set['news']['subcats']) {
         echo '<div class="treeview" id="tree">';
         $html->table($col);
         echo '</div>';
         $open = $apx->session->get('news_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('news.edit'));
         $apx->tmpl->parse('catshow_js');
     } else {
         $html->table($col);
         orderstr($orderdef, 'action.php?action=news.catshow');
     }
     save_index($_SERVER['REQUEST_URI']);
 }
示例#19
0
    $user->info['forum_ppp'] = intval($_POST['ppp']);
}
///////////////////////////////////////////////////////////////////////////////////////// THEMA ANZEIGEN
require_once BASEDIR . 'lib/class.mediamanager.php';
$mm = new mediamanager();
//Views eins hochzählen
$db->query("UPDATE " . PRE . "_forum_threads SET views=views+1 WHERE threadid='" . $threadinfo['threadid'] . "' LIMIT 1");
//Seitenzahlen
list($count) = $db->first("SELECT count(postid) FROM " . PRE . "_forum_posts WHERE ( threadid='" . $threadinfo['threadid'] . "' )");
pages(mkrellink('thread.php?id=' . $threadinfo['threadid'] . iif($_REQUEST['highlight'], '&amp;highlight=' . urlencode($_REQUEST['highlight'])), 'thread,' . $threadinfo['threadid'] . ',{P}' . urlformat($threadinfo['title']) . '.html' . iif($_REQUEST['highlight'], '?highlight=' . urlencode($_REQUEST['highlight']))), $count, $user->info['forum_ppp']);
//Thema als gelesen markieren (=auf der letzten Seite gewesen und es gibt neue Beiträge)
if ($_REQUEST['p'] == ceil($count / $user->info['forum_ppp']) && $threadinfo['lastposttime'] > $lastvisit) {
    thread_isread($threadinfo['threadid']);
}
//Beiträge auslesen
$data = $db->fetch("SELECT * FROM " . PRE . "_forum_posts WHERE ( threadid='" . $threadinfo['threadid'] . "' ) ORDER BY time ASC " . getlimit($user->info['forum_ppp']));
//Anhänge auslesen
$postids = get_ids($data, 'postid');
$attinfo = array();
$attimage = array();
if (count($postids)) {
    $attdata = $db->fetch("SELECT id,postid,hash,file,thumbnail,name,size FROM " . PRE . "_forum_attachments WHERE postid IN (" . implode(',', $postids) . ") ORDER BY name ASC");
    if (count($attdata)) {
        $typeinfo = array();
        $icondata = $db->fetch("SELECT ext,icon FROM " . PRE . "_forum_filetypes ORDER BY ext ASC");
        if (count($icondata)) {
            foreach ($icondata as $res) {
                $typeicon[$res['ext']] = $res['icon'];
            }
        }
        foreach ($attdata as $res) {
示例#20
0
 $_POST = unserialize($options);
 //Seitenzahlen
 list($count) = $db->first("SELECT count(userid) FROM " . PRE . "_user WHERE ( active='1' AND userid IN (" . implode(',', $results) . ") )");
 $pagelink = mklink('user.php?action=search&amp;searchid=' . $_REQUEST['searchid'] . '&amp;sortby=' . $_REQUEST['sortby'] . '&amp;letter=' . $_REQUEST['letter'], 'user,search.html?searchid=' . $_REQUEST['searchid'] . iif($_REQUEST['sortby'], '&amp;sortby=' . $_REQUEST['sortby']));
 pages($pagelink, $count, $set['user']['userlistepp']);
 //Orderby
 $orderdef[0] = 'username';
 $orderdef['regdate'] = array('reg_time', 'DESC');
 $orderdef['username'] = array('username', 'ASC');
 if ($apx->is_module('forum')) {
     $orderdef['forumposts'] = array('forum_posts', 'DESC');
 }
 if ($apx->is_module('forum')) {
     $data = $db->fetch("SELECT userid,username,email,reg_time,pub_hidemail,groupid,realname,gender,city,plz,country,city,lastactive,avatar,avatar_title,forum_posts,custom1,custom2,custom3,custom4,custom5,custom6,custom7,custom8,custom9,custom10 FROM " . PRE . "_user WHERE ( active='1' AND userid IN (" . implode(',', $results) . ") ) " . getorder($orderdef) . " " . getlimit($set['user']['userlistepp']));
 } else {
     $data = $db->fetch("SELECT userid,username,email,reg_time,pub_hidemail,groupid,realname,gender,city,plz,country,city,lastactive,avatar,avatar_title,custom1,custom2,custom3,custom4,custom5,custom6,custom7,custom8,custom9,custom10 FROM " . PRE . "_user WHERE ( active='1' AND userid IN (" . implode(',', $results) . ") ) " . getorder($orderdef) . " " . getlimit($set['user']['userlistepp']));
 }
 if (count($data)) {
     foreach ($data as $res) {
         ++$i;
         $tabledata[$i]['ID'] = $res['userid'];
         $tabledata[$i]['NAME'] = $res['username'];
         $tabledata[$i]['REGTIME'] = $res['reg_time'];
         $tabledata[$i]['LASTACTIVE'] = $res['lastactive'];
         $tabledata[$i]['REGDAYS'] = floor((time() - $res['reg_time']) / (24 * 3600));
         $tabledata[$i]['EMAIL'] = replace(iif(!$res['pub_hidemail'], $res['email']));
         $tabledata[$i]['EMAIL_ENCRYPTED'] = replace(iif(!$res['pub_hidemail'], cryptMail($res['email'])));
         $tabledata[$i]['GROUPID'] = $res['groupid'];
         $tabledata[$i]['REALNAME'] = replace($res['realname']);
         $tabledata[$i]['GENDER'] = $res['gender'];
         $tabledata[$i]['CITY'] = replace($res['city']);
示例#21
0
    $apx->tmpl->parse('detail');
    require 'lib/_end.php';
}
//////////////////////////////////////////////////////////////////////////////////////////////////////// NEWS AUFLISTEN
//Titelleiste
headline($apx->lang->get('HEADLINE'), mklink('news.php', 'news.html'));
titlebar($apx->lang->get('HEADLINE'));
//Verwendete Variablen auslesen
$parse = $apx->tmpl->used_vars('index');
//Kategorie-Baum holen
$cattree = news_tree($_REQUEST['catid']);
//Seitenzahlen generieren
list($count) = $db->first("SELECT count(id) FROM " . PRE . "_news WHERE ( " . time() . " BETWEEN starttime AND endtime " . iif(count($cattree), ' AND catid IN (' . @implode(',', $cattree) . ') ') . section_filter() . ")");
pages(mklink('news.php?catid=' . $_REQUEST['catid'], 'news,' . $_REQUEST['catid'] . ',{P}.html'), $count, $set['news']['epp']);
//News ausgeben
$data = $db->fetch("SELECT a.*,IF(a.sticky>=" . time() . ",1,0) AS sticky,b.userid,b.username,b.email,b.pub_hidemail FROM " . PRE . "_news AS a LEFT JOIN " . PRE . "_user AS b USING(userid) WHERE ( " . time() . " BETWEEN starttime AND endtime " . iif(count($cattree), ' AND catid IN (' . @implode(',', $cattree) . ') ') . section_filter() . ") ORDER BY sticky DESC,starttime DESC " . getlimit($set['news']['epp']));
//Kategorien auslesen
if (in_array('NEWS.CATTITLE', $parse) || in_array('NEWS.CATICON', $parse) || in_array('NEWS.CATLINK', $parse)) {
    $catinfo = news_catinfo(get_ids($data, 'catid'));
}
if (count($data)) {
    foreach ($data as $res) {
        ++$i;
        //Link
        $link = mklink('news.php?id=' . $res['id'], 'news,id' . $res['id'] . urlformat($res['title']) . '.html');
        //Newspic
        if (in_array('NEWS.PICTURE', $parse) || in_array('NEWS.PICTURE_POPUP', $parse) || in_array('NEWS.PICTURE_POPUPPATH', $parse)) {
            list($picture, $picture_popup, $picture_popuppath) = news_newspic($res['newspic']);
        }
        //Username + eMail
        if ($res['userid']) {
示例#22
0
 function show()
 {
     global $set, $db, $apx, $html;
     //Suche durchführen
     if ($_REQUEST['item'] && ($_REQUEST['title'] || $_REQUEST['text']) || $_REQUEST['secid'] || $_REQUEST['catid'] || $_REQUEST['userid']) {
         $where = '';
         $_REQUEST['secid'] = (int) $_REQUEST['secid'];
         $_REQUEST['catid'] = (int) $_REQUEST['catid'];
         $_REQUEST['userid'] = (int) $_REQUEST['userid'];
         //Suchbegriff
         if ($_REQUEST['item']) {
             if ($_REQUEST['title']) {
                 $sc[] = "title LIKE '%" . addslashes_like($_REQUEST['item']) . "%'";
             }
             if ($_REQUEST['subtitle']) {
                 $sc[] = "subtitle LIKE '%" . addslashes_like($_REQUEST['item']) . "%'";
             }
             if ($_REQUEST['teaser']) {
                 $sc[] = "teaser LIKE '%" . addslashes_like($_REQUEST['item']) . "%'";
             }
             if ($_REQUEST['text']) {
                 $sc[] = "text LIKE '%" . addslashes_like($_REQUEST['item']) . "%'";
             }
             if (is_array($sc)) {
                 $where .= ' AND ( ' . implode(' OR ', $sc) . ' )';
             }
         }
         //Sektion
         if (!$apx->session->get('section') && $_REQUEST['secid']) {
             $where .= " AND ( secid LIKE '%|" . $_REQUEST['secid'] . "|%' OR secid='all' ) ";
         }
         //Kategorie
         if ($_REQUEST['catid']) {
             $tree = $this->cat->getChildrenIds($_REQUEST['catid']);
             $tree[] = $_REQUEST['catid'];
             if (is_array($tree)) {
                 $where .= " AND catid IN (" . implode(',', $tree) . ") ";
             }
         }
         //Benutzer
         if ($_REQUEST['userid']) {
             $where .= " AND userid='" . $_REQUEST['userid'] . "' ";
         }
         $data = $db->fetch("SELECT id FROM " . PRE . "_videos WHERE 1 " . $where);
         $ids = get_ids($data, 'id');
         $ids[] = -1;
         $searchid = saveSearchResult('admin_videos', $ids, array('item' => $_REQUEST['item'], 'title' => $_REQUEST['title'], 'text' => $_REQUEST['text'], 'catid' => $_REQUEST['catid'], 'secid' => $_REQUEST['secid'], 'userid' => $_REQUEST['userid']));
         header("HTTP/1.1 301 Moved Permanently");
         header('Location: action.php?action=videos.show&what=' . $_REQUEST['what'] . '&searchid=' . $searchid);
         return;
     }
     //Unbroken setzen
     $_REQUEST['unbroken'] = (int) $_REQUEST['unbroken'];
     if ($_REQUEST['unbroken']) {
         $db->query("UPDATE " . PRE . "_videos SET broken='' WHERE id='" . $_REQUEST['unbroken'] . "' LIMIT 1");
     }
     //Vorgaben
     $_REQUEST['title'] = 1;
     $_REQUEST['text'] = 1;
     quicklink('videos.add');
     $layerdef[] = array('LAYER_ALL', 'action.php?action=videos.show', !$_REQUEST['what']);
     $layerdef[] = array('LAYER_BROKEN', 'action.php?action=videos.show&amp;what=broken', $_REQUEST['what'] == 'broken');
     if ($set['videos']['ffmpeg'] && $set['videos']['flvtool2']) {
         $layerdef[] = array('LAYER_FAILED', 'action.php?action=videos.show&amp;what=failed', $_REQUEST['what'] == 'failed');
     }
     //Layer Header ausgeben
     $html->layer_header($layerdef);
     $orderdef[0] = 'creation';
     $orderdef['title'] = array('a.title', 'ASC', 'COL_TITLE');
     $orderdef['user'] = array('b.username', 'ASC', 'COL_AUTHOR');
     $orderdef['category'] = array('c.title', 'ASC', 'COL_CATEGORY');
     $orderdef['creation'] = array('a.addtime', 'DESC', 'SORT_ADDTIME');
     $orderdef['publication'] = array('a.starttime', 'DESC', 'SORT_STARTTIME');
     $orderdef['hits'] = array('a.hits', 'DESC', 'COL_HITS');
     $orderdef['downloads'] = array('a.downloads', 'DESC', 'COL_DOWNLOADS');
     //Suchergebnis?
     $resultFilter = '';
     if ($_REQUEST['searchid']) {
         $searchRes = getSearchResult('admin_videos', $_REQUEST['searchid']);
         if ($searchRes) {
             list($resultIds, $resultMeta) = $searchRes;
             $_REQUEST['item'] = $resultMeta['item'];
             $_REQUEST['title'] = $resultMeta['title'];
             $_REQUEST['subtitle'] = $resultMeta['subtitle'];
             $_REQUEST['teaser'] = $resultMeta['teaser'];
             $_REQUEST['text'] = $resultMeta['text'];
             $_REQUEST['catid'] = $resultMeta['catid'];
             $_REQUEST['secid'] = $resultMeta['secid'];
             $_REQUEST['userid'] = $resultMeta['userid'];
             $resultFilter = " AND a.id IN (" . implode(', ', $resultIds) . ")";
         } else {
             $_REQUEST['searchid'] = '';
         }
     }
     //Sektionen auflisten
     $seclist = '';
     if (is_array($apx->sections) && count($apx->sections)) {
         foreach ($apx->sections as $res) {
             $seclist .= '<option value="' . $res['id'] . '"' . iif($_REQUEST['secid'] == $res['id'], ' selected="selected"') . '>' . replace($res['title']) . '</option>';
         }
     }
     //Kategorien auflisten
     $catlist = '';
     $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);
             }
             $catlist .= '<option value="' . $res['id'] . '"' . iif($_REQUEST['catid'] == $res['id'], ' selected="selected"') . '>' . $space . replace($res['title']) . '</option>';
         }
     }
     //Benutzer auflisten
     $userlist = '';
     $data = $db->fetch("SELECT b.userid,b.username FROM " . PRE . "_videos AS a LEFT JOIN " . PRE . "_user AS b USING (userid) WHERE a.userid!=0 GROUP BY userid ORDER BY username ASC");
     if (count($data)) {
         foreach ($data as $res) {
             $userlist .= '<option value="' . $res['userid'] . '"' . iif($_REQUEST['userid'] == $res['userid'], ' selected="selected"') . '>' . replace($res['username']) . '</option>';
         }
     }
     $apx->tmpl->assign('ITEM', compatible_hsc($_REQUEST['item']));
     $apx->tmpl->assign('SECLIST', $seclist);
     $apx->tmpl->assign('CATLIST', $catlist);
     $apx->tmpl->assign('USERLIST', $userlist);
     $apx->tmpl->assign('STITLE', (int) $_REQUEST['title']);
     $apx->tmpl->assign('STEXT', (int) $_REQUEST['text']);
     $apx->tmpl->assign('WHAT', $_REQUEST['what']);
     $apx->tmpl->assign('EXTENDED', $searchRes);
     $apx->tmpl->parse('search');
     //Filter
     $layerFilter = '';
     if ($_REQUEST['what'] == 'broken') {
         $layerFilter = " AND a.broken!=0 ";
     } elseif ($_REQUEST['what'] == 'failed') {
         $layerFilter = " AND a.status='failed' ";
     }
     list($count) = $db->first("SELECT count(userid) FROM " . PRE . "_videos AS a WHERE 1 " . $resultFilter . $layerFilter . section_filter(true, 'secid'));
     pages('action.php?action=videos.show&amp;what=' . $_REQUEST['what'] . iif($_REQUEST['searchid'], '&amp;searchid=' . $_REQUEST['searchid']) . '&amp;sortby=' . $_REQUEST['sortby'], $count);
     $data = $db->fetch("SELECT a.id,a.secid,a.title,a.addtime,a.status,a.allowcoms,a.allowrating,a.starttime,a.endtime,a.broken,a.hits,a.downloads,b.userid,b.username,c.title AS catname FROM " . PRE . "_videos AS a LEFT JOIN " . PRE . "_user AS b USING(userid) LEFT JOIN " . PRE . "_videos_cat AS c ON a.catid=c.id WHERE 1 " . $resultFilter . $layerFilter . section_filter(true, 'a.secid') . " " . getorder($orderdef) . getlimit());
     $this->show_print($data);
     orderstr($orderdef, 'action.php?action=videos.show&amp;what=' . $_REQUEST['what'] . iif($_REQUEST['searchid'], '&amp;searchid=' . $_REQUEST['searchid']));
     save_index($_SERVER['REQUEST_URI']);
     //Layer-Footer ausgeben
     $html->layer_footer();
 }
示例#23
0
    $orderdef[0] = 'date';
} else {
    $orderdef[0] = 'title';
}
$orderdef['title'] = array('a.title', 'ASC');
$orderdef['date'] = array('a.starttime', 'DESC');
$orderdef['hits'] = array('a.hits', 'DESC');
$orderdef['user'] = array('b.username', 'ASC');
if ($apx->is_module('ratings')) {
    $orderdef['rating'] = array('c.rating', 'DESC');
}
//Videos Select
if ($apx->is_module('ratings') && ($_REQUEST['sortby'] == 'rating.ASC' || $_REQUEST['sortby'] == 'rating.DESC')) {
    $data = $db->fetch("SELECT a.*,b.username,b.email,b.pub_hidemail,avg(c.rating) AS rating FROM " . PRE . "_videos AS a LEFT JOIN " . PRE . "_user AS b USING(userid) LEFT JOIN " . PRE . "_ratings AS c ON ( c.module='videos' AND a.id=c.mid ) WHERE ( a.status='finished' AND ( '" . time() . "' BETWEEN starttime AND endtime ) AND " . $filter . " " . section_filter() . " ) GROUP BY a.id " . getorder($orderdef) . getlimit($set['videos']['epp']));
} else {
    $data = $db->fetch("SELECT *,b.username,b.email,b.pub_hidemail FROM " . PRE . "_videos AS a LEFT JOIN " . PRE . "_user AS b USING(userid) WHERE ( a.status='finished' AND ( '" . time() . "' BETWEEN starttime AND endtime ) AND " . $filter . " " . section_filter() . " ) " . getorder($orderdef) . getlimit($set['videos']['epp']));
}
$catids = get_ids($data, 'catid');
//Kategorien auslesen, falls notwendig
$catinfo = array();
if (count($catids) && in_template(array('VIDEO.CATTITLE', 'VIDEO.CATTEXT', 'VIDEO.CATICON'), $parse)) {
    $catinfo = videos_catinfo($catids);
}
if (count($data)) {
    foreach ($data as $res) {
        ++$i;
        //Link
        $link = mklink('videos.php?id=' . $res['id'], 'videos,id' . $res['id'] . urlformat($res['title']) . '.html');
        //Teaserbild
        if (in_array('VIDEO.PICTURE', $parse) || in_array('VIDEO.PICTURE_POPUP', $parse) || in_array('VIDEO.PICTURE_POPUPPATH', $parse)) {
            list($picture, $picture_popup, $picture_popuppath) = videos_teaserpic($res['teaserpic']);
示例#24
0
文件: main.php 项目: araranga/mono
<?php 
$field = array("accounts_id", "username", "email");
$where = getwheresearch($field);
$total = countquery("SELECT username FROM tbl_accounts");
//primary query
$limit = getlimit(10, $_GET['p']);
$query = "SELECT * FROM tbl_accounts {$where} {$limit}";
$q = mysql_query($query);
$options = getpackagelist();
$pagecount = getpagecount($total, 10);
?>
<style>
#dataTables-example_filter , #dataTables-example_info , #dataTables-example_wrapper .row
{
    display:none;
}
</style>
<h2>Users</h2>
<div class="panel panel-default">
   <div class="panel-body">
         <div class="row">
            <div class="col-md-2">
               <div class="panel panel-default">
                  <div class="panel-body">
                    <input onclick="window.location='<?php 
echo "?pages=" . $_GET['pages'] . "&task=add";
?>
';" type="button" class="btn btn-primary" value="Add New Data">
                  </div>
               </div>
            </div>
示例#25
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']);
 }
示例#26
0
            user_assign_visitors('blog', $_REQUEST['id'], $apx->tmpl, $parse);
        }
    }
    $link_report = "javascript:popupwin('user.php?action=report&amp;contentid=blogentry:" . $_REQUEST['blogid'] . "',500,300);";
    $apx->tmpl->assign('LINK_REPORT', $link_report);
    $apx->tmpl->parse('blog_detail');
} else {
    headline($apx->lang->get('HEADLINE_BLOG'), str_replace('&', '&amp;', $_SERVER['REQUEST_URI']));
    titlebar($apx->lang->get('HEADLINE_BLOG'));
    //Verwendete Variablen auslesen
    $parse = $apx->tmpl->used_vars('blog');
    //Seitenzahlen
    list($count) = $db->first("SELECT count(id) FROM " . PRE . "_user_blog WHERE userid='" . $_REQUEST['id'] . "'");
    pages(mklink('user.php?action=blog&amp;id=' . $_REQUEST['id'], 'user,blog,' . $_REQUEST['id'] . ',{P}.html'), $count, $set['user']['blog_epp']);
    //Einträge auslesen
    $data = $db->fetch("SELECT * FROM " . PRE . "_user_blog WHERE userid='" . $_REQUEST['id'] . "' ORDER BY time DESC" . getlimit($set['user']['blog_epp']));
    if (count($data)) {
        foreach ($data as $res) {
            ++$i;
            //Link
            $link = mklink('user.php?action=blog&amp;id=' . $_REQUEST['id'] . '&amp;blogid=' . $res['id'], 'user,blog,' . $_REQUEST['id'] . ',id' . $res['id'] . urlformat($res['title']) . '.html');
            //Text
            $text = $res['text'];
            $text = badwords($text);
            $text = replace($text, 1);
            $text = dbsmilies($text);
            $text = dbcodes($text);
            $tabledata[$i]['ID'] = $res['id'];
            $tabledata[$i]['TITLE'] = replace($res['title']);
            $tabledata[$i]['TEXT'] = $text;
            $tabledata[$i]['LINK'] = $link;
示例#27
0
 function ranks()
 {
     global $set, $apx, $db, $html;
     //Aktionen
     if ($_REQUEST['do'] == 'add') {
         return $this->ranks_add();
     }
     if ($_REQUEST['do'] == 'edit') {
         return $this->ranks_edit();
     }
     if ($_REQUEST['do'] == 'del') {
         return $this->ranks_del();
     }
     //Voreinstellung
     if (!$_REQUEST['what']) {
         $_REQUEST['what'] = 'posts';
     }
     echo '<p class="slink">&raquo; <a href="action.php?action=forum.ranks&amp;do=add&amp;criteria=' . $_REQUEST['what'] . '">' . $apx->lang->get('ADDRANK') . '</a></p>';
     //Layer
     $layerdef[] = array('LAYER_POST', 'action.php?action=forum.ranks&amp;what=posts', $_REQUEST['what'] == 'posts');
     $layerdef[] = array('LAYER_USER', 'action.php?action=forum.ranks&amp;what=user', $_REQUEST['what'] == 'user');
     $layerdef[] = array('LAYER_USERGROUPS', 'action.php?action=forum.ranks&amp;what=groups', $_REQUEST['what'] == 'groups');
     //Layer Header ausgeben
     $html->layer_header($layerdef);
     ///////////////////// Benutzer-Ränge
     if ($_REQUEST['what'] == 'user') {
         $col[] = array('COL_RANK', 50, 'class="title"');
         $col[] = array('COL_USER', 50, 'align="center"');
         $orderdef[0] = 'title';
         $orderdef['title'] = array('a.title', 'ASC', 'COL_RANK');
         $orderdef['username'] = array('b.username', 'ASC', 'COL_USER');
         list($count) = $db->first("SELECT count(id) FROM " . PRE . "_forum_ranks WHERE userid!=''");
         pages('action.php?action=forum.ranks&amp;what=' . $_REQUEST['what'] . '&amp;sortby=' . $_REQUEST['sortby'], $count);
         $data = $db->fetch("SELECT a.id,a.title,a.userid,b.username FROM " . PRE . "_forum_ranks AS a LEFT JOIN " . PRE . "_user AS b USING(userid) WHERE a.userid!='' " . getorder($orderdef) . getlimit());
         if (count($data)) {
             foreach ($data as $res) {
                 ++$i;
                 $tabledata[$i]['COL1'] = $res['title'];
                 $tabledata[$i]['COL2'] = $res['username'];
                 //Optionen
                 $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'forum.ranks', 'do=edit&id=' . $res['id'], $apx->lang->get('CORE_EDIT'));
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', 'forum.ranks', 'do=del&id=' . $res['id'], $apx->lang->get('CORE_DEL'));
             }
         }
     } elseif ($_REQUEST['what'] == 'groups') {
         $col[] = array('COL_RANK', 70, 'class="title"');
         $col[] = array('COL_USERGROUP', 30, 'align="center"');
         $orderdef[0] = 'title';
         $orderdef['title'] = array('a.title', 'ASC', 'COL_RANK');
         $orderdef['group'] = array('b.name', 'ASC', 'COL_USERGROUP');
         list($count) = $db->first("SELECT count(id) FROM " . PRE . "_forum_ranks WHERE groupid!=0");
         pages('action.php?action=forum.ranks&amp;what=' . $_REQUEST['what'] . '&amp;sortby=' . $_REQUEST['sortby'], $count);
         $data = $db->fetch("SELECT a.id,a.title,b.name FROM " . PRE . "_forum_ranks AS a LEFT JOIN " . PRE . "_user_groups AS b USING(groupid) WHERE a.groupid!=0 " . getorder($orderdef) . getlimit());
         if (count($data)) {
             foreach ($data as $res) {
                 ++$i;
                 $tabledata[$i]['COL1'] = $res['title'];
                 $tabledata[$i]['COL2'] = $res['name'];
                 //Optionen
                 $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'forum.ranks', 'do=edit&id=' . $res['id'], $apx->lang->get('CORE_EDIT'));
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', 'forum.ranks', 'do=del&id=' . $res['id'], $apx->lang->get('CORE_DEL'));
             }
         }
     } else {
         $col[] = array('COL_RANK', 70, 'class="title"');
         $col[] = array('COL_POSTS', 30, 'align="center"');
         $orderdef[0] = 'posts';
         $orderdef['title'] = array('title', 'ASC', 'COL_RANK');
         $orderdef['posts'] = array('minposts', 'ASC', 'COL_POSTS');
         list($count) = $db->first("SELECT count(id) FROM " . PRE . "_forum_ranks WHERE minposts!=-1");
         pages('action.php?action=forum.ranks&amp;sortby=' . $_REQUEST['sortby'], $count);
         $data = $db->fetch("SELECT id,title,minposts FROM " . PRE . "_forum_ranks WHERE minposts!=-1 " . getorder($orderdef) . getlimit());
         if (count($data)) {
             foreach ($data as $res) {
                 ++$i;
                 $tabledata[$i]['COL1'] = $res['title'];
                 $tabledata[$i]['COL2'] = $res['minposts'];
                 //Optionen
                 $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'forum.ranks', 'do=edit&id=' . $res['id'], $apx->lang->get('CORE_EDIT'));
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', 'forum.ranks', 'do=del&id=' . $res['id'], $apx->lang->get('CORE_DEL'));
             }
         }
     }
     $apx->tmpl->assign('TABLE', $tabledata);
     $html->table($col);
     orderstr($orderdef, 'action.php?action=forum.ranks&amp;what=' . $_REQUEST['what']);
     save_index($_SERVER['REQUEST_URI']);
     //Layer-Footer ausgeben
     $html->layer_footer();
 }
示例#28
0
 function genre()
 {
     global $set, $db, $apx, $html;
     //Funktionen
     if ($_REQUEST['do'] == 'add') {
         return $this->genre_add();
     } elseif ($_REQUEST['do'] == 'edit') {
         return $this->genre_edit();
     } elseif ($_REQUEST['do'] == 'del') {
         return $this->genre_del();
     }
     echo '<p class="slink">&raquo; <a href="action.php?action=products.genre&amp;do=add&amp;type=' . $_REQUEST['type'] . '">' . $apx->lang->get('ADDGENRE') . '</a></p>';
     //Layer Header ausgeben
     $layerdef[] = array('PRODTYPE_ALL', 'action.php?action=products.genre', !$_REQUEST['type']);
     foreach ($this->genretypes as $type) {
         $layerdef[] = array('PRODTYPE_' . strtoupper($type), 'action.php?action=products.genre&amp;type=' . $type, $_REQUEST['type'] == $type);
     }
     $html->layer_header($layerdef);
     //Einträge zu einem bestimmten Produkttyp
     if (in_array($_REQUEST['type'], $this->types)) {
         list($count) = $db->first("SELECT count(id) FROM " . PRE . "_products_groups WHERE grouptype='genre' AND type='" . $_REQUEST['type'] . "'");
         pages('action.php?action=products.genre&amp;type=' . $_REQUEST['type'], $count);
         $data = $db->fetch("SELECT * FROM " . PRE . "_products_groups WHERE grouptype='genre' AND type='" . $_REQUEST['type'] . "' ORDER BY title ASC" . getlimit());
         $this->genre_print($data);
         save_index($_SERVER['REQUEST_URI']);
     } else {
         list($count) = $db->first("SELECT count(id) FROM " . PRE . "_products_groups WHERE grouptype='genre'");
         pages('action.php?action=products.genre', $count);
         $data = $db->fetch("SELECT * FROM " . PRE . "_products_groups WHERE grouptype='genre' ORDER BY title ASC" . getlimit());
         $this->genre_print($data);
         save_index($_SERVER['REQUEST_URI']);
     }
     //Layer-Footer ausgeben
     $html->layer_footer();
 }
示例#29
0
 function show()
 {
     global $set, $db, $apx, $html;
     quicklink_multi('guestbook.blockip');
     quicklink_multi('guestbook.blockcontent');
     quicklink_out();
     $orderdef[0] = 'time';
     $orderdef['name'] = array('username', 'ASC', 'COL_NAME');
     $orderdef['time'] = array('time', 'DESC', 'SORT_TIME');
     if ($set['guestbook']['mod']) {
         $col[] = array('', 1, 'align="center"');
     }
     $col[] = array('COL_NAME', 30, 'class="title"');
     $col[] = array('COL_TEXT', 50, '');
     $col[] = array('COL_IP', 20, 'align="center"');
     list($count) = $db->first("SELECT count(id) FROM " . PRE . "_guestbook");
     pages('action.php?action=guestbook.show&amp;sortby=' . $_REQUEST['sortby'], $count);
     $data = $db->fetch("SELECT id,username,text,ip,active,com_text FROM " . PRE . "_guestbook " . getorder($orderdef) . getlimit());
     if (count($data)) {
         foreach ($data as $res) {
             ++$i;
             $icol = 0;
             //Moderiert -> Icons
             if ($set['guestbook']['mod']) {
                 if ($res['active']) {
                     $tabledata[$i]['COL' . ++$icol] = '<img src="design/greendot.gif" alt="' . $apx->lang->get('CORE_ACTIVE') . '" title="' . $apx->lang->get('CORE_ACTIVE') . '" />';
                 } else {
                     $tabledata[$i]['COL' . ++$icol] = '<img src="design/reddot.gif" alt="' . $apx->lang->get('CORE_INACTIVE') . '" title="' . $apx->lang->get('CORE_INACTIVE') . '" />';
                 }
             }
             $tabledata[$i]['COL' . ++$icol] = replace($res['username']);
             $tabledata[$i]['COL' . ++$icol] = shorttext($res['text'], 50);
             $tabledata[$i]['COL' . ++$icol] = $res['ip'] . iif($apx->user->has_right('guestbook.blockip'), ' <a href="action.php?action=guestbook.blockip&amp;setip=' . $res['ip'] . '"><img src="design/block.gif" alt="' . $apx->lang->get('BLOCK') . '" title="' . $apx->lang->get('BLOCK') . '" /></a>');
             $tabledata[$i]['ID'] = $res['id'];
             //Optionen
             if ($apx->user->has_right('guestbook.edit')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'guestbook.edit', 'id=' . $res['id'], $apx->lang->get('CORE_EDIT'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             if ($apx->user->has_right('guestbook.del')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', 'guestbook.del', 'id=' . $res['id'], $apx->lang->get('CORE_DEL'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             //Moderiert -> Enable/Disable
             if ($set['guestbook']['mod']) {
                 if ($res['active'] && $apx->user->has_right('guestbook.disable')) {
                     $tabledata[$i]['OPTIONS'] .= optionHTML('disable.gif', 'guestbook.disable', 'id=' . $res['id'] . '&sectoken=' . $apx->session->get('sectoken'), $apx->lang->get('CORE_DISABLE'));
                 } elseif (!$res['active'] && $apx->user->has_right('guestbook.enable')) {
                     $tabledata[$i]['OPTIONS'] .= optionHTML('enable.gif', 'guestbook.enable', 'id=' . $res['id'] . '&sectoken=' . $apx->session->get('sectoken'), $apx->lang->get('CORE_ENABLE'));
                 } else {
                     $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
                 }
             }
             $tabledata[$i]['OPTIONS'] .= '&nbsp;';
             if ($apx->user->has_right('guestbook.com')) {
                 $icon = 'comment_none.gif';
                 if ($res['com_text']) {
                     $icon = 'comment.gif';
                 }
                 $tabledata[$i]['OPTIONS'] .= optionHTML($icon, 'guestbook.com', 'id=' . $res['id'], $apx->lang->get('ADDCOM'));
             }
         }
     }
     $multiactions = array();
     if ($apx->user->has_right('guestbook.del')) {
         $multiactions[] = array($apx->lang->get('CORE_DEL'), 'action.php?action=guestbook.del&module=' . $this->module . '&mid=' . $this->mid);
     }
     if ($set['guestbook']['mod']) {
         if ($apx->user->has_right('guestbook.enable')) {
             $multiactions[] = array($apx->lang->get('CORE_ENABLE'), 'action.php?action=guestbook.enable&module=' . $this->module . '&mid=' . $this->mid);
         }
         if ($apx->user->has_right('guestbook.disable')) {
             $multiactions[] = array($apx->lang->get('CORE_DISABLE'), 'action.php?action=guestbook.disable&module=' . $this->module . '&mid=' . $this->mid);
         }
     }
     $apx->tmpl->assign('TABLE', $tabledata);
     $html->table($col, $multiactions);
     orderstr($orderdef, 'action.php?action=guestbook.show&amp;id=' . $_REQUEST['id']);
     save_index($_SERVER['REQUEST_URI']);
 }
示例#30
0
//Gelöschte Themen filtern
$delfilter = '';
if (!($user->info['userid'] && ($user->is_admin() || in_array($user->info['userid'], $foruminfo['moderator'])))) {
    $delfilter = " AND del=0 ";
}
//Seitenzahlen
list($count) = $db->first("SELECT count(threadid) FROM " . PRE . "_forum_threads WHERE (forumid='" . $foruminfo['forumid'] . "' " . $delfilter . " )");
pages(mkrellink('forum.php?id=' . $foruminfo['forumid'] . iif($_REQUEST['sortby'], '&amp;sortby=' . $_REQUEST['sortby']), 'forum,' . $foruminfo['forumid'] . ',{P}' . urlformat($foruminfo['title']) . '.html' . iif($_REQUEST['sortby'], '?sortby=' . $_REQUEST['sortby'])), $count, $user->info['forum_tpp']);
//Sortierung
$orderdef[0] = 'lastpost';
$orderdef['title'] = array('title', 'ASC');
$orderdef['opener'] = array('opener', 'ASC');
$orderdef['lastpost'] = array('lastposttime', 'DESC');
$orderdef['posts'] = array('posts', 'DESC');
$orderdef['views'] = array('views', 'DESC');
$threadData = $db->fetch("SELECT *, IF(del!=0,0,sticky) AS stickyord FROM " . PRE . "_forum_threads WHERE ( forumid='" . $_REQUEST['id'] . "' " . $delfilter . " ) " . getorder($orderdef, 'stickyord DESC', 1) . " " . getlimit($user->info['forum_tpp']));
if (count($threadData)) {
    foreach ($threadData as $res) {
        ++$i;
        $pre = array();
        //Lastvisit bestimmen
        $lastview = max(array($user->info['forum_lastonline'], thread_readtime($res['threadid']), forum_readtime($foruminfo['forumid'])));
        //Verschoben
        if ($res['moved']) {
            $res['threadid'] = $res['moved'];
        }
        //Link
        $link = mkrellink('thread.php?id=' . $res['threadid'], 'thread,' . $res['threadid'] . ',1' . urlformat($res['title']) . '.html');
        //Icon
        if ($res['icon'] != -1 && isset($set['forum']['icons'][(int) $res['icon']])) {
            $icon = $set['forum']['icons'][(int) $res['icon']]['file'];