Welcome, Guest. Please login or register.
Did you miss your activation email?
May 26, 2012, 10:12:52 AM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
155537 Posts in 21714 Topics by 7737 Members
Latest Member: chris85
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Droplet not getting the variables from commandline  (Read 507 times)
foonji

Offline Offline

Posts: 8


« on: March 26, 2010, 12:52:52 PM »


I've put together some php to get an image and extract IPTC info for the img alt to display with fancy box when it opens the image.

however I'm having problems with droplets. the script works fine on its own page, but can't get it going with droplets correctly.

Through droplets it's missing the two essential variables that are needed which are passed on through the command to call the droplet... any ideas what may be going on?

Commandline: [[imgCaption?folder=test&filename=test.jpg]]

Code:
$filename = '';
$folder = '';
$dir = '/media/blog/' . $folder . '/' . $filename;
$class = 'group';

$size = getimagesize($dir, $info);

if(isset($info['APP13']))
{
    $iptc = iptcparse($info['APP13']);
    $caption = $iptc["2#120"][0];
}
else {
$caption = $filename;
}

return '<a class="' . $class . '" href="' . $dir . '"><img src="' . $dir . '" alt="' .$caption . '"></a>
';
Logged
pcwacht
AddOn Development
*
Offline Offline

Posts: 2859



WWW
« Reply #1 on: March 26, 2010, 03:00:48 PM »

Hmm?

      $filename = '';
      $folder = '';

sets the variables wich you need back to empty...

Try leaving them out!

John
Logged

http://www.ictwacht.nl = Dutch ICT info
http://www.pcwacht.nl = My first
both still work in progress, since years.....
foonji

Offline Offline

Posts: 8


« Reply #2 on: March 26, 2010, 11:52:08 PM »

Ok thanks!! That solved it.
Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!