<% ' *********************************************************************************** ' ADROTATOR ASP CODE ' *********************************************************************************** dim MyAd dim MyAdString1, MyAdString2, MyAdString3, MyAdString4 ' THIS CREATES THE ADROTATOR OBJECT WHICH WILL THEN BE USED TO ' ROTATE ADS ON THE WEBSITE Set MyAd = Server.CreateObject("MSWC.AdRotator") ' TargetFrame SET THE DEFAULT TARGET FOR THE ROTATOR ADS WHEN A PERSON SELECTS THE ' AD. _blank MEANS THAT THE LINK WILL BE OPENED INTO ITS OWN BROWSER SESSION INSTEAD ' OF REPLACING THE WWW.BCLOGGER.COM SITE. ' MyAdString1 IS THE FIRST ADVERTISEMENT WE ARE ROTATING. THE ACTUAL ADS ARE STORED ' IN THE FILE bcLoggerAD.txt. GetAdvertisement RANDOMLY SELECTS ONE OF THE ADS FROM ' THIS FILE AND ASSIGNS IT TO THE VARIABLE MyAdString1 (AND 2,3,4 BELOW). CURRENTLY ' THERE ARE ONLY FOUR ADS IN THE txt FILE. EACH OF THE MyAdString VARIABLES MAKE SURE ' THEY GET A UNIQUE VALUE AND NOT CONFLICTING WITH ANY OF THE OTHER STRINGS. THAT'S ' WHY THE LOOPS ARE IMPLEMENTED. IF YOU ADD ANOTHER LOOP WITH ONLY 4 ADS, THIS PROGRAM ' WILL NEVER FIND A VALUE AND WILL LOOP FOREVER SO YOU NEED TO BE CAREFUL. MyAdString1 = MyAd.GetAdvertisement("bcLoggerAD.txt") do MyAdString2 = MyAd.GetAdvertisement("bcLoggerAD.txt") loop while MyAdString2 = MyAdString1 do MyAdString3 = MyAd.GetAdvertisement("bcLoggerAD.txt") loop while (MyAdString3 = MyAdString1 or MyAdString3 = MyAdString2) do MyAdString4 = MyAd.GetAdvertisement("bcLoggerAD.txt") loop while MyAdString4 = MyAdString1 or MyAdString4 = MyAdstring2 or MyAdString4 = MyAdString3 ' (I USE THE $ INSTEAD OF % BECAUSE IF I PUT THE % BESIDE A <, THE ASP SERVER ' INTERPRETS IT AS AN ASP COMMAND, EVEN IN THE COMMENTS. SO <$ BELOW SHOULD BE A < AND ' % AND $> SHOULD BE % AND >) ' NOW THAT WE HAVE OUR MyAdStringX VARIABLES ASSIGNED TO ADS, WE DISPLAY THE ADS BY ' USING THE ASP COMMAND <$=MyAdString1$>, <$=MyAdString2$>, <$=MyAdString3$>, AND ' <$=MyAdString4$> AS USED BELOW AFTER THE COMMENT . ' ' IF YOU ADD MORE ADS TO bcLoggerAD.txt, THEN YOU CAN CREATE MORE AD OBJECT. FOR EXAMPLE, ' THE FOLLOWING WILL ADD A FIFTH AD: ' ' do ' MyAdString5 = MyAd.GetAdvertisement("bcLoggerAD.txt") ' loop while MyAdString5 = MyAdString1 or MyAdString5 = MyAdstring2 or MyAdString5 = MyAdString3 or MyAdString5 = MyAdstring4 ' ' ANOTHER OPTION IS TO CREATE ANOTHER TEXT FILE, IE bcLoggerADLeft.txt. THEN YOU COULD DO THE FOLLOWING ' MyAdString5 = MyAd.GetAdvertisement("bcLoggerADLeft.txt") ' THEN YOU WOULD PUT THE FOLLOWING INTO THE SECTION: <$=MyAdString5$> ' TO DO THIS, COPY THE CONTENTS OF LEFT_COLUMNDIRECT.ASP AND REPLACE THE INCLUDE LINE ' BELOW. THEN ADD THE <$=...$> WHERE YOU WANT THE AD TO BE DISPLAYED. ' *********************************************************************************** ' END OF ADROTATOR ASP CODE ' *********************************************************************************** %> <% dim myDirPage dim sLocation, sCategory dim strPathInfo, strPhysicalPath dim objFSO, objFile dim objFileText dim x dim sLeftCol dim cDirType ' Added to tell us which directory type we are displaying. (ADH) sLocation = Request.QueryString("Location") sCategory = Request.QueryString("Category") cDirType = "L" ' Initialize (ADH) ' SET LOCATION IF IT ISNT "None" if (sLocation <> "None") then strPathInfo = "Dir_" & sLocation & ".htm" cDirType = "L" ' Set for Locations (ADH) elseif (sCategory <> "None") then strPathInfo = "Dir_" & sCategory & ".htm" cDirType = "C" ' Set for Categorys (ADH) end if strPhysicalPath = Server.MapPath(strPathInfo) set objFSO = Server.CreateObject("Scripting.FileSystemObject") if (objFSO.FileExists(strPhysicalPath) = False) then strPhysicalPath = Server.MapPath("Dir_Main.htm") sLeftCol = 1 cDirType = "L" ' Reset to Locations (ADH) else sLeftCol = 2 if (cDirType = "L") then ' Locations ad processing (ADH) if (sLocation = "Vernon") then MyAdString3 = MyAd.GetAdvertisement("bcLoggerADVernon.txt") do MyAdString4 = MyAd.GetAdvertisement("bcLoggerADVernon.txt") loop while MyAdString4 = MyAdString3 elseif (sLocation = "Lumby") then MyAdString3 = MyAd.GetAdvertisement("bcLoggerADLumby.txt") do MyAdString4 = MyAd.GetAdvertisement("bcLoggerADLumby.txt") loop while MyAdString4 = MyAdString3 end if else ' cDirType = "C" which means it's a category that we are displaying ' Cecil, heres where you can now put the code in for categories (ADH) if (sCategory = "Road Building") then ' MyAdString3 = MyAd.GetAdvertisement("bcLoggerADRoad Building.txt") ' do ' MyAdString4 = MyAd.GetAdvertisement("bcLoggerADRoad Building.txt") ' loop while MyAdString4 = MyAdString3 else end if end if end if Set objFile = objFSO.GetFile(strPhysicalPath) Set objFileText = objFile.OpenAsTextStream(1, -2) myDirPage = objFileText.ReadAll() objFileText.Close() %> bcLogger.com - Directory <% if (sLeftCol = 1) then %> <% else %> <% end if %>
<%=MyAdString3%>

<%=MyAdString4%>
<%=myDirPage%>