Description - Adds a File Attachment Icon to the Postlist, Show Flat and Threaded View indicating the TYPE of File that is attached. With the new download script.. you don't know what you are clicking on... a small photo... a large video file... a text file... a pdf, a File Attachment Icon will indicate what type of file is attached. In the Postlist view, the icon appears in front of the subject (in place of the standard disk). In Flat and Threaded views, it will appear next to the "Attachment" link, which also helps users find the small "attachment" link. You can edit the file types if you need to add an extension. If the file type isn't in the code, it will default to the disk icon.
Working Under - UBB.threads 6.1
Any pre-requisites - none
Author(s) - Joshua Pettit (JoshPet)
Credits - many have suggested it at ThreadsDev - I think Gardener recently suggested this more specifically
Like I said.... I don't really like the icons.... it's all I could find. Suggestions please. Also let me know if I've left out or mis categorized any file type extension.
Thank you! Filesize would be a good idea. I'll have to look at that in a revision. We have a video forum on our site.. and some of those attachments can get large for the poor folks using dial up .
Just bothering you with another question, or rather suggestion. From the description, it seems this iwll work only for attachments. But in my board, though I have the hack installed which displays attached pictures inline in the post, most of my members tend to post pictures using the [image] code -- in your future release, if you could incorporate displaying the gif in postlist even for [image] tagged pics inside a post, that will be gr8!
I'll have to see if that's doable. I don't think the postlist looks up the body of the message... although it could.... That also might be a first step at a mousover preview of the message.
2) showthreaded -- doesnt show the icon beside Attachment -- in fact, doesnt even show th eword "Attachment" any more.
3) Postlist -- absolutely no effect -- it just doesnt show any icons.
Where might I have gone wrong? I do have a hack installed which inlines all attachments and displays the image, but in showflat, both of them works together and is working fine.
Personally, I can live without the icon showing up beside "Attachment" text -- we only allow image attachments, and they are inlined anyway. But the postlist is what I desperately wanted to work.
If its any clue, I have installed the Sticky hack, and though I can Stick posts, it does not display the word "Sticky:" in front of the Subject like the code says it should. I have checked the code and found nothing wrong.
If you take the two incidences together, then in my board something is stopping anything to be displayed in front of the $subject! Any clues?
posted by crescendo: Josh, had some problems (v.6.0.1)... 3) Postlist -- absolutely no effect -- it just doesnt show any icons.
Sounds like you figured out all the problems except Postlist.
I revised the postlist instructions (for 6.0.x) and will repost below... as version 1.2.
In 6.1 Rick is already checking the database to see if there's a file.. as he does the disk icon thing... but not in 6.0.x.... so we need to add that in.
Download 1.2 and note the 2 new lines to change (Adding $file to the database query) in postlist.php and you should be all set.
Sorry.... didn't test for 6.0.x and have begun to lose track of what were features and what were hacks.
posted by omegatron: How come when I take a look at your hack instructions none of the lines you say are in the files are actually in the files?
They do not exist in version 6.1 of files. Is this hack an add-on of another hack I need to do?
I just looked at your site.... you're running 6.0.3.
The instructions at the begining of the hack are for the newly created.... 6.1 BR1...came out just a couple of days ago.
If you need instructions for 6.0.1, 6.0.2, and 6.0.3... the instructions come AFTER the 6.1 instructions (as I added them for crescendo). Read past the 6.1 instructions if you're not running 6.1 BR1 yet.
Whooooohooo...I got it working finally (6.0.1) -- bless you Josh!!
OK, there was still a 'wee bit' of crease in the text of v1.2 -- confusion between $File and $file (yes, just uppercasing all Fs wherever there is "$file" solved the problem with postlist!!)
I am taking the privilege of uploading the corrected instruction -- please note that this is entirely Joshpets creation, I have merely corrected some minor errors in the UBBT6.0.x instructions
I've added the ability for it to display in showflat and showthreaded the size of the Attachment in Bytes, KB or MB (whichever is the most logical). Thus users can not initiate the download of a large attachment if they have a slow connection.
posted by crescendo: Just bothering you with another question, or rather suggestion. From the description, it seems this iwll work only for attachments. But in my board, though I have the hack installed which displays attached pictures inline in the post, most of my members tend to post pictures using the [image] code -- in your future release, if you could incorporate displaying the gif in postlist even for [image] tagged pics inside a post, that will be gr8!
Just re-read this thread and was reminded of this request... I think this has merit too, to allow for inline photos.
I'm not sure if it's do-able (at my level)... I'm new to this but learning fast... but I surprised myself today in figuring out the filesize thing..... so I will look and see if i can make this work.
I think mod has some great potential...I am especially liking the addition of the filesize.... you should be able to see what lines were new in the instructions if you wish to add that in.
If anyone finds some better images (or feels creative) that would better fit with the size and theme of threads....please post them.
Well it is actually very doable. I have both hacks installed together fine. Here is the code below. You will see I did not delete the initial hacks code so the pics are still displayed inline.
Thats right Josh. Omegatron: this hack works perfectly with inlined "Attached" images, as you say...even I have both installed and working together. All you have to do is correctly identify where to replace or insert the codes keeping the inlining code intact. I was specifically looking for this to work with [image] tagged pictures too.
It offers 2 alternative icons for Zip and Movie files.
It fixes a bug in the filesize calculation that wasn't working correctly if the file name had spaces or special characters. Thanks to Dave_L for helping me with this.
It fixes a bug where .RAM files (video) were showing as a sound file because .RA came first in my list.
Enjoy! Seems to be working well on my 6.1 br1 board which has now gone live.
[]most of my members tend to post pictures using the [image] code -- in your future release, if you could incorporate displaying the gif in postlist even for [image] tagged pics inside a post, that will be gr8!
I haven't forgotten this..... but I don't think it's possible.
The post is stored with the <img src tag in the database. If you were to say "if the body contains img src tag...then display the photo image in the subject... it would do so for graemlins as well.
Don't know of a way around that. They are images too.
If I had a photo icon in each post when graemlins were used.... every post would have one.. and it would be worthless. <SHRUG>
One way could be to add a field in the table which can be 1 or 0 and is set when the post is made. If there is an image-tag in the post, the value of the field is set to 1. Then you would only have to check this variable in the postlist.
I'm kinda bored, might start farting around with this one. I would do it with no database alterations though. More code to add in, but less intrusive if you remove it later on.
I got this working, but it's only searching the first post for the <img> tag so far. I need to have it ignore graemlins and see if I can get it to look at the other post bodies as well. May just let it look at the first, since that seems more doable and far less strain on the server.
I just finished a hack to show an image in the supject on the postlist.php page for posts that have an image inserted in the body on the initial post. It is located here.
It just seemed like too much server load to have it hunt down every reply and search through them...
The post is stored with the <img src tag in the database. If you were to say "if the body contains img src tag...then display the photo image in the subject... it would do so for graemlins as well.
Don't know of a way around that. They are images too.
Josh, thee graemlins are stored in a specific directory, isnt it? Cant we make the script ignore any img src tag pointing to that directory?
I mean, when I thought of this, I too was exactly foxed by "what to do with graemlins?", but this seems to be the simplest way, if its possible.
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.