Title: Message
I'm no PHP guru, but I can read through it a little bit..
 
This is not the exact same thing, but close enough to give you an idea maybe...
- I just manually set the value for $CFG['paths']['user_images'] since I don't know where that comes from
- Cold Fusion has no built in "getimagesize" that I'm aware of, so that was removed
- I replaced the "opener.editor1.addImage" function with an alert, since I don't have the original function to test with
 
Hope it helps some..
 
<!--- Create an array --->
<CFSET images=ListToArray('test.jpg,test.png,test.gif')>
 
<!--- Set up the path for $CFG['paths']['user_images']--->
<CFSET userpath = "imagesfolder">
 
<table cellpadding="2" cellspacing="0" border="0">
<!--- Loop through the array --->
<CFLOOP FROM="1" TO="#ArrayLen(images)#" INDEX="idx">
 <!--- Create the image source path --->
 <CFSET img_src = userpath & "/" & images[idx]>
 <!--- Determine background color to use --->
 <CFIF idx mod 2 EQ 0>
  <TR STYLE="background-color: #dfdfdf">
 <CFELSE>
  <TR>
 </CFIF>
 <!--- Output the table row --->
 <CFOUTPUT>
   <TD><IMG SRC="">http://#CGI.SERVER_NAME#/#GetDirectoryFromPath(CGI.PATH_INFO)#/#img_src#?id=#HASH(Now())#"></TD>
   <TD VALIGN="TOP"><A HREF="" >Insert Image</a></td>
 </CFOUTPUT>
  </tr>
</CFLOOP>
</TABLE>
 
 
-----Original Message-----
From: Ron Mast [mailto:[EMAIL PROTECTED]
Sent: Friday, September 16, 2005 8:10 AM
To: [email protected]
Subject: for php gurus

Hello php gurus,

Can someone convert this to ColdFusion please?

 

<?php

            // In my system, a function is called that returns the file names of images in a certain format

            // in an array. All images that are in the sample array below are known to exist, etc. and this

            // matches the structure of the return value from the function... (this assumes that the function

            // did return an array with at least one element)

 

    // this is an example of what would be used

    $images=array(

            'test.jpg',

            'test.png',

            'test.gif'

    );

    $num_images=count($images);

 

    // loop through and display all current images

    echo '<table cellpadding="2" cellspacing="0" border="0">',"\n";

    foreach($images as $num=>$file){

        $img_src=$CFG['paths']['user_images'].'/'.$file;

        $size=getimagesize($CFG['paths']['sys_path'].$img_src);

        echo '<tr';

        if($num%2) echo ' style="background-color: #dfdfdf"';

        echo '><td><img src="" ',$size[3],' alt="" /></td>',

            '<td valign="top"><a href="" >Insert Image</a></td></tr>';

    }

?>

 

Thanks in advance,

 

Ron Mast

Webmaster

Truth Hardware

Ph: 507-444-4748

Fx: 507-444-5361

www.truth.com

 

_______________________________

This e-mail and any files transmitted with it are confidential and are intended solely for the use of the individual to whom they are addressed.  If you are not the intended recipient or the individual responsible for delivering the e-mail to the intended recipient, please be advised that you have received this e-mail in error and that any use, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited.

Reply via email to