Proposed method for file attachments and uploads
File uploads and attachments: like many others, I am highly interested in such a plugin. While I agree with the intent of the developers to keep bbPress light and awesome (which it is,) it certainly seems a shame to have to abandon bbPress because it does not provide for file uploads.
It’s my understanding that each post is given a unique identifier, visible as a URL parameter: id=38 for post 38, id=39 for post 39, etc.
Functionally, it seems a matter of creating an /uploads folder, and using a PHP upload/file management script to create a folder with the same name of the post ID in the /uploads folder.
I think one could add some PHP code in the topic page loop to parse the /uploads folder for folders whose names match the numbers of the post id’s displayed on that page, if-then display links to any files contained within those folders, if-not, then don’t.
Do I have the technical know-how to pull this off? Of course not. I barely got the forums installed and avatar plugin running on my server. But others lurking here with any PHP ninja skills might be able to.
Of course, there might be horrendous security risks that I’m not thinking of with this method. And the PHP code that scans the uploads folder for foldernames that match post id’s might ridiculously slow down the forums, as it constantly scans the filesystem instead of performing a quick database lookup.
But it might be a good start. Between all of us here in these forums, I am confident that we’ll eventually stumble across this much-needed functionality. Necessity is a mother…
I think all languages place the file extension on the right of the filename.
Progress is excellent, way ahead of schedule, should have a public demo Saturday night (24 hours or so).
Working on a auto-thumbnail method now for image uploads.
I’ve come up with some extra security features like the files are not directly publicly accessible (stored in non-webroot directory) so they never get fed through the parsers and cannot be executed (ie. .php .html .asp) even if someone manages to trick a file extension or mime somehow. The only downside to this is that the files must be “dumped” through PHP (readfile) which will keep the PHP session open longer but unless you are serving multi-megabyte files at high traffic rates, this should not be a big issue (optionally you can make the files directly accessible off the web if this is critical issue).
As a bonus the above method makes hotlinking impossible as you can set attachments as accessible to logged-in members only.
Piping things through PHP will be slower (but potentially more secure).
Oh, and the file size may be limited by the memory limits in PHP that way too. Not the file upload size limits, but the memory allocation limits set in the PHP INI file.
This stuff will come out in the wash once it is released and in the hands of users though.
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.
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
(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).
An early beta is now available for review:
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.
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:
I recall a ticket where mdawaffe was hesitant to put hooks in the templates.
Would you require hooks in the templates?
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_formin the core, no?
Just for clarification, because this one is important,
do_action('post_edit_form')should go AFTER the
do_action('pre_edit_form')should be before the
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.
Installation of antivirus software is important if you regularly use your computer. When any virus infect a PC, it becomes troublesome for the users to cope up with this problem. At this time antivirus software can come to your rescue. Using a antivirus software will help you free from any worried associated with any virus problems which come out of sudden. However, your Avast antivirus systems also tend to have some issues which can be better tackled with a perfect tech support for Avast antivirus. When your computer is affected with a malicious virus, then the best support to get is to call our experienced professionals who are ready to help you out in any problem related with your antivirus glitch.
If you are trapped into Avast antivirus issues, then the most suitable option before you is to call for the assistance of our Avast antivirus technical support which is rendered by our certified professionals. Avast tech support from our staff would be much convenient to you as our services can be rendered to you at any odd hour of a day. Issues arising in your antivirus such as Avast activation issues, upgrading issues, basic troubleshooting of your Avast antivirus systems can be handled professionally by our technicians. The issues which occur in your Avast antivirus software are professionally handled by our experts who have a track of queries which help them coming out with the effective solutions meant for the most complex issues of Avast antivirus. Hence, don’t be tensed and rely on us for getting great tech support for your Avast antivirus glitches.
Avast Customer Care
Avast password reset or recovery
- You must be logged in to reply to this topic.