RE: Syntax Question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Gates, Jeff [mailto:GatesJ@xxxxxx]
> Sent: Wednesday, August 03, 2011 10:23 AM
> To: php-general@xxxxxxxxxxxxx
> Subject:  Syntax Question
> 
> I, too, am a super newbie. I have a beginning knowledge of being able
> to
> "read" php and understand its syntax but I can¹t write it. This is a
> bit
> complicated but here¹s my problem:
> 
> I want to create a variable in PHP that I can use to link to an image
> in our
> museum's image website. We have done it with ColdFusion here but I need
> the
> same thing for PHP because I¹m building a site using a php-based CMS
> called
> Omeka.
> 
> In ColdFusion the variable is written:
> <cfset tmpImageDirectory = getToken(artwork.accessionNumber, 1, ".")>
> 
> Basically, it¹s saying find the image on our server by looking for its
> accession number within the year directory. Since the first part of the
> accession number is the year we got the artwork this variable is saying
> look
> for the accession number in the year directory by first looking at the
> first
> part of that accession number (the year), look in that year directory
> and
> then use the entire accession number to find the image within that
> directory.  An example of an accession number is 2011.15. That¹s saying
> that
> artwork was the 15th artwork brought into our collection in 2011. On
> our
> image server it will be found in a directory called 2011. (Am I making
> sense?)
> 
> Then the Coldfusion call is:
> 
> <a
> href="http://ids.si.edu/ids/dynamic?container.fullpage&id=http://americ
> anart
> .si.edu/images/#tmpImageDirectory#/#artwork.accessionNumber#_1a.jpg">
> (the
> 1a.jpg is simply the size image we want to call).
> 
> I need to be able to do the same thing with PHP but have no idea how.
> 
> More information: within my site I¹m housing the accession number in a
> mySQL
> database. I¹ve gotten a bit of help on this already (but not enough,
> that¹s
> why I¹m turning to you).
> 
> I was told I need to create two variables [('Dublin Core','Identifier')
> is
> the name of the field that houses the accession number):
> 
> $accessionNumber =  item('Dublin Core','Identifier');
> $tmpImageDirectory = strtok($accessionNumber,".");
> 
> And then create a third variable to create a url variable
> 
> $url =
> "http://ids.si.edu/ids/dynamic?container.fullpage&id=http://americanart
> .si.e
> du/images/
> <http://ids.si.edu/ids/dynamic?container.fullpage&id=http://americanart
> .si.e
> du/images/$tmpImageDirectory/$artwork.accessionNumber_1a.jpg> " +
> $tmpImageDirectory + "/" + $accessionNumber + "_1ajpg";
> 
> That's as far as I've gotten. I don't know how to put all of these
> together
> using proper PHP syntax. Can someone help me with this? Thanks.
> 
> Best, Jeff
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php




$url =
"http://ids.si.edu/ids/dynamic?container.fullpage&id=http://americanart.si.e
du/images/
<http://ids.si.edu/ids/dynamic?container.fullpage&id=http://americanart.si.e
du/images/". $tmpImageDirectory ."/". $artwork ."accessionNumber_1a.jpg> ".
$tmpImageDirectory ."/". $accessionNumber ."_1ajpg";

I am not sure I agree with the way you are setting the $url it looks like
you have mashed and a url hyperlink partially into 1.
Like you are trying to set the $url as a image with a link are you trying to
set a link or an image as the $url?

If you are trying to set a image as the $url do this.

$url = "<image
src=http://ids.si.edu/ids/dynamic?container.fullpage&id=http://americanart.s
i.edu/images/". $tmpImageDirectory ."/". $accessionNumber ."_1ajpg ALT=''>";

Sorry if this is not correct for what you are trying to do. I just do not
understand the intent.















-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux