bbPress

Simple, Fast, Elegant

bbPress support forums » Plugins

Proposed method for file attachments and uploads

(37 posts)
  • Started 5 months ago by charliestout
  • Latest reply from _ck_
  • This topic is not resolved
  1. Yes there used to be a limit with readfile/passthru but supposedly fixed in newer PHP and even the old limit was 2mb which is fairly high anyway. Also there is some debate that flushing output and making sure compression/output buffers are turned off avoids the limit. We'll find out as more people test it.

    I'll have a version up for testing in 12 hours or so.

    Posted 2 months ago #
  2. fel64: No, there's been hooks for the post form for as long as I can remember.

    Unfortunately that's only for new posts. For editing existing posts there is absolutely no way to affect the template without editing it. There's no hooks for edit_form() or any of it's sub-functions or the template loader (the loader does the include AFTER the hook so nothing can be placed afterwards. I requested some hooks many month ago but they may have been missed (or ignored). This plugin will require (one, simple) edit of the edit-post.php template.

    (In theory it could be done via the bb_get_footer but that's really messy and the footer hook is AFTER the footer has been rendered).

    Posted 2 months ago #
  3. An early beta is now available for review:
    http://bbpress.org/plugins/topic/bb-attachments/

    Posted 2 months ago #
  4. @ _ck_

    Which ticket was he hook request in. I'll see if I can do something about it sooner rather than later.

    I'm also happy to do a new release 0.9.0.2 to get those changes more readily available for this plugin.

    Posted 2 months ago #
  5. The ticket was months back, I'd have to search.
    It's fairly simple in theory though, why not mimic the existing hook structure for new posts to match editing existing posts:
    pre_post_form -> pre_edit_form
    post_form -> edit_form
    post_post_form -> post_edit_form

    Posted 2 months ago #
  6. I recall a ticket where mdawaffe was hesitant to put hooks in the templates.

    Would you require hooks in the templates?

    Posted 2 months ago #
  7. I agree with not doing the actions in the templates - that was a mistake WordPress did for awhile eh? The hooks can go inside function edit_form in the core, no?

    Just for clarification, because this one is important, do_action('post_edit_form') should go AFTER the </form> is closed.

    do_action('pre_edit_form') should be before the <form
    and do_action('edit_form') should be inside the form.

    If all the post_form's are actions, so should be the edit_forms. I don't think any are filters, wouldn't make sense...?

    This will help other plugins like my Signatures too.
    Less template edits needed, makes it easier for users.

    Of course I still have to support some 0.8.3 people so it's going to be awhile before this solves all problems but at least newer installs can benefit.

    Posted 2 months ago #

RSS feed for this topic

Reply

You must log in to post.

Code is Poetry.