Howdy,
I'd like to pull the EXIF information on my single photo pages into a PHP variable. All I need is the Model string to compare against an ifelse statement.
Thoughts?
Frankly, at this point my preference would be to use something like this PHP code block in the photo.tpl:
{php} $theimageurl = '____ need help with this _____'; $exif_model = exif_read_data('$theimageurl', 'IFD0', 0); $emodel = $exif_model['Model']; {/php}
But I need to be able to place this code snippet into the variable to give me the image URL:
{g->url arg1="view=core.DownloadItem" arg2="itemId=`$theme.sourceImage.id`"}
Any help?
enable debugging in config.php to see the smarty variables that are available in each template.
-s FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
$this->_reg_objects['g'][0]->url(array('arg1' => "view=core.DownloadItem",'arg2' => "itemId=".($this->_tpl_vars['theme']['sourceImage']['id']), 'forceFullUrl' => true, 'htmlEntities' => false), $this)
Wow -- that's really outstanding code! Very accurate! Thank you!
{php} $theimageurl = $this->_reg_objects['g'][0]->url(array('arg1' => "view=core.DownloadItem",'arg2' => "itemId=".($this->_tpl_vars['theme']['sourceImage']['id']), 'forceFullUrl' => true, 'htmlEntities' => false), $this); $exif_model = exif_read_data($theimageurl, 'IFD0', 0); $emodel = $exif_model['Model']; //example echo 'the camera model is a ' . $emodel; {/php}
for what it's worth, you can see an example of how I ended up implementing it here
Posts: 112
Frankly, at this point my preference would be to use something like this PHP code block in the photo.tpl:
{php} $theimageurl = '____ need help with this _____'; $exif_model = exif_read_data('$theimageurl', 'IFD0', 0); $emodel = $exif_model['Model']; {/php}But I need to be able to place this code snippet into the variable to give me the image URL:
{g->url arg1="view=core.DownloadItem" arg2="itemId=`$theme.sourceImage.id`"}Any help?
Posts: 6138
enable debugging in config.php to see the smarty variables that are available in each template.
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 6138
$this->_reg_objects['g'][0]->url(array('arg1' => "view=core.DownloadItem",'arg2' => "itemId=".($this->_tpl_vars['theme']['sourceImage']['id']), 'forceFullUrl' => true, 'htmlEntities' => false), $this)-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 112
Wow -- that's really outstanding code! Very accurate! Thank you!
{php} $theimageurl = $this->_reg_objects['g'][0]->url(array('arg1' => "view=core.DownloadItem",'arg2' => "itemId=".($this->_tpl_vars['theme']['sourceImage']['id']), 'forceFullUrl' => true, 'htmlEntities' => false), $this); $exif_model = exif_read_data($theimageurl, 'IFD0', 0); $emodel = $exif_model['Model']; //example echo 'the camera model is a ' . $emodel; {/php}Posts: 112
for what it's worth, you can see an example of how I ended up implementing it here