Description: This hack will display the attached image in the body of the post, provided that the attachment contains the correct extensions (jpg,gif,png). 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. There is also a config switch to disable inline photo viewing for unregistered visitors.
Version 3.1 - fixes a bug where the on/off for anonymous users was not working correctly.
Working Under: UBB.Threads 6.2-6.3
Mod Status: Finished
Any pre-requisites: none
Author(s): JustDave, ExcelsiorDDZ, JoshPet
Date: 04/27/03
Credits: JoshPet suggested and JustDave developed for version 5. ExcelsiorDDZ modified for version 6. JoshPet revised instructions for version 6.1 and 6.2. JoshPet added the image width constraint ability. JoshPet added the switch for anon viewers. Many others have worked on variations of this over time.
Files Altered: showflat.php, showthreaded.php
New Files: none
Database Altered: none
Info/Instructions:Version 2 adds an option to constrain the width of the attachment thus protecting your layout. Version 3 adds a config switch to hide inline images from unregistered users and save your bandwidth.
It`s show 1) images 2) images as link (open in new window ) when filewidth > $config['max_width'] 3) button to attachment in body and open in new window
I installed UBBThreads 6.3 and the Inline Image Hack doesn't work. Any idea why? No error message, it just doesn't work, images are still shown as Attachments only. We had UBBThreads 6.2.3 before with the Inline Image Hack installed and it worked perfectly. Any hint? Thanks.
Make sure you add the options into the config file and define them (see the first part of the instructions).
It uses 2 config variables to determine maximum width and if anonymous users can see them inline - if you don't add the options to the config file - then nothing appears.
[]JoshPet said: Make sure you add the options into the config file and define them (see the first part of the instructions).
It uses 2 config variables to determine maximum width and if anonymous users can see them inline - if you don't add the options to the config file - then nothing appears. [/]
Did as you said from the beginning but it didn't work. I always read instructions very carefully.
I then took the old showthreaded.php and showflat.php files from my 6.2.3 backup, copied the modified stuff out of it and pasted it into the new 6.3 files. Voila...it worked. I only hope that I didn't mess up something.
Unfortunately I didn't have the time to make a comparison between the files but if you want me to (I don't know if Infopop allows sending files from UBBThreads), I can send you my showthreaded.php and showflat.php files via eMail.
I will concur what Josh has already stated. Follow the instructions to the LETTER. This is quite an easy hack and is working fine on mutliple sites.
If you took the old code from 6.2.3 files and pasted it and it worked then your error is as Josh stated. You did not add the config options under your config menu in admin section. That is the change in the code between the old and new version. The new version allows some config options the old one did not. They are defined by the lines below added to the end of config file in admin section.
I will concur what Josh has already stated. Follow the instructions to the LETTER. This is quite an easy hack and is working fine on mutliple sites.
If you took the old code from 6.2.3 files and pasted it and it worked then your error is as Josh stated. You did not add the config options under your config menu in admin section. That is the change in the code between the old and new version. The new version allows some config options the old one did not. They are defined by the lines below added to the end of config file in admin section.
I took the "old" code from 6.2.3 after it didn't work with the 6.3 code. I followed it to the letter, looked up every single line and it doesn't work. No error message but also no inline images. The setting is "800" for width and "no" for anon images.
The first thing I learned after using UBBT and applying hacks from you PHP genius guys at Threadsdev is to read the instructions very carefully. It always worked but now I'm getting a little bit desperate. Thanks for trying to help, I really appreciate it.
Maybe I just do a fresh 6.3 install and see what happens.
Rteam let me see if this helps. You see my config options. They go into the config options on the bottom of the admin config screen in unknown variables section.
Here is the code from showflat.php I will paste a beginning line and end line so you know where to copy and paste from notice begin with the if file and copy all the way to $editlinkstart
I will concur what Josh has already stated. Follow the instructions to the LETTER. This is quite an easy hack and is working fine on mutliple sites.
If you took the old code from 6.2.3 files and pasted it and it worked then your error is as Josh stated. You did not add the config options under your config menu in admin section. That is the change in the code between the old and new version. The new version allows some config options the old one did not. They are defined by the lines below added to the end of config file in admin section.
I did follow the instructions by the letter, trust me. I'm working in a business where not following instructions by the letter could kill people, so I think I know what "by the letter" means. It still doesn't work, it is hopeless.
There is however a strange thing which might have something to do with my problem: in the config section (from Admin Config menue), I get another line of code: $config['fifth_mail'] = ''; Whenever I delete this line and klick the Update button, it comes back again. I don't have any other hacks installed.
Thanks again for trying to help, I really appreciate it.
The fifth mail config item will not cause any problems. If you cut and paste what I posted above and place the config options in it should work. The only other way I can help you is if I do the modification myself for you. Contact me privately if you wish me to get this working for you.
Yeah, we are using this on alot of sites - this one being one of them - and it really hasn't changed that much over the years. My guess is you are missing something.
Don't delete the fifth mail config option - that's used by UBB.Threads 6.3.
Are you seeing those other 2 config options in that extra area as well ? Or are those gone each time you go back to the config file? My thought being if your config file isn't writable - the changes aren't getting saved.
Hi All, Yes it works but...with an error. I did excactly what you said and it runs ok on my testforum at 127.0.0.1. But as soon as I do it on the online machine both adresses (inside 127.0.0.1 and outside gives an error as soon as i open the message. It holds for 1 or 2 seconds and than this shows up:
Warning: php_hostconnect: connect failed in c:\appserv\www\ubbthreads\showflat.php on line 946
Warning: getimagesize: Unable to open 'http://80.126.87.6/ubbthreads/bestanden/3869-logo_sm.gif' for reading. in c:\appserv\www\ubbthreads\showflat.php on line 946
B.t.w; the message and the picture are ok. What can i do ?
Looks like the server isn't liking the "getimagesize" command - not sure why a server would do that. Unless there are directory restrictions in place? The changebasic uses the same 'getimagesize' command if you are allowing users to upload avatars.
[]Omegatron said: The fifth mail config item will not cause any problems. If you cut and paste what I posted above and place the config options in it should work. The only other way I can help you is if I do the modification myself for you. Contact me privately if you wish me to get this working for you. [/]
Wow, Chuck...this is a more than generous offer. Thanks a lot, I sent you a mail.
Hi Josh, Thanks for youre response, it works now ok. I put a "@" before getimagesize. The error message is gone away now.
The only thing is that it takes up to 20 seconds before the message opens and the picture shows. It doesn't make a difference if it is a small or big picture. Any ideas?
And to be honest: i really have no idea if php is running in safe mode. I just insalled it and an apache server and was surprised that it worked!
Yeah - the @ will surpress the warning that it wasn't allowed to get the filesize of the image - my guess would be permissions or a directory restriction in php which is preventing it from being able to read the size of the images.
Mine didn't work either until I properly spaced out the variables by manually editing the config.inc.php file at the bottom. Use Tabs and Spaces as shown by the example of other variables above it in the file. Use the
Thanks guys - I fixed the instructions for the config variables. I was using the wrong quotes - which the online editor for the config file didn't like. I updated my instructions.
This works for me in showflat, but not in showthreaded. I get this error: Parse error: parse error, unexpected '<' in /home/laondal/public_html/foros/templates/default/showthreaded.tmpl on line 321
The showthreaded.tmpl is attached to this post. Any help would be appreciated. Thanks
Now that I have upgrated to 6.3.2 I am able to retain the settings when adding the variables, I was having trouble with that before. I installed the inline image hack and still have these two issues, this has been the case for 6.2.3 and 6.3.2
1) if I put in $config['inline_anon'] = 'no'; it will not display them at all, not even for registered users so I have to leave it at yes.
Sounds like you either left out or added a character in your code. Go back over your showflat and showthreaded files and make sure you have EXACTLY what Josh put in his instructions.
I re-installed it from scratch after I upgraded with the exact same issues. Obviously it's something that I am doing because I am the only one having it. I don't mind the "> so much (I looked at all the code and the closing statements are all in there) but I would like to be able to set $config['inline_anon'] = 'no'; and have it work.
Looking at your HTML, I am guessing that they are not as the width is not shown at all in your HTML code. So also make sure the width variable is set in the config.
for some reason this won't work for me, no error messages, but my attachments just stay as attachments and don't actually display.... any ideas? thanks very much.
Josh, I get this error from time to time and anytime there is an image attached and the threads usually take for ever to load whether I get the error or not, any ideas on this?
Warning: getimagesize(): php_network_getaddresses: getaddrinfo failed: Name or service not known (is your IPV6 configuration correct? If this error happens all the time, try reconfiguring PHP using --disable-ipv6 option to configure) in /home/vhfansco/public_html/boards/showflat.php on line 975
Warning: Cannot modify header information - headers already sent by (output started at /home/vhfansco/public_html/boards/showflat.php:975) in /home/vhfansco/public_html/boards/ubbt.inc.php on line 236
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.