Exemplo n.º 1
0
        $mm->deletefile($file);
        $db->query("DELETE FROM " . PRE . "_forum_attachments WHERE ( id='" . $delete . "' AND postid='" . $_REQUEST['postid'] . "' AND hash='" . addslashes($_REQUEST['hash']) . "' ) LIMIT 1");
        $message .= $apx->lang->get('MSG_DELETE', array('FILE' => $filename));
    }
}
//Dateien auflisten
$attrefresh = '';
$data = $db->fetch("SELECT * FROM " . PRE . "_forum_attachments WHERE ( postid='" . $_REQUEST['postid'] . "' AND hash='" . addslashes($_REQUEST['hash']) . "' ) ORDER BY name ASC");
if (count($data)) {
    foreach ($data as $res) {
        ++$i;
        $ext = strtolower($mm->getext($res['name']));
        $attdata[$i]['ID'] = $res['id'];
        $attdata[$i]['FILENAME'] = $res['name'];
        $attdata[$i]['ICON'] = $typeinfo[$ext][1];
        $attdata[$i]['SIZE'] = forum_getsize($res['size']);
        $attrefresh .= "window.opener.att.add('" . addslashes($res['name']) . "','" . round($res['size'] / 1024) . " KB','" . addslashes($typeinfo[$ext][1]) . "');\n";
    }
}
//Javascript zur Aktualisierung des Hauptfensters
if ($_POST['send'] || $_POST['delete']) {
    $refresh = '<script language="JavaScript" type="text/javascript">' . "\n<!--\n\n";
    $refresh .= "if ( typeof window.opener.att!='undefined' ) {\nwindow.opener.att.reset();\n";
    $refresh .= $attrefresh;
    $refresh .= "}\n\n";
    $refresh .= "//-->\n</script>";
}
$apx->tmpl->assign('TYPE', $filedata);
$apx->tmpl->assign('ATTACHMENT', $attdata);
$apx->tmpl->assign('MESSAGE', $message);
$apx->tmpl->assign('HASH', $_REQUEST['hash']);
Exemplo n.º 2
0
        if ($att['hash'] != $res['hash']) {
            continue;
        }
        //Nur Anhänge mit gültigem Hash-Wert
        ++$ai;
        if ($att['thumbnail']) {
            $imgatttable[$ai]['THUMBNAIL'] = HTTPDIR . getpath('uploads') . $att['thumbnail'];
            $imgatttable[$ai]['ICON'] = $typeicon[strtolower($mm->getext($att['name']))];
            $imgatttable[$ai]['NAME'] = replace($att['name']);
            $imgatttable[$ai]['LINK'] = 'attachments.php?getid=' . $att['id'];
            $imgatttable[$ai]['SIZE'] = forum_getsize($att['size']);
        } else {
            $atttable[$ai]['ICON'] = $typeicon[strtolower($mm->getext($att['name']))];
            $atttable[$ai]['NAME'] = replace($att['name']);
            $atttable[$ai]['LINK'] = 'attachments.php?getid=' . $att['id'];
            $atttable[$ai]['SIZE'] = forum_getsize($att['size']);
        }
    }
}
//Rang
$rankinfo = get_rank($userdat);
$apx->tmpl->assign('ID', $postinfo['postid']);
$apx->tmpl->assign('TITLE', replace($postinfo['title']));
$apx->tmpl->assign('TEXT', $text);
$apx->tmpl->assign('TIME', $postinfo['time']);
$apx->tmpl->assign('USERNAME', replace($postinfo['username']));
$apx->tmpl->assign('USERID', $postinfo['userid']);
$apx->tmpl->assign('USER_POSTS', $userdat['forum_posts']);
$apx->tmpl->assign('USER_REGTIME', $userdat['reg_time']);
$apx->tmpl->assign('IP', $postinfo['ip']);
$apx->tmpl->assign('HOMEPAGE', replace($userdat['homepage']));