Topic: How to rewrite ebay links (affiliation)


After googling for a few hours, I really need advice because I have found nothing that matches what I was looking for.

The situation is as follows:

I have a site with a forum based on PunBB 1.2. I use a system of affiliation displaying ebay ads on the site, but it happens regularly that members post links directly to ebay, and in this case visitors who click on these links do not pass through the tracker which recognizes my clicks on my affiliate program, they will go directly on ebay without my little cookie affiliation ...

So I thought it would be wise to rewrite all links like:


So that they will go through my affiliate program. I need the rewrite to output those urls:


I think this can be done with a regex, and probably somewhere in parser.php, around line 447 where there is

// Make hyperlinks clickable
function do_clickable($text)

Or somewhere around it.

Could someone help me setting up something to rewrite the ebay links on my forum?