Description: This hack will display the attached image to registered users that are loggin in provided that the attachment contains the correct extensions. The Photo will appear below the body of the message. It will also be constrained to a maximum width that you define, to avoid large images being posted and messing up your layout.
Info/Instructions: Minor instructions update for 6.5 - Also in 6.5 we can't add custom config variables, so in these instructions they are added into the main.inc.php file manually.
Disclaimer: Please backup every file that you intend to modify. If the modification modifies the database, it's a good idea to backup your database before doing so.
Note: If you modify your UBB.Threads code, you may be giving up your right for "official" support from Infopop.If you need official support, you'll need to restore unmodified files.
Hmmm it's not working for me.... but where could be the problem ?
Important thing: the attached jpg image is not even being uploaded. I've set the permissions for my upload dir to 777 where else could I look ?
Thanks
Update: I just uninstalled this mod and it seems the upload doesn't work at all... Which file is responsible for the file upload ? Update 2: Stupid me. I was using a wrong path to my upload dir in de configpanel! It's working now!
But is there a way to restrict download to registered Users only? I tried your old hack adding to download.php the following line:
if ((!strstr($user['U_Groups'],"-5-")) && (!strstr($user['U_Groups'],"-8-"))) { $html = new html; $html -> not_right("You are not authorized to download.",$Cat);}
It works but with a little bug: inline pictures can be viewed by registered Users but when they click on the Attachment link, they get the same "You are not authorized to download" message.
[]JoshPet said: This mod already has that functionality built in.
Where you put this:
$config['inline_anon'] = 'yes'; // Allow anonymous users to see inline images
Set that to 'no' so that anonymous users won't see inline images. [/]
Oh boy, my English really sucks, sorry guys.
What I actually needed help for is the bug of this mod: even registered Users who are logged in can't download Attachments, they can just see the inline picture but Attachment download is not possible for them. Any hint? Thanks and sorry for the confusion.
[]JoshPet said: I'm confused. This mod doesn't do anything at all to the download.php file - this only displays attachments inline.
I'd try re-uploading a clean copy of download.php from your UBBThreads zip. [/]
I'm even dumber than I thought, I forgot to mention that I'm using the download restriction too. Sorry, Josh...this wasn't my day today.
So I guess the problem lies with the download.php mod.
Stupid question: may I contact you via PM to ask you about some mods and a photopost integration? Of course not for free, I'm thinking about hiring you.
I often post little Flash movies and added some code to display them inline as well. I'm not sure about the etiquitte of modding mods, so I'll post this and you all can change it or do with it as you see fit.
What if I wanted to leave the images as they are with no restrictions as to what they are or who can view them. but add the ability to use .swf or .fla in their custom sig?
Dr C, I'm not sure about that. If you allow html in the sigs, they could just embed the flash object themselves, but if you want to allow them to upload a flash object and have it display automatically, or even just have an interface for them to enter the url and have embed code generated, that's a little beyond my meager skillz at the moment.
Hey I have a weird problem which i'm not sure why it would happen.
Going off the instructions (and verifying afterwards) I get this error on my site now. (Luckily it's a new unpublished site right now.)
Code
[:"red"] <br />Warning: main(/ubbt.inc.php): failed to open stream: No such file or directory in /home/iraqiins/public_html/ubbthreads/includes/main.inc.php on line 13<br /><br />Warning: main(/ubbt.inc.php): failed to open stream: No such file or directory in /home/iraqiins/public_html/ubbthreads/includes/main.inc.php on line 13<br /><br />Warning: main(): Failed opening '/ubbt.inc.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/iraqiins/public_html/ubbthreads/includes/main.inc.php on line 13<br /><br />Fatal error: Call to undefined function: getmicrotime() in /home/iraqiins/public_html/ubbthreads/includes/main.inc.php on line 16<br />
[/]
Line 13 is this: [:"blue"] include("$thispath/ubbt.inc.php");[/]
Line 16 is this: [:"blue"] $timea = getmicrotime(); [/] (The original lines in main.inc.php)
My site worked before installing and looking at your script I didnt notice anything that should affect the calls in ubbt.inc.php.
Any idea why this would happen? The only mod my ubbt.inc.php has is the one needed for Josh's Who's Online mod. Which, the Who's Online mod and my whole site worked fine after testing that. Once I put in this mod my site gets the above errors.
* Buddy, if you are using a different build of threads than I am, or if the code is calling variables that aren't in your database (due to added mods or mods that you haven't added yet) that might be it. Hopefully you have a backed-up version of things that you can revert to until an answer comes. Sorry I'm not more help here...
Well I even tried putting the original ubbt.inc.php file back but i get the same results. This error started after I uploaded the main.inc.php. I dont see how it's possible for it to cause those errors though.
I'm in no real hurry to get the site up. Just a side project i'm doing while i'm in Iraq. If Josh or someone doesnt know then i'll just start from scratch.
Thanks Josh for helping me with this. We ended up having to bypass the getimage function - which unfortunately gives us no control now over image size, but at least it works.
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.