<% ''''''''''' (C) Stefan Holmberg 1999 - 2006 ''''''''''' Free to use if these sourcecode lines is not deleted ''''''''''' http://www.aspcode.net ''''''''''' Please read license at http://www.aspcode.net ''''''''''' ''''''''''''''''Config - global variables Dim g_AdMentor_AdMentorRedirPath ' Dim g_Admentor_strConnect ' Connect string Dim g_AdMentor_MaxRecords Dim g_AdMentor_PathToAdServe ' HTTP path to adserve.asp and adclick.asp, like http://www.aspcode.net/ads Dim g_AdMentor_DatabaseType ' SQLServer or Access Dim g_AdMentor_TablePrefix ' if you renamed your tables... Dim g_AdMentor_BannerMediaDirectory ' for upload ''''''''''''TODO 1. Database type g_AdMentor_DatabaseType = "Access" 'g_AdMentor_DatabaseType = "SQLServer" ''''''''''''TODO 2. The path to where your admentor is installed g_AdMentor_PathToAdServe = "http://www.tvandfilmtoys.com/bannerama/" ''''''''''''TODO 3. Connection string 'g_Admentor_strConnect = "Driver={SQL Server};Server=(local);Database=admtest;Uid=sa;Pwd=stefan;" g_Admentor_strConnect = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ="& Server.MapPath("/access_db/adpower.mdb") g_AdMentor_BannerMediaDirectory = "../bannerama/bannermedia/" ''''''''''''TODO 4. Database table prefix 'Maybe you want to use a prefix on all your database tables g_AdMentor_TablePrefix = "" g_AdMentor_MaxRecords = 100 If Right(g_AdMentor_PathToAdServe,1) <> "/" Then g_AdMentor_PathToAdServe = g_AdMentor_PathToAdServe & "/" End If ''''''''''''''''DONT CHANGE ANYTHING BELOW g_AdMentor_AdMentorRedirPath = g_AdMentor_PathToAdServe & "admentorredir.asp" ' This should be the path to admentorredir.asp g_AdMentor_Demo = False ' If true then you can really update/add/delete stuff Dim g_MaxLongInt, g_MaxEndDate g_MaxLongInt = 2147483647 ' Virtually forever, max for a long integer in Access g_MaxEndDate = "2020-01-01" ' This date means forever... If Right(g_AdMentor_PathToAdServe,1) <> "/" Then g_AdMentor_PathToAdServe = g_AdMentor_PathToAdServe & "/" End If %> <% '-------------------------------------------------------------------- ' Microsoft ADO ' ' (c) 1996 Microsoft Corporation. All Rights Reserved. ' ' ' ' ADO constants include file for VBScript ' '-------------------------------------------------------------------- '---- CursorTypeEnum Values ---- Const adOpenForwardOnly = 0 Const adOpenKeyset = 1 Const adOpenDynamic = 2 Const adOpenStatic = 3 Const adTypeBinary = 1 COnst adSaveCreateOverWrite = 2 '---- CursorOptionEnum Values ---- Const adHoldRecords = &H00000100 Const adMovePrevious = &H00000200 Const adAddNew = &H01000400 Const adDelete = &H01000800 Const adUpdate = &H01008000 Const adBookmark = &H00002000 Const adApproxPosition = &H00004000 Const adUpdateBatch = &H00010000 Const adResync = &H00020000 Const adNotify = &H00040000 '---- LockTypeEnum Values ---- Const adLockReadOnly = 1 Const adLockPessimistic = 2 Const adLockOptimistic = 3 Const adLockBatchOptimistic = 4 '---- ExecuteOptionEnum Values ---- Const adRunAsync = &H00000010 '---- ObjectStateEnum Values ---- Const adStateClosed = &H00000000 Const adStateOpen = &H00000001 Const adStateConnecting = &H00000002 Const adStateExecuting = &H00000004 '---- CursorLocationEnum Values ---- Const adUseServer = 2 Const adUseClient = 3 '---- DataTypeEnum Values ---- Const adEmpty = 0 Const adTinyInt = 16 Const adSmallInt = 2 Const adInteger = 3 Const adBigInt = 20 Const adUnsignedTinyInt = 17 Const adUnsignedSmallInt = 18 Const adUnsignedInt = 19 Const adUnsignedBigInt = 21 Const adSingle = 4 Const adDouble = 5 Const adCurrency = 6 Const adDecimal = 14 Const adNumeric = 131 Const adBoolean = 11 Const adError = 10 Const adUserDefined = 132 Const adVariant = 12 Const adIDispatch = 9 Const adIUnknown = 13 Const adGUID = 72 Const adDate = 7 Const adDBDate = 133 Const adDBTime = 134 Const adDBTimeStamp = 135 Const adBSTR = 8 Const adChar = 129 Const adVarChar = 200 Const adLongVarChar = 201 Const adWChar = 130 Const adVarWChar = 202 Const adLongVarWChar = 203 Const adBinary = 128 Const adVarBinary = 204 Const adLongVarBinary = 205 '---- FieldAttributeEnum Values ---- Const adFldMayDefer = &H00000002 Const adFldUpdatable = &H00000004 Const adFldUnknownUpdatable = &H00000008 Const adFldFixed = &H00000010 Const adFldIsNullable = &H00000020 Const adFldMayBeNull = &H00000040 Const adFldLong = &H00000080 Const adFldRowID = &H00000100 Const adFldRowVersion = &H00000200 Const adFldCacheDeferred = &H00001000 '---- EditModeEnum Values ---- Const adEditNone = &H0000 Const adEditInProgress = &H0001 Const adEditAdd = &H0002 Const adEditDelete = &H0004 '---- RecordStatusEnum Values ---- Const adRecOK = &H0000000 Const adRecNew = &H0000001 Const adRecModified = &H0000002 Const adRecDeleted = &H0000004 Const adRecUnmodified = &H0000008 Const adRecInvalid = &H0000010 Const adRecMultipleChanges = &H0000040 Const adRecPendingChanges = &H0000080 Const adRecCanceled = &H0000100 Const adRecCantRelease = &H0000400 Const adRecConcurrencyViolation = &H0000800 Const adRecIntegrityViolation = &H0001000 Const adRecMaxChangesExceeded = &H0002000 Const adRecObjectOpen = &H0004000 Const adRecOutOfMemory = &H0008000 Const adRecPermissionDenied = &H0010000 Const adRecSchemaViolation = &H0020000 Const adRecDBDeleted = &H0040000 '---- GetRowsOptionEnum Values ---- Const adGetRowsRest = -1 '---- PositionEnum Values ---- Const adPosUnknown = -1 Const adPosBOF = -2 Const adPosEOF = -3 '---- enum Values ---- Const adBookmarkCurrent = 0 Const adBookmarkFirst = 1 Const adBookmarkLast = 2 '---- MarshalOptionsEnum Values ---- Const adMarshalAll = 0 Const adMarshalModifiedOnly = 1 '---- AffectEnum Values ---- Const adAffectCurrent = 1 Const adAffectGroup = 2 Const adAffectAll = 3 '---- FilterGroupEnum Values ---- Const adFilterNone = 0 Const adFilterPendingRecords = 1 Const adFilterAffectedRecords = 2 Const adFilterFetchedRecords = 3 Const adFilterPredicate = 4 '---- SearchDirection Values ---- Const adSearchForward = 1 Const adSearchBackward = -1 '---- ConnectPromptEnum Values ---- Const adPromptAlways = 1 Const adPromptComplete = 2 Const adPromptCompleteRequired = 3 Const adPromptNever = 4 '---- ConnectModeEnum Values ---- Const adModeUnknown = 0 Const adModeRead = 1 Const adModeWrite = 2 Const adModeReadWrite = 3 Const adModeShareDenyRead = 4 Const adModeShareDenyWrite = 8 Const adModeShareExclusive = &Hc Const adModeShareDenyNone = &H10 '---- IsolationLevelEnum Values ---- Const adXactUnspecified = &Hffffffff Const adXactChaos = &H00000010 Const adXactReadUncommitted = &H00000100 Const adXactBrowse = &H00000100 Const adXactCursorStability = &H00001000 Const adXactReadCommitted = &H00001000 Const adXactRepeatableRead = &H00010000 Const adXactSerializable = &H00100000 Const adXactIsolated = &H00100000 '---- XactAttributeEnum Values ---- Const adXactCommitRetaining = &H00020000 Const adXactAbortRetaining = &H00040000 '---- PropertyAttributesEnum Values ---- Const adPropNotSupported = &H0000 Const adPropRequired = &H0001 Const adPropOptional = &H0002 Const adPropRead = &H0200 Const adPropWrite = &H0400 '---- ErrorValueEnum Values ---- Const adErrInvalidArgument = &Hbb9 Const adErrNoCurrentRecord = &Hbcd Const adErrIllegalOperation = &Hc93 Const adErrInTransaction = &Hcae Const adErrFeatureNotAvailable = &Hcb3 Const adErrItemNotFound = &Hcc1 Const adErrObjectInCollection = &Hd27 Const adErrObjectNotSet = &Hd5c Const adErrDataConversion = &Hd5d Const adErrObjectClosed = &He78 Const adErrObjectOpen = &He79 Const adErrProviderNotFound = &He7a Const adErrBoundToCommand = &He7b Const adErrInvalidParamInfo = &He7c Const adErrInvalidConnection = &He7d Const adErrStillExecuting = &He7f Const adErrStillConnecting = &He81 '---- ParameterAttributesEnum Values ---- Const adParamSigned = &H0010 Const adParamNullable = &H0040 Const adParamLong = &H0080 '---- ParameterDirectionEnum Values ---- Const adParamUnknown = &H0000 Const adParamInput = &H0001 Const adParamOutput = &H0002 Const adParamInputOutput = &H0003 Const adParamReturnValue = &H0004 '---- CommandTypeEnum Values ---- Const adCmdUnknown = &H0008 Const adCmdText = &H0001 Const adCmdTable = &H0002 Const adCmdStoredProc = &H0004 '---- SchemaEnum Values ---- Const adSchemaProviderSpecific = -1 Const adSchemaAsserts = 0 Const adSchemaCatalogs = 1 Const adSchemaCharacterSets = 2 Const adSchemaCollations = 3 Const adSchemaColumns = 4 Const adSchemaCheckConstraints = 5 Const adSchemaConstraintColumnUsage = 6 Const adSchemaConstraintTableUsage = 7 Const adSchemaKeyColumnUsage = 8 Const adSchemaReferentialContraints = 9 Const adSchemaTableConstraints = 10 Const adSchemaColumnsDomainUsage = 11 Const adSchemaIndexes = 12 Const adSchemaColumnPrivileges = 13 Const adSchemaTablePrivileges = 14 Const adSchemaUsagePrivileges = 15 Const adSchemaProcedures = 16 Const adSchemaSchemata = 17 Const adSchemaSQLLanguages = 18 Const adSchemaStatistics = 19 Const adSchemaTables = 20 Const adSchemaTranslations = 21 Const adSchemaProviderTypes = 22 Const adSchemaViews = 23 Const adSchemaViewColumnUsage = 24 Const adSchemaViewTableUsage = 25 Const adSchemaProcedureParameters = 26 Const adSchemaForeignKeys = 27 Const adSchemaPrimaryKeys = 28 Const adSchemaProcedureColumns = 29 %> <% Function DanDate (strDate, strFormat) Dim intPosItem Dim intHourPart Dim strHourPart Dim strMinutePart Dim strSecondPart Dim strAMPM If not IsDate(strDate) Then DanDate = strDate Exit Function End If intPosItem = Instr(strFormat, "%m") Do While intPosItem > 0 strFormat = Left(strFormat, intPosItem-1) & _ DatePart("m",strDate) & _ Right(strFormat, Len(strFormat) - (intPosItem + 1)) intPosItem = Instr(strFormat, "%m") Loop intPosItem = Instr(strFormat, "%b") Do While intPosItem > 0 strFormat = Left(strFormat, intPosItem-1) & _ MonthName(DatePart("m",strDate),True) & _ Right(strFormat, Len(strFormat) - (intPosItem + 1)) intPosItem = Instr(strFormat, "%b") Loop intPosItem = Instr(strFormat, "%B") Do While intPosItem > 0 strFormat = Left(strFormat, intPosItem-1) & _ MonthName(DatePart("m",strDate),False) & _ Right(strFormat, Len(strFormat) - (intPosItem + 1)) intPosItem = Instr(strFormat, "%B") Loop intPosItem = Instr(strFormat, "%d") Do While intPosItem > 0 strFormat = Left(strFormat, intPosItem-1) & _ DatePart("d",strDate) & _ Right(strFormat, Len(strFormat) - (intPosItem + 1)) intPosItem = Instr(strFormat, "%d") Loop intPosItem = Instr(strFormat, "%j") Do While intPosItem > 0 strFormat = Left(strFormat, intPosItem-1) & _ DatePart("y",strDate) & _ Right(strFormat, Len(strFormat) - (intPosItem + 1)) intPosItem = Instr(strFormat, "%j") Loop intPosItem = Instr(strFormat, "%y") Do While intPosItem > 0 strFormat = Left(strFormat, intPosItem-1) & _ Right(DatePart("yyyy",strDate),2) & _ Right(strFormat, Len(strFormat) - (intPosItem + 1)) intPosItem = Instr(strFormat, "%y") Loop intPosItem = Instr(strFormat, "%Y") Do While intPosItem > 0 strFormat = Left(strFormat, intPosItem-1) & _ DatePart("yyyy",strDate) & _ Right(strFormat, Len(strFormat) - (intPosItem + 1)) intPosItem = Instr(strFormat, "%Y") Loop intPosItem = Instr(strFormat, "%w") Do While intPosItem > 0 strFormat = Left(strFormat, intPosItem-1) & _ DatePart("w",strDate,1) & _ Right(strFormat, Len(strFormat) - (intPosItem + 1)) intPosItem = Instr(strFormat, "%w") Loop intPosItem = Instr(strFormat, "%a") Do While intPosItem > 0 strFormat = Left(strFormat, intPosItem-1) & _ WeekDayName(DatePart("w",strDate,1),True) & _ Right(strFormat, Len(strFormat) - (intPosItem + 1)) intPosItem = Instr(strFormat, "%a") Loop intPosItem = Instr(strFormat, "%A") Do While intPosItem > 0 strFormat = Left(strFormat, intPosItem-1) & _ WeekDayName(DatePart("w",strDate,1),False) & _ Right(strFormat, Len(strFormat) - (intPosItem + 1)) intPosItem = Instr(strFormat, "%A") Loop intPosItem = Instr(strFormat, "%I") Do While intPosItem > 0 intHourPart = DatePart("h",strDate) mod 12 if intHourPart = 0 then intHourPart = 12 strFormat = Left(strFormat, intPosItem-1) & _ intHourPart & _ Right(strFormat, Len(strFormat) - (intPosItem + 1)) intPosItem = Instr(strFormat, "%I") Loop intPosItem = Instr(strFormat, "%H") Do While intPosItem > 0 strHourPart = DatePart("h",strDate) if strHourPart < 10 Then strHourPart = "0" & strHourPart strFormat = Left(strFormat, intPosItem-1) & _ strHourPart & _ Right(strFormat, Len(strFormat) - (intPosItem + 1)) intPosItem = Instr(strFormat, "%H") Loop intPosItem = Instr(strFormat, "%M") Do While intPosItem > 0 strMinutePart = DatePart("n",strDate) if strMinutePart < 10 then strMinutePart = "0" & strMinutePart strFormat = Left(strFormat, intPosItem-1) & _ strMinutePart & _ Right(strFormat, Len(strFormat) - (intPosItem + 1)) intPosItem = Instr(strFormat, "%M") Loop intPosItem = Instr(strFormat, "%S") Do While intPosItem > 0 strSecondPart = DatePart("s",strDate) if strSecondPart < 10 then strSecondPart = "0" & strSecondPart strFormat = Left(strFormat, intPosItem-1) & _ strSecondPart & _ Right(strFormat, Len(strFormat) - (intPosItem + 1)) intPosItem = Instr(strFormat, "%S") Loop intPosItem = Instr(strFormat, "%P") Do While intPosItem > 0 if DatePart("h",strDate) >= 12 then strAMPM = "PM" Else strAMPM = "AM" End If strFormat = Left(strFormat, intPosItem-1) & _ strAMPM & _ Right(strFormat, Len(strFormat) - (intPosItem + 1)) intPosItem = Instr(strFormat, "%P") Loop intPosItem = Instr(strFormat, "%%") Do While intPosItem > 0 strFormat = Left(strFormat, intPosItem-1) & "%" & _ Right(strFormat, Len(strFormat) - (intPosItem + 1)) intPosItem = Instr(strFormat, "%S") Loop DanDate = strFormat End Function Function Date_GetYear( dDate ) Date_GetYear = DatePart( "yyyy", dDate ) End Function Function Date_GetMonthNo( dDate ) Date_GetMonthNo = DatePart( "m", dDate ) End Function Function Date_GetDayNo( dDate ) Date_GetDayNo = DatePart( "d", dDate ) End Function Function Date_GetMonthName( nMonthNo ) Select Case nMonthNo Case 1 Date_GetMonthName = "Jan" Case 2 Date_GetMonthName = "Feb" Case 3 Date_GetMonthName = "Mar" Case 4 Date_GetMonthName = "Apr" Case 5 Date_GetMonthName = "May" Case 6 Date_GetMonthName = "Jun" Case 7 Date_GetMonthName = "Jul" Case 8 Date_GetMonthName = "Aug" Case 9 Date_GetMonthName = "Sep" Case 10 Date_GetMonthName = "Oct" Case 11 Date_GetMonthName = "Nov" Case 12 Date_GetMonthName = "Dec" End Select End Function Sub Date_FillBoxWithHours( nDefault ) Dim nHour, nHourWrite For nHour = 0 To 24 Response.Write "" & nHourWrite & "" Next End Sub Sub Date_FillBoxWithMinutes( nDefault ) Dim nHour, nHourWrite For nHour = 0 To 59 Response.Write "" & nHourWrite & "" Next End Sub Function IncGeneral_ConvertDateToShort( dDate ) Dim nYear, nMonth, nDay nYear = DatePart("yyyy", dDate ) nMonth = DatePart("m", dDate ) If nMonth < 10 Then nMonth = "0" & nMonth End If nDay = DatePart("d", dDate ) If nDay < 10 Then nDay = "0" & nDay End If IncGeneral_ConvertDateToShort = nYear & "-" & nMonth & "-" & nDay End Function Sub Date_FillBoxWithYears( nFirst, nLast, nDefault ) Dim nYear If nDefault = "" Then nDefault = Date_GetYear( Now() ) End If For nYear = nFirst To nLast Response.Write "" & nYear & "" Next End Sub Sub Date_FillBoxWithDays( nDefault ) Dim nDay If nDefault = "" Then nDefault = Date_GetDayNo( Now() ) End If For nDay = 1 To 31 Response.Write "" & nDay & "" Next End Sub Sub Date_FillBoxWithMonths( nDefault, fUseNumbersAsValue ) Dim nMonth If nDefault = "" Then nDefault = Date_GetMonthNo( Now() ) End If For nMonth = 1 To 12 Response.Write "" & Date_GetMonthName(nMonth) & "" Next End Sub %> <% ''''''''''' (C) Stefan Holmberg 1999 ''''''''''' Free to use if these sourcecode lines is not deleted ''''''''''' Contact me at webmaster@sqlexperts.com ''''''''''' http://www.sqlexperts.com ''''''''''' AdMentor homepage at http://www.create-a-webshop.com ' Version 1.11 contains contribution from Shawn Willmon - traceclicks code Function Internal_AdMentordb_GetDateFunction() If g_AdMentor_DatabaseType = "SQLServer" Then Internal_AdMentordb_GetDateFunction = "getdate()" Else Internal_AdMentordb_GetDateFunction = "date()" End If End Function Function Internal_AdMentordb_GetBoolValue( fTrue ) If g_AdMentor_DatabaseType = "SQLServer" Then If fTrue = True Then Internal_AdMentordb_GetBoolValue = "1" Else Internal_AdMentordb_GetBoolValue = "0" End If Else If fTrue = true Then Internal_AdMentordb_GetBoolValue = "true" Else Internal_AdMentordb_GetBoolValue = "false" End If End If End Function Function AdMentor_DBOpenConnection() Dim oConn Set oConn = Server.CreateObject("ADODB.Connection") oConn.Open g_AdMentor_strConnect Set AdMentor_DBOpenConnection = oConn End Function Function AdMentor_DBOpenConnectionStats() Dim oConn Set oConn = Server.CreateObject("ADODB.Connection") oConn.Open g_Admentor_strConnectStats Set AdMentor_DBOpenConnectionStats = oConn End Function Function AdMentor_DBGetBannersInFarm( oConn, nBannerFarm ) Dim oRS Set oRS = CreateObject("ADODB.Recordset") oRS.CursorLocation = adUseClient oRS.MaxRecords = g_AdMentor_MaxRecords oRS.CacheSize = g_AdMentor_MaxRecords oRS.CursorType = adOpenForwardOnly oRS.Open "select bannerid, gifurl, weight, alttext, undertext, xsize, ysize from " & g_AdMentor_TablePrefix & "banner where farmid=" & nBannerFarm & " and weight > 0 and showcount < maximpressions AND clickcount+underclickcount < maxclicks AND validtodate >= " & Internal_AdMentordb_GetDateFunction() & " AND validfromdate <= " & Internal_AdMentordb_GetDateFunction(), oConn Set oRS.ActiveConnection = Nothing Set AdMentor_DBGetBannersInFarm = oRS End Function Sub AdMentor_DBAddShowCount( oConn, nBanner ) oConn.Execute "update " & g_AdMentor_TablePrefix & "banner set showcount=showcount+1 where bannerid=" & nBanner End Sub Function AdMentor_DBUpdateClickCountAndGetUrl( oConn, nBannerId, fUnderText ) Dim sSQL Dim oRSTC If fUnderText = True Then sSQL = "update " & g_AdMentor_TablePrefix & "banner set underclickcount = underclickcount +1 where bannerid = " & nBannerId Else sSQL = "update " & g_AdMentor_TablePrefix & "banner set clickcount = clickcount +1 where bannerid = " & nBannerId End if oConn.Execute ( sSQL ) Set oRSTC = Server.CreateObject("ADODB.Recordset") Set oRSTC.ActiveConnection = oConn oRSTC.Open "select * from " & g_AdMentor_TablePrefix & "traceclicks where bannerid = -1 ", ,adOpenKeyset,adLockOptimistic oRSTC.AddNew() oRSTC("bannerid")=nBannerId oRSTC("page")=Request.ServerVariables("HTTP_REFERER") oRSTC("dt") = now() oRSTC("ip")=Request.ServerVariables( "REMOTE_ADDR" ) oRSTC("undertext")=False oRSTC.Update oRSTC.Close Set oRSTC = Nothing AdMentor_DBUpdateClickCountAndGetUrl = AdMentor_DBGetUrl(oConn, nBannerId, False ) End Function Function AdMentor_DBGetUrl( oConn, nBanner, fUnderText ) Dim oRS Dim sSQL2 If fUnderText = True Then sSQL2 = "select underurl as url from " & g_AdMentor_TablePrefix & "banner where bannerid= " & nBanner Else sSQL2 = "select redirurl as url from " & g_AdMentor_TablePrefix & "banner where bannerid= " & nBanner End if Set oRS = oConn.Execute ( sSQL2 ) AdMentor_DBGetUrl = oRS("url").Value oRS.Close Set oRS = Nothing End Function Function AdSQL_AddAndWhere( strWhere, strWhat ) If strWhere = "" Then strWhere = " WHERE " Else strWhere = strWhere & " AND " End If strWhere = strWhere & " " & strWhat AdSQL_AddAndWhere = strWhere End Function Function AdMentor_DBGetAvailBanners( oConn, fASP, strZones, nFarm, nBannerId, fCanUseHTML ) Dim oRS Set oRS = CreateObject("ADODB.Recordset") oRS.CursorLocation = adUseClient oRS.MaxRecords = g_AdMentor_MaxRecords oRS.CacheSize = g_AdMentor_MaxRecords oRS.CursorType = adOpenStatic oRS.Open GetAdSQL(fASP, strZones, nFarm, nBannerId, fCanUseHTML ), oConn Set oRS.ActiveConnection = Nothing Set AdMentor_DBGetAvailBanners = oRS End Function Function AdMentor_GetHTMLCode( oConn, nBannerId ) Dim oRS Set oRS = CreateObject("ADODB.Recordset") oRS.CursorLocation = adUseClient oRS.MaxRecords = 1 oRS.CacheSize = 1 oRS.CursorType = adOpenForwardOnly oRS.Open "select htmlcode from " & g_AdMentor_TablePrefix & "banner where bannerid="&nBannerId, oConn AdMentor_GetHTMLCode = oRS("htmlcode").Value oRS.Close Set oRS = Nothing End Function Function GetAdSQL( fASP, sZone, nFarm, nBannerId, fCanUseHTML ) Dim strSQL Dim strWhere strSQL = "select distinct " & g_AdMentor_TablePrefix & "banner.bannerid, " & g_AdMentor_TablePrefix & "banner.gifurl, " & g_AdMentor_TablePrefix & "banner.weight " If fASP Then strSQL = strSQL & ", " & g_AdMentor_TablePrefix & "banner.AltText, " & g_AdMentor_TablePrefix & "banner.UnderText, " & g_AdMentor_TablePrefix & "banner.xsize, " & g_AdMentor_TablePrefix & "banner.ysize " End If If fCanUseHTML Then strSQL = strSQL & ",ishtml" End If If strAdmentor_strAlreadyOnPage <> "" Then strWhere = AdSQL_AddAndWhere( strWhere, g_AdMentor_TablePrefix & "banner.bannerid not in ( " & strAdmentor_strAlreadyOnPage & ")" ) End If strSQL = strSQL & " from " & g_AdMentor_TablePrefix & "banner " If sZone <> "0" Then strSQL = strSQL & "," & g_AdMentor_TablePrefix & "banzone " strWhere = AdSQL_AddAndWhere( strWhere, g_AdMentor_TablePrefix & "banner.bannerid=" & g_AdMentor_TablePrefix & "banzone.bannerid" ) strWhere = AdSQL_AddAndWhere( strWhere, g_AdMentor_TablePrefix & "banzone.zoneid in ( " & sZone & ")" ) End If If nBannerId <> "" Then strWhere = AdSQL_AddAndWhere( strWhere, g_AdMentor_TablePrefix & "banner.bannerid=" & nBannerId ) Else If nFarm <> 0 Then strWhere = AdSQL_AddAndWhere( strWhere, g_AdMentor_TablePrefix & "banner.farmid=" & nFarm ) End If strWhere = AdSQL_AddAndWhere( strWhere, "weight > 0 and showcount < maximpressions AND validtodate >= " & Internal_AdMentordb_GetDateFunction() & " AND validfromdate <= " & Internal_AdMentordb_GetDateFunction() ) If fCanUseHTML = True Then strWhere = AdSQL_AddAndWhere( strWhere, " ( ( clickcount+underclickcount < maxclicks ) OR ishtml=" & Internal_AdMentordb_GetBoolValue(true) & " )" ) Else strWhere = AdSQL_AddAndWhere( strWhere, "ishtml <> " & Internal_AdMentordb_GetBoolValue(true) ) End If End If strSQL = strSQL & strWhere ' If you want banners with no zoning to mean all zones then add these ' lines ' If sZone <> "0" Then ' strSQL = strSQL & "union select distinct banner.bannerid, banner.gifurl, banner.weight " ' If fASP Then ' strSQL = strSQL & ", banner.AltText, banner.UnderText, banner.xsize, banner.ysize " ' End If ' If fCanUseHTML Then ' strSQL = strSQL & ",ishtml" ' End If ' strSQL = strSQL & " from banner " ' strSQL = strSQL & " where bannerid not in (select bannerid from banzone)" ' If strAdmentor_strAlreadyOnPage <> "" Then ' strSQL = strSQL & " AND banner.bannerid not in ( " & strAdmentor_strAlreadyOnPage & ")" ' End If ' End If GetAdSQL = strSQL End Function %> <% ''''''''''' (C) Stefan Holmberg 1999 ''''''''''' Free to use if these sourcecode lines is not deleted ''''''''''' Contact me at webmaster@sqlexperts.com ''''''''''' http://www.sqlexperts.com ''''''''''' AdMentor homepage at http://www.create-a-webshop.com ''''''''''''''''The public functions 'This should be called from ASP pages on SAME server 'The QueryString parameter is just that - a querystring string 'where you specify zone etc the same way as when 'using NonSSI version Public Function AdMentor_GetAdASP( strQueryString ) Dim sArr, n Dim sArr2 'Setable parameters Dim sZones, nFarm, nBannerId sArr = Split( strQueryString, "&" ) For n=LBound(sArr) To UBound(sArr) sArr2 = Split( sArr(n), "=" ) Select Case sArr2(0) Case "Z" sZones = sArr2(1) Case "F" nFarm = sArr2(1) Case "B" nBannerId = sArr2(1) Case "N" nBannerOnPage = sArr2(1) End Select Next 'If we have selected a certain banner to run on this 'specific spot then just don't care about the rest... AdMentor_GetAdASP = AdMentor_GetAdEx( True, sZones, nFarm, nBannerId, nBannerOnPage, True ) End Function Public Function AdMentor_GetAdNonSSI() 'Setable parameters Dim sZones, nFarm, nBannerId, nBannerOnPage sZones = Request.QueryString("Z") nFarm = Request.QueryString("F") nBannerId = Request.QueryString("B") nBannerOnPage = Request.QueryString("N") AdMentor_GetAdNonSSI = AdMentor_GetAdEx( False, sZones, nFarm, nBannerId, nBannerOnPage, False ) End Function Public Function AdMentor_GetPicASP( strQueryString ) Dim sArr, n Dim sArr2 'Setable parameters Dim sZones, nFarm, nBannerId sArr = Split( strQueryString, "&" ) For n=LBound(sArr) To UBound(sArr) sArr2 = Split( sArr(n), "=" ) Select Case sArr2(0) Case "Z" sZones = sArr2(1) Case "F" nFarm = sArr2(1) Case "B" nBannerId = sArr2(1) Case "N" nBannerOnPage = sArr2(1) End Select Next 'If we have selected a certain banner to run on this 'specific spot then just don't care about the rest... AdMentor_GetPicASP = AdMentor_GetPicEx( True, sZones, nFarm, nBannerId, nBannerOnPage, True ) End Function 'Private functions Private Function AdMentor_AddToUsedList( nBannerId ) If strAdmentor_strAlreadyOnPage <> "" Then strAdmentor_strAlreadyOnPage = strAdmentor_strAlreadyOnPage & "," End If strAdmentor_strAlreadyOnPage = strAdmentor_strAlreadyOnPage & CStr(nBannerId) End Function ' If ASP then it returns the HTML ' else it simply returns the bannerid ' fASP = true or false Private Function AdMentor_GetAdEx( fASP, strZone, nFarm, nBannerId, nBannerOnPage, fCanUseHTML ) Dim oConn Dim oRS Dim nSumWeight Dim nTempIndex Dim nWeight Dim nTempIndex2 Dim nBanner Dim nCurRow Dim nMax Set oConn = AdMentor_DBOpenConnection() If strZone = "" Then strZone = "0" End If If nFarm = "" Then nFarm = "0" End If ' Get Total Weight Set oRS = AdMentor_DBGetAvailBanners( oConn, fASP, strZone, nFarm, nBannerId, fCanUseHTML ) If oRS.EOF Then 'There is no banner in this banner farm 'TODO: RETURN DEFAULT BANNER!!!!! oRS.Close Set oRS = Nothing oConn.Close Set oConn = Nothing AdMentor_GetAdEx = "No banner in farm" Exit Function End If 'Now lets get the total weight nSumWeight = 0 While Not oRS.EOF nSumWeight = nSumWeight + oRS("weight").Value oRS.MoveNext Wend ' Lets get a random banner Randomize nBanner = Int((nSumWeight * Rnd) + 1) oRS.MoveFirst nCurVal = 0 While nCurVal + oRS("weight").Value < nBanner nCurVal = nCurVal + oRS("weight").Value oRS.MoveNext Wend nBanner = oRS("bannerid").Value AdMentor_AddToUsedList nBanner If Not fASP Then oRS.Close Set oRS = Nothing AdMentor_GetAdEx = nBanner & "---" & oRS("gifurl").Value AdMentor_DBAddShowCount oConn, nBanner oConn.Close Set oConn = Nothing Exit Function End If If fCanUseHTML And oRS("ishtml").Value = True Then Dim sHTMCode oRS.Close Set oRS = Nothing sHTMCode = AdMentor_GetHTMLCode( oConn, nBanner ) sHTMCode = Replace(sHTMCode, "", g_AdMentor_AdMentorRedirPath & "?id=" & nBanner & "&way=ban") AdMentor_GetAdEx = FixupSpecialVariables(sHTMCode) AdMentor_DBAddShowCount oConn, nBanner oConn.Close Set oConn = Nothing Exit Function End If ' Now we have the banner id, lets create the actual HTML 'Move into temp variables only to make it more readable Dim sRedirUrl Dim sGifUrl Dim sAltText Dim sUnderText Dim sUnderUrl Dim sRet Dim nXSize Dim nYSize sRedirUrl = g_AdMentor_AdMentorRedirPath & "?id=" & nBanner & "&way=ban" If IsNull( oRS("gifurl").Value ) Then sGifUrl = "" Else sGifUrl = oRS("gifurl").Value End if If IsNull( oRS("AltText").Value ) Then sAltText = "" Else sAltText = oRS("AltText").Value End if If IsNull( oRS("UnderText").Value ) Then sUnderText = "" Else sUnderText = oRS("UnderText").Value End if sUnderUrl = g_AdMentor_AdMentorRedirPath & "?id=" & nBanner & "&way=txt" nXSize=oRS("xsize").Value nYSize=oRS("ysize").Value sRet = "
" & " 0 Then sRet = sRet & " width=""" & nXSize & """" End if If nYSize > 0 Then sRet = sRet & " height=""" & nYSize & """" End if sRet = sRet & ">" & "" If sUnderText <> "" Then sRet = sRet & "
" & sUnderText & "" Else ' End If sRet = sRet & "
" AdMentor_GetAdEx = sRet ' Lets update impression for it AdMentor_DBAddShowCount oConn, nBanner oRS.Close Set oRS = Nothing oConn.Close Set oConn = Nothing End Function Private Function AdMentor_GetPicEx( fASP, strZone, nFarm, nBannerId, nBannerOnPage, fCanUseHTML ) Dim oConn Dim oRS Dim nSumWeight Dim nTempIndex Dim nWeight Dim nTempIndex2 Dim nBanner Dim nCurRow Dim nMax Set oConn = AdMentor_DBOpenConnection() If strZone = "" Then strZone = "0" End If If nFarm = "" Then nFarm = "0" End If ' Get Total Weight Set oRS = AdMentor_DBGetAvailBanners( oConn, fASP, strZone, nFarm, nBannerId, fCanUseHTML ) If oRS.EOF Then 'There is no banner in this banner farm 'TODO: RETURN DEFAULT BANNER!!!!! oRS.Close Set oRS = Nothing oConn.Close Set oConn = Nothing AdMentor_GetAdEx = "No banner in farm" Exit Function End If 'Now lets get the total weight nSumWeight = 0 While Not oRS.EOF nSumWeight = nSumWeight + oRS("weight").Value oRS.MoveNext Wend ' Lets get a random banner Randomize nBanner = Int((nSumWeight * Rnd) + 1) oRS.MoveFirst nCurVal = 0 While nCurVal + oRS("weight").Value < nBanner nCurVal = nCurVal + oRS("weight").Value oRS.MoveNext Wend nBanner = oRS("bannerid").Value AdMentor_AddToUsedList nBanner If Not fASP Then oRS.Close Set oRS = Nothing AdMentor_GetAdEx = nBanner & "---" & oRS("gifurl").Value AdMentor_DBAddShowCount oConn, nBanner oConn.Close Set oConn = Nothing Exit Function End If If fCanUseHTML And oRS("ishtml").Value = True Then Dim sHTMCode oRS.Close Set oRS = Nothing sHTMCode = AdMentor_GetHTMLCode( oConn, nBanner ) sHTMCode = Replace(sHTMCode, "", g_AdMentor_AdMentorRedirPath & "?id=" & nBanner & "&way=ban") AdMentor_GetAdEx = FixupSpecialVariables(sHTMCode) AdMentor_DBAddShowCount oConn, nBanner oConn.Close Set oConn = Nothing Exit Function End If ' Now we have the banner id, lets create the actual HTML 'Move into temp variables only to make it more readable Dim sRedirUrl Dim sGifUrl Dim sAltText Dim sUnderText Dim sUnderUrl Dim sRet Dim nXSize Dim nYSize sRedirUrl = g_AdMentor_AdMentorRedirPath & "?id=" & nBanner & "&way=ban" If IsNull( oRS("gifurl").Value ) Then sGifUrl = "" Else sGifUrl = oRS("gifurl").Value End if If IsNull( oRS("AltText").Value ) Then sAltText = "" Else sAltText = oRS("AltText").Value End if If IsNull( oRS("UnderText").Value ) Then sUnderText = "" Else sUnderText = oRS("UnderText").Value End if sUnderUrl = g_AdMentor_AdMentorRedirPath & "?id=" & nBanner & "&way=txt" nXSize=oRS("xsize").Value nYSize=oRS("ysize").Value sRet = "
" & " 0 Then sRet = sRet & " width=""" & nXSize & """" End if If nYSize > 0 Then sRet = sRet & " height=""" & nYSize & """" End if sRet = sRet & ">" If sUnderText <> "" Then sRet = sRet & "
" & sUnderText & "" Else ' End If sRet = sRet & "
" AdMentor_GetpicEx = sRet ' Lets update impression for it AdMentor_DBAddShowCount oConn, nBanner oRS.Close Set oRS = Nothing oConn.Close Set oConn = Nothing End Function Public Function AdMentor_ClickAd(nBannerId, sWay) Dim oConn Dim sSQL Dim sSQL2 Dim oRS Dim sRedir Dim fIsUnderText If sWay ="txt" Then fIsUnderText = true Else fIsUnderText = false ' Clicked on actual banner End If 'Pretty easy... Set oConn = AdMentor_DBOpenConnection() sRedir = AdMentor_DBUpdateClickCountAndGetUrl( oConn, nBannerId, fIsUnderText ) oConn.Close Set oConn = Nothing AdMentor_ClickAd = sRedir End Function Private Function FixupSpecialVariables( sHTML ) 'Now check for ' 0 Then sLeftHTML = Left( sHTML, nIndStart -1 ) nIndEnd = InStr( nIndStart, sHTML, ">" ) sRightHTML = Mid( sHTML, nIndEnd + 1 ) sSubStr = Mid( sHTML, nIndStart, nIndEnd - nIndStart ) vData = Split( sSubStr, "-") If vData(1) = "LAST" Then nNumber = Session("AdMentor_RndNumber") Else nLow = CLng(vData(1)) nHigh = CLng(vData(2)) Randomize nNumber = CLng((nHigh * Rnd) + nLow) Session("AdMentor_RndNumber") = nNumber End If sHTML = sLeftHTML & CStr(nNumber) & sRightHTML End If If InStr( 1,CStr(sHTML), " 0 Then fCont = True Else fCont = False End If Wend FixupSpecialVariables = sHTML End Function Public Function GetAdminPagesBannerCode() 'Want to advertise on your admin pages? 'Then just change this function to what you want... 'What I do is just call AdMentorGetAd with a special banner id 'to get by Datais-banners showed ' Dim sRet ' sRet = AdMentor_GetAdASP("B=93") GetAdminPagesBannerCode = "" End Function %> Engineernerd's TV & Film Toys Review of Jawa & WED Treadwell Droid
[an error occurred while processing this directive]

Jawa & WED Treadwell

Star Wars®, Star Wars Action Figures®, jawa®, WED, Treadwell, Droid, Action Figure Review

Star Wars®, Star Wars Action Figures®, jawa®, WED, Treadwell, Droid, Action Figure Review

All of the Wal-Marts in my area have been resetting all their displays and haven't been stocking anything to speak of. I was actually surprised to find this new Jawa & Treadwell two pack when on a  recent visit.  Stormtrooper Luke I could pass up with a $7 price tag, but the blister on this guy looked completely full.

I'd detailed my love of Jawas in my Jawa & LIN review from the TAC series of figures.  Similar to the LIN two pack, this duo is taken from Star Wars (A New Hope).  In particular, they are take from the droid sidewalk sale where Uncle Own and Luke purchase R2-D2 and C-3PO. 

This Treadwell droid is a different model of the droid seen helping Beru at the homestead and Han fix the Falcon in Empire.  According to Wookiepedia, this particular WED-15 Septoid Treadwell is designated as WED-15-ST68.  If I'm interrupting the information on this droid correctly, accessory arms could be bought and switched out similar to how I got a hedge trimmer that fits on my gas powered weed eater.

Star Wars®, Star Wars Action Figures®, jawa®, WED, Treadwell, Droid, Action Figure ReviewAppearance:

In the LIN two-pack review I stated it would have been nice to get the Jawa with the corded weapon instead of at tiny pistol.  Apparently they listened, because this Jawa has that weapon. 

For the most part, this version of the diminutive desert scavengers is a repaint of the LIN droid's companion.  There are couple of notable changes. 

The first being the paint used on his eyes.  The LIN Jawa did not have light pipe eyes and neither does this one.  Instead of the yellow used on the LIN, they used a metallic gold paint.  This actually fooled me for a minute, and had me looking for a light pipe.  The eyes really show up great and reflect enough light to make them look like the film version.  Great job, Hasbro. 

Star Wars®, Star Wars Action Figures®, jawa®, WED, Treadwell, Droid, Action Figure ReviewIn order to create a multi layered look, this Jawa has a vest on over his robe.  Unlike, the previous version, this dude's robe and vest are matched in color.  I really like the fact that none of the Jawas ever seem to match in color.  The variety goes a long way to making them appear as they did in the films.

The main difference, other than coloration,  in these two traders is the utility belts.  The new one has a sculpted holster to hold the corded weapon.  The side of the holster and the back of the belts have some Jawa looking decoration.  The pouches on this guy's belt are a bit bigger that his earlier cousins.  There's a bit of a wash over the belt piece to give the look of leather with silver snaps to finish it off.

Star Wars®, Star Wars Action Figures®, jawa®, WED, Treadwell, Droid, Action Figure ReviewThe taller pouches on the belt actually create one of the small things that I don't like about this figure.  When the head is popped down on the ball joint, the pouches keep it from sitting all the way down.  This makes him slightly taller than the previous version.  It also creates a bit of space under his head that looks a little un-natural from some views.   It also causes the head to be detached easily. 

Now, let's not kid anyone.  A new Jawa figure is great.  There's loads of these guys throughout the six films, and lots of display opportunities for them.  The reason most collectors and kids are going to want this two pack is the WED Treadwell droid.  As one of the last droids needed for a good Purchase of the Droids diorama, this Treadwell has been a long time coming.  Star Wars®, Star Wars Action Figures®, jawa®, WED, Treadwell, Droid, Action Figure Review

This figure pulls of the WED Treadwell look.  Multiple spindly arms on a treaded base.  I'm sure this guy was steered away from just because of the spindly arms. 

Comparing this guy to his film counterpart, I noticed a couple of things.   The first was the scale seems to be a bit off.  Where the LIN droid seemed a little too small the WED seems a little to big. In the film his (hers?) photoreceptors were almost level with the top of R2's dome.  This guys' eyes are a up higher than that (See Bottom Picture). 

Also, the version in the film has a red white color scheme, instead of the figures copper and grey.  To be honest, the base looks like something out of Star Trek TOS to me.  The copper textured section I guess.

Star Wars®, Star Wars Action Figures®, jawa®, WED, Treadwell, Droid, Action Figure ReviewThe overall size isn't the only thing that is off scale wise.  The end effectors on the arms all look a little on the biggish side as well.  I'm willing to concede the oversize limbs and tools, however.  You can only mass produce detail in plastic down to a certain size an have it hold up.  I'm sure this a trade off between appearance and durability.

The Dr. Who like antenna coming out of the front of the base was a surprise.  That could have easily been left off and nobody would have mentioned, but it was nice to see the attention to detail.  I was also impressed with the fact, none of the tools is a duplicate generic grabber.  Most of them appear to be farming implements.

Fun:

I've said it before, anytime you get two figures on a card, it's going to be fun.  When one of the figures is a multi armed robot with tank treads, instant fun.  Maybe the Jawa is repairing the droid, maybe he's hunting him.  The possibilities are endless.

Star Wars®, Star Wars Action Figures®, jawa®, WED, Treadwell, Droid, Action Figure Review

This guy can really stretch out. There's a joint at the bottom and and one in the middle of each arm.  The one thing that arms don't do that would have been nice is swivel at the bottom.  Not a show stopper, but it would have been nice.  To be honest not having them is probably more screen accurate.

The treads are similar to the LIN's. They are sculpted in place, and there are no wheels on the base.  The arms are the key feature of this guy, though, and they look great.

Star Wars®, Star Wars Action Figures®, jawa®, WED, Treadwell, Droid, Action Figure ReviewThe Jawa has two accessories his weapon and a small tin can.  The gun has a cord that leads to a small detailed box.  The box attaches to his body with a shoulder strap. 

There are two things about the weapon I don't like.  First, he can't hold it. Well, to be fair, he can hold it, just not so that he can pull the trigger.  Second thing, What's with the sealed off end?  Even if it was indented only slightly it would have looked better.  (BTW. After getting all this typed, I found a picture of a Jawa with the pack on this back, my bad.)  

Now the little canister.  At first I thought this was a droid caller, like the one that came with the previous version.  However, after I realized this is the restraining bolt gun, my opinion changed.  I'm not Hasbro and have no idea for sure, but I'm guessing this is suppose to be a restraining bolt.  Since the Jawa can't hold it or put it anywhere, I'm also guessing the original intent was to make the gun to where it would fit in the muzzle.  That would have rocked. I would imagine difficulties in molding or cost cutting may have eliminated that in the final version.

Overall:

Star Wars®, Star Wars Action Figures®, jawa®, WED, Treadwell, Droid, Action Figure ReviewAs a sorely needed droid for a Lars homestead diorama, I have to say well done.  I was initially worried that the arms would be cheap immovable things, but my fears proved unfounded.  The Jawa, while a repack, is different enough to be a good scene filler.

Aside from the scale issue with WED and the mysterious canister, overall a well done pair.  The detail is good, there's articulation is good, and the paint doesn't seem to have been skimped on.

Kids and collectors take note, I can't give you a good reason not to buy this pair if you see them.  Of course finding them on the pegs is going to be like finding a protocol droid in the Dune Sea.

Engineernerd Score: 97/100

Discuss in our forums!

Star Wars®, Star Wars Action Figures®, jawa®, WED, Treadwell, Droid, Action Figure Review

<%=AdMentor_GetAdASP("F=5&Z=5&N=1")%>

  Got a passion for toys? We're looking for contributors. Click Here

<%=AdMentor_GetPicASP("F=5&Z=6&N=1")%>

Google

 Search:

 

  <%=AdMentor_GetAdASP("F=4&Z=0&N=1")%>  

Copyright ©2006 TV & Film Toys

 All TV and film titles and character names are TM and © of their respective owners.

Site Hosting & Promotion by The Creative Concept