Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Embedding ebay affiliate code
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Embedding ebay affiliate code

 Post Reply Post Reply Page  <12
Author
kbannon View Drop Down
Groupie
Groupie


Joined: 03 October 2002
Location: Ireland
Status: Offline
Points: 115
Post Options Post Options   Thanks (0) Thanks(0)   Quote kbannon Quote  Post ReplyReply Direct Link To This Post Posted: 28 June 2007 at 12:24am
I'll draw up instructions in the next day or so.
I don't suffer from insanity, I enjoy every minute of it.
Back to Top
MortiOli View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 May 2002
Location: United Kingdom
Status: Offline
Points: 514
Post Options Post Options   Thanks (0) Thanks(0)   Quote MortiOli Quote  Post ReplyReply Direct Link To This Post Posted: 29 June 2007 at 9:18am
Cheers kbannon, that would be great.
Back to Top
kbannon View Drop Down
Groupie
Groupie


Joined: 03 October 2002
Location: Ireland
Status: Offline
Points: 115
Post Options Post Options   Thanks (0) Thanks(0)   Quote kbannon Quote  Post ReplyReply Direct Link To This Post Posted: 06 July 2007 at 9:43pm
eventually:
Im using version 7.9 still so line numbers may differ for V8.x or V9.x

at the top of forum_posts.asp add in the following (just below "<!--#include file="includes/emoticons_inc.asp" -->" on or about line 8 (my code has been tweaked that:

<%
Function EncodeEbayHyperlinks(inText)
Dim objRegExp, strBuf, ebayAffiliateURL
Dim objMatches, objMatch
Dim Value, ReplaceValue, iStart, iEnd

  ebayAffiliateURL = "http://rover.ebay.com/rover/1/711-1751-2978-71/1?AID=5463217&PID=2399323&mpre="
  strBuf = ""
  iStart = 1
  iEnd = 1
  Set objRegExp = New RegExp
  objRegExp.Pattern = "\b(http\://stores.ebay\.|http\://www.ebay\.|http\://cgi\.ebay\.|stores.ebay\.)\S+\b"
  objRegExp.IgnoreCase = True                   ' Set case insensitivity.
  objRegExp.Global = True                       ' Set global applicability.
  Set objMatches = objRegExp.Execute(inText)
  For Each objMatch in objMatches
    iEnd = objMatch.FirstIndex
    strBuf = strBuf & Mid(inText, iStart, iEnd-iStart+1)
      strBuf = strBuf & ebayAffiliateURL & replace(Server.UrlEncode(objMatch.Value), "%26amp%3B", "%26")
    iStart = iEnd+objMatch.Length+1
  Next
  strBuf = strBuf & Mid(inText, iStart)
  EncodeEbayHyperlinks = strBuf
  Set objRegExp = Nothing
End Function
%>




On line 854 (of my modded code!)  before the following block of code:
        Response.Write(vbCrLf & "          </td>" & _
        vbCrLf & "          </tr>" & _
        vbCrLf & "          <tr>" & _
        vbCrLf & "           <td colspan=""2""><hr /></td>" & _
        vbCrLf & "          </tr>" & _
        vbCrLf & "         </table>" & _
        vbCrLf & "<!-- Message body -->" & vbCrLf & strMessage & vbCrLf &  "<!-- Message body ''"""" -->" & _
etc.


add the following:
'######################################################
'####    ebay link hack
'######################################################

strmessage = EncodeEbayHyperlinks(strMessage)



Points to note:
* My code has been modified so line numbers are not accurate
* The variable named ebayAffiliateURL  holds my ebay affiliate link is in red - replace it with yours or else i will earn your commission (if any!)
* As I previously said, this is for WWF version 7.9 - check the code in version 8 onwards for compatibility - maybe someone will be able to show correct line numbers.
* this doesn't change text before it is inserted into the database - it replaces text before after it is selected out and served in the HTML to the user.
* how it works: the function is called via the line
strmessage = EncodeEbayHyperlinks(strMessage)
with the entire message as an argument for the function.
The function uses VBScript regular expressions to find references of the following:

http://stores.ebay.
http://www.ebay.
http://cgi.ebay.
stores.ebay.
(note that the '.' and ':' are escaped using a backslash (\))

Once these are found within your message the enay affiliate part of the link is placed in front of it.

If you have any queries about this, just post them here.
Oh and despite all the hassle of creating this, I have made (so far) a measly UK£0.41
 Cry
I don't suffer from insanity, I enjoy every minute of it.
Back to Top
kbannon View Drop Down
Groupie
Groupie


Joined: 03 October 2002
Location: Ireland
Status: Offline
Points: 115
Post Options Post Options   Thanks (0) Thanks(0)   Quote kbannon Quote  Post ReplyReply Direct Link To This Post Posted: 06 July 2007 at 10:05pm
incidentally, to join ebay's affiliate partnership, sign up at affiliates.ebay.com
I don't suffer from insanity, I enjoy every minute of it.
Back to Top
 Post Reply Post Reply Page  <12

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.