Esempio n. 1
0
        foreach ($_REQUEST["Selected"] as $appr_id) {
            // lets build the query string
            $appr_id = intval($appr_id);
            $query = "UPDATE " . TABLE_PREFIX . "comments SET `approved` = 1 WHERE `id`= '{$appr_id}'";
            $result = run_query($query);
            $num_items++;
        }
        $output .= "<p class=\"actions\">" . sprintf(plog_tr('You have approved %d comment(s) successfully.'), $num_items) . "</p>";
    } else {
        $output .= "<p class=\"errors\">" . plog_tr('Nothing selected to approve!') . "</p>";
    }
}
if (isset($_REQUEST["action"])) {
    if ($_REQUEST["action"] == "edit-comment") {
        // show the edit form
        $output .= edit_comment_form($_REQUEST["pid"]);
    } else {
        if ($_REQUEST["action"] == "update-comment") {
            // update comment in database
            $result = update_comment($_POST["pid"], $_POST["author"], $_POST["email"], $_POST["url"], $_POST["comment"]);
            if (isset($result['errors'])) {
                $output .= '<p class="errors">' . $result['errors'] . '</p>';
            } elseif (isset($result['output'])) {
                $output .= '<p class="actions">' . $result['output'] . '</p>';
            }
        }
    }
}
$output .= '<form id="contentList" action="' . $_SERVER["PHP_SELF"] . '" method="get">';
$allowedCommentKeys = array("unix_date", "author", "email", "url", "comment");
// lets iterate through all the content and build a table
Esempio n. 2
0
						
					    <label for="allow_comments" accesskey="w">Allo<em>w</em> Comments?<label><br /><input type="checkbox" id="allow_comments" name="allow_comments" value="1"' . " {$state}>";
                    $output .= '<input type="hidden" name="pid" value="' . $photo['id'] . '"><input type="hidden" 
						name="action" value="update-picture"><button class="submit" type="submit">Update</button>';
                    $output .= '</form>';
                } else {
                    if ($_GET["action"] == "edit-album") {
                        // show the edit form
                        $output .= plog_edit_album_form($_REQUEST["id"]);
                    } else {
                        if ($_GET["action"] == "edit-collection") {
                            $output .= plog_edit_collection_form($_GET["id"]);
                        } else {
                            if ($_GET["action"] == "edit-comment") {
                                // show the edit form
                                $output .= edit_comment_form($_GET["pid"]);
                            }
                        }
                    }
                }
            } else {
                if (!empty($_POST["action"])) {
                    if ($_POST['action'] == 'update-picture') {
                        $action_result = update_picture($_POST['pid'], $_POST['caption'], $_POST['allow_comments'], $_POST['description']);
                    } else {
                        if ($_POST['action'] == 'update-album') {
                            $action_result = update_album($_POST['pid'], $_POST['name'], $_POST['description'], $_POST['thumbnail_id']);
                        } else {
                            if ($_POST["action"] == "update-collection") {
                                $action_result = update_collection($_POST["pid"], $_POST["name"], $_POST["description"], $_POST["thumbnail_id"]);
                            } else {