1 (edited by Frank H 2003-11-07 18:26)

Topic: Attachments

Well I was planning on writing this mod during the summer, but if someone already have started, then I'll rather wait smile (I have a feeling that I read somewhere that someone was going to do this, or is it only in my imagination?)

But if noone has started this I'll start it at the middle of next month (will go away 11days, with no contact to the computer).

Ok it's progressing nicely


26th july
* Attachment rules is functional. If you're allowed to post an attachment, the attach and browse button is showed.

* Rules is as of now 'hardcoded' in the forum, and admin page will be added to handle this in the future.

* Both uploads and downloads is functional. Images is viewed in browser.

10th aug
*Improved the visibility on the page, now shows filesize, and number of downloads.

*Fixed so that png files is viewed in the browser instead of downloaded.

11th aug
*Have fiddeled with the admin part, it now lists all the attachments, and links back to posts etc. so it's easy to alter.

*Admin Edit attachment now works (need to be an admin to have the ability to alter the info in the attachment)

12th aug
* Fixed so it's possible to delete attachments, only from the admin menu at the moment.

* Made the attachment administration menu avaible, (only for admins, as it's more admin stuff there, moderators will have the delete option in each post-edit)

14th aug
* Altering forum attachment rights now functional. So now all admins can alter what the max uploadsize is, and who can ul/dl the files.

* If you delete the post the attachment will also be deleted, This will not work for Threads, so if the post is the first in the thread, all posts will get deleted, but the attachments will remain, so it's possible to have attachments saved if something would be deleted by mistake (it's bad enough if someone deletes a post, and might loose 1 file, but loosing hundreds isn't as fun) ... these will be possible to delete by using the 'list/delete orphans in the admin interface'.

* In the post edit you now have the option to delete the attachment. Moderators can delete posts here.

15th aug
* Fixed a bug in delete.php where I only could delete posts with attachments, this was due to using the wrong variablename. (I did try the delete only on posts with attachments big_smile)

16th aug
* Listing orphans now work, one has the option to either edit it (so one can link it to a new post), delete it, or just let it lay there unused.

* Fixed a bug where the listing of all attachments had pages for more attachments than listed when orphans existed.

* Added the possibility to optimize the attachment tables, to be used if one has deleted alot of messages.

17th aug
* Refined the attachment admin menu, looks better with a menu with buttons instead of ordinary links.

* Clear all orphans now working.

* Other small fixes

18th aug
*Displays an icon next to the attachment when viewing a thread, icon is dependent on the mimecode for that document. The icons need further work though wink

21th aug
* Been fiddling with filetypes, how to allow and disallow them (that's what have taken so long!), isn't as easy as it might be at a first glance, but I think I've come up with a working solution.
   First there's an array within a php file with a list of extrentions that's always disallowed, BIG security risk if you allow all files for everyone! (but is ignored for admins, hey, if they're admins, you do trust them, right? wink). Furthermore you can for every forum specify the files you want to allow, and then only those will be allowed(not overriding the always deny list). If you leave the files field empty, it will allow all files(except those always denied of course). Puh ... it was truly a hard thing to write... and I still have a few lines of admin pages to do for it also wink

* Admin interface now updated to handle the file allows, and it works like a charm big_smile

* The icons next to the attachment is now dependent on if you want to see images or not. So it's possible not to have them. smile
21th aug
* Fixed a small bug where it was only possible to delete one orphan at a time.
25th aug
* Edit posts now allows you to replace the attachment you already have there, or to add a new attachment if there wasn't one there in the first place.
7th sept
* Added alot of new stuff throughout the time since I last updated this changelog, alot was small fixes and stuff, have now made new screenshots, showing how the 1.0 release will look like.
7th nov
* After a very busy period, I managed to wrap it out for an official release! Click here to go to release thread.

And here are a few pics how it looks atm.

The posts: (there will be more than one icontype avaible + a template)
http://stingray.campus.luth.se/attachme … wtopic.png

Admin menu:
http://stingray.campus.luth.se/attachme … h_menu.png

Admin menu, list all attachments:
http://stingray.campus.luth.se/attachme … h_list.png

Admin menu, edit an attachment:
http://stingray.campus.luth.se/attachme … h_edit.png

Admin menu, edit forums:
http://stingray.campus.luth.se/attachme … forums.png

Admin menu, alter attachment rules for  forum:
http://stingray.campus.luth.se/attachme … _rules.png

Post a new reply:
http://stingray.campus.luth.se/attachme … s/post.png

Edit a message without attachment, but attachments allowed:
http://stingray.campus.luth.se/attachme … it_new.png

Edit a message with attachment, attachments allowed:
http://stingray.campus.luth.se/attachme … t_with.png

When viewing images, it's popped up in a PunBB page(was a blank page before)
http://stingray.campus.luth.se/attachme … geview.png

Re: Attachments

This will probably never be a feature in PunBB so I'll move this to the mod forum.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

3 (edited by Frank H 2003-07-16 15:45)

Re: Attachments

Ok, I'm back from England now and ready to fix this attachment mod ... I do have two small questions:

*Is it long before Version 1.0 is released? (no need to specify date, but within a week, month, 3 months etc. ... just so I know my priorities)

*Does the files differ alot from RC2? (so I know if it's worth fiddling within all the php files before 1.0 is released)

So far I have written down the tables needed and have planned where and how it should be included ... now it's 'only' to write the mod wink

(If someone have something they reeeeeally want in the mod, speak now or forever be silent wink )

Re: Attachments

1.0 will most likely be released somewhere around the 30th of this month. I'm going away on vacation now and will be back the 28th.

Changes in 1.0 are primarily small fixes and tweaks, so developing a mod for RC2 and then porting the mod to 1.0 should be easy.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Attachments

Thanks, will then dig into the php files smile

Re: Attachments

ok ... an update report, just to tease you all wink

The rules seems to be functional, done tests with all different users for different scenarious (who that may down or upload attachments on what forum, divided in the large groups: guests, registered, moderators, admins).

The upload seems to be working just fine...  smile

I'm working on the viewtopic.php and will make the file that downloads it now ... and then it's 'only' the admin part to do smile

(did a stupid mistake though ... only added the enctype in the new thread, and not on replies ... adn I had one thread to test in ... and I just couldn't get the files to be transferred ... lol ... so now I know that I _need_ to look for more than one place to define stuff in... hehehe ... documentations would be handy smile)

Re: Attachments

Downloads functional smile

admin pages still to do, here I come smile

(oh, some things I won't do for the 1st version ... like deleting files when a post gets deleted (will do a script in admin interface, that searches for orphans) ... those small things ... that's just a little timesaver ... wait for the 2nd version if you want everything 100% functional)

Re: Attachments

Sounds excellent. I'm looking forward to testing this mod!

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Attachments

*phew* the admin pages are a ----- to make ... think I'll do a quite simplified version on the 1.0 rerlease, where one needs to write the rules with binaries ... or decimals really ... ie. 204 = mod and admins up & download ... 207=mod&admin up, all but guests download ... and such ... will make it easier to make a functional adminpage ...

furthermore ... things like browsing attachments, etc. will probably be put to unknown time ... I guess a delete is neccessary though ...

(the admin funcitons and such is actually more to code, than just the up and download, and check for rights... lol ... really didn't think it would be this much lrger.. but there's small bits and pieces in alot of php files smile)

Re: Attachments

I just thought perhaps I should write alittle changelog here ... so you all know how it's progressing smile
I don't know how much longer you have to wait, but probably not that long, as the admin interface is almost ready too ... I'm currently just finishing up all those small things, so the 1.0 release will actually be quite complete ... no 'special hardcoded' stuff of the look of it now smile

The changelog will be in the first post, and I won't bump this thread when I update it, just peak in from now and then I guess... wink

Re: Attachments

Looks great! smile

Re: Attachments

WOW! This looks awesome.

"Programming is like sex: one mistake and you have to support it for the rest of your life."


Re: Attachments


4B 65 6E 6E 65 6C 20 65 20 65 6E 20 67 61 6E 67 73 74 65 72

Re: Attachments

thnx, doing the best I can smile

15 (edited by Arne 2003-08-16 17:21)

Re: Attachments

Looking awesome! smile Congrats so far for a promising development!
Any thoughts about an estimated release date?

Cheers ~ Arne

Re: Attachments

thnx smile

Well not really ... but I've got 2 weeks of exams coming up just now, so it probably won't be ready whithin that time, as I must write the documentation how to add it also ... and that will take alittle while, but I'm still on RC2 so I will install 1.0stable later on another server and try updating that and write the docs in the same time...

but 3 weeks perhaps, but that's not a promise, just a guess, considering the time on my hands atm.

Re: Attachments

hmm... a question to you all ...

How should I implement file extention restrictions?

1. Use one ruleset over the whole forum (quickest)

2. Use one ruleset for each forum (slower, and more to administrate, but much more 'dynamic')

what do you all say? (i.e. this will be then next thing I'll dig into) smile

Re: Attachments

I definately think that a general ruleset would be sufficient. I can't even think of a situation where you would want to allow specific filetypes in different forums :-)

"Programming is like sex: one mistake and you have to support it for the rest of your life."


Re: Attachments

What do you think about a rule by status for guests, members, mods/admins?
maybe you could use that rules for different allowed file size too?

Cheers ~ Arne

Re: Attachments

hmm... no idea why I would need that, but perhaps I'll add it in a later version, the first version will have the rules you see above.

(it might require quite bit of rewriting on some parts, as the rules are saved as forum specific, not usertype specific, and as of now I'd rather finish up the 1.0 release...)

Re: Attachments

Well, you could just ignore any filetype restrictions if the uploading user is an admin/mod. That shouldn't be any problems.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Attachments

Yep, rather that I guess (a much faster script then) smile

that on the other hand might as well be included in the 1.0 release

Re: Attachments

ok ... the mod is now more or less ready for 1.0 RC 2 ... so I'm planning on installing a 1.0.1 soon and try to write the big installation instruction smile

and fix small fixes here and there, as it evolved quite alot from the first few lines of code, and remove the edit and delete rights from the guests ... so one guest cannot remove the other guests attchment, that would be odd smile

Re: Attachments

Guests can upload attachements?

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Attachments

if you allow them, yes, othervise, no smile

See the screenshots ... where one alteres the rights ... will probably write alittle comment after the guest upload, that it's _very_ insecure ... but I guess it's possible to use as an upload section if one allow everyone to upload, but only mods and admins to download. smile