JoshPet
I type Like navaho
Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
Mod Name / Version: Inline Images 3.1 <br /> <br />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). <br />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. <br />There is also a config switch to disable inline photo viewing for unregistered visitors. <br /> <br />Version 3.1 - fixes a bug where the on/off for anonymous users was not working correctly. <br /> <br />Working Under: UBB.Threads 6.2-6.3 <br /> <br />Mod Status: Finished <br /> <br />Any pre-requisites: none <br /> <br />Author(s): JustDave, ExcelsiorDDZ, JoshPet <br /> <br />Date: 04/27/03 <br /> <br />Credits: JoshPet suggested and JustDave developed for version 5. <br />ExcelsiorDDZ modified for version 6. JoshPet revised instructions for version 6.1 and 6.2. <br />JoshPet added the image width constraint ability. JoshPet added the switch for anon viewers. <br />Many others have worked on variations of this over time. <br /> <br />Files Altered: showflat.php, showthreaded.php <br /> <br />New Files: none <br /> <br />Database Altered: none <br /> <br />Info/Instructions:Version 2 adds an option to constrain the width of the attachment thus protecting your layout. <br />Version 3 adds a config switch to hide inline images from unregistered users and save your bandwidth. <br /> <br /> <br />
I installed UBBThreads 6.3 and the Inline Image Hack doesn't work. <img src="/forum/images/graemlins/frown.gif" alt="" /> Any idea why? No error message, it just doesn't work, images are still shown as Attachments only.<br />We had UBBThreads 6.2.3 before with the Inline Image Hack installed and it worked perfectly.<br />Any hint? Thanks.
[]DLWebmaestro said:<br />How many places are you going to ask this? <img src="/forum/images/graemlins/wink.gif" alt="" /> [/]<br /><br />Sorry, didn't know if this is the right place to ask, so I posted to another forum too. <img src="/forum/images/graemlins/blush.gif" alt="" />
JoshPet
I type Like navaho
Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
Make sure you add the options into the config file and define them (see the first part of the instructions).<br /><br />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
I type Like navaho
Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
Well... confession -<br /><br />It wasn't working here - and I said gee I must not have installed it.<br /><br />so I went to add it, and it was already here.<br /><br />But when I switched from using the beta forum to the real one - I needed to transfer the variable to the correct config file. <img src="/forum/images/graemlins/crazy.gif" alt="" /><br /><br />So I learned that one through experience. <img src="/forum/images/graemlins/tongue.gif" alt="" />
[]JoshPet said:<br />Make sure you add the options into the config file and define them (see the first part of the instructions).<br /><br />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. [/]<br /><br />Did as you said from the beginning but it didn't work.<br />I always read instructions very carefully. <img src="/forum/images/graemlins/wink.gif" alt="" /><br /><br />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.<br />I only hope that I didn't mess up something.<br /><br />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.<br /><br />Thanks for trying to help.
RTeam,<br /><br /> 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.<br /><br /> 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.<br /><br />$config['max_width'] = '500';<br />$config['inline_anon'] = 'yes';<br />
[]Omegatron said:<br />RTeam,<br /><br /> 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.<br /><br /> 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.<br /><br />$config['max_width'] = '500';<br />$config['inline_anon'] = 'yes';<br /> [/]<br /><br />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. <img src="/forum/images/graemlins/frown.gif" alt="" /><br />No error message but also no inline images. <img src="/forum/images/graemlins/frown.gif" alt="" /><br />The setting is "800" for width and "no" for anon images.<br /><br />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. <img src="/forum/images/graemlins/frown.gif" alt="" /> Thanks for trying to help, I really appreciate it. <img src="/forum/images/graemlins/smile.gif" alt="" /><br /><br />Maybe I just do a fresh 6.3 install and see what happens. <img src="/forum/images/graemlins/wink.gif" alt="" />
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. <br /> <br />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 <br />notice begin with the if file and copy all the way to $editlinkstart <br /> <br />
[]Omegatron said:<br />RTeam,<br /><br /> 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.<br /><br /> 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.<br /><br />$config['max_width'] = '500';<br />$config['inline_anon'] = 'yes';<br /> [/]<br /><br />I did follow the instructions by the letter, trust me. <img src="/forum/images/graemlins/frown.gif" alt="" /><br />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. <img src="/forum/images/graemlins/wink.gif" alt="" /><br />It still doesn't work, it is hopeless.<br /><br />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:<br />$config['fifth_mail'] = '';<br />Whenever I delete this line and klick the Update button, it comes back again. I don't have any other hacks installed.<br /><br />Thanks again for trying to help, I really appreciate it. <img src="/forum/images/graemlins/smile.gif" alt="" />
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.
JoshPet
I type Like navaho
Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
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.<br /><br />Don't delete the fifth mail config option - that's used by UBB.Threads 6.3. <img src="/forum/images/graemlins/smile.gif" alt="" /><br /><br />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.
foppen
Power User
Registered: 12/03/02
Posts: 68
Loc: netherlands
Hi All,<br />Yes it works but...with an error.<br />I did excactly what you said and it runs ok on my testforum at 127.0.0.1.<br />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.<br />It holds for 1 or 2 seconds and than this shows up:<br /><br />Warning: php_hostconnect: connect failed in c:\appserv\www\ubbthreads\showflat.php on line 946<br /><br />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<br /><br />B.t.w; the message and the picture are ok.<br />What can i do ?<br />
JoshPet
I type Like navaho
Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
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? <br />The changebasic uses the same 'getimagesize' command if you are allowing users to upload avatars.<br /><br />http://www.php.net/getimagesize<br /><br /><br />"Unable to open 'http://80.126.87.6/ubbthreads/bestanden/3869-logo_sm.gif' for reading"<br /><br />Leads me to believe that it's a permissions thing? Is PHP in safe mode?<br /><br />I notice in changebasic.php Scream adds a @ sign before it. I don't really know what that does. <img src="/forum/images/graemlins/tongue.gif" alt="" /><br /><br />Try in showflat and show threaded changing<br /><br />getimagesize<br /><br />to <br /><br />@getimagesize<br /><br />See if that helps.
[]Omegatron said:<br />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. [/]<br /><br />Wow, Chuck...this is a more than generous offer. Thanks a lot, I sent you a mail. <img src="/forum/images/graemlins/smile.gif" alt="" />
foppen
Power User
Registered: 12/03/02
Posts: 68
Loc: netherlands
Hi Josh, <br />Thanks for youre response, it works now ok. <br />I put a "@" before getimagesize. <br />The error message is gone away now. <br /> <br />The only thing is that it takes up to 20 seconds before the message opens and the picture shows. <br />It doesn't make a difference if it is a small or big picture. <br />Any ideas? <br /> <br />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!
JoshPet
I type Like navaho
Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
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.
[b]Hi<br /><br />Is there a way to make this hack work in one board only?<br /><br />Maybe someone has done something like this? []http://autokacik.pl/images/graemlins/niewiem.gif[/]
Mine didn't work either until I properly spaced out the variables by manually editing the config.inc.php file at the bottom. <br />Use Tabs and Spaces as shown by the example of other variables above it in the file. Use the <br /> <br />$config['ICQ_Status'] = 1; <br />$config['fifth_mail'] = ''; <br /> <br />as examples of where to use tabs and where to use spaces on the variable lines. <br /> <br />Cheers.
JoshPet
I type Like navaho
Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
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. <img src="/forum/images/graemlins/smile.gif" alt="" /> I updated my instructions. <img src="/forum/images/graemlins/smile.gif" alt="" />
donJulio
Code Monkey
Registered: 06/17/02
Posts: 682
Loc: CA, USA
This works for me in showflat, but not in showthreaded. I get this error: <br />Parse error: parse error, unexpected '<' in /home/laondal/public_html/foros/templates/default/showthreaded.tmpl on line 321 <br /> <br />The showthreaded.tmpl is attached to this post. Any help would be appreciated. Thanks <img src="/forum/images/graemlins/smile.gif" alt="" /> <br /> <br />--EDIT-- <br />I've fixed it. Never mind me <img src="/forum/images/graemlins/rolleyes.gif" alt="" />
_________________________
Too many men. There's too many people making too many problems, and not much love to go around. Can't you see this is the Land of Confusion? <img src="http://www.ubbdev.com/forum/images/graemlins/confused.gif" alt="" />
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<br /><br />1) if I put in $config['inline_anon'] = 'no';<br />it will not display them at all, not even for registered users so I have to leave it at yes.<br /><br />2) I keep getting this
Code:
">
on the right side of every image displayed.<br /><br />Thanks <br />
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.