<% ''''''''''' (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 ToyFare Pepe
[an error occurred while processing this directive]

ToyFare Exclusive Vacation Pepe

Pepe, King Prawn, Muppets®, Muppet Show®, Palisades®, Action Figure Review

Pepe, King Prawn, Muppets®, Muppet Show®, Palisades®, Action Figure ReviewI've got maybe a half dozen or so of the ToyFare exclusive figures.  (Ironically, I never recieved the Radioactive Homer that I mailed for.)  I like quirky characters and that's mostly what ToyFare had as their exclusives, Lara Croft, Guardian, etc...  One I missed out on was the Vacation Pepe from Palisades Muppet line.  I already had the regular one and couldn't justify another one.  However, I did manage to pick up a few of these as a lot recently on the secondary market. 

These Pepe's have been sitting around in my storage area in their white mailer boxes for awhile.  Since, I have a bunch of Muppet figures, but very few reviews, I though I'd take a crack at a Retro review of the king prawn.  (Yikes!  It looks like my only other Muppet review was the Penguin 2-Pack.)

That said, this is Vacation Pepe.  Ready for a day at the beach, the ToyFare version is decked out in a different color scheme than the main version.  This change in colors was a theme that ran through most of the Exclusive Muppet figures.  Variant chasers had a lot of work to do with this line.

Appearance:

The biggest reason I collected the Muppets line from Palisades was there character representations were always dead on. There's no generic sculpting to them, and you can tell they really tried to capture each character.

Pepe, King Prawn, Muppets®, Muppet Show®, Palisades®, Action Figure ReviewWhile this particular Pepe never appeared on film anywhere, he definitely looks like he could have. Most "EU" and exclusive items comes off as being 2nd rate compared to the main lines. Not in this case. The main difference in for this Pepe was the hoodie. And the paint work on this one is good. There's a fairly complex design going around his body. The only place it falls flat is the sculpted hood portion is a bit blotchy on the paint work.  I can forgive this as a cheap hoodie he picked at a tourist trap near the beach.

The use of texture is one of the things that Palisades really nailed with this line.  Look at fur or hair on most modern lines, and it's easy to see what set this line apart.  Pepe's body looks like it's furry.  The scale, depth, and direction are all thought out. 

Fun:

The Muppet line was one of those rare instances were a company managed to create a line that was high enough quality to please collectors and packed with enough play features to entertain kids.  Just as the Muppets themselves bring kids and parents together, these toys did the same.  While the representations were dead on, the articulation and accessories rock. Pepe, King Prawn, Muppets®, Muppet Show®, Palisades®, Action Figure Review

Pepe comes armed with 4 four ball jointed shoulders.  They function flawlessly and don't detract from the figure's appearance.  Yeah, I know people out there would like to see elbows and wrists.  But if you think about, Muppets don't really move like that.  The Muppet line in general is good example of "smart articulation."  Put joints in if and where they make sense, and don't do it just to make the figure move like a Micronaut.  A cut neck and hips round out movement points.

This may seem limited, but Pepe is a shrimp among some of the other Muppets.  However, he's one of those figures that when he's on your desk you can find a million poses for him and they all look cool.  Move this arm and he's waving.  Move all four arms and he's surprised.  Etc...

To go with those poses, Pepe's got a slew of accessories for enjoying at the beach.  Swim fins, mask, snorkel, an adult beverage, swim trunks, a floatie, and a plain stand.  The accessories in this set are color matched to his jacket and just a little different than the standard Vacation Pepe.

Pepe, King Prawn, Muppets®, Muppet Show®, Palisades®, Action Figure ReviewThe snorkel clips into the mask, which clips on to his face.  It's a clear mask that works great and looks just as great.  I love the fins.  They are sculpted all the way around.  Even when they are on the figure, you can still put him his generic display stand.

The floatie is an elephant and fits perfectly on the figure.  The wrinkles and the sheen of this piece really sell it as one of those vinyl things you see at resort pools.

The chair and adult beverage let Pepe kick back and enjoy the sunset, okay?  The drink looks like a martini with an umbrella, but I'm guessing Mojito or some sort of Margarita.  The chair folds up works like a a real beach chair.  The only thing missing is the umbrella that comes with the standard prawn.  The holder is there, just no shade was provided in the package. 

The one item that Pepe comes with that I'm perplexed by, is his swim trunks.  While well tailored and sewn, I don't get why needs them.  One, he's a prawn.  Two, he's a Muppet that normally doesn't wear pants.  Why would he put them on to swim?

Overall:

Pepe, King Prawn, Muppets®, Muppet Show®, Palisades®, Action Figure ReviewFor the most part, I've not been very accepting of some of the more "modern" Muppets.  It's not that they aren't cool or funny.  I just grew up with Fozzie, Kermit and the gang.  That said, Pepe has worked his way into my heart.  He's a touch of a practical joker, a bit sarcastic, and just a touch self centered for a Muppet.  And for all that, I love him.  So, even though this Pepe isn't directly from an on screen appearance, I accept him into my collection without reservation.  Great look and great accessories make for great figures. 

If you consider the price range the Muppet line generally sold in, they were a steal.  Modern figures in this scale normally don't have the accessories or articulation the Muppets had, and normally cost twice as much.

I think the only thing that could have made this version of the plush king prawn any better, would have been the inclusion of his umbrella.  Now, if you'll excuse me, I have an uncontrollable desire to go build a jacuzzi.

(I have a few extras of these I'd be willing to part with for about $15 each plush shipping.  Drop me a line if you are looking for one!)

Engineernerd Score: 95/100

Discuss in our forums!

Pepe, King Prawn, Muppets®, Muppet Show®, Palisades®, 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")%>
  <%=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