Ejemplo n.º 1
0
function forum_path($info, $inpath = false)
{
    global $set, $db, $apx;
    if (!$info['forumid']) {
        return array();
    }
    $parents = dash_unserialize($info['parents']);
    if ($inpath) {
        $parents[] = $info['forumid'];
    }
    //Forum in der Liste zeigen
    if (!count($parents)) {
        return array();
    }
    $data = $db->fetch("SELECT forumid,title FROM " . PRE . "_forums WHERE forumid IN (" . implode(',', $parents) . ") ORDER BY parents ASC");
    if (!count($data)) {
        return array();
    }
    $pathdata = array();
    foreach ($data as $res) {
        ++$i;
        $link = mkrellink('forum.php?id=' . $res['forumid'], 'forum,' . $res['forumid'] . ',1' . urlformat($res['title']) . '.html');
        $pathdata[$i]['TITLE'] = replace($res['title']);
        $pathdata[$i]['LINK'] = $link;
    }
    return $pathdata;
}
Ejemplo n.º 2
0
function misc_productsfeed()
{
    global $set, $db, $apx;
    $apx->tmpl->loaddesign('blank');
    header('Content-type: application/rss+xml');
    $apx->lang->drop('types', 'products');
    $type = $_REQUEST['type'];
    $alltypes = array('normal', 'game', 'software', 'hardware', 'music', 'movie', 'book');
    if (!in_array($type, $alltypes)) {
        $type = '';
    }
    $data = $db->fetch("SELECT * FROM " . PRE . "_products WHERE active='1' " . iif($type, " AND type='" . $type . "'") . " ORDER BY addtime DESC LIMIT 20");
    if (count($data)) {
        foreach ($data as $res) {
            ++$i;
            //Link
            $link = mklink('products.php?id=' . $res['id'], 'products,id' . $res['id'] . urlformat($res['title']) . '.html');
            $tabledata[$i]['ID'] = $res['id'];
            $tabledata[$i]['TITLE'] = rss_replace($res['title']);
            $tabledata[$i]['TIME'] = date('r', $res['starttime']);
            //Kein TIMEDIFF weil Zeitverschiebung mit angegeben!
            $tabledata[$i]['TEXT'] = rss_replace(preg_replace('#{IMAGE\\(([0-9]+)\\)}#s', '', $res['text']));
            $tabledata[$i]['TYPE'] = $res['type'];
            $tabledata[$i]['LINK'] = HTTP_HOST . $link;
        }
    }
    $apx->tmpl->assign('WEBSITENAME', $set['main']['websitename']);
    $apx->tmpl->assign('PRODUCT', $tabledata);
    $apx->tmpl->parse('rss', 'products');
}
Ejemplo n.º 3
0
function search_gallery($items, $conn)
{
    global $set, $db, $apx, $user;
    require_once BASEDIR . getmodulepath('gallery') . 'functions.php';
    //Suchstring generieren
    $tagmatches = gallery_match_tags($items);
    foreach ($items as $item) {
        $tagmatch = array_shift($tagmatches);
        $search1[] = "caption LIKE '" . addslashes_like($item) . "'";
        $search2[] = " ( " . iif($tagmatch, " id IN (" . implode(',', $tagmatch) . ") OR ") . " title LIKE '%" . addslashes_like($item) . "%' OR description LIKE '%" . addslashes_like($item) . "%' ) ";
    }
    $searchstring1 = implode($conn, $search1);
    $searchstring2 = implode($conn, $search2);
    //Bilder durchsuchen
    $data = $db->fetch("SELECT galid FROM " . PRE . "_gallery_pics WHERE ( active='1' AND ( " . $searchstring1 . " ) ) GROUP BY galid");
    $galids = get_ids($data, 'galid');
    if (count($galids)) {
        $picres = " id IN (" . @implode(',', $galids) . ") OR ";
    }
    //Ergebnisse
    $data = $db->fetch("SELECT id,title FROM " . PRE . "_gallery WHERE ( searchable='1' AND '" . time() . "' BETWEEN starttime AND endtime " . section_filter() . " AND ( " . $picres . " ( " . $searchstring2 . " ) ) ) ORDER BY title ASC");
    if (count($data)) {
        foreach ($data as $res) {
            ++$i;
            $result[$i]['TITLE'] = strip_tags($res['title']);
            $result[$i]['LINK'] = mklink('gallery.php?id=' . $res['id'], 'gallery,list' . $res['id'] . ',1' . urlformat($res['title']) . '.html');
        }
    }
    return $result;
}
Ejemplo n.º 4
0
function glossar_highlight($text, $module = false, $ignore = false)
{
    global $apx, $db, $set;
    static $highlights;
    $ignore = (int) $ignore;
    if (!$set['glossar']['highlight'] || !$text) {
        return $text;
    }
    $apx->lang->drop('highlights', 'glossar');
    $classname_word = 'glossar_highlight';
    $classname_title = 'glossar_info_title';
    $classname_text = 'glossar_info_text';
    $classname_readmore = 'glossar_info_readmore';
    //Daten auslesen
    if (!isset($highlights)) {
        $highlights = array();
        $data = $db->fetch("SELECT id,title,spelling,text FROM " . PRE . "_glossar WHERE starttime!=0" . iif($ignore, " AND id!='" . $ignore . "'"));
        if (count($data)) {
            foreach ($data as $res) {
                $words = array();
                if ($res['spelling']) {
                    $words = explode(',', strtolower($res['spelling']));
                }
                $words[] = strtolower($res['title']);
                $words = array_unique(array_map('trim', $words));
                $link = mklink('glossar.php?id=' . $res['id'], 'glossar,id' . $res['id'] . urlformat($res['title']) . '.html');
                $content = '<div class="' . $classname_title . '"><a href="' . $link . '">' . $res['title'] . '</a></div><div class="' . $classname_text . '">' . shorttext($res['text'], 200) . '</div><div class="' . $classname_readmore . '"><a href="' . $link . '">' . $apx->lang->get('READMORE') . '</a></div>';
                $content = strtr(compatible_hsc($content), array("\n" => ' ', "\r" => '', '\'' => '\\\'', '\\' => '\\\\'));
                $highlights[] = array('words' => $words, 'content' => $content);
            }
        }
    }
    //Text nach Highlights durchsuchen
    $lowertext = strtolower($text);
    foreach ($highlights as $element) {
        $words = $element['words'];
        foreach ($words as $wkey => $word) {
            if (strpos($lowertext, strtolower($word)) === false) {
                unset($words[$wkey]);
            }
        }
        if (!count($words)) {
            continue;
        }
        $words = array_map('preg_quote', $words);
        $searchfor = implode('|', $words);
        $hover = 'Tip(\'' . $element['content'] . '\')';
        $text = preg_replace('#((<[^>]*)|($|[\\s<>,.:;_!-])(' . $searchfor . ')([\\s<>,.:;_!-]|$))#ie', '"\\2"=="\\1" ? glossar_stripslashes("\\1") : glossar_stripslashes("\\3")."<span class=\\"' . $classname_word . '\\" onmouseover=\\"' . strtr($hover, array('\\' => '\\\\')) . '\\">".glossar_stripslashes("\\4")."</span>".glossar_stripslashes("\\5")', $text);
        //$text=preg_replace('#((<[^>]*)|('.$searchfor.'))#ie', '"\2"=="\1" ? glossar_stripslashes("\1") : "<span class=\"'.$classname_word.'\" onmouseover=\"'.$hover.'\">".glossar_stripslashes("\3")."</span>"', $text);
    }
    return $text;
}
Ejemplo n.º 5
0
function misc_articlesfeed()
{
    global $set, $db, $apx;
    $apx->tmpl->loaddesign('blank');
    header('Content-type: application/rss+xml');
    //Verwendete Variablen
    $parse = $apx->tmpl->used_vars('rss', 'articles');
    //Baum holen, wenn nur eine bestimmte Kategorie gezeigt werden soll
    $cattree = articles_tree($_REQUEST['catid']);
    $data = $db->fetch("SELECT a.id,a.type,a.catid,a.title,a.subtitle,a.teaser,a.starttime,a.top,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 " . iif(count($cattree), "AND catid IN (" . @implode(',', $cattree) . ")") . " " . section_filter() . " ) ORDER BY starttime DESC LIMIT 20");
    //Kategorien auslesen
    $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';
            }
            //Link
            $link = mklink($link2file . '.php?id=' . $res['id'], $link2file . ',id' . $res['id'] . ',0' . urlformat($res['title']) . '.html');
            //Text: Teaser oder Artikelseite
            if ($res['teaser'] && $set['articles']['teaser']) {
                $text = $res['teaser'];
            } else {
                list($text) = $db->first("SELECT text FROM " . PRE . "_articles_pages WHERE artid='" . $res['id'] . "' ORDER BY ord ASC LIMIT 1");
                $text = $text;
            }
            $tabledata[$i]['ID'] = $res['id'];
            $tabledata[$i]['TITLE'] = rss_replace($res['title']);
            $tabledata[$i]['SUBTITLE'] = rss_replace($res['subtitle']);
            $tabledata[$i]['TIME'] = date('r', $res['starttime']);
            //Kein TIMEDIFF weil Zeitverschiebung mit angegeben!
            $tabledata[$i]['TEXT'] = rss_replace(preg_replace('#{IMAGE\\(([0-9]+)\\)}#s', '', $text));
            $tabledata[$i]['CATTITLE'] = rss_replace($catinfo[$res['catid']]['title']);
            $tabledata[$i]['LINK'] = HTTP_HOST . $link;
            $tabledata[$i]['USERNAME'] = replace($res['username']);
            $tabledata[$i]['EMAIL'] = replace(iif(!$res['pub_hidemail'], $res['email']));
            $tabledata[$i]['EMAIL_ENCRYPTED'] = replace(iif(!$res['pub_hidemail'], cryptMail($res['email'])));
            $tabledata[$i]['TOP'] = $res['top'];
        }
    }
    $apx->tmpl->assign('WEBSITENAME', $set['main']['websitename']);
    $apx->tmpl->assign('ARTICLE', $tabledata);
    $apx->tmpl->parse('rss', 'articles');
}
Ejemplo n.º 6
0
function search_faq($items, $conn)
{
    global $set, $db, $apx, $user;
    //Suchstring generieren
    foreach ($items as $item) {
        $search[] = " ( question LIKE '%" . addslashes_like($item) . "%' OR answer LIKE '%" . addslashes_like($item) . "%' ) ";
    }
    $searchstring = implode($conn, $search);
    //Ergebnisse
    $data = $db->fetch("SELECT id,question FROM " . PRE . "_faq WHERE ( searchable='1' AND starttime!='0' AND ( " . $searchstring . " ) ) ORDER BY starttime DESC");
    if (count($data)) {
        foreach ($data as $res) {
            ++$i;
            $link = mklink('faq.php?id=' . $res['id'], 'faq,' . $res['id'] . urlformat($res['question']) . '.html');
            $result[$i]['TITLE'] = strip_tags($res['question']);
            $result[$i]['LINK'] = $link;
        }
    }
    return $result;
}
Ejemplo n.º 7
0
function links_path($id)
{
    global $set, $db, $apx, $user;
    $id = (int) $id;
    if (!$id) {
        return array();
    }
    require_once BASEDIR . 'lib/class.recursivetree.php';
    $tree = new RecursiveTree(PRE . '_links_cat', 'id');
    $data = $tree->getPathTo(array('title'), $id);
    if (!count($data)) {
        return array();
    }
    foreach ($data as $res) {
        ++$i;
        $pathdata[$i]['TITLE'] = $res['title'];
        $pathdata[$i]['LINK'] = mklink('links.php?catid=' . $res['id'], 'links,' . $res['id'] . ',1' . urlformat($res['title']) . '.html');
    }
    return $pathdata;
}
Ejemplo n.º 8
0
function search_videos($items, $conn)
{
    global $set, $db, $apx, $user;
    require_once BASEDIR . getmodulepath('videos') . 'functions.php';
    //Suchstring generieren
    $tagmatches = videos_match_tags($items);
    foreach ($items as $item) {
        $tagmatch = array_shift($tagmatches);
        $search[] = " ( " . iif($tagmatch, " id IN (" . implode(',', $tagmatch) . ") OR ") . " title LIKE '%" . addslashes_like($item) . "%' OR text LIKE '%" . addslashes_like($item) . "%' ) ";
    }
    $searchstring = implode($conn, $search);
    //Videos durchsuchen
    $data = $db->fetch("SELECT id,title FROM " . PRE . "_videos WHERE ( searchable='1' AND '" . time() . "' BETWEEN starttime AND endtime " . section_filter() . " AND ( " . $searchstring . " ) ) ORDER BY addtime DESC");
    if (count($data)) {
        foreach ($data as $res) {
            ++$i;
            $result[$i]['TITLE'] = $res['title'];
            $result[$i]['LINK'] = mklink('videos.php?id=' . $res['id'], 'videos,id' . $res['id'] . urlformat($res['title']) . '.html');
        }
    }
    return $result;
}
Ejemplo n.º 9
0
function search_glossar($items, $conn)
{
    global $set, $db, $apx, $user;
    require_once BASEDIR . getmodulepath('glossar') . 'functions.php';
    //Suchstring generieren
    $tagmatches = glossar_match_tags($items);
    foreach ($items as $item) {
        $tagmatch = array_shift($tagmatches);
        $search[] = " ( " . iif($tagmatch, " id IN (" . implode(',', $tagmatch) . ") OR ") . " title LIKE '%" . addslashes_like($item) . "%' OR text LIKE '%" . addslashes_like($item) . "%' ) ";
    }
    $searchstring = implode($conn, $search);
    //Ergebnisse
    $data = $db->fetch("SELECT id,title FROM " . PRE . "_glossar WHERE ( searchable='1' AND starttime!='0' AND ( " . $searchstring . " ) ) ORDER BY title ASC");
    if (count($data)) {
        foreach ($data as $res) {
            ++$i;
            $result[$i]['TITLE'] = strip_tags($res['title']);
            $result[$i]['LINK'] = mklink('glossar.php?id=' . $res['id'], 'glossar,id' . $res['id'] . urlformat($res['title']) . '.html');
        }
    }
    return $result;
}
Ejemplo n.º 10
0
function search_content($items, $conn)
{
    global $set, $db, $apx, $user;
    //Suchstring generieren
    foreach ($items as $item) {
        $search[] = " ( title LIKE '%" . addslashes_like($item) . "%' OR text LIKE '%" . addslashes_like($item) . "%' ) ";
    }
    $searchstring = implode($conn, $search);
    //Ergebnisse
    $data = $db->fetch("SELECT id,title FROM " . PRE . "_content WHERE ( searchable='1' AND active='1' " . section_filter() . " AND ( " . $searchstring . " ) ) ORDER BY title ASC");
    if (count($data)) {
        foreach ($data as $res) {
            ++$i;
            $temp = explode('->', $res['title']);
            $title = array_pop($temp);
            $link = mklink('content.php?id=' . $res['id'], 'content,' . $res['id'] . urlformat($title) . '.html');
            $result[$i]['TITLE'] = strip_tags($title);
            $result[$i]['LINK'] = $link;
        }
    }
    return $result;
}
Ejemplo n.º 11
0
function misc_linksfeed()
{
    global $set, $db, $apx;
    $apx->tmpl->loaddesign('blank');
    header('Content-type: application/rss+xml');
    //Baum holen, wenn nur eine bestimmte Kategorie gezeigt werden soll
    $cattree = links_tree($_REQUEST['catid']);
    $data = $db->fetch("SELECT a.id,a.catid,a.title,a.text,a.starttime,a.top,b.username,b.email,b.pub_hidemail FROM " . PRE . "_links 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 starttime DESC LIMIT 20");
    if (count($data)) {
        //Kategorien auslesen
        $catids = get_ids($data, 'catid');
        if (count($catids)) {
            $catdata = $db->fetch("SELECT id,title FROM " . PRE . "_links_cat WHERE id IN (" . implode(',', $catids) . ")");
            if (count($catdata)) {
                foreach ($catdata as $catres) {
                    $catinfo[$catres['id']] = $catres;
                }
            }
        }
        foreach ($data as $res) {
            ++$i;
            //Link
            $link = mklink('links.php?id=' . $res['id'], 'links,id' . $res['id'] . urlformat($res['title']) . '.html');
            $tabledata[$i]['ID'] = $res['id'];
            $tabledata[$i]['TITLE'] = rss_replace($res['title']);
            $tabledata[$i]['URL'] = $res['url'];
            $tabledata[$i]['TIME'] = date('r', $res['starttime']);
            //Kein TIMEDIFF weil Zeitverschiebung mit angegeben!
            $tabledata[$i]['TEXT'] = rss_replace(preg_replace('#{IMAGE\\(([0-9]+)\\)}#s', '', $res['text']));
            $tabledata[$i]['CATTITLE'] = rss_replace($catinfo[$res['catid']]['title']);
            $tabledata[$i]['LINK'] = HTTP_HOST . $link;
            $tabledata[$i]['TOP'] = $res['top'];
        }
    }
    $apx->tmpl->assign('WEBSITENAME', $set['main']['websitename']);
    $apx->tmpl->assign('LINK', $tabledata);
    $apx->tmpl->parse('rss', 'links');
}
Ejemplo n.º 12
0
function misc_galleryfeed()
{
    global $set, $db, $apx;
    $apx->tmpl->loaddesign('blank');
    header('Content-type: application/rss+xml');
    $data = $db->fetch("SELECT id,title,description,starttime FROM " . PRE . "_gallery WHERE ( ( '" . time() . "' BETWEEN starttime AND endtime ) " . section_filter() . " ) ORDER BY starttime DESC LIMIT 20");
    if (count($data)) {
        foreach ($data as $res) {
            ++$i;
            //Link
            $link = mklink('gallery.php?id=' . $res['id'], 'gallery,list' . $res['id'] . ',1' . urlformat($res['title']) . '.html');
            $tabledata[$i]['ID'] = $res['id'];
            $tabledata[$i]['TITLE'] = rss_replace($res['title']);
            $tabledata[$i]['TIME'] = date('r', $res['starttime']);
            //Kein TIMEDIFF weil Zeitverschiebung mit angegeben!
            $tabledata[$i]['DESCRIPTION'] = rss_replace($res['description']);
            $tabledata[$i]['LINK'] = HTTP_HOST . $link;
        }
    }
    $apx->tmpl->assign('WEBSITENAME', $set['main']['websitename']);
    $apx->tmpl->assign('GALLERY', $tabledata);
    $apx->tmpl->parse('rss', 'gallery');
}
Ejemplo n.º 13
0
function search_calendar($items, $conn)
{
    global $set, $db, $apx, $user;
    require_once BASEDIR . getmodulepath('calendar') . 'functions.php';
    //Suchstring generieren
    $tagmatches = calendar_match_tags($items);
    foreach ($items as $item) {
        $tagmatch = array_shift($tagmatches);
        $search[] = " ( " . iif($tagmatch, " id IN (" . implode(',', $tagmatch) . ") OR ") . " title LIKE '%" . addslashes_like($item) . "%' OR text LIKE '%" . addslashes_like($item) . "%' ) ";
    }
    $searchstring = implode($conn, $search);
    //Ergebnisse
    $data = $db->fetch("SELECT id,title FROM " . PRE . "_calendar_events WHERE ( active!=0 AND private=0 " . section_filter() . " AND ( " . $searchstring . " ) ) ORDER BY startday ASC, starttime ASC, title ASC");
    if (count($data)) {
        foreach ($data as $res) {
            ++$i;
            $link = mklink('events.php?id=' . $res['id'], 'events,id' . $res['id'] . urlformat($res['title']) . '.html');
            $result[$i]['TITLE'] = strip_tags($res['title']);
            $result[$i]['LINK'] = $link;
        }
    }
    return $result;
}
Ejemplo n.º 14
0
function search_articles($items, $conn)
{
    global $set, $db, $apx, $user;
    require_once BASEDIR . getmodulepath('articles') . 'functions.php';
    //Suchstrings generieren
    $tagmatches = articles_match_tags($items);
    foreach ($items as $item) {
        $tagmatch = array_shift($tagmatches);
        $search1[] = "( title LIKE '%" . addslashes_like($item) . "%' OR text LIKE '%" . addslashes_like($item) . "%' ) ";
        $search2[] = "( " . iif($tagmatch, " id IN (" . implode(',', $tagmatch) . ") OR ") . " title LIKE '%" . addslashes_like($item) . "%' OR subtitle LIKE '%" . addslashes_like($item) . "%' OR teaser LIKE '%" . addslashes_like($item) . "%' ) ";
    }
    $searchstring1 = "( " . implode($conn, $search1) . " )";
    $searchstring2 = "( " . implode($conn, $search2) . " )";
    //Seiten durchsuchen
    $data = $db->fetch("SELECT artid FROM " . PRE . "_articles_pages WHERE ( " . $searchstring1 . " ) GROUP BY artid");
    $artids = get_ids($data, 'artid');
    if (count($artids)) {
        $pageres = "id IN (" . @implode(',', $artids) . ") OR";
    }
    //Artikel durchsuchen
    $data = $db->fetch("SELECT id,type,title,subtitle FROM " . PRE . "_articles WHERE ( searchable='1' AND '" . time() . "' BETWEEN starttime AND endtime " . section_filter() . " AND ( " . $pageres . " " . $searchstring2 . " ) ) ORDER BY starttime DESC");
    if (count($data)) {
        foreach ($data as $res) {
            ++$i;
            //Wohin soll verlinkt werden?
            if ($res['type'] == 'normal') {
                $link2file = 'articles';
            } else {
                $link2file = $res['type'] . 's';
            }
            $link = mklink($link2file . '.php?id=' . $res['id'], $link2file . ',id' . $res['id'] . ',0' . urlformat($res['title']) . '.html');
            $result[$i]['TITLE'] = strip_tags($res['title']) . iif($res['subtitle'], ' - ' . strip_tags($res['subtitle']));
            $result[$i]['LINK'] = $link;
        }
    }
    return $result;
}
Ejemplo n.º 15
0
}
print '</tr>';
for ($i = 1; $guest = $sql->fetch($guests); $i++) {
    $guest['lasturl'] = str_replace('<', '&lt;', $guest['lasturl']);
    $guest['lasturl'] = str_replace('>', '&gt;', $guest['lasturl']);
    $guest['lasturl'] = str_replace('shoph', 'shop', $guest['lasturl']);
    $guest['lasturl'] = preg_replace('/[\\?\\&]debugsql=[0-9]+/i', '', $guest['lasturl']);
    // let's not give idiots any ideas
    /*		if ($guest['useragent'] == "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.19) Gecko/2010031218 Firefox/3.0.19" && $banorama) {
    //		if (stripos($guest['useragent'], "robot") !== false && $banorama)
    			$marker	= " style='color: #f88;'";
    		else
    			$marker	= "";
    */
    $marker = '';
    $lasturltd = "{$tccell2l}{$marker}><a rel=\"nofollow\" href=\"" . urlformat($guest['lasturl']) . "\">{$guest['lasturl']}";
    if (substr($guest['lasturl'], -11) == '(IP banned)') {
        $lasturltd = "{$tccell2l}{$marker}><a rel=\"nofollow\" href=\"" . substr($guest['lasturl'], 0, -12) . "\">" . substr($guest['lasturl'], 0, -12) . "</a> (IP banned)";
    } elseif (substr($guest['lasturl'], -11) == '(Tor proxy)') {
        $lasturltd = "{$tccell2l}{$marker}><a rel=\"nofollow\" href=\"" . substr($guest['lasturl'], 0, -12) . "\">" . substr($guest['lasturl'], 0, -12) . "</a> (Tor proxy)";
    }
    print "<tr style=\"height:40px;\">\n\t\t\t{$tccell1}{$marker}>{$i}</td>\n\t\t\t{$tccell2s}{$marker}>" . htmlspecialchars($guest['useragent']) . "</td>\n\t\t\t{$tccell1}{$marker}>" . date('h:i:s A', $guest['date'] + $tzoff) . "</td>\n\t\t\t{$lasturltd}</td>";
    if ($banorama && !$guest['banned']) {
        $ipban = "<a href=?banip={$guest['ip']}&valid=" . md5($guest['ip'] . "aglkdgslhkadgshlkgds") . ">Ban</a> - ";
    } elseif ($guest['banned']) {
        $ipban = "<span style='color: #f88; font-weight: bold;'>Banned</span> - ";
    } else {
        $ipban = "";
    }
    if ($isadmin) {
        print "</td>{$tccell1}{$marker}>\n\t\t\t<a href=ipsearch.php?ip={$guest['ip']}>{$guest['ip']}</a>{$smallfont}\n\t\t\t<br>[{$ipban}<a href=http://google.com/search?q={$guest['ip']}>G</a>-<a href=http://en.wikipedia.org/wiki/User:{$guest['ip']}>W</a>-<a href=http://{$guest['ip']}/>H</a>]</a></font>";
Ejemplo n.º 16
0
function products_print($data, $template)
{
    global $set, $db, $apx, $user;
    $tmpl = new tengine();
    $apx->lang->drop('fields', 'products');
    //Verwendet Variablen auslesen
    $parse = $apx->tmpl->used_vars($template, 'products');
    $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'),$parse) ) $groups = array_merge($groups,get_ids($data,'media'));
        		if ( in_array('PRODUCT.GENRE',$parse) ) $groups = array_merge($groups,get_ids($data,'genre'));
        		if ( in_array('game',$types) && in_template(array('PRODUCT.RELEASE.SYSTEM','PRODUCT.RELEASE.SYSTEM_ICON','PRODUCT.SYSTEM'),$parse) ) {
        			if ( count($groups)==0 ) $groups = array(0);
        			$groupinfo = $db->fetch_index("SELECT id,title,icon FROM ".PRE."_products_groups WHERE id IN (".implode(',',$groups).") OR grouptype='system'",'id');
        		}
        		elseif ( in_array('movie',$types) && in_template(array('PRODUCT.RELEASE.MEDIA','PRODUCT.RELEASE.MEDIA_ICON','PRODUCT.MEDIA'),$parse) ) {
        			if ( count($groups)==0 ) $groups = array(0);
        			$groupinfo = $db->fetch_index("SELECT id,title,icon FROM ".PRE."_products_groups WHERE id IN (".implode(',',$groups).") OR grouptype='media'",'id');
        		}
        		elseif ( count($groups) ) {
        			$groupinfo = $db->fetch_index("SELECT id,title,icon FROM ".PRE."_products_groups WHERE id IN (".implode(',',$groups).")",'id');
        		}*/
        $groupinfo = $db->fetch_index("SELECT id,title,icon FROM " . PRE . "_products_groups", 'id');
        //Veröffentlichungs-Daten auslesen
        $releaseinfo = array();
        if (in_array('PRODUCT.RELEASE', $parse)) {
            $releasedata = $db->fetch("SELECT prodid,system,data,stamp FROM " . PRE . "_products_releases WHERE prodid IN (" . implode(',', $ids) . ") ORDER BY stamp ASC");
            if (count($releasedata)) {
                foreach ($releasedata as $relres) {
                    $info = unserialize($relres['data']);
                    $releasedate = products_format_release($info);
                    $relentry = array('stamp' => $relres['stamp'], 'DATE' => $releasedate, 'SYSTEM' => $groupinfo[$relres['system']]['title'], 'SYSTEM_ICON' => $groupinfo[$relres['system']]['icon'], 'MEDIA' => $groupinfo[$relres['system']]['title'], 'MEDIA_ICON' => $groupinfo[$relres['system']]['icon']);
                    $releaseinfo[$relres['prodid']][] = $relentry;
                }
            }
        }
        //Produkte auflisten
        foreach ($data as $res) {
            ++$i;
            //Link
            $link = mklink('products.php?id=' . $res['id'], 'products,id' . $res['id'] . urlformat($res['title']) . '.html');
            //Produktbild
            if (in_array('PRODUCT.PICTURE', $parse) || in_array('PRODUCT.PICTURE_POPUP', $parse) || in_array('PRODUCT.PICTURE_POPUPPATH', $parse)) {
                list($picture, $picture_popup, $picture_popuppath) = products_pic($res['picture']);
            }
            //Teaserbild
            if (in_array('PRODUCT.TEASERPIC', $parse) || in_array('PRODUCT.TEASERPIC_POPUP', $parse) || in_array('PRODUCT.TEASERPIC_POPUPPATH', $parse)) {
                list($teaserpic, $teaserpic_popup, $teaserpic_popuppath) = products_pic($res['teaserpic']);
            }
            //Text
            $text = '';
            if (in_array('PRODUCT.TEXT', $parse)) {
                $text = mediamanager_inline($res['text']);
                if ($apx->is_module('glossar')) {
                    $text = glossar_highlight($text);
                }
            }
            //Datehead
            if ($laststamp != date('Y/m/d', $res['addtime'] - TIMEDIFF)) {
                $tabledata[$i]['DATEHEAD'] = $res['addtime'];
            }
            //Tags
            if (in_array('PRODUCT.TAG', $parse) || in_array('PRODUCT.TAG_IDS', $parse) || in_array('PRODUCT.KEYWORDS', $parse)) {
                list($tagdata, $tagids, $keywords) = products_tags($res['id']);
            }
            //Standard-Platzhalter
            $tabledata[$i]['ID'] = $res['id'];
            $tabledata[$i]['TYPE'] = $res['type'];
            $tabledata[$i]['LINK'] = $link;
            $tabledata[$i]['TITLE'] = $res['title'];
            $tabledata[$i]['TEXT'] = $text;
            $tabledata[$i]['TIME'] = $res['addtime'];
            $tabledata[$i]['WEBSITE'] = $res['website'];
            $tabledata[$i]['BUYLINK'] = $res['buylink'];
            $tabledata[$i]['PRICE'] = $res['price'];
            $tabledata[$i]['HITS'] = $res['hits'];
            $tabledata[$i]['PICTURE'] = $picture;
            $tabledata[$i]['PICTURE_POPUP'] = $picture_popup;
            $tabledata[$i]['PICTURE_POPUPPATH'] = $picture_popuppath;
            $tabledata[$i]['TEASERPIC'] = $teaserpic;
            $tabledata[$i]['TEASERPIC_POPUP'] = $teaserpic_popup;
            $tabledata[$i]['TEASERPIC_POPUPPATH'] = $teaserpic_popuppath;
            $tabledata[$i]['PRODUCT_ID'] = $res['prodid'];
            $tabledata[$i]['RECOMMENDED_PRICE'] = $res['recprice'];
            $tabledata[$i]['GUARANTEE'] = $res['guarantee'];
            //Sammlung
            if ($user->info['userid']) {
                if (!products_in_coll($res['id'])) {
                    $tabledata[$i]['LINK_COLLECTION_ADD'] = mklink('products.php?id=' . $res['id'] . '&amp;addcoll=1', 'products,id' . $res['id'] . urlformat($res['title']) . '.html?addcoll=1');
                } else {
                    $tabledata[$i]['LINK_COLLECTION_REMOVE'] = mklink('products.php?id=' . $res['id'] . '&amp;removecoll=1', 'products,id' . $res['id'] . urlformat($res['title']) . '.html?removecoll=1');
                }
            }
            //Tags
            $tabledata[$i]['TAG'] = $tagdata;
            $tabledata[$i]['TAG_IDS'] = $tagids;
            $tabledata[$i]['KEYWORDS'] = $keywords;
            //NORMAL
            if ($res['type'] == 'normal') {
                $manulink = mklink('manufacturers.php?id=' . $res['manufacturer'], 'manufacturers,id' . $res['manufacturer'] . urlformat($unitinfo[$res['manufacturer']]['title']) . '.html');
                $tabledata[$i]['MANUFACTURER'] = $unitinfo[$res['manufacturer']]['title'];
                $tabledata[$i]['MANUFACTURER_WEBSITE'] = $unitinfo[$res['manufacturer']]['website'];
                $tabledata[$i]['MANUFACTURER_LINK'] = $manulink;
            } elseif ($res['type'] == 'game') {
                //System-Liste
                $systemdata = array();
                if (in_array('PRODUCT.SYSTEM', $parse)) {
                    $systems = dash_unserialize($res['systems']);
                    if (!is_array($systems)) {
                        $systems = array();
                    }
                    foreach ($systems as $sysid) {
                        ++$ii;
                        $systemdata[$ii]['TITLE'] = $groupinfo[$sysid]['title'];
                        $systemdata[$ii]['ICON'] = $groupinfo[$sysid]['icon'];
                    }
                }
                //Media-Liste
                $media = dash_unserialize($res['media']);
                if (!is_array($media)) {
                    $media = array();
                }
                $mediadata = array();
                foreach ($media as $medid) {
                    ++$ii;
                    $mediadata[$ii]['TITLE'] = $groupinfo[$medid]['title'];
                    $mediadata[$ii]['ICON'] = $groupinfo[$medid]['icon'];
                }
                $manulink = mklink('manufacturers.php?id=' . $res['manufacturer'], 'manufacturers,id' . $res['manufacturer'] . urlformat($unitinfo[$res['manufacturer']]['title']) . '.html');
                $publink = mklink('manufacturers.php?id=' . $res['publisher'], 'manufacturers,id' . $res['publisher'] . urlformat($unitinfo[$res['publisher']]['title']) . '.html');
                $tabledata[$i]['DEVELOPER'] = $unitinfo[$res['manufacturer']]['title'];
                $tabledata[$i]['DEVELOPER_WEBSITE'] = $unitinfo[$res['manufacturer']]['website'];
                $tabledata[$i]['DEVELOPER_LINK'] = $manulink;
                $tabledata[$i]['PUBLISHER'] = $unitinfo[$res['publisher']]['title'];
                $tabledata[$i]['PUBLISHER_WEBSITE'] = $unitinfo[$res['publisher']]['website'];
                $tabledata[$i]['PUBLISHER_LINK'] = $publink;
                $tabledata[$i]['USK'] = $res['sk'];
                $tabledata[$i]['GENRE'] = $groupinfo[$res['genre']]['title'];
                $tabledata[$i]['MEDIA'] = $mediadata;
                $tabledata[$i]['SYSTEM'] = $systemdata;
                $tabledata[$i]['REQUIREMENTS'] = $res['requirements'];
            } elseif ($res['type'] == 'hardware') {
                $manulink = mklink('manufacturers.php?id=' . $res['manufacturer'], 'manufacturers,id' . $res['manufacturer'] . urlformat($unitinfo[$res['manufacturer']]['title']) . '.html');
                $tabledata[$i]['MANUFACTURER'] = $unitinfo[$res['manufacturer']]['title'];
                $tabledata[$i]['MANUFACTURER_WEBSITE'] = $unitinfo[$res['manufacturer']]['website'];
                $tabledata[$i]['MANUFACTURER_LINK'] = $manulink;
                $tabledata[$i]['EQUIPMENT'] = $res['equipment'];
            } elseif ($res['type'] == 'software') {
                //Media-Liste
                $media = dash_unserialize($res['media']);
                if (!is_array($media)) {
                    $media = array();
                }
                $mediadata = array();
                foreach ($media as $medid) {
                    ++$ii;
                    $mediadata[$ii]['TITLE'] = $groupinfo[$medid]['title'];
                    $mediadata[$ii]['ICON'] = $groupinfo[$medid]['icon'];
                }
                $manulink = mklink('manufacturers.php?id=' . $res['manufacturer'], 'manufacturers,id' . $res['manufacturer'] . urlformat($unitinfo[$res['manufacturer']]['title']) . '.html');
                $tabledata[$i]['MANUFACTURER'] = $unitinfo[$res['manufacturer']]['title'];
                $tabledata[$i]['MANUFACTURER_WEBSITE'] = $unitinfo[$res['manufacturer']]['website'];
                $tabledata[$i]['MANUFACTURER_LINK'] = $manulink;
                $tabledata[$i]['OS'] = $res['os'];
                $tabledata[$i]['LANGUAGES'] = $res['languages'];
                $tabledata[$i]['REQUIREMENTS'] = $res['requirements'];
                $tabledata[$i]['LICENSE'] = $res['license'];
                $tabledata[$i]['VERSION'] = $res['version'];
                $tabledata[$i]['MEDIA'] = $mediadata;
            } elseif ($res['type'] == 'music') {
                //Media-Liste
                $media = dash_unserialize($res['media']);
                if (!is_array($media)) {
                    $media = array();
                }
                $mediadata = array();
                foreach ($media as $medid) {
                    ++$ii;
                    $mediadata[$ii]['TITLE'] = $groupinfo[$medid]['title'];
                    $mediadata[$ii]['ICON'] = $groupinfo[$medid]['icon'];
                }
                $manulink = mklink('manufacturers.php?id=' . $res['manufacturer'], 'manufacturers,id' . $res['manufacturer'] . urlformat($unitinfo[$res['manufacturer']]['title']) . '.html');
                $publink = mklink('manufacturers.php?id=' . $res['publisher'], 'manufacturers,id' . $res['publisher'] . urlformat($unitinfo[$res['publisher']]['title']) . '.html');
                $tabledata[$i]['ARTIST'] = $unitinfo[$res['manufacturer']]['title'];
                $tabledata[$i]['ARTIST_WEBSITE'] = $unitinfo[$res['manufacturer']]['website'];
                $tabledata[$i]['ARTIST_LINK'] = $manulink;
                $tabledata[$i]['LABEL'] = $unitinfo[$res['publisher']]['title'];
                $tabledata[$i]['LABEL_WEBSITE'] = $unitinfo[$res['publisher']]['website'];
                $tabledata[$i]['LABEL_LINK'] = $publink;
                $tabledata[$i]['FSK'] = $res['sk'];
                $tabledata[$i]['GENRE'] = $groupinfo[$res['genre']]['title'];
                $tabledata[$i]['MEDIA'] = $mediadata;
            } elseif ($res['type'] == 'movie') {
                //Media-Liste
                $media = dash_unserialize($res['media']);
                if (!is_array($media)) {
                    $media = array();
                }
                $mediadata = array();
                foreach ($media as $medid) {
                    ++$ii;
                    $mediadata[$ii]['TITLE'] = $groupinfo[$medid]['title'];
                    $mediadata[$ii]['ICON'] = $groupinfo[$medid]['icon'];
                }
                $publink = mklink('manufacturers.php?id=' . $res['publisher'], 'manufacturers,id' . $res['publisher'] . urlformat($unitinfo[$res['publisher']]['title']) . '.html');
                $tabledata[$i]['STUDIO'] = $unitinfo[$res['publisher']]['title'];
                $tabledata[$i]['STUDIO_WEBSITE'] = $unitinfo[$res['publisher']]['website'];
                $tabledata[$i]['STUDIO_LINK'] = $publink;
                $tabledata[$i]['REGISSEUR'] = $res['regisseur'];
                $tabledata[$i]['ACTORS'] = $res['actors'];
                $tabledata[$i]['LENGTH'] = $res['length'];
                $tabledata[$i]['FSK'] = $res['sk'];
                $tabledata[$i]['GENRE'] = $groupinfo[$res['genre']]['title'];
                $tabledata[$i]['MEDIA'] = $mediadata;
            } elseif ($res['type'] == 'book') {
                //Media-Liste
                $media = dash_unserialize($res['media']);
                if (!is_array($media)) {
                    $media = array();
                }
                $mediadata = array();
                foreach ($media as $medid) {
                    ++$ii;
                    $mediadata[$ii]['TITLE'] = $groupinfo[$medid]['title'];
                    $mediadata[$ii]['ICON'] = $groupinfo[$medid]['icon'];
                }
                $manulink = mklink('manufacturers.php?id=' . $res['manufacturer'], 'manufacturers,id' . $res['manufacturer'] . urlformat($unitinfo[$res['manufacturer']]['title']) . '.html');
                $publink = mklink('manufacturers.php?id=' . $res['publisher'], 'manufacturers,id' . $res['publisher'] . urlformat($unitinfo[$res['publisher']]['title']) . '.html');
                $tabledata[$i]['AUTHOR'] = $unitinfo[$res['manufacturer']]['title'];
                $tabledata[$i]['AUTHOR_WEBSITE'] = $unitinfo[$res['manufacturer']]['website'];
                $tabledata[$i]['AUTHOR_LINK'] = $manulink;
                $tabledata[$i]['PUBLISHER'] = $unitinfo[$res['publisher']]['title'];
                $tabledata[$i]['PUBLISHER_WEBSITE'] = $unitinfo[$res['publisher']]['website'];
                $tabledata[$i]['PUBLISHER_LINK'] = $publink;
                $tabledata[$i]['GENRE'] = $groupinfo[$res['genre']]['title'];
                $tabledata[$i]['MEDIA'] = $mediadata;
                $tabledata[$i]['ISBN'] = $res['isbn'];
            }
            //Benutzerdefinierte Felder
            for ($ii = 1; $ii <= 10; $ii++) {
                $tabledata[$i]['CUSTOM' . $ii . '_NAME'] = replace($set['products']['custom_' . $res['type']][$ii - 1]);
                $tabledata[$i]['CUSTOM' . $ii] = $res['custom' . $ii];
            }
            //Veröffentlichung
            if (in_array('PRODUCT.RELEASE', $parse)) {
                if ($res['releasestamp']) {
                    $temprel = $releaseinfo[$res['id']];
                    foreach ($temprel as $rel) {
                        if ($rel['stamp'] != $res['releasestamp']) {
                            continue;
                        }
                        ++$ii;
                        $tabledata[$i]['RELEASE'][$ii] = $rel;
                    }
                } else {
                    $tabledata[$i]['RELEASE'] = $releaseinfo[$res['id']];
                }
            }
            //Kommentare
            if ($apx->is_module('comments') && $set['products']['coms'] && $res['allowcoms']) {
                require_once BASEDIR . getmodulepath('comments') . 'class.comments.php';
                if (!isset($coms)) {
                    $coms = new comments('products', $res['id']);
                } else {
                    $coms->mid = $res['id'];
                }
                $link = mklink('products.php?id=' . $res['id'], 'products,id' . $res['id'] . urlformat($res['title']) . '.html');
                $tabledata[$i]['COMMENT_COUNT'] = $coms->count();
                $tabledata[$i]['COMMENT_LINK'] = $coms->link($link);
                $tabledata[$i]['DISPLAY_COMMENTS'] = 1;
                if (in_template(array('PRODUCT.COMMENT_LAST_USERID', 'PRODUCT.COMMENT_LAST_NAME', 'PRODUCT.COMMENT_LAST_TIME'), $parse)) {
                    $tabledata[$i]['COMMENT_LAST_USERID'] = $coms->last_userid();
                    $tabledata[$i]['COMMENT_LAST_NAME'] = $coms->last_name();
                    $tabledata[$i]['COMMENT_LAST_TIME'] = $coms->last_time();
                }
            }
            //Bewertungen
            if ($apx->is_module('ratings') && $set['products']['ratings'] && $res['allowrating']) {
                require_once BASEDIR . getmodulepath('ratings') . 'class.ratings.php';
                if (!isset($rate)) {
                    $rate = new ratings('products', $res['id']);
                } else {
                    $rate->mid = $res['id'];
                }
                $tabledata[$i]['RATING'] = $rate->display();
                $tabledata[$i]['RATING_VOTES'] = $rate->count();
                $tabledata[$i]['DISPLAY_RATING'] = 1;
            }
            $laststamp = date('Y/m/d', $res['addtime'] - TIMEDIFF);
        }
    }
    $tmpl->assign('PRODUCT', $tabledata);
    $tmpl->parse($template, 'products');
}
Ejemplo n.º 17
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']);
 }
Ejemplo n.º 18
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']);
 }
Ejemplo n.º 19
0
function calendar_print($data, $template)
{
    global $set, $db, $apx, $user;
    $tmpl = new tengine();
    $parse = $tmpl->used_vars($template, 'calendar');
    //Kategorie-Info
    $catids = get_ids($data, 'catid');
    $catdata = array();
    if (count($catids)) {
        $catdata = $db->fetch_index("SELECT * FROM " . PRE . "_calendar_cat WHERE id IN (" . implode(',', $catids) . ")", 'id');
    }
    //Termine auflisten
    if (count($data)) {
        foreach ($data as $res) {
            ++$i;
            $event = array();
            //Kategorie-Info
            $catinfo = $catdata[$res['catid']];
            //Link zum Termin
            $link = mklink('events.php?id=' . $res['id'], 'events,id' . $res['id'] . urlformat($res['title']) . '.html');
            //Aufmacher
            $picture = $picture_popup = '';
            if (in_template(array('EVENT.PICTURE', 'EVENT.PICTURE_POPUP', 'EVENT.PICTURE_POPUPPATH'), $parse)) {
                list($picture, $picture_popup, $picture_popuppath) = calendar_pic($res['picture']);
            }
            //Start berechnen
            $startday = $starttime = $endday = $endtime = 0;
            if (in_template(array('EVENT.STARTDAY', 'EVENT.STARTTIME'), $parse)) {
                $startday = calendar_stamp2time($res['startday']);
                if ($res['starttime'] != -1) {
                    $time_comp = calendar_explode_stamp($res['startday']);
                    $tmpstamp = sprintf('%04d', $res['starttime']);
                    $time_comp['hour'] = substr($tmpstamp, 0, 2);
                    $time_comp['minute'] = substr($tmpstamp, 2, 2);
                    $starttime = mktime($time_comp['hour'], $time_comp['minute'], 0, $time_comp['month'], $time_comp['day'], $time_comp['year']) + TIMEDIFF;
                }
            }
            //Ende berechnen (falls nötig)
            if (in_template(array('EVENT.ENDDAY', 'EVENT.ENDTIME'), $parse)) {
                if ($res['endday'] != $res['startday'] || $res['endtime'] != -1) {
                    $endday = calendar_stamp2time($res['endday']);
                    if ($res['endtime'] != -1) {
                        $time_comp = calendar_explode_stamp($res['endday']);
                        $tmpstamp = sprintf('%04d', $res['endtime']);
                        $time_comp['hour'] = substr($tmpstamp, 0, 2);
                        $time_comp['minute'] = substr($tmpstamp, 2, 2);
                        $endtime = mktime($time_comp['hour'], $time_comp['minute'], 0, $time_comp['month'], $time_comp['day'], $time_comp['year']) + TIMEDIFF;
                    }
                }
            }
            //Username + eMail
            if ($res['userid']) {
                $username = $res['username'];
                $email = iif(!$res['pub_hidemail'], $res['email']);
            } else {
                $username = $res['send_username'];
                $email = $res['send_email'];
            }
            //Text
            $eventtext = '';
            if (in_array('EVENT.TEXT', $parse)) {
                $eventtext = mediamanager_inline($res['text']);
                if ($apx->is_module('glossar')) {
                    $eventtext = glossar_highlight($eventtext);
                }
            }
            //Datehead
            if ($laststamp != $res['startday']) {
                $event['DATEHEAD'] = $startday;
            }
            //Tags
            if (in_array('EVENT.TAG', $parse) || in_array('EVENT.TAG_IDS', $parse) || in_array('EVENT.KEYWORDS', $parse)) {
                list($tagdata, $tagids, $keywords) = calendar_tags($res['id']);
            }
            $event['ID'] = $res['id'];
            $event['TITLE'] = $res['title'];
            $event['TEXT'] = $eventtext;
            $event['LINK'] = $link;
            $event['LOCATION'] = compatible_hsc($res['location']);
            $event['LOCATION_LINK'] = compatible_hsc($res['location_link']);
            $event['PRIORITY'] = $res['priority'];
            $event['RESTRICTED'] = $res['restricted'];
            $event['PRIVATE'] = $res['private'];
            $event['HITS'] = $res['hits'];
            $event['RELATED'] = calendar_links($res['links']);
            $event['PICTURE'] = $picture;
            $event['PICTURE_POPUP'] = $picture_popup;
            $event['PICTURE_POPUPPATH'] = $picture_popuppath;
            $event['STARTDAY'] = $startday;
            $event['STARTTIME'] = $starttime;
            $event['ENDDAY'] = $endday;
            $event['ENDTIME'] = $endtime;
            $event['USERID'] = $res['userid'];
            $event['USERNAME'] = replace($username);
            $event['EMAIL'] = replace($email);
            $event['EMAIL_ENCRYPTED'] = replace(cryptMail($email));
            $event['CATID'] = $res['catid'];
            $event['CATTITLE'] = $catinfo['title'];
            $event['CATICON'] = $catinfo['icon'];
            //Tags
            $event['TAG'] = $tagdata;
            $event['TAG_IDS'] = $tagids;
            $event['KEYWORDS'] = $keywords;
            //Galerie
            if ($apx->is_module('gallery') && $res['galid'] && !$res['private'] && in_template(array('EVENT.GALLERY_ID', 'EVENT.GALLERY_TITLE', 'EVENT.GALLERY_LINK'), $parse)) {
                $galinfo = gallery_info($res['galid']);
                $event['GALLERY_ID'] = $galinfo['id'];
                $event['GALLERY_TITLE'] = $galinfo['title'];
                $event['GALLERY_LINK'] = mklink('gallery.php?id=' . $galinfo['id'], 'gallery,list' . $galinfo['id'] . ',1' . urlformat($galinfo['title']) . '.html');
            }
            //Kommentare
            if ($apx->is_module('comments') && $set['calendar']['coms'] && $res['allowcoms']) {
                require_once BASEDIR . getmodulepath('comments') . 'class.comments.php';
                if (!isset($coms)) {
                    $coms = new comments('calendar', $res['id']);
                } else {
                    $coms->mid = $res['id'];
                }
                $link = mklink('events.php?id=' . $res['id'], 'events,id' . $res['id'] . urlformat($res['title']) . '.html');
                $event['COMMENT_COUNT'] = $coms->count();
                $event['COMMENT_LINK'] = $coms->link($link);
                $event['DISPLAY_COMMENTS'] = 1;
                if (in_template(array('EVENT.COMMENT_LAST_USERID', 'EVENT.COMMENT_LAST_NAME', 'EVENT.COMMENT_LAST_TIME'), $parse)) {
                    $event['COMMENT_LAST_USERID'] = $coms->last_userid();
                    $event['COMMENT_LAST_NAME'] = $coms->last_name();
                    $event['COMMENT_LAST_TIME'] = $coms->last_time();
                }
            }
            $eventdata[$i] = $event;
            $laststamp = $res['startday'];
        }
    }
    $tmpl->assign('EVENT', $eventdata);
    $tmpl->parse($template, 'calendar');
}
Ejemplo n.º 20
0
function downloads_categories($catid = false, $template = 'categories')
{
    global $set, $db, $apx, $user;
    $tmpl = new tengine();
    $catid = (int) $catid;
    //Eine bestimmte Kategorie
    if ($catid) {
        require_once BASEDIR . 'lib/class.recursivetree.php';
        $tree = new RecursiveTree(PRE . '_downloads_cat', 'id');
        $data = $tree->getTree(array('*'), $catid);
    } else {
        require_once BASEDIR . 'lib/class.recursivetree.php';
        $tree = new RecursiveTree(PRE . '_downloads_cat', 'id');
        $data = $tree->getTree(array('*'));
    }
    foreach ($data as $cat) {
        ++$i;
        $catdata[$i]['ID'] = $cat['id'];
        $catdata[$i]['TITLE'] = $cat['title'];
        $catdata[$i]['ICON'] = $cat['icon'];
        $catdata[$i]['LEVEL'] = $cat['level'];
        $catdata[$i]['LINK'] = mklink('downloads.php?catid=' . $id, 'downloads,' . $cat['id'] . ',1' . urlformat($cat['title']) . '.html');
    }
    $tmpl->assign('CATEGORY', $catdata);
    $tmpl->parse('functions/' . $template, 'downloads');
}
Ejemplo n.º 21
0
 function gallery()
 {
     global $set, $apx, $db, $html;
     $_REQUEST['userid'] = (int) $_REQUEST['userid'];
     //AKTIONEN
     if ($_REQUEST['do'] == 'edit') {
         return $this->gallery_edit();
     } elseif ($_REQUEST['do'] == 'del') {
         return $this->gallery_del();
     } elseif ($_REQUEST['do'] == 'pics') {
         return $this->gallery_pics();
     }
     $orderdef[0] = 'update';
     $orderdef['name'] = array('title', 'ASC', 'COL_TITLE');
     $orderdef['addtime'] = array('addtime', 'DESC', 'COL_ADDTIME');
     $orderdef['update'] = array('lastupdate', 'DESC', 'COL_LASTUPDATE');
     if ($_REQUEST['userid']) {
         $col[] = array('COL_TITLE', 60, '');
         $col[] = array('COL_PICS', 10, 'align="center"');
         $col[] = array('COL_ADDTIME', 15, 'align="center"');
         $col[] = array('COL_LASTUPDATE', 15, 'align="center"');
     } else {
         $col[] = array('COL_TITLE', 40, 'class="title"');
         $col[] = array('COL_PICS', 10, 'align="center"');
         $col[] = array('COL_ADDTIME', 15, 'align="center"');
         $col[] = array('COL_LASTUPDATE', 15, 'align="center"');
         $col[] = array('COL_OWNER', 20, 'align="center"');
     }
     //Benuternamen als Titel ausgeben
     if ($_REQUEST['userid']) {
         list($username) = $db->first("SELECT username FROM " . PRE . "_user WHERE userid='" . $_REQUEST['userid'] . "' LIMIT 1");
         echo '<h2>' . $apx->lang->get('GALLERYOF') . ' ' . $username . '</h2>';
     }
     if ($_REQUEST['userid']) {
         $ownerfilter = " AND owner='" . $_REQUEST['userid'] . "' ";
     } else {
         $ownerfilter = '';
     }
     list($count) = $db->first("SELECT count(id) FROM " . PRE . "_user_gallery WHERE 1 " . $ownerfilter);
     pages('action.php?action=gallery.show&amp;sortby=' . $_REQUEST['sortby'], $count);
     $data = $db->fetch("SELECT id,title,addtime,lastupdate,owner,allowcoms FROM " . PRE . "_user_gallery WHERE 1 " . $ownerfilter . " " . getorder($orderdef) . getlimit());
     if (count($data)) {
         //Owner-Namen auslesen
         if (!$_REQUEST['userid']) {
             $userids = get_ids($data, 'owner');
             $usernames = $db->fetch_index("SELECT userid,username FROM " . PRE . "_user WHERE userid IN (" . implode(',', $userids) . ")", 'userid');
         }
         foreach ($data as $res) {
             ++$i;
             //Anzahl Bilder
             list($pics) = $db->first("SELECT count(*) FROM " . PRE . "_user_pictures WHERE galid='" . $res['id'] . "'");
             $link = mklink('user.php?action=gallery&amp;id=' . $res['owner'] . '&amp;galid=' . $res['id'], 'user,gallery,' . $res['owner'] . ',' . $res['id'] . ',0.html', iif($set['main']['forcesection'], $apx->section_default, 0));
             $tabledata[$i]['COL1'] = '<a href="' . $link . '" target="_blank">' . replace($res['title']) . '</a>';
             $tabledata[$i]['COL2'] = number_format($pics, 0, ',', '.');
             $tabledata[$i]['COL3'] = mkdate($res['addtime'], '<br />');
             $tabledata[$i]['COL4'] = mkdate($res['lastupdate'], '<br />');
             if (!$_REQUEST['userid']) {
                 $ownername = $usernames[$res['owner']]['username'];
                 $ownerprofile = mklink('user.php?action=profile&amp;id=' . $res['owner'], 'user,profile,' . $res['owner'] . urlformat($res['username']) . '.html', iif($set['main']['forcesection'], $apx->section_default, 0));
                 $tabledata[$i]['COL5'] = '<a href="' . $ownerprofile . '" target="_blank">' . replace($ownername) . '</a>';
             }
             $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'user.gallery', 'userid=' . $_REQUEST['userid'] . '&do=edit&id=' . $res['id'], $apx->lang->get('CORE_EDIT'));
             $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', 'user.gallery', 'userid=' . $_REQUEST['userid'] . '&do=del&id=' . $res['id'], $apx->lang->get('CORE_DEL'));
             $tabledata[$i]['OPTIONS'] .= optionHTML('pic.gif', 'user.gallery', 'userid=' . $_REQUEST['userid'] . '&do=pics&galid=' . $res['id'], $apx->lang->get('SHOWPICS'));
             '<a href="action.php?action=user.gallery&amp;userid=' . $_REQUEST['userid'] . '&amp;do=pics&amp;galid=' . $res['id'] . '"><img src="design/pic.gif" title="' . $apx->lang->get('SHOWPICS') . '" alt="' . $apx->lang->get('SHOWPICS') . '" style="vertical-align:middle;" /></a>';
             //Kommentare + Bewertungen
             if ($apx->is_module('comments')) {
                 $tabledata[$i]['OPTIONS'] .= '&nbsp;';
                 list($comments) = $db->first("SELECT count(id) FROM " . PRE . "_comments WHERE ( module='usergallery' AND mid='" . $res['id'] . "' )");
                 if ($comments && $apx->is_module('comments') && $res['allowcoms'] && $apx->user->has_right('comments.show')) {
                     $tabledata[$i]['OPTIONS'] .= optionHTML('comments.gif', 'comments.show', 'module=usergallery&mid=' . $res['id'], $apx->lang->get('COMMENTS') . ' (' . $comments . ')');
                 } else {
                     $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
                 }
             }
         }
     }
     $apx->tmpl->assign('TABLE', $tabledata);
     $html->table($col, $factions);
     orderstr($orderdef, 'action.php?action=user.gallery&amp;userid=' . $_REQUEST['userid']);
     save_index($_SERVER['REQUEST_URI']);
 }
Ejemplo n.º 22
0
function createForumVars($res, $readoutMods = true)
{
    global $apx, $db, $set, $user;
    global $collapse, $readthreads, $foruminfo;
    //Link
    $link = mkrellink('forum.php?id=' . $res['forumid'], 'forum,' . $res['forumid'] . ',1' . urlformat($res['title']) . '.html');
    //Moderatoren
    $moddata = array();
    if ($readoutMods) {
        //$mods=dash_unserialize($res['moderator']);
        $mods = $res['moderator'];
        if (count($mods)) {
            $userdata = $db->fetch("SELECT userid,username FROM " . PRE . "_user WHERE userid IN (" . implode(',', $mods) . ") ORDER BY username ASC");
            if (count($userdata)) {
                foreach ($userdata as $modres) {
                    ++$mi;
                    $moddata[$mi]['USERID'] = $modres['userid'];
                    $moddata[$mi]['USERNAME'] = replace($modres['username']);
                }
            }
        }
    }
    $forumdata['ID'] = $res['forumid'];
    $forumdata['ISCAT'] = $res['iscat'];
    $forumdata['LEVEL'] = $res['level'];
    $forumdata['TITLE'] = $res['title'];
    $forumdata['DESCRIPTION'] = $res['description'];
    $forumdata['LINKTO'] = $res['link'];
    $forumdata['LINK'] = $link;
    $forumdata['THREADS'] = '-';
    $forumdata['POSTS'] = '-';
    $forumdata['CLOSED'] = iif($res['open'], 0, 1);
    $forumdata['MODERATOR'] = $moddata;
    $forumdata['COLLAPSE'] = in_array($res['forumid'], $collapse);
    //Neues Thema erstellen, wenn Schreibrechte
    if (forum_access_open($res)) {
        $forumdata['LINK_NEWTHREAD'] = 'newthread.php?id=' . $res['forumid'];
    }
    //Nur anzeigen, wenn Leserechte
    if (forum_access_read($res) && correct_forum_password($res)) {
        $thread = false;
        //Lastvisit bestimmen
        $lastview = max(array($user->info['forum_lastonline'], forum_readtime($res['forumid'])));
        $forumdata['NEWPOSTS'] = iif($res['lastposttime'] && $res['lastposttime'] > $lastview, 1, 0);
        $forumdata['THREADS'] = number_format($res['threads'], 0, '', '.');
        $forumdata['POSTS'] = number_format($res['posts'], 0, '', '.');
        //Letzter Beitrag
        //if ( $res['lastposttime'] && $thread==false ) $thread=$db->first("SELECT threadid,title,icon FROM ".PRE."_forum_threads WHERE ( del=0 AND moved=0 AND forumid='".$res['forumid']."' ) ORDER BY lastposttime DESC LIMIT 1");
        if ($res['lastthread_icon'] != -1 && isset($set['forum']['icons'][$res['lastthread_icon']])) {
            $icon = $set['forum']['icons'][$res['lastthread_icon']]['file'];
        } else {
            $icon = '';
        }
        $forumdata['LASTPOST_THREADID'] = $res['lastthread'];
        $forumdata['LASTPOST_THREADTITLE'] = replace($res['lastthread_title']);
        $forumdata['LASTPOST_THREADPREFIX'] = forum_get_prefix($res['lastthread_prefix']);
        $forumdata['LASTPOST_USERNAME'] = replace($res['lastposter']);
        $forumdata['LASTPOST_USERID'] = $res['lastposter_userid'];
        $forumdata['LASTPOST_TIME'] = $res['lastposttime'];
        $forumdata['LASTPOST_LINK'] = 'thread.php?id=' . $res['lastthread'] . '&amp;goto=lastpost';
        $forumdata['LASTPOST_ICON'] = $icon;
    }
    return $forumdata;
}
Ejemplo n.º 23
0
//Die letzten 10 Beiträge
$data = $db->fetch("SELECT postid,userid,username,text,time,allowcodes,allowsmilies FROM " . PRE . "_forum_posts WHERE ( del=0 AND threadid='" . $threadinfo['threadid'] . "' ) ORDER BY time DESC LIMIT 10");
if (count($data)) {
    foreach ($data as $res) {
        ++$i;
        //Text
        $text = forum_replace($res['text'], $res['allowcodes'], $res['allowsmilies']);
        $postdata[$i]['ID'] = $res['postid'];
        $postdata[$i]['USERID'] = $res['userid'];
        $postdata[$i]['USERNAME'] = replace($res['username']);
        $postdata[$i]['TEXT'] = $text;
        $postdata[$i]['TIME'] = $res['time'];
    }
}
$apx->tmpl->assign('POST', $postdata);
$apx->tmpl->assign('ATTACH', forum_access_addattachment($foruminfo));
$apx->tmpl->assign('ID', $threadinfo['threadid']);
$apx->tmpl->assign('HASH', $_POST['hash']);
$apx->tmpl->parse('newpost');
////////////////////////////////////////////////////////////////////////////////////////////////////////
$threadpath = array(array('TITLE' => trim(compatible_hsc(strip_tags(forum_get_prefix($threadinfo['prefix']) . ' ') . $threadinfo['title'])), 'LINK' => mkrellink('thread.php?id=' . $threadinfo['threadid'], 'thread,' . $threadinfo['threadid'] . ',1' . urlformat($threadinfo['title']) . '.html')));
$apx->tmpl->assign_static('STYLESHEET', compatible_hsc($foruminfo['stylesheet']));
$apx->tmpl->assign('PATH', array_merge(forum_path($foruminfo, 1), $threadpath));
$apx->tmpl->assign('PATHEND', $apx->lang->get('HEADLINE_NEWPOST'));
titlebar($apx->lang->get('HEADLINE_NEWPOST'));
////////////////////////////////////////////////////////////////////////////////////////////////////////
require 'lib/_end.php';
///////////////////////////////////////////////////////////////////////////
require '../lib/_end.php';
//////////////////////////////////////////////////////// SCRIPT BEENDEN ///
////////////////////////////////////////////////////////////////////////////////////////////////////////
Ejemplo n.º 24
0
    }
    $node['level'] = 0;
    $subData = $tree->getTree(array('*'), $_REQUEST['id'], "starttime!='0'");
    $data = array_merge(array($node), $subData);
} else {
    $data = $tree->getTree(array('*'), null, "starttime!='0'");
}
$first = null;
if (count($data)) {
    foreach ($data as $res) {
        ++$i;
        if (!$first) {
            $first = $res;
        }
        //Link
        $link = mklink('faq.php?id=' . $res['id'], 'faq,' . $res['id'] . urlformat($res['question']) . '.html');
        //Nummer
        $prefixstring = '';
        ++$prefix[$res['level']];
        for ($pi = $res['level'] + 1; isset($prefix[$pi]); $pi++) {
            unset($prefix[$pi]);
        }
        $prefixstring = implode('.', $prefix) . '.';
        //Antwort
        $answer = mediamanager_inline($res['answer']);
        if ($apx->is_module('glossar')) {
            $answer = glossar_highlight($answer);
        }
        $faqdata[$i]['ID'] = $res['id'];
        $faqdata[$i]['NUMBER'] = $prefixstring;
        $faqdata[$i]['QUESTION'] = $res['question'];
Ejemplo n.º 25
0
function postUserBlogTwitter($data, &$twitter)
{
    global $set, $apx, $db;
    foreach ($data as $entry) {
        $entry['link'] = mklink('user.php?action=blog&amp;id=' . $entry['userid'] . '&amp;blogid=' . $entry['id'], 'user,blog,' . $entry['userid'] . ',id' . $entry['id'] . urlformat($entry['title']) . '.html');
        $input = array('TITLE' => $entry['title'], 'LINK' => $entry['link']);
        postTwitterMessage($twitter, $set['twitter']['tpl_user_blog'], $input);
    }
}
Ejemplo n.º 26
0
function user_assign_profile_links(&$tmpl, $userinfo)
{
    global $apx, $set, $db, $user;
    $link_profile = mklink('user.php?action=profile&amp;id=' . $userinfo['userid'], 'user,profile,' . $userinfo['userid'] . urlformat($userinfo['username']) . '.html');
    if ($set['user']['blog']) {
        $link_blog = mklink('user.php?action=blog&amp;id=' . $userinfo['userid'], 'user,blog,' . $userinfo['userid'] . ',1.html');
    }
    if ($set['user']['gallery']) {
        $link_gallery = mklink('user.php?action=gallery&amp;id=' . $userinfo['userid'], 'user,gallery,' . $userinfo['userid'] . ',0,0.html');
    }
    if ($set['user']['guestbook'] && $userinfo['pub_usegb']) {
        $link_guestbook = mklink('user.php?action=guestbook&amp;id=' . $userinfo['userid'], 'user,guestbook,' . $userinfo['userid'] . ',1.html');
    }
    if ($apx->is_module('products') && $set['products']['collection']) {
        $link_collection = mklink('user.php?action=collection&amp;id=' . $userinfo['userid'], 'user,collection,' . $userinfo['userid'] . ',0,1.html');
    }
    $tmpl->assign('LINK_PROFILE', $link_profile);
    $tmpl->assign('LINK_BLOG', $link_blog);
    $tmpl->assign('LINK_GALLERY', $link_gallery);
    $tmpl->assign('LINK_GUESTBOOK', $link_guestbook);
    $tmpl->assign('LINK_COLLECTION', $link_collection);
}
Ejemplo n.º 27
0
 function announce()
 {
     global $set, $apx, $db, $html;
     //Aktionen
     if ($_REQUEST['do'] == 'add') {
         return $this->announce_add();
     }
     if ($_REQUEST['do'] == 'edit') {
         return $this->announce_edit();
     }
     if ($_REQUEST['do'] == 'del') {
         return $this->announce_del();
     }
     //Voreinstellung
     if (!$_REQUEST['what']) {
         $_REQUEST['what'] = 'posts';
     }
     echo '<p class="slink">&raquo; <a href="action.php?action=forum.announce&amp;do=add&amp;criteria=' . $_REQUEST['what'] . '">' . $apx->lang->get('ADDANNOUNCE') . '</a></p>';
     $col[] = array('', 0, '');
     $col[] = array('COL_TITLE', 50, 'class="title"');
     $col[] = array('COL_USER', 30, 'align="center"');
     $col[] = array('COL_PUBDATE', 20, 'align="center"');
     $orderdef[0] = 'addtime';
     $orderdef['title'] = array('a.title', 'ASC', 'COL_TITLE');
     $orderdef['username'] = array('b.username', 'ASC', 'COL_USER');
     $orderdef['addtime'] = array('a.starttime', 'DESC', 'SORT_ADDTIME');
     $orderdef['publication'] = array('a.starttime', 'DESC', 'COL_PUBDATE');
     list($count) = $db->first("SELECT count(id) FROM " . PRE . "_forum_announcements WHERE userid!=''");
     pages('action.php?action=forum.announce&amp;sortby=' . $_REQUEST['sortby'], $count);
     $data = $db->fetch("SELECT a.id,a.title,a.userid,a.starttime,a.endtime,b.username FROM " . PRE . "_forum_announcements AS a LEFT JOIN " . PRE . "_user AS b USING(userid) WHERE a.userid!='' " . 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') . '" />';
             }
             $link = mklink($set['forum']['directory'] . '/announcement.php?id=' . $res['id'], $set['forum']['directory'] . '/announcement,' . $res['id'] . urlformat($res['title']) . '.html');
             $tabledata[$i]['COL2'] = '<a href="' . $link . '" target="_blank">' . replace($res['title']) . '</a>';
             $tabledata[$i]['COL3'] = $res['username'];
             if ($res['starttime']) {
                 $tabledata[$i]['COL4'] = mkdate($res['starttime'], '<br />');
             } else {
                 $tabledata[$i]['COL4'] = '&nbsp;';
             }
             //Optionen
             $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'forum.announce', 'do=edit&id=' . $res['id'], $apx->lang->get('CORE_EDIT'));
             $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', 'forum.announce', 'do=del&id=' . $res['id'], $apx->lang->get('CORE_DEL'));
         }
     }
     $apx->tmpl->assign('TABLE', $tabledata);
     $html->table($col);
     orderstr($orderdef, 'action.php?action=forum.announce');
     save_index($_SERVER['REQUEST_URI']);
 }
Ejemplo n.º 28
0
 //Kategorie
 $tabledata[$i]['CATID'] = $res['catid'];
 $tabledata[$i]['CATTITLE'] = $catinfo[$res['catid']]['title'];
 $tabledata[$i]['CATTEXT'] = $catinfo[$res['catid']]['text'];
 $tabledata[$i]['CATICON'] = $catinfo[$res['catid']]['icon'];
 //Produkt
 $tabledata[$i]['PRODUCT_ID'] = $res['prodid'];
 //Kommentare
 if ($apx->is_module('comments') && $set['videos']['coms'] && $res['allowcoms']) {
     require_once BASEDIR . getmodulepath('comments') . 'class.comments.php';
     if (!isset($coms)) {
         $coms = new comments('videos', $res['id']);
     } else {
         $coms->mid = $res['id'];
     }
     $link = mklink('videos.php?id=' . $res['id'], 'videos,id' . $res['id'] . urlformat($res['title']) . '.html');
     $tabledata[$i]['COMMENT_COUNT'] = $coms->count();
     $tabledata[$i]['COMMENT_LINK'] = $coms->link($link);
     $tabledata[$i]['DISPLAY_COMMENTS'] = 1;
     if (in_template(array('VIDEO.COMMENT_LAST_USERID', 'VIDEO.COMMENT_LAST_NAME', 'VIDEO.COMMENT_LAST_TIME'), $parse)) {
         $tabledata[$i]['COMMENT_LAST_USERID'] = $coms->last_userid();
         $tabledata[$i]['COMMENT_LAST_NAME'] = $coms->last_name();
         $tabledata[$i]['COMMENT_LAST_TIME'] = $coms->last_time();
     }
 }
 //Bewertungen
 if ($apx->is_module('ratings') && $set['videos']['ratings'] && $res['allowrating']) {
     require_once BASEDIR . getmodulepath('ratings') . 'class.ratings.php';
     if (!isset($rate)) {
         $rate = new ratings('videos', $res['id']);
     } else {
Ejemplo n.º 29
0
    $apx->tmpl->assign('FORUM', $forumdata);
    $apx->tmpl->assign('POST', $postdata);
    $apx->tmpl->assign('SELPOST', $seldata);
    $apx->tmpl->assign('TITLE', compatible_hsc($_POST['title']));
    $apx->tmpl->assign('ICON', $_POST['icon']);
    $apx->tmpl->assign('ICONLIST', $icondata);
    $apx->tmpl->assign('STICKY_TYPE', compatible_hsc($_POST['sticky_type']));
    $apx->tmpl->assign('STICKY_TEXT', compatible_hsc($_POST['sticky_text']));
    $apx->tmpl->assign('ANNOUNCE', forum_access_announce($foruminfo));
    $apx->tmpl->assign('ID', $threadinfo['threadid']);
    $apx->tmpl->assign('P', $_REQUEST['p']);
    $apx->tmpl->assign('PREVIOUS', iif($_REQUEST['p'] > 1, 1, 0));
    $apx->tmpl->assign('NEXT', iif($_REQUEST['p'] < $pages, 1, 0));
    $apx->tmpl->parse('split');
    ////////////////////////////////////////////
    $threadpath = array(array('TITLE' => replace($threadinfo['title']), 'LINK' => mkrellink('thread.php?id=' . $threadinfo['threadid'], 'thread,' . $threadinfo['threadid'] . ',1' . urlformat($threadinfo['title']) . '.html')));
    $apx->tmpl->assign('PATH', array_merge(forum_path($foruminfo, 1), $threadpath));
    $apx->tmpl->assign('PATHEND', $apx->lang->get('SPLITTHREAD'));
    titlebar($apx->lang->get('SPLITTHREAD'));
} elseif ($_REQUEST['action'] == 'ipstats') {
    $apx->lang->drop('ipstats');
    $_REQUEST['id'] = (int) $_REQUEST['id'];
    if (!$_REQUEST['id']) {
        die('missing post-ID!');
    }
    $postinfo = post_info($_REQUEST['id']);
    if (!$postinfo['postid'] || $postinfo['del']) {
        message($apx->lang->get('MSG_POSTNOTEXIST'));
    }
    $threadinfo = thread_info($postinfo['threadid']);
    if (!$threadinfo['threadid'] || $threadinfo['del']) {
Ejemplo n.º 30
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']);
 }