예제 #1
0
$slog = new slog();
$my = $slog->logged();
$lang->init($my->language);
$tpl = new tpl();
if ($config['tpcallow'] == 0 && $_GET['action'] == "thumbnail") {
    include 'classes/graphic/class.thumbnail.php';
    $thumb = new thumbnail();
    $thumb->create_error('#0 ' . $lang->phrase('thumb_error'));
} elseif ($config['tpcallow'] == 0) {
    error($lang->phrase('upload_switched_off'));
}
if ($_GET['action'] == "thumbnail") {
    include 'classes/graphic/class.thumbnail.php';
    $thumb = new thumbnail();
    if (!$_GET['id']) {
        $thumb->create_error('#1 ' . $lang->phrase('thumb_error'));
    } else {
        $result = $db->query('
		SELECT u.id, u.file, t.board 
		FROM ' . $db->pre . 'uploads AS u LEFT JOIN ' . $db->pre . 'topics AS t ON t.id = u.tid 
		WHERE u.id = ' . $_GET['id'], __LINE__, __FILE__);
        $row = $db->fetch_assoc($result);
        $my->p = $slog->Permissions($row['board']);
        $uppath = 'uploads/topics/' . $row['file'];
        if ($db->num_rows($result) != 1) {
            $thumb->create_error('#2 ' . $lang->phrase('thumb_error'));
        }
        if ($my->p['forum'] == 0 || $my->p['downloadfiles'] == 0) {
            $thumb->create_error('#3 ' . $lang->phrase('thumb_error'));
        }
        if (!file_exists($uppath)) {