コード例 #1
0
		</form>' . "\n";
            $edit_page = 1;
            break;
        case 'edit-album':
            // Show the edit album form
            $output .= plog_edit_album_form($id);
            $edit_page = 1;
            break;
        case 'edit-collection':
            // Show the edit collection form
            $output .= plog_edit_collection_form($id);
            $edit_page = 1;
            break;
        case 'edit-comment':
            // Show the edit comment form
            $output .= plog_edit_comment_form($id);
            $edit_page = 1;
            break;
        case 'update-picture':
            // Update the picture information
            if (!isset($_REQUEST['cancel'])) {
                $allow_comments = isset($_REQUEST['allow_comments']) ? $_REQUEST['allow_comments'] : '';
                $action_result = update_picture($_REQUEST['pid'], $_REQUEST['caption'], $allow_comments, $_REQUEST['description']);
            }
            break;
        case 'update-album':
            // Update the album information
            if (!isset($_REQUEST['cancel'])) {
                $action_result = update_album($_POST['pid'], $_POST['name'], $_POST['description'], $_POST['thumbnail_id']);
            }
            break;
コード例 #2
0
                     $result = run_query($query);
                     $num_items++;
                 }
                 if ($num_items > 0) {
                     $text = $num_items == 1 ? plog_tr('comment') : plog_tr('comments');
                     $output .= "\n\t" . '<p class="success">' . sprintf(plog_tr('You have approved %s successfully'), '<strong>' . $num_items . '</strong> ' . $text) . '.</p>' . "\n";
                 } else {
                     $output .= "\n\t" . '<p class="errors">' . plog_tr('Nothing selected to approve') . '!</p>' . "\n";
                 }
             }
         }
     }
 } else {
     if ($_REQUEST['action'] == 'edit-comment') {
         // Show the edit form
         $output .= plog_edit_comment_form($_REQUEST['pid']);
         $edit_page = 1;
     } else {
         if ($_REQUEST['action'] == 'update-comment') {
             if (!isset($_REQUEST['cancel'])) {
                 // Update comment in database
                 $result = update_comment($_POST['pid'], $_POST['author'], $_POST['email'], $_POST['url'], $_POST['comment']);
                 if (isset($result['errors'])) {
                     $output .= "\n\t" . '<p class="errors">' . $result['errors'] . '</p>' . "\n";
                 } else {
                     if (isset($result['output'])) {
                         $output .= "\n\t" . '<p class="success">' . $result['output'] . '</p>' . "\n";
                     }
                 }
             }
         }