예제 #1
0
function get_forum_info($id)
{
    static $cache;
    if (!isset($cache[$id])) {
        $cache[$id] = forum_info($id);
    }
    return $cache[$id];
}
예제 #2
0
    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']) {
        message($apx->lang->get('MSG_THREADNOTEXIST'));
    }
    $foruminfo = forum_info($threadinfo['forumid']);
    if (!$foruminfo['forumid']) {
        message($apx->lang->get('MSG_FORUMNOTEXIST'));
    }
    if (!forum_access_admin($foruminfo)) {
        tmessage('noright', array(), false, false);
    }
    //////////////////////////////////////////////////////////////////////////////// SUCHERGEBNISSE ANZEIGEN
    //Beiträge von dieser IP
    $data = $db->fetch("SELECT userid,username,count(postid) AS posts FROM " . PRE . "_forum_posts WHERE ip='" . addslashes($postinfo['ip']) . "' GROUP BY username ORDER BY username ASC");
    if (count($data)) {
        foreach ($data as $res) {
            ++$i;
            $fromdata[$i]['USERID'] = $res['userid'];
            $fromdata[$i]['USERNAME'] = replace($res['username']);
            $fromdata[$i]['POSTS'] = $res['posts'];
예제 #3
0
define('APXRUN', true);
define('INFORUM', true);
define('BASEREL', '../');
////////////////////////////////////////////////////////////////////////////////////////////////////////
require '../lib/_start.php';
///////////////////////////////////////////////////////// SYSTEMSTART ///
require 'lib/_start.php';
/////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////
$apx->lang->drop('postform');
$apx->lang->drop('editor');
$_REQUEST['id'] = (int) $_REQUEST['id'];
if (!$_REQUEST['id']) {
    die('missing forum-ID!');
}
$foruminfo = forum_info($_REQUEST['id']);
if (!$foruminfo['forumid']) {
    message($apx->lang->get('MSG_FORUMNOTEXIST'));
}
if (!forum_access_read($foruminfo)) {
    tmessage('noright', array(), false, false);
}
if (!forum_access_open($foruminfo)) {
    tmessage('noright', array(), false, false);
}
check_forum_password($foruminfo);
////////////////////////////////////////////////////////////////////////////////////////// THEMA ERSTELLEN
//Vorschau generieren
if ($_POST['preview']) {
    $preview = $_POST['text'];
    if ($_POST['transform_links']) {
예제 #4
0
function forum_readout($forum = false)
{
    global $set, $db, $apx, $forum_inheritfields;
    require_once BASEDIR . 'lib/class.recursivetree.php';
    $tree = new RecursiveTree(PRE . '_forums', 'forumid');
    $data = $tree->getTree(array('*'), $forum ? $forum : null);
    $lastlevel = 0;
    $handdown = array();
    //Parent-Forum auslesen
    if ($forum) {
        $parentinfo = forum_info($forum);
        $inheritData = array();
        foreach ($forum_inheritfields as $fieldname) {
            $inheritData[$fieldname] = $parentinfo[$fieldname];
        }
        $handdown[] = $inheritData;
    }
    foreach ($data as $key => $res) {
        //Moderatoren
        $res['moderator'] = dash_unserialize($res['moderator']);
        //Vererbbare Daten entfernen, wenn vorheriges = aktuelles Level
        if ($lastlevel == $res['level']) {
            array_pop($handdown);
        }
        //Rechte vererben
        if ($res['inherit']) {
            $res = array_merge($res, $handdown[count($handdown) - 1]);
        }
        //Vererbbare Rechte
        $inheritData = array();
        foreach ($forum_inheritfields as $fieldname) {
            $inheritData[$fieldname] = $res[$fieldname];
        }
        $inheritData['password_fromid'] = $res['password_fromid'] ? $res['password_fromid'] : $res['forumid'];
        $handdown[] = $inheritData;
        //Daten speichern
        $data[$key] = $res;
        $lastlevel = $res['level'];
    }
    return $data;
}
예제 #5
0
}
//Ankündigung auslesen
$anninfo = $db->first("\n\tSELECT * FROM " . PRE . "_forum_announcements\n\tWHERE id='" . $_REQUEST['id'] . "'\n\tLIMIT 1\n");
if (!$anninfo) {
    filenotfound();
}
//Prüfen, ob der Nutzer Zugang hat
$data = $db->fetch("SELECT forumid FROM " . PRE . "_forum_anndisplay WHERE id='" . $_REQUEST['id'] . "'");
$forumids = get_ids($data, 'forumid');
//Keine Foren-Ids vorhanden
if (!count($forumids)) {
    filenotfound();
} elseif (!in_array(0, $forumids)) {
    $access = false;
    foreach ($forumids as $fid) {
        $foruminfo = forum_info($fid);
        if (!$foruminfo['forumid']) {
            continue;
        }
        //Zugang erlaubt, alles ok
        if (forum_access_read($foruminfo) && correct_forum_password($foruminfo)) {
            $access = true;
            break;
        }
    }
    //Kein Zugang
    if (!$access) {
        tmessage('noright', array(), false, false);
    }
}
//Lastvisit für dieses Thema bestimmen