コード例 #1
0
ファイル: postops.php プロジェクト: adrianbroher/thwboard
                message("Bestätigung", '
<form name="theform" method="post" action="' . build_link("postops.php") . '">
  M&ouml;chten Sie diesen Post wirklich l&ouml;schen?<br><br>
  <input type="hidden" name="do_delete" value="1">
  <input type="hidden" name="action" value="delete">
  <input type="hidden" name="post[postid]" value="' . $post['postid'] . '">
  <input class="tbbutton" type="submit" name="Submit" value="L&ouml;schen &gt;&gt;">
</form>');
            }
        } else {
            // re-get $post
            $post = $HTTP_POST_VARS['post'];
            if (!($post['postid'] = intval($post['postid']))) {
                exit('nix da');
            }
            // decrease thread reply count
            thwb_query("UPDATE " . $pref . "thread SET threadreplies=threadreplies-1 WHERE threadid={$thread['threadid']}");
            // decrease board post count
            thwb_query("UPDATE " . $pref . "board SET boardposts=boardposts-1 WHERE boardid={$board['boardid']}");
            // remove post
            thwb_query("DELETE FROM " . $pref . "post WHERE postid={$post['postid']}");
            // display stuff
            updatethread($thread['threadid']);
            updateboard($board['boardid']);
            log_action('delete post');
            message("Post wurde gel&ouml;scht", "Post wurde gel&ouml;scht.<br><a href=\"" . build_link("showtopic.php?thread[threadid]={$thread['threadid']}") . "\">Zur&uuml;ck zum Thread</a>");
        }
    } else {
        message("Fehler", "Sie haben keine Erlaubnis diesen Post zu l&ouml;schen");
    }
}
コード例 #2
0
ファイル: threadops.php プロジェクト: adrianbroher/thwboard
    }
    if (!($a_src['threadtime'] > $a_tgt['threadtime'])) {
        message('Fehler', 'Der Ziel-Thread ist j&uuml;nger als der Quell-Thread. Dies w&uuml;rde die Beitragsreihenfolge zerst&ouml;ren');
    }
    // do it.
    thwb_query('UPDATE ' . $pref . 'post
               SET threadid = \'' . $tgt . '\'
               WHERE threadid = \'' . $src . '\'');
    thwb_query('DELETE FROM ' . $pref . 'thread
               WHERE threadid = \'' . $src . '\'');
    thwb_query('UPDATE ' . $pref . 'thread
               SET threadreplies = ' . ($a_tgt['threadreplies'] + $a_src['threadreplies'] + 1) . '
               WHERE threadid = \'' . $tgt . '\'');
    updatethread($tgt);
    updateboard($a_src['boardid']);
    updateboard($a_tgt['boardid']);
    logaction('merge with ' . $tgt);
    message('Info', 'Die Threads wurden erfolgreich verschmolzen.<br><a href="' . build_link('showtopic.php?threadid=' . $tgt) . '">Zum Ziel-Thread</a>.');
}
/*
 * ===============================================================
 *  action: markthread thread
 * ===============================================================
 */
/*if( $action == 'markthread' )
{
    $navpath .= "Thread markieren";
    if( $g_user['userid'] != 0 )
    {
        if ( substr_count( $g_user['usermarkedthreads'], ';'.$thread['threadid'].';' ) != 0 )
        {
コード例 #3
0
ファイル: mysql.php プロジェクト: adrianbroher/thwboard
        Totally <strong>' . $wrong . '</strong> Posts had been counted falsely.<br>
        <br><a href="mysql.php?session=' . $session . '">back to mysql-clean</a>';
} elseif ($action == "threadcount") {
    if (!isset($do) || !$do) {
        print '    Do you want to continue correcting the threadcount of ' . getboardcount() . ' boards?<BR>
            <a href="mysql.php?session=' . $session . '&action=threadcount&do=1">Yes</a> || <a href="mysql.php?session=' . $session . '">No</a>';
        exit;
    }
    print "Threadcount is being checked ... please wait ...<BR><BR>";
    $a_board = array();
    $a_boards = array();
    $boards = 0;
    $r_board = query("SELECT boardid FROM {$pref}" . "board");
    if (mysql_num_rows($r_board) >= 1) {
        while ($a_board = mysql_fetch_array($r_board)) {
            $a_boards[] = $a_board['boardid'];
        }
        foreach ($a_boards as $k => $v) {
            ++$boards;
            updateboard($v);
        }
    }
    print 'Threadcount of <strong>' . $boards . '</strong> boards has been checked and corrected.<br>
               <br><a href="mysql.php?session=' . $session . '">back to mysql-clean</a>';
} elseif ($action == "optimize") {
    $a_tables = array("adminlog", "avatar", "ban", "bannedwords", "board", "calendar", "category", "group", "groupboard", "lastvisited", "news", "online", "pm", "post", "qlink", "rank", "registry", "registrygroup", "session", "style", "thread", "user", "flood");
    print 'Optimizing ... please wait ...<br>';
    query("OPTIMIZE TABLE {$pref}" . join(", {$pref}", $a_tables));
    print 'done<br><a href="mysql.php?session=' . $session . '">back to mysql-clean</a>';
}
tb_footer();
コード例 #4
0
ファイル: edit.php プロジェクト: adrianbroher/thwboard
            $msg .= "Ihr Text ist zu kurz!<br>";
        }
        if (strlen($newpost['posttext']) > $config['message_maxlength']) {
            $msg .= "Ihr Text ist zu lang!<br>";
        }
        if (isset($msg) && strlen($msg) > 0) {
            message("Fehler", "Es sind leider folgende Fehler aufgetreten:<br><br><font color='{$style['color_err']}'>{$msg}</font>");
        }
        $c_time = time();
        thwb_query("UPDATE " . $pref . "post SET posttext='" . addslashes(preparse_code($newpost['posttext'])) . "',\n        postlasteditby='{$g_user['username']}', postlastedittime='" . time() . "',\n        postsmilies='" . ($newpost['postsmilies'] ? 1 : 0) . "',\n        postcode='" . ($newpost['postcode'] ? 1 : 0) . "',\n        postemailnotify='" . (isset($newpost['postemailnotify']) && $newpost['postemailnotify'] ? 1 : 0) . "' WHERE postid='{$post['postid']}'");
        // topic updaten, (auch board), nicht als normaluser
        if ($firstpost && $P->has_permission(P_EDITTOPIC)) {
            $newpost['threadtopic'] = addslashes(preparse_code($newpost['threadtopic']));
            // topic setten
            thwb_query("UPDATE " . $pref . "thread SET threadtopic = '" . $newpost['threadtopic'] . "' WHERE threadid = '{$post['threadid']}'");
            // board updaten
            updateboard($thread['boardid']);
            // eventuell vorhandene threadlinks updaten
            $r_link = thwb_query("SELECT threadid, boardid FROM " . $pref . "thread WHERE threadlink = " . $post['threadid']);
            if (mysql_num_rows($r_link)) {
                $a_link = mysql_fetch_array($r_link);
                thwb_query("UPDATE " . $pref . "thread SET threadtopic = '" . $newpost['threadtopic'] . "' WHERE threadid = " . $a_link['threadid']);
                // nicht updaten, threadlinks werden eh nicht im boardlastpost angezeigt
                // updateboard( $a_link['boardid'] );
            }
        }
        header("Location: " . build_link("showtopic.php?threadid={$thread['threadid']}&pagenum=lastpage#" . $post['postid'], true));
    }
} else {
    message("Fehler", "Sie k&ouml;nnen diesen Post nicht editieren");
}