
September 22 2007 by

Wally Kolcz
Lets say in your database you have a column for
employee names and another for department. If you want to loop all the
employees under each unique department, use this:
CFC/SQL:
Coldfusion:
Posted in ColdFusion | Lazy Code |
2 comments

September 13 2007 by

Wally Kolcz
Function:
<cfscript>
function EmailAntiSpam(EmailAddress) {
var i = 1;
var antiSpam = "";
for (i=1; i LTE len(EmailAddress); i=i+1) {
antiSpam = antiSpam & "&##" & asc(mid(EmailAddress,i,1)) & ";";
}
if ((ArrayLen(Arguments) eq 2) AND (Arguments[2] is "Yes")) return "<a href="
& "mailto:" & antiSpam & ">" & antiSpam & "</a>";
else return antiSpam;
}
</cfscript>
Page:
<a href="mailto:#EmailAntiSpam("#email#")#">#firstname# #Lastname#</a>
Posted in ColdFusion | Lazy Code |
1 comments

September 06 2007 by

Wally Kolcz
I had a project where I was moving a web site with over 1000 images
that were pasted onto html pages. I wanted to database them instead so
they can just loop out and so I could then apply a link list to
navigate through them. This would allow the client to easily approve or
disapprove incoming images to the site rather than having to constantly
keep adding them manually.
First problem was trying to database
the files names of over 1000 images in a folder. No way I was going to
copy and paste those into the database manually.... thank you
cfdirectrory.
Read more...
Posted in ColdFusion | Lazy Code |
2 comments

September 03 2007 by

Wally Kolcz
I use this one all the time. I often rather my outputting of image go
horizontally first, then vertically. Sometimes I like a 3x3 output of
images or text rather than a 1x9. So rather than figure out if the row
is an even row, then put it in one area and the odds in another, I do
an H-Loop.
Read more...
Posted in ColdFusion | Lazy Code |
2 comments