look for image logic but its not working

 

 

 

<cfset var mlnumber=Arguments.mlnumber_unformmated>

      <cfset var physical_img_path_primary = image_dir>  ( original image

folder)

    <cfset var physical_img_path_secondary = image2_dir>  ( new image folder

)

      

      <cfif Mid(mlnumber,1,1) EQ "*">

        <cfset mlnumber=RemoveChars(mlnumber, 1,1)>

     <cfelse>

        <cfset mlnumber=mlnumber>

    </cfif>

    

    <cfloop from="1" to="10" index="x"> <!--- assuming there will be maximum
up to 10 images for a single listing  --->

      

 

        <cfif len(trim(mlnumber))>

           <cfif

FileExists("#physical_img_path_primary#/#mlnumber#_#x#.jpg")>--this one is
pulling the ads showing  

                <cfreturn

"#arguments.directory_to_Check#/#mlnumber#_#x#.jpg">

                <cfabort/>

            </cfif>   

           

   <cfif FileExists("#physical_img_path_secondary#/P#mlnumber#_#x#.jpg")>

--this one I just added

                <cfreturn

"#arguments.directory2_to_Check#/P#mlnumber#_#x#.jpg">

                <cfabort/>

            </cfif>   

            

            

             <cfif

FileExists("#physical_img_path_primary#/P#mlnumber#_#x#.jpg")>

 

                <cfreturn

"#arguments.directory_to_Check#/P#mlnumber#_#x#.jpg">

                <cfabort/>       

            </cfif>                 

          

             

              

            <cfif

FileExists("#physical_img_path_secondary#/#mlnumber#_#x#.jpg")>_ thus you
would think this would bring the missing ones up , bneing there is no "P"

added as prefix   

                <cfreturn

"#arguments.directory2_to_Check#/#mlnumber#_#x#.jpg">

                <cfabort/>

             </cfif>                   

            </cfif>

                               

        <cfif

FileExists("#physical_img_path_primary#/#arguments.listingID#_#x#.jpg")>

 

            <cfreturn

"#arguments.directory_to_Check#/#arguments.listingID#_#x#.jpg">

            <cfabort/>

            </cfif>        

      </cfloop>       

      

      <cfreturn "#arguments.directory_to_Check#/nopic.gif">

 

</cffunction>

 

  _____  

From: Charlie Stell [mailto:charlie.st...@gmail.com] 
Sent: 2010-05-25 18:39
To: cf...@aceligent.com
Subject: Re: Need CF help- is anyone available

 

As long as the image names follow your pattern, you should be able to use a
http redirect to a cfm, and in the cfm have something like

 

...logic to determine X - the complete current file path.

<cfcontent file="#X#" type="image/x-jpg"><cfsetting showdebugoutput="no">

 

**this assumes its a jpg...

 

On Tue, May 25, 2010 at 5:28 PM, cfcom <cf...@aceligent.com> wrote:


We have a legacy site that was originally written without error handling.
Yesterday the old programmer ran a script to clear out the images folder
that had grown to 20 gigs. He set up a new image folder but all the images
stopped showing up in queries. We've spent all day chasing down globals but
it keeps throwing errors and the pictures aren't showing up.

Heres notes from what the old programmer did: wrote a script to break up the
directory in to smaller directories.  The created 900 subdirectories inside
a new folder called images_new  The image 90031_7.jpg will be in the folder
"images_houses_new\900\" because it begins with 900.  then put a url
redirect on the original directory to redirect any 404 errors to a script
which will try to find the correct image. also threw the file
Directorybreaker.exe into the root dir of the e drive.  running it with the
old dir as param one and the new drive as param two will break up any new
images. only updated the listings pages. His note goes on to something about
creating an object called Image.cfc and then extend that to HouseImages.cfc

With the exception of the images-folder too big before he touched the code
we had most things functioning and now they are not. - any help would be
greatly appreciated.


>
> -----Original Message-----
> From: Phillip Vector [mailto:vec...@mostdeadlygame.com]
> Sent: 2010-05-25 16:50
> To: cf-talk
> Subject: Re: Need CF help- is anyone available
>
>
> The best solution is to ask directly here. It allows for allot of
> people to help.
>
> So what's the issue?
>

> On Tue, May 25, 2010 at 1:47 PM, cfcom <cf...@aceligent.com> wrote:
>>
>> Having serious problem with a piece of code
>> Is there anyone who could take a look
>> Been racking my head on this all day
>>
>> Please contact off list
>>
>> And thank you in advane
>>
>>
>>
>
>



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:333993
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to