Topic: How to rewrite ebay links (affiliation)

Hello,

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:

http://cgi.ebay.fr/BLABLABLA

and

http://stores.ebay.fr/BLABLA

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

http://rover.ebay.com/rover/1/700-11111-22222-0/1?type=4&campid=0000000000&toolid=10001&customid=0000&mpre=http%3A%2F%2Fcgi.ebay.fr%2FBLABLABLA

or

http://rover.ebay.com/rover/1/700-11111-22222-0/1?type=4&campid=0000000000&toolid=10001&customid=0000&mpre=http%3A%2F%2Fstores.ebay.fr%2FBLABLA

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?