Has this been done? - Posted (1434 Views)
Starting Member
Sam Conder
Posts: 9
9
I'm searching for a MOD that will evaluate all links in a new post or reply and append some text to the end of the URL if it is linking to a certain domain. For example...
If someone types "www.blahblah.com" into a post or reply, when it gets written to the database (and subsequently displayed) it will be "www.blahblah.com/?afid=567GH" but if they post any url other than a "blahblah.com" one, it will not get appended.
This is for an affiliates link situation.
If this has not been done, is there anyone willing to give it a try?
Thanks in advance,<
Sam Conder
http://www.bt3central.com

 Sort direction, for dates DESC means newest first  
 Page size 
Posted
Member Locked
laser
Posts: 3859
3859
Hasn't been done that I know of, but fairly simple to do I would guess<
Posted
Support Moderator
Shaggy
Posts: 6780
6780
If you want to do this with specific URLs only, you could (ab)use Snitz's bad word filter to replace domain.tld/ with domain.tld/?querystring

<
Search is your friend “I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Posted
Starting Member
Sam Conder
Posts: 9
9
Originally posted by Shaggy
If you want to do this with specific URLs only, you could (ab)use Snitz's bad word filter to replace domain.tld/ with domain.tld/?querystring


Good thought, but wouldn't work. Sometimes it would be domain.tld/thispage.cfm?prod_id=9382746223&sid=af432. I would want to append to the end of that as long as domain.tld matched what I wanted.<
Sam Conder
http://www.bt3central.com

Posted
Member Locked
laser
Posts: 3859
3859
Why wouldn't that work :

Bad word : (the F word) gets changed to ****
Bad word : domain.tld gets changed to domain.tld/thispage.cfm?prod_id=9382746223&sid=af432<
Posted
Support Moderator
Shaggy
Posts: 6780
6780
Laser, I think what Sam wants to do is append an affiliate id to any URI within a specific domain. E.G., domain.tld/ would need to replaced with domain.tld/?afid=ID and domain.tld/page.asp?querystring would need to be replaced with domain.tld/pages.asp?querystring&afid=ID

Using the bad word filter to acheive this would mean that Sam would have to enter every page his members could link to along with a seperate entry for every possible querystring combination. If it's a big site, it's going to be quite a tedious process.
One way to do it woud be to use the functions that process URIs in inc_func_common.asp to check for the presence of domain.tld, / and ? and append his affiliate ID as necessary. Unfortunately, that'd be quite a big job, moreso if there's more than one domain.
<
Search is your friend “I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Posted
Starting Member
Sam Conder
Posts: 9
9
Bingo Shaggy. There is actually only two domains that I would like to accomplish this for...<
Sam Conder
http://www.bt3central.com

Posted
Support Moderator
Shaggy
Posts: 6780
6780
OK, gimme a day or 2 to clear this backlog of work I have here and I'll see what I can throw together for you.
<
Search is your friend “I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Posted
Starting Member
Sam Conder
Posts: 9
9
Thanks Shaggy.<
Sam Conder
http://www.bt3central.com

Posted
Forum Moderator
AnonJr
Posts: 5768
5768
Originally posted by Shaggy
OK, gimme a day or 2 to clear this backlog of work I have here and I'll see what I can throw together for you.

Using regular expressions might make it easier....
I'd offer some help, but I'm still fighting with the sub-forums and a small download issue<
Posted
Support Moderator
Shaggy
Posts: 6780
6780
Probably would be but, unfortunately, I'm still too ropey with them to be able to work with them confidently. I'll throw my code up later in the week and maybe someone else can edit it to use RexExps.
<
Search is your friend “I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
You Must enter a message