PDA

View Full Version : Attachments Anywhere


amykhar
02-03-2006, 02:28 PM
Right now, attachments are attached to posts. I suggest that this be modified to not attach them to anything.

The attachment interface should be an independent thing - accessible from posts, private messages and external scripts.

When you create an attachment, it would be linked - as it is now- in your profile. You could delete and add attachments from your profile if you so choose. Each user would have a quota.

Attachments could be referenced in a post, private message or external script. If the user deletes the entity that has an attachment referenced in it, the user would be prompted asking if they want to delete the attachment.

Attachments could be cross-referenced. Users could reference other people's attachments by id.

If an attachment is deleted but other references remain to it, they would simply show a message or image stating that the attachment has been deleted.

There wouldn't be any need to ensure that all references are gone before an attachment is deleted.

The user who creates this mod will have effectively created file uploads for every script out there that needs user-owned file uploads. And, it will give users a single interface to control their files - gallery pictures, documents, userpage pictures, whatever.

harmor19
02-03-2006, 03:17 PM
isn't that what the [attach] bbcode is for?

amykhar
02-03-2006, 05:38 PM
Is there an interface to upload attachments aside from in posts? Have you tried using the attach bbcode in other places besides posts?
Amy

Andy
02-04-2006, 12:41 AM
I agree with you Amy.

One of the most important things for me was to be able to see attachments when a post was quoted. Imagine you want to compliment a user on a picture and when you quote their post the picture is not shown, this was a problem.

So I modified the template to require my members to use the [attach ] bbcode in order to see any image. In addition I modified the php code to allow displaying [attach ] bbcodes in any post even when the attachment was not originally attached to that particular post.

This has worked very well and has made quoting posts that have pictures very useful.

Adrian Schneider
02-04-2006, 02:04 AM
I was working on an upload system a week or 2 ago, and I also noticed this. After realizing I couldn't do this without major file edits (and tons of plugin code), I just ditched the idea alltogether and used the filesystem.

So yeah, I second this.

amykhar
02-20-2006, 06:22 PM
I've been thinking about this some.

What if we had something called a node with an associated nodeid. An attachment could attach to a node instead of a post.

So, pms could be nodes, posts could be nodes, quiz questions could be nodes, journal entries could be nodes, etc.

When we add an object to the database, we would first add a new node and then put the nodeid on the post, pm, whatever.

Then, if we delete the pm, post, whatever, we also go zap the node and any associated attachments.

Amy

Princeton
02-20-2006, 06:49 PM
I have a blog system which uses vb's attachment system flawlessly.*
The same technique could be used for anything.

The only thing I did was to modify the attachment table (I added a 'blogentryid' field) and 1 plugin. (Ahh, now that I think of it, I believe the plugin was for thumbnail display for all users--not sure--or it could be both--damn, can't remember.)

CLUE: The trick is to fetch the permissions for attachments (from a pre-defined forum).

*no vb files edits necessary

amykhar
02-20-2006, 07:22 PM
So, there is hope. It might not be that difficult at all to work out an attachment system we could all hook into.

Princeton
02-20-2006, 07:30 PM
the only difficult part is modifying the attachment table ... and we know how hard that is ;)

amykhar
02-20-2006, 07:38 PM
horribly difficult. Will take me all of 10 seconds :D

Carco
02-21-2006, 06:46 AM
I believe attachments should be an independent entity..

I would like to see some other feature like: Giving different permissions for each attachment..

For example:
I have post number 1, and its attachment should be downloaded by any visitor..
I have post number 2, and its attachment should be downloaded by members only..

AND BOTH OF THE POSTS ARE IN THE SAME THREAD

I'm not sure if this is doable without making them independent.. OR making them independent will make the permission process much simpler, and more elegant.

Burley
03-07-2006, 08:21 AM
Would it then also be possible to have them autamtically removed after a set period of time?

I think tons of people would benefit from such a hack

amcd
12-10-2006, 06:14 PM
did anyone actually attempt this?

thincom2000
01-18-2007, 05:50 PM
Thanks for that suggestion. Will be useful for the site news mod I am currently writing.

ConqSoft
01-18-2007, 06:27 PM
Slight ThreadJack:

(Ahh, now that I think of it, I believe the plugin was for thumbnail display for all users--not sure--or it could be both--damn, can't remember.)


Is this hack available? I'd like to show thumbnails to all users (i.e., guests) but only allow full size image attachment viewing by registered members.

timetunnel
01-18-2007, 09:04 PM
Hello.

How 'bout considering:

Allow members of a certain usergroup to create 1 thread e.g. 'ATTACHMENTS' with multiple posts that no one can reply to nor view (except of course admins or super mods when content violates rules). Each post conforms to the site's # of attachments/post rule. When that post reaches that limit, begin another post (reply) to attach additional attachments to. Of course, the total amount of space is still subject to the usergroup and vB Options parameters. All attachments will show up in User Profile's Edit Attachments for easy viewing and copy/paste of URL. Then use the URL throughout the site INCLUDING PM, SIGS, etc. That what I'm working on completing.

LIMITATION: With 'Allow Dynamic URL...' set to 'No', these images are not parsed inline within the [IMG] tag since they contain a query string (?&). Of course you can set that param to 'YES' and it all works fine. It depends on whether you want to follow the caution statement mentioned by vB as to why they believe that param should be set to 'No'. Else, you can create conditions of a new tag whereby you can keep the param set to 'No' but ONLY parse attachments and no other URLs containing a query string. (Note: there are other considerations to incorporate in the coding and conditions as well, but this is the gist). It works well.

Only hooks are involved to make this happen. No database edits nor file editing is needed.

I'm planning to use it for subscribers and/or other higher-end member groups whenever I get it completed...(who knows when...)

HTH.

P.S. If someone decides to use this method or some close version of it or create/formalize a HACK for others using this method, please add to this thread to let me and others know. Hopefully, vB will come up with some or similar version of it as part of their package.

Thanks.