Java?  Clearly there is no Java there.  A dead giveaway is this line
  if( Len(objProduct.getImage2()) GT 0 ) 
No respectable language like Java uses GT! haha!  j/k

This is cfscript.
http://livedocs.macromedia.com/coldfusion/6/Developing_ColdFusion_MX_Applications_with_CFML/CFScript.htm

DK

On 7/27/06, Robert Reil < [EMAIL PROTECTED]> wrote:

Good stuff all of you.

However if I want to put 3 steps in there the middle step would be

<cfelseif> correct?

 

I am also a little uneasy about what seems like multiple languages.

It seems that the orgininal code is in Java (?).

 

How will I imbed the CF into that language?

 

Ex:

<!--- Does the file exist on the server's file system? --->

<cfif FileExists("C:\www\images\picture.gif")>


    <!--- The file does exist, so let's show the picture ---->

    <img src="">
<cfelseif> <!---is this right???--à

   
    <!--- The file does not exist, let me show you an alternate picture that says that no image was available --->
   
    <img src="">

 

<cfelse>
   
    <!--- The file does not exist, let me show you an text that says that no image was available --->


   
            writeoutput("<img src=''>");
</cfif>

 

 

Robert P. Reil

Managing Director,

Motorcyclecarbs.com, Inc.

4292 Country Garden Walk NW

Kennesaw , Ga. 30152

Office 770-974-8851

Fax 770-974-8852

www.motorcyclecarbs.com


From: Teddy Payne [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 27, 2006 9:05 AM
To: discussion@acfug.org
Subject: Re: [ACFUG Discuss] Alternate image shown logic help?

 

Robert,
Chris has it right with using the FileExists function.  Here is a definition of the usage of the function: http://techfeed.net/cfQuickDocs/?FileExists

Let's look at what Chris was was demonstrating:

<!--- Does the file exist on the server's file system? --->

<cfif FileExists("C:\www\images\picture.gif")>


    <!--- The file does exist, so let's show the picture ---->

    <img src="">
<cfelse>
   
    <!--- The file does not exist, let me show you an alternate picture that says that no image was available --->
   
    <img src="">
</cfif>


Now you can display whatever you want when a file does not exist, but the FileExists function can save you some code and make your code more legible.

Teddy

On 7/27/06, Robert Reil < [EMAIL PROTECTED]> wrote:

This would work even though it is not this other language is the site is a
CF site?

Also I am not quite clear.

If I am reading this right the logic should break down like this:

*************
<!---If image is listed and exists--->
        if ( intImagePos EQ 3 ){
        WriteOutput("<td class=""ProductImage"">" & Chr(10) & Chr(13));
        //'show image
        if( Len(objProduct.getImage2()) GT 0 ){
        writeoutput("<img src="" & objProduct.getImage2() & """ " &
        objProduct.getImage2Params() & ">");
<!---If image is listed and does not exist--->
        ?????????????
<!---If image does not exist--->
        }else{
        writeoutput("<p>No Picture Available</p>"); }
        WriteOutput("</td>");
*************

Or are you saying that this should be structured a different way.
Excuse my ignorance as I am a total newbie and this is my first real attempt
at logic manipulation.

Can you explain further?


Robert P. Reil
Managing Director,
Motorcyclecarbs.com, Inc.
4292 Country Garden Walk NW
Kennesaw, Ga. 30152
Office 770-974-8851
Fax 770-974-8852
www.motorcyclecarbs.com

-----Original Message-----
From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED]]
Sent: Thursday, July 27, 2006 8:14 AM
To: discussion@acfug.org
Subject: RE: [ACFUG Discuss] Alternate image shown logic help?

You can use FileExists(absolute_path) in an if statement.

Eg.
<cfif FileExists("C:\www\images\picture.gif")>
        <img src=""> <cfelse>
        <img src=""> </cfif>

Chris

-----Original Message-----
From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED]] On Behalf Of Robert Reil
Sent: Thursday, July 27, 2006 7:28 AM
To: discussion@acfug.org
Subject: [ACFUG Discuss] Alternate image shown logic help?

Is there a way to have an alternate image called if an image called does
not exist?

For example:
We call out the image path for the image as if it would one day be
there.
When we shoot an image as it comes into inventory we place the image in
the correct directory, and name it the part number.jpg.

We would like to have a default image show if the correct image does not
exist.

Using the string:
******************
//'display the right product image
        if ( intImagePos EQ 3 ){
        WriteOutput("<td class=""ProductImage"">" & Chr(10) & Chr(13));
        //'show image
        if( Len(objProduct.getImage2()) GT 0 ){
        writeoutput("<img src="" & objProduct.getImage2() & """ " &
objProduct.getImage2Params () & ">");
        }else{
        writeoutput("<p>No Picture Available</p>"); }
        WriteOutput("</td>");
*******************
How would you modify this to be able to do that?

I can see that it would be easy to change
        }else{
        writeoutput("<p>No Picture Available</p>"); to show a path name
but it is VERY easy to add the file name even if it does not exist up
front.

Im thinking that instead of changing
        }else{
        writeoutput("<p>No Picture Available</p>"); I should use elseif
logic (hmm this is not even CF is it?) To say if the pic is not
available then call a certain image.
If that is not there then do
        }else{
        writeoutput("<p>No Picture Available</p>");

Robert P. Reil
Managing Director,
Motorcyclecarbs.com, Inc.
4292 Country Garden Walk NW
Kennesaw, Ga. 30152
Office 770-974-8851
Fax 770-974-8852
www.motorcyclecarbs.com


-------------------------------------------------------------
To unsubscribe from this list, manage your profile @
http://www.acfug.org?fa=login.edituserform

For more info, see http://www.acfug.org/mailinglists Archive @
http://www.mail-archive.com/discussion%40acfug.org/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------







-------------------------------------------------------------
To unsubscribe from this list, manage your profile @
http://www.acfug.org?fa=login.edituserform

For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------




-------------------------------------------------------------
To unsubscribe from this list, manage your profile @
http://www.acfug.org?fa=login.edituserform

For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------





--
<cf_payne />
http://cfpayne.wordpress.com/


-------------------------------------------------------------
To unsubscribe from this list, manage your profile @
http://www.acfug.org?fa=login.edituserform

For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by FusionLink
-------------------------------------------------------------




--
Douglas Knudsen
http://www.cubicleman.com
this is my signature, like it?
-------------------------------------------------------------
To unsubscribe from this list, manage your profile @
http://www.acfug.org?fa=login.edituserform

For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by FusionLink
-------------------------------------------------------------

Reply via email to