Hi all. I'm having some difficulties when trying to get three random images to appear on the site. 4-out-of-5 refreshes the image appear fine, but on the 5-attempt the image (and the image path) are blank.
All images are in the dB and on the server, already checked that.
This is my code:
This is where you can preview the code:
Hit refresh about 8-10 times and you'll see the broken images/missing path.
____________________________________
Just Imagine.
All images are in the dB and on the server, already checked that.
This is my code:
Code:
<cfquery name="getFtdLst" datasource="#DB#" username="#DB_Username#" password="#DB_Password#">
SELECT L.listingname as LNID, L.User_ID, L.tbnl, U.Username
FROM Listing L INNER JOIN Users U ON L.User_ID = U.User_ID
</cfquery>
<cfif getFtdLst.RecordCount EQ 0>
<!--- NOTHING --->
<cfelse>
<cfoutput query="getFtdLst" maxrows="1">
<cfset QuoteList = ValueList(getFtdLst.LNID)>
<cfset RandomQuoteID1 = ListGetAt(QuoteList, RandRange(1, ListLen(QuoteList)))>
<cfset RandomQuoteID2 = ListGetAt(QuoteList, RandRange(1, ListLen(QuoteList)))>
<cfset RandomQuoteID3 = ListGetAt(QuoteList, RandRange(1, ListLen(QuoteList)))>
<cfset featured_prop1 = "user_img/#Username[RandomQuoteID1]#/tbnl/#tbnl[RandomQuoteID1]#">
<cfset featured_prop2 = "user_img/#Username[RandomQuoteID2]#/tbnl/#tbnl[RandomQuoteID2]#">
<cfset featured_prop3 = "user_img/#Username[RandomQuoteID3]#/tbnl/#tbnl[RandomQuoteID3]#">
<div style="padding:100px 30px 0px 25px; position: absolute;">
<div style="border:1px solid black; height:155px; width: 440px;">
<div style="float:left; padding:10px 10px 10px 10px;">
<img src="#featured_prop1#" alt="#featured_prop1#" border="0">
<br/><a class="featuredProp" href="">Room with a view</a> <br/>NYC, NYC <br/>
</div>
<div style="padding:10px 10px 10px 10px;">
<img src="#featured_prop2#" alt="#featured_prop2#" border="0">
<br/><a class="featuredProp" href="">Room with a view</a> <br/>NYC, NYC <br/>
</div>
<div style="padding:10px 10px 10px 300px; margin:-12.5em -10em 0em 0em;">
<img src="#featured_prop3#" alt="#featured_prop3#" border="0">
<br/><a class="featuredProp" href="">Room with a view</a> <br/>NYC, NYC <br/>
</div>
</div>
<h4 style="margin:0em 0em 0em 0em; text-align:right">Featured Listings</h4>
</div>
</cfoutput>
</cfif>
This is where you can preview the code:
Hit refresh about 8-10 times and you'll see the broken images/missing path.
____________________________________
Just Imagine.