Discussion
parse error, unexpected T_VARIABLE(back to index)parse error, unexpected T_VARIABLE /extensions/fb_exif.php
doesn't anybody why i get this error?
this is the script i have written but it's doesn't to work
thanks for your help really appreciated!
<?php
// fb_exif Extension
// by Donald Tetto (with modifications by James Yencken)
// http://folderblog.tetto.org/
require ("/include/exifer/exif.php");
if(($page=="main")||($page=="comments")); {
$path =($fbimage[1])
$verbose = "0";
$data = read_exif_data_raw($path, $verbose);
$fbexposure = $data['SubIFD']['ExposureTime'];
$fbexposure = reduceExif($fbexposure);
$fbexposure = "$fbexposure sec";
$fbfocallength = $data['SubIFD']['FocalLength'];
$fbaperture = $data['SubIFD']['FNumber'];
$fbcamera = trim($data['IFD0']['Make'];
$fbflash = $data['SubIFD']['Flash'];
$fbtaken = $data['SubIFD']['DateTimeOriginal'];
$fbiso = $data['SubIFD']['ISOSpeedRatings']); // not working apparently
}
$tags += array("<#fbcamera#>" => isset($fbcamera) ? $fbcamera : ""
"<#fbflash#>" => isset($data["Flash"]) ? (bindec($data["Flash"]) ? "On" : "Off") : "",
"<#fbfocallength#>" => isset($fbfocallength) ? $fbfocallength : "",
"<#fbexposure#>" => isset($fbexposure) ? $fbexposure : "",
"<#fbiso#>" => isset($fbiso) ? $fbiso : "",
"<#fbaperture#>" => isset($fbaperture) ? $fbaperture : "",
"<#fbtaken#>"=> isset($fbaperture) ? $fbaperture : "",
?>
posted by
kiki on 8 Jul 05 at 8:14 PM
You have at least one parse error right on the first if statement (check out the extra semi-colon).
posted by
donald on 8 Jul 05 at 8:18 PM
And you're missing a semi-colon on the line after that.
posted by
donald on 8 Jul 05 at 8:19 PM
Here is a version that should parse:
<?php
if(($page=="main")||($page=="comments")) {
$path = $fbimage[1];
$verbose = "0";
$data = read_exif_data_raw($path, $verbose);
$fbexposure = $data['SubIFD']['ExposureTime'];
$fbexposure = reduceExif($fbexposure);
$fbexposure = "$fbexposure sec";
$fbfocallength = $data['SubIFD']['FocalLength'];
$fbaperture = $data['SubIFD']['FNumber'];
$fbcamera = trim($data['IFD0']['Make'];
$fbflash = $data['SubIFD']['Flash'];
$fbtaken = $data['SubIFD']['DateTimeOriginal'];
$fbiso = $data['SubIFD']['ISOSpeedRatings']);
}
$tags += array("<#fbcamera#>" => isset($fbcamera) ? $fbcamera : "",
"<#fbflash#>" => isset($data["Flash"]) ? (bindec($data["Flash"]) ? "On" : "Off") : "",
"<#fbfocallength#>" => isset($fbfocallength) ? $fbfocallength : "",
"<#fbexposure#>" => isset($fbexposure) ? $fbexposure : "",
"<#fbiso#>" => isset($fbiso) ? $fbiso : "",
"<#fbaperture#>" => isset($fbaperture) ? $fbaperture : "",
"<#fbtaken#>"=> isset($fbaperture) ? $fbaperture : "");
?>
posted by
donald on 8 Jul 05 at 8:21 PM
thanks for your help
here what i'm running right now...
need to optimize the code but right it's running fine.
get the library here:
http://www.jakeo.com/software/exif/index.php
then use this php script
<?php
// fb_exif Extension
// by Donald Tetto (with modifications by James Yencken)
// http://folderblog.tetto.org/
include ("path2library/exif.php");
if(($page=="main")||($page=="comments")) {
$path = $fbimage[1];
$verbose = "0";
$data = read_exif_data_raw($path, $verbose);
$fbexposure = $data['SubIFD']['ExposureTime'];
$fbfocallength = $data['SubIFD']['FocalLength'];
$fbaperture = $data['SubIFD']['FNumber'];
$fbcamera1 = trim($data['IFD0']['Make']);
$fbcamera2 = trim($data['IFD0']['Model']);
$fbcamera = "$fbcamera1 - $fbcamera2";
$fbflash = $data['SubIFD']['Flash'];
$fbtaken =$data['SubIFD']['DateTimeOriginal'];
$fbtaken = date($fbtaken,"d/m/Y" - "H:i");
/* $fbiso = $data['SubIFD']['ISOSpeedRatings'];
$fbwhitebalance = $data['SubIFD']['WhiteBalance'];
$fbexposurecomp = $data['SubIFD']['ExposureBiasValue']; */
}
$tags += array("<#fbcamera#>" => isset($fbcamera) ? $fbcamera : "",
"<#fbflash#>" => isset ($fbflash) ? $fbflash : "",
"<#fbfocallength#>" => isset($fbfocallength) ? $fbfocallength : "",
"<#fbexposure#>" => isset($fbexposure) ? $fbexposure : "",
"<#fbaperture#>" => isset($fbaperture) ? $fbaperture : "",
"<#fbtaken#>"=> isset($fbtaken) ? $fbtaken : "",
/* "<#fbiso#>" => isset($fbiso) ? $fbiso : "",
"<#fbexposurecomp#>"=> isset($fbexposurecomp) ? $fbexposurecomp : "",
"<#fbwhitebalance#>"=> isset($fbwhitebalance) ? $fbwhitebalance : "") */);
posted by
kiki on 9 Jul 05 at 12:34 PM
Post a Reply:
(back to index)