Previous Thread
Next Thread
Print Thread
Rating: 16
Page 2 of 3 1 2 3
Joined: Sep 2003
Posts: 16
Newbie
Newbie
Offline
Joined: Sep 2003
Posts: 16
I just installed this and it doesn't seem to be working quite right. I have to set the inline_anon variable to "yes" or it doesn't show up to anyone--even registered members. If I set it to "no" the file just shows up as a normal attachment.

Sponsored Links
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
I'd double check your changes to the actual showflat/showthreaded files then..... make sure you'd copied and replaced all the code correctly.

Joined: Sep 2003
Posts: 16
Newbie
Newbie
Offline
Joined: Sep 2003
Posts: 16
I looked at the code, and I changed this line:

if ($config['inline_anon'] == "yes") {


to this:

if (($config['inline_anon'] == "yes") && ($Groups != "-4-")) {


It works fine now. The inline_anon variable isn't much but a way to toggle this feature on/off though. I am guessing something changed in one of the versions prior to 6.3.2 to prevent the inline_anon feature from working right. <shrug> I dunno. Anyway, ericgtr, try this out. It solved my problem, and I was having the exact same problem that you were (with inline images only working if inline_anon was set to 'yes').


Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
Thanks for the tip. I am still having problems with it loading, it's off and on so it's inconsistent. Omegatron offered a helpful suggestion and though it appeared to work at first it eventually went back to taking 20 or 30 seconds to load up a thread with an inline image attached, I am sure this is taxing the server pretty good too during this time.

I uninstalled and re-installed it a few times to ensure I wasn't messing up some place, it's a pretty basic install. For now I will wait until everything's worked out with this hack before re-applying it

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
It depends on the size of the attachment. If you are allowing a huge attachment - just because the width is constrained in the image... it still has to load the full size image. So indeed, if they are large images, particularly if there are multiple attachments in one thread - it can really take a while to load and drive up your bandwidth.

Make sure you adjust the maximum allowed filesize in the upload section of the config file to keep people from uploading anything too big.

Sponsored Links
Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
I was experiencing it even with smaller images, even then with a single small image in the thread it would load fast some times and not others which is odd. This also happened to me on a different host when I ran an older version of threads.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Hmm.... could be a server issue. it's not anything complicated about the mod.

It simply adds an <img src= tag to the end of your post with the URL to the attachment, just as if someone had included it in their post.

There's no extra queries or anything. So it'll be as fast as the server's ability to load images.

Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
That's my first thought as well, I hate to tax it unnecessarily. Could it be that it's a combination of queries and tags that aren't working well together? Just a shot in the dark there, it's odd that it's happening like this on two different hosts.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
No, it's literally the same as if they had put the HTML (or image tag) in their post.

Very odd. We're using it here.... I'd venture to say I'm using it at 30+ sites. It's probably one of the most popular modifications.

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
This hack as Josh says works on many many sites Most error's I have seen are hacking error's as can be read over and over in this thread or one minor error with GD imagegif

Sponsored Links
Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
Well, my apologies for making it sound as if it's not working correctly. No telling what other mods I have running that may be getting in the way. I have seen it on other threads sites and it appears to be working great for them.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
It's just odd that it is slow for you. I can't imagine why it would be slower than if you had put the image in the post.

If I think of anything, I'll let you know.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
OK - Now I see what you are saying.... it's not correclty turning on/off for anonymous users.

I fixed the instructions as version 3.1. which fixes that issue.

And as stated.... this works with UBB.Threads 6.4.

Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
I had one of my moderators pose the following question:

[]
Is it possible for there to be a check box option that will not automatically show the attachment to a post? While the vast majority of posts would work fine with the automatic insert and it is nice to see the pics automatically instead of having to click on them, sometimes you may want to position the attachment(s) manually by using the img tags to help illustrate a point (look at the Tuning MTS snares thread) and having the pic appear twice (once where you position it and once at the bottom of the post) is a waste of space. It can be set to default so that it automatically shows the pic at the end, but it would be nice to be able to disable that function.
[/]

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
How about adding a special IMG-tag to insert an attached image? Either something like [img]attachment[/img] or something like [imageposition]. The hack could check for this ubbcode in the body and if it exists replace it with the image, otherwise it adds the image at the end.

Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
That sounds like it could be a bit over my head, but it's a good idea that's worth tinkering with!

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
Here's something to get someone started:

Replace this (in showflat):
Code
				 if ($filewidth[0] > $config['max_width']) {				 <br />	                 $TempBod .= "<br /><br /><IMG SRC=\"$config[fileurl]/$File\" width=\"{$config['max_width']}\" Border=\"0\" alt=\"{$ubbt_lang['FILE_ATTACH']}\">";<br />				 }<br />				 else {<br />	                 $TempBod .= "<br /><br /><IMG SRC=\"$config[fileurl]/$File\" Border=\"0\" alt=\"{$ubbt_lang['FILE_ATTACH']}\">";<br />				 }


With this:
Code
				 if ($filewidth[0] > $config['max_width']) {				 <br />	                 $imagestring = "<br /><br /><IMG SRC=\"$config[fileurl]/$File\" width=\"{$config['max_width']}\" Border=\"0\" alt=\"{$ubbt_lang['FILE_ATTACH']}\">";<br />				 }<br />				 else {<br />	                 $imagestring = "<br /><br /><IMG SRC=\"$config[fileurl]/$File\" Border=\"0\" alt=\"{$ubbt_lang['FILE_ATTACH']}\">";<br />				 }<br />				 if ( !strpos($Body, "[imageplacement]") ) {<br />				 	$TempBod .= $imagestring;<br />				 } else {<br />				 	$TempBod = str_replace("[imageplacement]", $imagestring, $Body);<br />				 }


I haven't tested this, but if it doesn't work it's at least a place to start. If it does work, the corresponding code in showthreaded would have to be changed as well.

Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
Would you be so kind as to walk me through the lines of code you added.

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
Sure.

I'll only comment changed lines.

Code
$imagestring = "<br /><br /><IMG SRC=\"$config[fileurl]/$File\" width=\"{$config['max_width']}\" Border=\"0\" alt=\"{$ubbt_lang['FILE_ATTACH']}\">";

I just add the image code in a variable instead of adding it to the body.

Code
$imagestring = "<br /><br /><IMG SRC=\"$config[fileurl]/$File\" Border=\"0\" alt=\"{$ubbt_lang['FILE_ATTACH']}\">";

Same thing here. This line is for when the image doesn't need to be resized.

Code
if ( !strpos($Body, "[imageplacement]") ) {

From here on, all lines are new. This line checks if the string "[imageplacement]" is somewhere in the body.

Code
$TempBod .= $imagestring;

No image placement tag found, so we just add the html code for the image, which we've already placed in the $imagestring variable, at the end of the message body.

Code
$TempBod = str_replace("[imageplacement]", $imagestring, $Body);

The [imageplacement]-tag was found, so we replace that with the html code for the image, which we have in the variable $imagestring.

BTW, does it work?

Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
I haven't tried it yet since I don't fully understand how to use it. Are you saying that this code will create a new UBBCODE [imageplacement]? If so, how exactly would it be used?

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
After you've installed the Inline Image hack you can replace the lines I showed in both showflat and showthreaded with the new lines.

You will now have the possibility to add the text "[imageplacement]" anywhere in your post and if an image is attached to the post, the image will be placed in place of that text instead of added at the end of the message.

Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
Ahhh.....

[rushes off to try]

Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
It worked!

Muchos Gracias!

Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
Oh, I've made a small cosmetic change...

I took out the <br /><br /> if the image is not bigger than the max_width.

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
Great! If someone feels so inclined they can add this to the instructions of the mod. =]

Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
I have been working a little bit with this to try and get it going again. I think I have it narrowed down, when I apply the hack according to the instructions it displays the image as it should but I get an open tag
Code
 "> 

right next to every image that is attached on the right. This happens no matter how many times I undo and re-apply, I can't seem to find it. I have a feeling this is what is causing the images to load extremely slow.

Joined: Mar 2001
Posts: 145
Member
Member
Offline
Joined: Mar 2001
Posts: 145
Is there a way to get this working with remote loaded images? It seems like the idea is there, but I really would like to restrict images to a certain size that are loaded with the {img} tag.

As I run a game site, folks tend to put a lot of game screenshots at 1280x1024 in there which totally breaks my site's formatting.

Any ideas?

Joined: Jan 2004
Posts: 20
User
User
Offline
Joined: Jan 2004
Posts: 20
I want to install this - but it looks like trouble - it the version posted for download the most current??

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
he he
Read the subject. The version posted is for 6.2 6.3 and 6.4. The modification information for all the mods here is very detailed.

Joined: Jan 2004
Posts: 20
User
User
Offline
Joined: Jan 2004
Posts: 20
this worked wonderfully for me and I just started today

Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
When, oh when, will this hack and the online extra info gonna be a part of the stock Threads scripts?!

Well Done Josh!

Joined: Mar 2001
Posts: 145
Member
Member
Offline
Joined: Mar 2001
Posts: 145
I've been using this mod on my board for some time now, and it's worked well.

However, yesterday I noticed that the inline images while being displayed are no longer being constrained. I checked - the variable in my admin area is still there for a width of 625. I posted an image attachment with a width of 800, and it's showing it as that. Looking at some older ones, it's not restricting them either.

I haven't changed the board's code in awhile - most definitely not anywhere NEAR when this happened. I'm at a loss as to where to even begin to look to try and resolve this.

Ideas?

Edit: After thinking, I did last week implement an anti bandwith leech thing on our server, but the inline images thing still worked fine for a week and a half until yesterday. Not that I can see where this would have anything to do with it anyway. Just thought I'd mention it, as it's the only server change I've made in quite awhile.

Last edited by Joe Siegler; 03/05/2004 12:23 PM.
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Has anything changed on your server - this uses getimagesize() to find the real width. If it fails - the error is surpressed and there is no size used in the HTML.

If you want to see if getimagesize() on your server is throwing any kind of errors, in the code you can look for @getimagesize and remove the "@" (which surpresses the error).

But if this PHP function isn't working for you - my guess...it's either a server thing or a PHP configuration thing.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Oh and if getiamgesize is throwing some kind of error - sometimes that can be permission related as well.

Joined: Mar 2001
Posts: 145
Member
Member
Offline
Joined: Mar 2001
Posts: 145
I found out what the problem is - but I'm not sure how to fix it.

I remembered one thing I did recently. I implemented .htaccess rules to prevent people from stealing our bandwith. It replaces a call to that with another image.

Turning this off appears to fix the problem. I removed the .htaccess file, and this worked again. Put it back, it can't figure out the images.

Problem is I don't know how to get around it. I really want the .htaccess image block in there to conserve bandwith, but I also want this working. Any thoughts as to where to look?

Joined: Nov 2002
Posts: 554
Code Monkey
Code Monkey
Offline
Joined: Nov 2002
Posts: 554
Joe would you mind sharing the .htaccess rule. I am looking for something along that line.

Joined: Mar 2001
Posts: 145
Member
Member
Offline
Joined: Mar 2001
Posts: 145
[]ChAoS said:
Joe would you mind sharing the .htaccess rule. I am looking for something along that line. [/]

Done. Check your PM's - I'd rather not start up a conversation about .htaccess in the middle of a thread about something else; I'm pretty anal about keeping threads on topic.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
I'm not really an expert with htaccess stuff like that. So I'm not sure. Basically the question you want to ask - is how can you block hotlinking without messing up php's getimagesize() function.

Joined: Mar 2001
Posts: 145
Member
Member
Offline
Joined: Mar 2001
Posts: 145
[]JoshPet said:
I'm not really an expert with htaccess stuff like that. So I'm not sure. Basically the question you want to ask - is how can you block hotlinking without messing up php's getimagesize() function. [/]

Yeah, that appears to be what I'm asking.

I've always been told I tend to be too verbose for my own good.

Joined: Dec 2003
Posts: 107
Journeyman
Journeyman
Joined: Dec 2003
Posts: 107
Great mod! Took less than three minutes to install (literaly) and works like a charm!

Page 2 of 3 1 2 3

Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Posts: 70
Joined: January 2007
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240430)