FB and other url querystrings

Page: 1

Author Post
I am so grateful for Floatbox.!

I am trying to use it to display ajax generated text. I can get it to work with a plain html file and a plain php file but not with a url to a php file that contains a querystring:

<a href="exif-pop-up.php?pic=pic_8" rel="floatbox" rev="type:ajax width:400 height:300 scrolling:no">

I suspect that the querystring feature of FB may be interfering with my pic querystring getting to the script. If so, any way around this? Thanks for your time.
Registered: Aug 2008
Posts: 3382
Hi Troutster.
No query strings were harmed in the making of floatbox. It doesn't do anything to them nor interfere with them nor modify them in any way. The only interaction is a quick read of the host page's query string to see if there's any juicy floatbox options in there.

I set up a little php/ajax/querystring test at the top of the demo page on the test instance of my site. http://test.randomous.com/tools/floatbox/demo.php. It works fine.

The anchor is simply:
<a href="ajaxqry.php?foo=bar" rel="floatbox" rev="type:ajax">Ajax query string test</a>

The php file in its entirety is:
<?php echo '<p>Apparently, foo = "'.$_GET['foo'].'"</p>'; ?>

It works like a hot damn every time.
I think your problem must lie elsewhere.

But let me hijack your topic here a bit. I'd be interested in a good little php exif info display widget. If you've got something that you think is quality it would be great if you wouldn't mind sharing it with me. Hell, I'd even give you a free copy of the next version of floatbox in exchange. :P

EXIF display is one of my main motivations for adding in the "Info..." capability to floatbox. Add a rev tag something like the following to your main image link and Bob's yer uncle.

rev="info:`exif-pop-up.php?pic=pic_8` infoText:EXIF... infoOptions:`width:600 height:400`"

OK, I finally figured it out:
For some reason the FB js strips off anything after a period in the query string. I'm sending "me_and_the_queen.jpg" and I'm getting "me_and_the_queen". I can work around it.

Try changing your test link to:

<a href="ajaxqry.php?foo=bar.jpg" rel="floatbox" rev="type:ajax">Ajax query string test</a>

and when you click it you just get "bar" back, not "bar.jpg"

At least I do in my set up.

I'm pretty sure you can have '.' s in querystrings, I do it a lot. This worked in other litebox type js libraries.

As to the exif script. I would be happy to share whatever I come up with. Right now I'm using exifer and am going to also try PEL. It apparently is not trivial to come up with a catch all script because of the vast number of variables and small format variations by manufacturers. Whatever I come up with would just build on these I think, since they are available, and not re-invent the wheel. But I must say, I'd obliviously have a hard time meeting your level of quality!

Being able to click and optionally see the exif data is what I'm trying to do too. Having it mechanized the way you plan to would make things easier.
Registered: Aug 2008
Posts: 3382
foo = "bar.b.que" is working fine for me.
foo = "bar.jpg" is giving me grief.
I'll get back to you...
Registered: Aug 2008
Posts: 3382
You have fallen victim to two stupid mistakes in the floatbox code. Either bug alone would not have created a problem for you.

The first is that the regular expression used to detect images is flawed. The .jpg at the end of the query string confuses it and the type detection based on file name reports your href as an img.

The second error was a failure to let the type parameter in the rev attribute always take precedence.

These two together makes ajaxqry.php?foo=bar.jpg try to load as an image, which of course fails.

This is fixed in the next version. Until then, I think there's two good choices for you. One is to do something like put a underscore on the end of your query strings and then strip it off in the php code. "?x.jpg_". That will get past the jpg detector. The other one is to grab the working copy of the next release off my test site and use that until the official release. http://test.randomous.com/floatbox/

Apologies for eating up your time with these errors, and thanks for your help in tracking them down.
Thanks for finding and fixing this so fast. Hand it to me to uncover obscure bugs.

I tried your working copy and it works fine so I don't have to do the work around.

regular expressions, don't get me started.

I'll let you know when I have a decent exif script.

Page: 1