Firefox PHP

In-body attachment links/images (for Phorum 5.1 or later)

Posted by Maurice Makaay 
Re: In-body attachment links/images (for Phorum 5.1 or later)
September 24, 2007 07:58PM
Hi,
I changed the mod_allusers.php so that the define was before the inlcude and that did stop error messages for this. So it appears the problem was in that one in
particular.

Thanks !!
Re: In-body attachment links/images (for Phorum 5.1 or later)
October 31, 2007 12:57PM
Hi maurice and everyone else,

this is exctly what I was looking for and it works great for uploaded images,

however images that are displayed using bbcode are not limited in width size.

Yes I have tried the already made suggestions, GD is working on my server and allow_url_fopen is also turned on.

I also installed the 'BB Code always as last formatter' mod and now it seems to try to resize the external images but only displays them as broken files (i.e. in FF not at all and in IE the red X in the broken image)

I have Phroum 5.1.22 and use the embeding module to run phorum under drupal

Any suggestions. Read the whole thread nothing worked.

Tino

Discover the Divine Truth | [www.discoverthedivinetruth.com]
Re: In-body attachment links/images (for Phorum 5.1 or later)
October 31, 2007 01:01PM
oh one more small think the slimbox or lightbox display option is also not working which is not such a big problem but would be nice of course to have

Tino

Discover the Divine Truth | [www.discoverthedivinetruth.com]
Re: In-body attachment links/images (for Phorum 5.1 or later)
October 31, 2007 02:15PM
The thread and my comments in the README file are all that I know about reasons why scaling could fail. So I'm sorry, but I'm afraid I can't help you. Some debugging on your side would be needed to see exactly what is doing what in the process. If Other have ideas about why the scaling could fail, I'd love to hear about it.

I have run this module within an embedded environment myself and lightbox and slimbox were working there without problems. For this problem, the same thing applies. You'd need to do debugging on your site. Check if the javascript console displays errors for you.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: In-body attachment links/images (for Phorum 5.1 or later)
November 01, 2007 05:46PM
is there a way to easily debug the GD problem?
To me it seems it's trying to create the thumbnails but it's not working - any easy way to display the errors?

Sorry never debugged GD

regarding the Slimbox problem, yes seems I get javascript errors, but I also have a few css errors so I'll fix these first.

Tino

Discover the Divine Truth | [www.discoverthedivinetruth.com]
Re: In-body attachment links/images (for Phorum 5.1 or later)
November 01, 2007 07:14PM
An easy way? Not really. For the 5.2 version of the module, I wanted to add debugging options. This would mean creating a good trail of what is going on and saving intermediate data to see how the images are created. I don't know if I'll ever get to that ;-) For now, you'll have to follow the code and do things like checking if the file data is indeed retrieved correctly. Nothing easy though, sorry.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: In-body attachment links/images (for Phorum 5.1 or later)
November 02, 2007 07:48AM
Hi Maurice,

thanks a lot for your answers ok I'll try to debug my page but may be need a bit help. Your appreciated as always :)

Currently when I turn on resizing for bbcod img tags the source of a short post with one pic looks like this:

<div class="phorum-read_body">

     Ich meine zwar dass ich den hier schonmal irgendwo hier gesehen hab, aber falls nicht will ich ihn euch nicht vorenthalten... <img class="mod_smileys_img" src="[www.hummer-zone.com]; alt="spinning smiley sticking its tongue out" title="spinning smiley sticking its tongue out"/>
<br />
<br />
<a href="[www.hummer-zone.com]; target="_new"><img border="0" src="[www.hummer-zone.com] />
<br />
<br />
<br />
</div>

If I turn it off the same post and its code look like the following:

<div class="phorum-read_body">

     Ich meine zwar dass ich den hier schonmal irgendwo hier gesehen hab, aber falls nicht will ich ihn euch nicht vorenthalten... <img class="mod_smileys_img" src="[www.hummer-zone.com]; alt="spinning smiley sticking its tongue out" title="spinning smiley sticking its tongue out"/>
<br />
<br />
<img src="[www.hummer-zone.com]; border="0" alt="[www.hummer-zone.com]; /><br />
<br />
<br />
<br />
</div>


so the following seems to try to resize the image but fails:

[www.hummer-zone.com]

this seems to be the url of the image which is actually not working in the browser in that format :
http%3A%2F%2Fwww.hummer-zone.com%2Fdiscuss%2Ffile%2C23%2Cfile%3D123

The URL is correct but only works in the browser once cleared up. I'm not sure if it makes a difference for the script to resize it

If I type into my browser the Script URL and the cleared up img url as variable like this:
[www.hummer-zone.com]

I get the following error:
warning: imagecreatefromstring(): Data is not in a recognized format. in /kunden/102614_79279/web_hzone/phorum/mods/in_body_attachments/in_body_attachments.php on line 355.

it seems the script or GD is not able to read the format, does it have to do with the way my phorum set up uses the URLs to display images??

Using external images with the complete filename of the image in the url it works like a charm:

[www.hummer-zone.com]

I'm not sure really but I think it has to do with the script not recognizing images that have a different URL than the filename at the end of it. Help is appreciated a lot.

Tino
Re: In-body attachment links/images (for Phorum 5.1 or later)
November 02, 2007 07:53AM
ok just made another test post with an external image that seems to be resized when the clean URL is entered in the browser directly like this:
[www.hummer-zone.com]


however in the phorum itself it won't work the URL of the image is not clear and it is not working:
<div class="phorum-read_body">
     TEST
<br />

<br />
<a href="[www.tino-designs.com]; target="_new"><img border="0" src="[www.hummer-zone.com];  </div>

so for now I think it has to do with the formatting of the URL, any help on how I can change it?

Tino
Re: In-body attachment links/images (for Phorum 5.1 or later)
November 02, 2007 08:08AM
The URL in the test post source looks like this

[www.hummer-zone.com]
followed by
http%3A%2F%2Fwww.tino-designs.com%2Fimages%2Flogo_intro.jpg

if that is used in the browser the script won't rescale however if I clear it up the script will work - it is not cleared up by default

Just posted this as addittion since the formatting of my previous post might not make this clear

Tino
Re: In-body attachment links/images (for Phorum 5.1 or later)
November 02, 2007 08:12AM
Very good, this makes finding the problem a lot easier. Thanks ;)

The URLs in the scaling URL are not clear, because they are URL encoded. That is very important to be able to pass all characters through the URL, without colliding with other standard characters in the URL. It might work for you here, but it's not good to put the URLs non-encoded in the URL. So we have to figure out why the script does not turn them back into clear URLs when retrieving the request.

Funny thing is that it seems to work for me on my test forums:

5.2 test forum post
5.1 test forum post

For those pages, the scale URL contains "http%3A%2F%2Fwww.tino-designs.com%2Fimages%2Flogo_intro.jpg".

So it should be possible to get this to work. It looks like the embedding code somewhere breaks the data. Since you are running embedded Phorum, we should start with looking at the query string that is handed over to Phorum by the connector code. Can you add a print statement to che common.php file, right before "// look for and parse the QUERY_STRING", to find out what the custom query string is set to? Code could be something simple like:
print htmlspecialchars($GLOBALS["PHORUM_CUSTOM_QUERY_STRING"]);
If we know what's in this code, then we know what direction to take for searching. Forward into the in body attachment module code or backward into the embedding code.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Sorry, only registered users may post in this forum.

Click here to login