Esempio n. 1
0
// Handle Archive & DELETE
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    //echo $current_user->ID;
    if (get_magic_quotes_gpc()) {
        $_POST = array_map('stripslashes_deep', $_POST);
        $_REQUEST = array_map('stripslashes_deep', $_REQUEST);
    }
    $selected = $_POST['reportID'];
    if ($selected && is_array($selected) && count($selected) > 0) {
        // If Archive
        if (isset($_POST['archiveit'])) {
            global $current_user;
            get_currentuserinfo();
            $archive_c = $_POST['archive_c'];
            foreach ($selected as $archive) {
                if (!$wprp->archive($archive, $current_user->ID, $archive_c)) {
                    echo "ERROR: " . $wprp->last_error;
                    break;
                    // EXIT LOOP
                }
            }
        }
        // DELETE
        if (isset($_POST['deleteit'])) {
            foreach ($selected as $archive) {
                if (!$wprp->delete($archive)) {
                    echo "ERROR: " . $wprp->last_error;
                    break;
                    // EXIT LOOP
                }
            }
Esempio n. 2
0
            $comments = split("<br />", $comments);
            # Split Different Contents
            foreach ($comments as $comment) {
                $comment_array = split(":", $comment, 2);
                # GETS IP
                $IP = $comment_array[0];
                $IP = str_replace(array("[", "]"), "", trim($IP));
                $comment_array = split('\\|', $comment_array[1], 2);
                # GETS Type & Actual Comment
                // Now we Start to INSERT into NEW
                $wprp->add($report->post_id, $comment_array[0], $comment_array[1], $report->stamp, $IP);
            }
            // comments
            // Update Archive Status
            if ($report->status == "1" && $wprp->insert_id > 0) {
                $wprp->archive($wprp->insert_id, $current_user->ID, "Converted during Upgrade");
            }
            $wprp->insert_id = 0;
            // Just to be SAFE!
        }
    }
    // Delete OLD TABLE
    $wpdb->query($wpdb->prepare("DROP TABLE {$old_table}"));
    // Restore Email Option
    update_option("rp_send_email", $email_opt);
    $text = '<font color="green"> * successfully updated</font>';
}
// Check IS require to UPGRADE
if ($wpdb->get_var("SHOW TABLES LIKE '{$old_table}'") == $old_table) {
    // FOUND YA!
    $upgrade_required = true;