Re: Syntax Question

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

 



On 8/3/11 10:41 AM, "admin@xxxxxxxxxxxxxxxxxxx" <admin@xxxxxxxxxxxxxxxxxxx>
wrote:

>> -----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.
> 

To be honest with you, I'm not sure what that $url is supposed to do. This
is the info (albeit without any explanation) someone told me to use. But he
didn't tell me how to use it.

Basically, I need to be able to link to an image on our web server
dynamically. The structure of the web server is as I described: each image
has an accession number and each image is housed in a directory on that
server that is named the year that artwork was accessioned. We can retrieve
the accession number that is stored in the data field ('Dublin
Core','Identifier')

An example of an actual (non-dynamic) link to the image server might look
like this: 
http://ids.si.edu/ids/dynamic?container.fullpage&id=http://americanart.si.ed
u/images/2011/2011.15_1a.jpg

I just need to be able to build that link dynamically for each artwork on
the site. (Personally, I'm not wedded to the code I posted earlier if
someone can find a better way of doing it. This is just what I was told to
use. Again, I'm a newbie.)


-- 
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