Rank: Member
Groups: Member
Joined: 5/29/2007(UTC) Posts: 7
|
HI Alex My code lines don't go up that hi I did a search for Manual OnLoad in my file and couldn't find it are you sure you were looking at my code if so what page were you looking on here is my code: Code:
<!--- To check the size of selected file --->
<cfset ImgSize = #VAL(CGI.CONTENT_LENGTH)#/1000>
<cfset NewDirUsedSpace = (#session.DirUsedSpace#*1024) + #ImgSize# >
<cfset OldDirUsedSpace = (#session.DirectorySize#*1024)>
<cfset MaxTotalFile = #OldDirUsedSpace# - (#session.DirUsedSpace#*1024)>
<cfif #MaxTotalFile# LT 0 >
<cfset MaxTotalFile = 0.00000001>
<cfset SizeNOTE = "You have exceeded the disk space cannot upload the image.">
<cfelse>
<cfset #MaxTotal# = #MaxTotalFile#*1024>
<cfset SizeNOTE = "You only have #MaxTotalFile# kb of disk space remaining, please delete some photos or contact CAPP.net.au about getting more disk space">
</cfif>
<cfset maxPhotoImgSize = (#session.MaxPhotoImageFileSize#*1024)>
<!--- --->
<!---- Filter for client: 1.If admin want see the detail of client then fetch the record accordingly.
2.If client is login fetch records for that session--->
<cfif isdefined("session.userFilter") AND #session.userFilter# eq 0 ><cfset UserClientID = #session.id#></cfif>
<cfif isdefined("session.userFilter") AND #session.userFilter# neq 0 ><cfset UserClientID = #session.userFilter#></cfif>
<!--- --->
<cfquery name="galleryselection" datasource="#Application.dsn#">
SELECT *
FROM LUGallery
WHERE ClientID = '#UserClientID#'
ORDER BY "Rating" ASC
</cfquery>
<script language="javascript" type="text/javascript" src="selectSubGallery.js"></script>
<cfquery name="GetPrices" datasource="#Application.dsn#">
SELECT *
FROM LUPriceSet
WHERE ClientID = '#UserClientID#'
</cfquery>
<script language="javascript" src="iuembed.js"></script>
<form name="Form1" id="Form1">
<table width="780" border="0" cellpadding="5">
<tr>
<TD colspan="2">
<span class="heading2">Add multiple photos</span></TD>
</tr>
<tr>
<TD width="103">Gallery:</TD>
<TD width="651"><select name="GalleryID" id="GalleryID" onChange="showSubGallery(this.value)">
<option value="0">-- Please Select --</option>
<cfoutput query="galleryselection">
<option value="#galleryselection.GalleryID#">#galleryselection.GalleryName#</option>
</cfoutput>
</select>
add a <a href="<cfoutput>admin.cfm?p=galleryAddPublic</cfoutput>">Public</a> or <a href="<cfoutput>admin.cfm?p=galleryAddSecure</cfoutput>">Secure</a> Gallery
</TD>
</TR>
<TR><TD colspan="3"><div id="subGalleryList"></div></TD></TR>
<TR>
<TD>Price Set:</TD>
<TD>
<select name="PriceID" id="select3">
<option value="0">-- Please Select --</option>
<cfoutput query="GetPrices">
<option value="#GetPrices.PriceID#">#GetPrices.PriceSetName#</option>
</cfoutput>
</select>
<a href="<cfoutput>admin.cfm?p=pricesAdd</cfoutput>">add price set</a></TD>
</TR>
<TR>
<TD>Edition Size:</TD>
<TD><input type="text" name="EditionSize" id="EditionSize" vaule="" /></TD>
</TR>
<TR>
<TD>Photo Order:</TD>
<TD>
<input name="PhotoRating" type="text" id="PhotoRating" size="4" maxlength="3" />
<a href="javascript:MM_openBrWindow('Help.cfm?HelpID=5','PleaseHelp','scrollbars=yes,resizable=yes,width=550,height=200')" class="helpLink">?</a>
</TD>
</TR>
<tr>
<TD>Display On Web Site:</TD>
<TD>
<input name="DisplayOnWebsite" type="checkbox" id="DisplayOnWebsite2" value="checkbox" checked="checked" class="tickBox" />
<input name="DateAdded" type="hidden" id="DateAdded" value=""></TD>
</tr>
<tr>
<td colspan="2" bgcolor="#9999CC">
<!--- these two following java scripts must stay here for the image uploader to appear in this position --->
<script language="javascript">
function ImageUploader_Progress(Status, Progress, ValueMax, Value, StatusText){
if (Status=="COMPLETE"){
// When upload is finished, we are redirecting to the photovaultmaster page
window.location = '<cfoutput>admin.cfm?p=photosAdmin</cfoutput>';
}
}
</script>
<script type="text/javascript">
//<![CDATA[
//Create JavaScript object that will embed Image Uploader to the page.
var iu = new ImageUploaderWriter("ImageUploader1",780, 500);
iu.activeXControlCodeBase = "./ImageUploader4.cab";
iu.activeXControlVersion = "4,1,21,0";
//For Java applet only path to directory with JAR files should be specified (without file name).
iu.javaAppletCodeBase="./";
iu.javaAppletCached = true;
iu.javaAppletVersion = "2.0.79.0";
iu.javaAppletEnabled = true;
iu.activeXControlEnabled = true;
iu.showNonemptyResponse = "off";
function beforeUploadHandler() {
var GalleryID = document.getElementById("GalleryID");
if(GalleryID.value == 0){
alert("Please Select Gallery");
GalleryID.focus();
return false;
}
else{
iu.addParam("Action","photosAddMultiAction.cfm");
return true;
}
}
//Configure appearance.
iu.addParam("PaneLayout", "TwoPanes");
iu.addParam("ShowDebugWindow", "true");
iu.addParam("AllowRotate", "false");
iu.addParam("BackgroundColor", "#ccccff");
iu.addParam("AdditionalFormName","Form1");
iu.addParam("AllowMultipleSelection", "true");
//Configure thumbnail settings.
iu.addParam("UploadThumbnail1FitMode", "Fit");
iu.addParam("UploadThumbnail1Width", "<cfoutput>#session.SmallThumbWidth#</cfoutput>");
iu.addParam("UploadThumbnail1Height", "<cfoutput>#session.SmallThumbHeight#</cfoutput>");
iu.addParam("UploadThumbnail1JpegQuality", "<cfoutput>#session.SmallThumbQaulity#</cfoutput>");
//Configure file mask to upload JPEG images only.
iu.addParam("FileMask", "*.jpeg;*.jpg;*.jpe;*.png;*.gif");
iu.addParam("MaxFileCount", "100");
iu.addParam("LicenseKey", "8326-5092-7900-6935;3384-1677-5822-9997;9346-7912-7520-7408");
iu.addParam("MaxFileSize", "<cfoutput>#maxPhotoImgSize#</cfoutput>");
iu.addParam("MessageMaxFileSizeExceededText", "Images cannot be any bigger than <cfoutput>#maxPhotoImgSize#</cfoutput>");
iu.addParam("MaxTotalFileSize", "<cfoutput>#MaxTotal#</cfoutput>");
iu.addParam("MessageMaxTotalFileSizeExceededText", "<cfoutput>#SizeNOTE#</cfoutput>");
iu.addParam("Action","photosAddMultiAction.cfm");
//Configure URL where to redirect after upload.
iu.addEventListener("Progress", "ImageUploader_Progress");
//Configure URL files are uploaded to.
iu.addEventListener("BeforeUpload", "beforeUploadHandler");
//Tell Image Uploader writer object to generate all necessary HTML code to embed
//Image Uploader to the page.
iu.writeHtml();
//]]>
</script>
</td>
</tr>
</table>
</form>
and the action page Code:<cfset dest = "#Application.PathToDomain##session.UsersDirectory#\images\Photos\">
<!---- Filter for client: 1.If admin want see the detail of client then fetch the record accordingly.
2.If client is login fetch records for that session--->
<cfif isdefined("session.userFilter") AND #session.userFilter# eq 0 ><cfset UserClientID = #session.id#></cfif>
<cfif isdefined("session.userFilter") AND #session.userFilter# neq 0 ><cfset UserClientID = #session.userFilter#></cfif>
<!--- --->
<cfif isdefined("Form.DisplayOnWebsite")>
<cfset form.DisplayOnWebsite = "Yes">
<cfelse>
<cfset form.DisplayOnWebsite = "No">
</cfif>
<!--- Set DateAdded Field --->
<cfset Form.DateAdded = #Application.TodaysDate#>
<!--- Loop through the number of images submited using the form field FileCount --->
<cfloop index="LoopCount" from="1" to=#Form.FileCount#>
<!--- Save the file to a file directory path on the server using the file field Image and followed by the index of the loop.
(This will tell coldfusion what file field to save) --->
<!-- now upload the photos -->
<CFIF Application.Server is "Local">
<cffile action="UPLOAD" filefield="SourceFile_#LoopCount#" destination="#dest#" nameconflict="makeunique">
<cfset fileName="#CFFILE.ServerFile#">
</cfif>
<CFIF Application.Server eq "StandardCFMX7Server">
<cffile action="UPLOAD" filefield="SourceFile_#LoopCount#" destination="#dest#" nameconflict="makeunique">
<cfset fileName="#CFFILE.ServerFile#">
</cfif>
<!-- now upload the thumbnails -->
<!--- Get first thumbnail (the single thumbnail in this code sample) and save it to disk. --->
<cffile action="UPLOAD" filefield="Thumbnail1_#LoopCount#" destination="#dest#" nameconflict="MakeUnique">
<!--- Rename thumbnail with prefix set in session --->
<cffile action="rename" source="#dest#/#serverFile#" destination="#dest#/#session.SmallThumbPrefix##fileName#">
<!--- now insert into database --->
<cfquery datasource="#Application.dsn#">
INSERT INTO Photos (ClientID, FilmID, NegNumber, PhotoTitle, PhotoSpeil, GalleryID, SubGalleryID, ContinentID, CountryID, CityID, StateID, CategoryID, Image, Thumbnail, ShutterSpeed, Aperture, DisplayOnWebsite, KeyWords, PhotoRating, Scanned, HighResScanned, Format, ModelRelease, ProductID, PriceID, DisplayInImageLibrary, DateAdded, DateEdited, Notes, Name, Width, Height, Author, Description, BWAvailable, Lense,EditionSize, DirName)
VALUES ('#UserClientID#',
<cfif IsDefined("FORM.FilmID") AND #FORM.FilmID# NEQ "">#FORM.FilmID#<cfelse>NULL</cfif>,
<cfif IsDefined("FORM.NegNumber") AND #FORM.NegNumber# NEQ "">'#FORM.NegNumber#'<cfelse>NULL</cfif>,
<!--- '#evaluate("form.Title_#LoopCount#")#', --->
<cfif IsDefined("FORM.PhotoTitle") AND #FORM.PhotoTitle# NEQ "">'#FORM.PhotoTitle#'<cfelse>NULL</cfif>,
<cfif IsDefined("FORM.PhotoSpeil") AND #FORM.PhotoSpeil# NEQ "">'#FORM.PhotoSpeil#'<cfelse>NULL</cfif>,
<cfif IsDefined("FORM.GalleryID") AND #FORM.GalleryID# NEQ "">#FORM.GalleryID#<cfelse>NULL</cfif>,
<cfif IsDefined("FORM.SubGalleryID") AND #FORM.SubGalleryID# NEQ "">#FORM.SubGalleryID#<cfelse>NULL</cfif>,
<cfif IsDefined("FORM.ContinentID") AND #FORM.ContinentID# NEQ "">#FORM.ContinentID#<cfelse>NULL</cfif>,
<cfif IsDefined("FORM.CountryID") AND #FORM.CountryID# NEQ "">#FORM.CountryID#<cfelse>NULL</cfif>,
<cfif IsDefined("FORM.CityID") AND #FORM.CityID# NEQ "">'#FORM.CityID#'<cfelse>NULL</cfif>,
<cfif IsDefined("FORM.StateID") AND #FORM.StateID# NEQ "">#FORM.StateID#<cfelse>NULL</cfif>,
<cfif IsDefined("FORM.CategoryID") AND #FORM.CategoryID# NEQ "">#FORM.CategoryID#<cfelse>NULL</cfif>,
'#fileName#',
<cfif IsDefined("FORM.Thumbnail") AND #FORM.Thumbnail# NEQ "">'#FORM.Thumbnail#'<cfelse>NULL</cfif>,
<cfif IsDefined("FORM.ShutterSpeed") AND #FORM.ShutterSpeed# NEQ "">#FORM.ShutterSpeed#<cfelse>NULL</cfif>,
<cfif IsDefined("FORM.Aperture") AND #FORM.Aperture# NEQ "">#FORM.Aperture#<cfelse>NULL</cfif>,
<cfif IsDefined("FORM.DisplayOnWebsite") AND #FORM.DisplayOnWebsite# NEQ "">'yes'<cfelse>'no'</cfif>,
<cfif IsDefined("FORM.KeyWords") AND #FORM.KeyWords# NEQ "">'#FORM.KeyWords#'<cfelse>NULL</cfif>,
<cfif IsDefined("FORM.PhotoRating") AND #FORM.PhotoRating# NEQ "">#FORM.PhotoRating#<cfelse>'999'</cfif>,
<cfif IsDefined("FORM.Scanned") AND #FORM.Scanned# NEQ "">'#FORM.Scanned#'<cfelse>NULL</cfif>,
<cfif IsDefined("FORM.HighResScanned") AND #FORM.HighResScanned# NEQ "">'#FORM.HighResScanned#'<cfelse>NULL</cfif>,
<!--- set the format of the image depending on dimensions --->
<cfif evaluate("form.Width_#LoopCount#") gt evaluate("form.Height_#LoopCount#")><cfset FORM.Format = 1></cfif><!--- landscape --->
<cfif evaluate("form.Height_#LoopCount#") gt evaluate("form.Width_#LoopCount#")><cfset FORM.Format = 2></cfif><!--- portrait --->
<cfif evaluate("form.Height_#LoopCount#") eq evaluate("form.Width_#LoopCount#")><cfset FORM.Format = 3></cfif><!--- square --->
<cfif IsDefined("FORM.Format") AND #FORM.Format# NEQ "">#FORM.Format#<cfelse>NULL</cfif>,
<cfif IsDefined("FORM.ModelRelease") AND #FORM.ModelRelease# NEQ "">'#FORM.ModelRelease#'<cfelse>NULL</cfif>,
<cfif IsDefined("FORM.ProductID") AND #FORM.ProductID# NEQ "">#FORM.ProductID#<cfelse>NULL</cfif>,
<cfif IsDefined("FORM.PriceID") AND #FORM.PriceID# NEQ "">#FORM.PriceID#<cfelse>NULL</cfif>,
<cfif IsDefined("FORM.DisplayInImageLibrary") AND #FORM.DisplayInImageLibrary# NEQ "">'yes'<cfelse>'no'</cfif>,
<cfif IsDefined("FORM.DateAdded") AND #FORM.DateAdded# NEQ "">'#FORM.DateAdded#'<cfelse>NULL</cfif>,
<cfif IsDefined("FORM.DateEdited") AND #FORM.DateEdited# NEQ "">'#FORM.DateEdited#'<cfelse>NULL</cfif>,
<cfif IsDefined("FORM.Notes") AND #FORM.Notes# NEQ "">'#FORM.Notes#'<cfelse>NULL</cfif>,
<cfif IsDefined("FORM.Name") AND #FORM.Name# NEQ "">'#FORM.Name#'<cfelse>NULL</cfif>,
'#evaluate("form.Width_#LoopCount#")#',
'#evaluate("form.Height_#LoopCount#")#',
<cfif IsDefined("FORM.Author") AND #FORM.Author# NEQ "">'#FORM.Author#'<cfelse>NULL</cfif>,
'#evaluate("form.Description_#LoopCount#")#',
<cfif IsDefined("FORM.BWAvailable")>'Yes'<cfelse>'No'</cfif>,
<cfif IsDefined("FORM.Lense") AND #FORM.Lense# NEQ "">'#FORM.Lense#'<cfelse>NULL</cfif>,
<cfif IsDefined("FORM.EditionSize") AND #FORM.EditionSize# NEQ "">'#FORM.EditionSize#'<cfelse>'0'</cfif>,
LTRIM('#session.UsersDirectory#')
)
</cfquery>
</cfloop>
Thanks Kris Edited by user Monday, December 17, 2007 1:02:34 PM(UTC)
| Reason: Not specified
|