ASP Help

Discussion in 'Co-op Advertising Network' started by cyberax, Jul 13, 2005.

  1. #1
    I have few ASP sites and they are well indexed on Google. Recently our servers got slowed down and all ASP sites with Coop started giving problem. So I had to remove them from the site. Since I am a new coop user I didnt understand what to do so as a safe bet we decided to remove the code.

    I would like to again add the sites to the network.

    But I am not able to get it work. I am getting the following error:

    msxml3.dll error '800c0005'

    The system cannot locate the resource specified.
    /ad_network.asp, line 155

    But this link is opening fine on my local PC but not opening on the Remote Server.

    Server IP is: 67.18.159.226

    Please assist.

    Regards,
     
    cyberax, Jul 13, 2005 IP
  2. cyberax

    cyberax Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I would really appreciate if any one can really help me.

    Regards,
    Cyberax
     
    cyberax, Jul 15, 2005 IP
  3. cyberax

    cyberax Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi Shawn can you please help me :(

    Is my host server IP banned.

    Regards,
    Vijay
     
    cyberax, Jul 15, 2005 IP
  4. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #4
    Sorry, I don't know anything about the ASP versions out there.
     
    digitalpoint, Jul 16, 2005 IP
  5. cyberax

    cyberax Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Hi,

    Everyone saying that ASP versions works but it is not working on my server. So just wanted to know if my server got blocked for making too many requests. :(

    Regards,
    Vijay
     
    cyberax, Jul 16, 2005 IP
  6. ColumbusOnline

    ColumbusOnline Guest

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Ive been having ASP issues also. One min its working, the next its not. Its always working fine on my server at home but all of the problems have been with a dedicated server we have for a web server.

    I don't know why it does it, I am now thinking it may be a firewall issue or something because I recently discovered that when the ASP websites lag down to 20 second load times, its actually unable to pull any ads, so a connection is not being made. I didnt notice before because it was still displaying the ads that were in the .txt file, but recently I deleted all of those files and noticed that it was never adding any new ones. I really wish someone would come up with an actual solution because I am missing out on about 75K of weight right now.
     
    ColumbusOnline, Jul 18, 2005 IP
  7. Zinho

    Zinho Peon

    Messages:
    284
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #7
    It depends upon how is the ms xml library installed on the server.
    You should contact the server admin and ask for it or provide more infos here to see if I may help
     
    Zinho, Jul 18, 2005 IP
  8. iTISTIC

    iTISTIC Peon

    Messages:
    140
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Shawn,

    Would I be able to help you write an official ASP version of the code? I also want to ad the co-op to my sites but ASP is definitely the only way I can do it. I'd be more than happy to develop and help maintain the ASP code as you make PHP updates. Let me know. I really think it would help the co-op out quite a bit. There are a ton of people requesting ASP support, along with myself!

    Looking forward to hear your response.

    -- The other Shawn. ;)
     
    iTISTIC, Sep 16, 2005 IP
  9. elkiwi

    elkiwi Active Member

    Messages:
    536
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    68
    #9
    I just set up an asp version for a mate of mine...post or send me the file (ad_network.asp) you are using and I'll see what I can do.

    I had errors at first but changed something in ad_network.asp and now no problems...
     
    elkiwi, Sep 16, 2005 IP
  10. mpandur

    mpandur Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Hi elkiwi.

    If you could send me your asp version it would be great.

    mdp@centermail.net

    thanks,

    Markus
     
    mpandur, Nov 12, 2005 IP
  11. elkiwi

    elkiwi Active Member

    Messages:
    536
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    68
    #11
    Files sent. Let me know if you need more help.

    Elkiwi
     
    elkiwi, Nov 15, 2005 IP
  12. dealgain

    dealgain Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Elkiwi, iTISTIC
    Our site www.dealgain.com is an ASP site. we are using the ASP vesion attached with this post.

    Our site has PR 3 and 110K pages in Google. when I validate, I get a weight =7.

    Please help us in fixing the code

    Thanks in advance
    Jag
     

    Attached Files:

    dealgain, Dec 3, 2005 IP
  13. ARIE_B

    ARIE_B Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #13
    I've tried this but it's not working.
    I get the following ad (b.t.w. you get this ad as well on your own site dealgain.com).
    I've changed the code a bit but the problem is getting the valid ads.
     
    ARIE_B, Dec 21, 2005 IP
  14. iTISTIC

    iTISTIC Peon

    Messages:
    140
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #14
    I started working on an ASP version a few months ago but never finished. I have since left my full-time job and am working for myself and have regained some sense of a life back. Working full-time and running your own company at the same time will put a hurtin on any time available to work on projects for "fun".

    In any case, I'm going to pull out my code and try and finish it up in the next few days or so. I'll post here when I'm through.
     
    iTISTIC, Dec 21, 2005 IP
  15. kkibak

    kkibak Peon

    Messages:
    1,083
    Likes Received:
    78
    Best Answers:
    0
    Trophy Points:
    0
    #15
    sorry to bump such an old thread but was progress made on this?
     
    kkibak, May 26, 2006 IP
  16. lbordea

    lbordea Peon

    Messages:
    74
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #16
    is there any version of as_network.asp functional for Asp SITES?
     
    lbordea, Jul 19, 2006 IP
  17. elkiwi

    elkiwi Active Member

    Messages:
    536
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    68
    #17
    here's mine which works: ad_network.asp

    <%
    dim ad_params, ad_objFSO
    
    'Set num_ads to the number of ads you want to display.
    'Set ad_separator to the separator you want between ads.
    const num_ads = 4
    const ad_separator = " | "
    const ad_file_name = "ad_network_ads_###.txt"
    
    Function ad_network()
    	Const root_path="\" 'the (writable) path to ad_network_ads.txt
    	
    	dim ad_ids()
    	dim ad_type, ad_url, ad_file, AllLinks, NewTextLinks, objTextStreamR, objTextStreamW, newlink, spParam, LinksDate, i, NewTextLink, attempt, r, j
    	dim stream, displayAds(), fileWritable
    	
    	Randomize()
    	on error resume next
    	
    	ad_type = "link" '"link" for text link | "text" for text banner | "" (empty) for graphical banner
    	ad_url = "http://ads.digitalpoint.com/network.php?c=" & Request.ServerVariables("SERVER_NAME") & "&type=" & ad_type
    	ad_file = Server.MapPath("/") & root_path & ad_file_name 'it must be a path with write privileges
    	
    	Set ad_objFSO = Server.CreateObject("Scripting.FileSystemObject")
    	Set objTextStreamR = ad_objFSO.OpenTextFile(ad_file,1,true)
    	
    	'Is the file writable?
    	set fileWritable = ad_objFSO.GetFile(ad_file)
    	if (fileWritable.Attributes and 1) = 1 then
    		Response.Write "You must set the ad network .txt file to be writable."
    		exit function
    	end if
    		
    	'If the file contains no data then set up for new file
    	if objTextStreamR.AtEndOfStream then
    		redim AllLinks(1)
    	else 'else split existing data
    		AllLinks = split(objTextStreamR.ReadAll,"<ad_break>")
    	end if
    	
    	'If no timestamp in first record, get new ad_param data
    	if instr(1,AllLinks(0),"|",vbTextCompare) = 0 then
    		newlink = GetNewLink(ad_url)
    		spParam = split(ad_params,"|",-1,vbTextCompare)
    		spParam(0) = AllLinks(0)
    		AllLinks(0) = ad_params
    		AllLinks(Ubound(AllLinks)) = newlink
    			
    		SaveFile join(AllLinks, "<ad_break>"), ad_file
    	else
    		spParam = split(AllLinks(0),"|",-1,vbTextCompare)
    	end if
    	
    	if IsDate(spParam(0)) then
    		LinksDate = cdate(spParam(0))
    	else
    		LinksDate = Now()
    	end if
    		
    	If (UBound(AllLinks) <= spParam(3) + 1 and clng(datediff("s",LinksDate,now())) > clng(spParam(5))) or clng(datediff("s",LinksDate,now())) > clng(spParam(4)) Then 
    		NewTextLink = GetNewLink(ad_url)
    			
    		if NewTextLink <> "" then
    			redim preserve AllLinks(UBound(AllLinks) + 1)
    			AllLinks(0) = ad_params
    			AllLinks(ubound(AllLinks)) = NewTextLink
    		end if
    			
    		If ubound(AllLinks) > spParam(3) then
    			for i = 1 to spParam(3)
    				AllLinks(i) = AllLinks(i + 1)
    			next
    			redim preserve AllLinks(spParam(3))
    		End If
    
    		AllLinks(0) = Now() & mid(AllLinks(0),instr(1,AllLinks(0),"|",vbTextCompare))
    			
    		SaveFile join(AllLinks, "<ad_break>"), ad_file
    	End If 
    	
    	'get 5 random non-duplicate ads
    	dim id_string, c_safety, temp_ad
    	
    	redim preserve displayAds(num_ads - 1)
    	redim preserve ad_ids(num_ads - 1)
    	
    	c_safety = 0
    	id_string = "-"
    	i = 0
    		
    	do while i < num_ads and i < UBound(AllLinks) and c_safety < 100
    		r = int(Rnd() * (UBound(AllLinks)) + 1)
    		temp_ad = split(AllLinks(r), "<id>")
    		
    		'If this ad has NOT been selected before its id will NOT be in id_string.
    		'When searching for id add a "-"'s to make sure we do not match partial numbers.
    		if not instr(1, id_string, "-" & temp_ad(1) & "-") > 0 then
    			id_string = id_string & temp_ad(1) & "-"
    				
    			if Request.ServerVariables("REMOTE_ADDR") = spParam(1) or Request.ServerVariables("SERVER_ADDR") = Request.ServerVariables("REMOTE_ADDR") then
    				displayAds(i) = Replace(temp_ad(0),""" />",""" class=""" & spParam(2) & """ />")
    			else
    				displayAds(i) = temp_ad(0)
    			end if
    			displayAds(i) = Replace(displayAds(i),"<a","<a class='adnetwork'")
    			i = i + 1
    		end if
    		c_safety = c_safety + 1
    	loop
    	
    	'Remove trailing "-" from id_string
    	if len(id_string) > 0 then id_string = left(id_string, len(id_string) - 1)
    	
    	dim printAds
    	printAds = join(displayAds, ad_separator & vbcrlf)
    	
    	Response.Write "<img src=""http://ads.digitalpoint.com/t" & id_string & ".gif"" width=""1"" height=""1"">"
    	
    	ad_network = displayAds	'Print yourself
    	'Response.Write printAds		'Print all at once
    	
    end function
    
    '------------------------------------------------
    ' Private functions
    '------------------------------------------------
    
    Private Function SaveFile(strDataToSave, strFileName)
    	dim stream
    	
    	Application.Lock 'prevents other processes from changing file while writing
    	set stream = ad_objFSO.opentextfile(strFileName,2,true)
    	stream.write strDataToSave
    	stream.close
    	Application.UnLock		
    end function
    
    Private Function GetHTTPText(File)
    
    	if Application("LastCommsAttempt") = "" then
    		Application("LastCommsAttempt") = now
    	else
    		if datediff("s",Application("LastCommsAttempt"),now()) > 4 then
    			Application("LastCommsAttempt") = now
    		else
    			exit function
    		end if
    	end if
    	
    	'on error resume next
    	Dim wHTTP
    	'Set wHTTP = server.CreateObject("Microsoft.XMLHTTP")
    	Set wHTTP = server.CreateObject("Msxml2.ServerXMLHTTP.3.0")
    	'whttp.settimeouts 2000,30000,30000,30000
    	wHTTP.Open "GET", File, false
    	wHTTP.Send
    	'If wHTTP.WaitForResponse(5) = True Then
    		GetHTTPText = wHTTP.ResponseText
    	'End If
    	Set wHTTP=nothing
    
    end function 
    
    Private Function GetNewLink(File)
    
    	dim ht, spLink
    	ht = GetHTTPText(File)
    	if ht <> "" then
    		if instr(1,ht,"<ad_param>",vbTextCompare) > 0 then
    			spLink = split(ht,"<ad_param>",-1,vbTextCompare)
    			ad_params = now() & "|216.9.35.51|" & spLink(0)
    			GetNewLink = spLink(1)
    		else
    			Application("LastCommsAttempt") = dateadd("s",100,now)
    			ad_params = now() & "|216.9.35.51|abcdefgh|400|900|4"
    		end if
    	else
    		if datediff("s",Application("LastCommsAttempt"),now()) > 5 then
    			Application("LastCommsAttempt") = dateadd("s",100,now)
    		end if
    		ad_params = now() & "|216.9.35.51|abcdefgh|400|900|4"
    	end if
    
    end function 
    %>
    Code (markup):
    Then my footer looks like this: (strip out css and divs)

    <!-- #INCLUDE virtual=ad_network.asp -->
    <div class="adnetwork">
    Link Partners:<br>
    <%
    dim ads
    ads=ad_network
    response.write ads(0) & " | " & ads(1) & " | " & ads(2) & " | " & ads(3) 
    %>
    
    </div>
    Code (markup):
    You'll need to upload the ad_network_ads_###.txt file replace the ### with a number and point to it from the ad_network.asp

    Elkiwi
     
    elkiwi, Jul 20, 2006 IP
  18. lbordea

    lbordea Peon

    Messages:
    74
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #18
    thanks, elkiwi - that really worked :) - now i'm waiting :)
     
    lbordea, Jul 20, 2006 IP