简体   繁体   English

自动将所有外部链接转换为会员链接

[英]Automatically Convert all external links to affiliate links

I would like to be able to automatically change links into affiliate links on my Wordpress and Mybb installation. 我希望能够在我的Wordpress和Mybb安装上自动将链接更改为会员链接。 This would help to reduce the amount of time managing links in case the code needs to be changed in the future as you know advertiser keeps changing the affiliate websites from one another. 如果您知道将来广告商会不断更改彼此的联属网站,那么将来需要更改代码时,这将有助于减少管理链接的时间。

This is my setup of bestylish.com affiliate scheme. 这是我的bestylish.com会员计划设置。 If the url is suppose : http://www.bestylish.com/men-shoes 如果该网址是假定的: http : //www.bestylish.com/men-shoes
I need to make it this :- http://affiliates.tyroodr.com/ez/arttnpokwow/&lnkurl=http://www.bestylish.com/men-shoes%3Futm_source%3Dtyroo%26utm_medium%3Daffiliate%26utm_campaign%3D12june12_20percenteossoffer 我需要这样做-http : //affiliates.tyroodr.com/ez/arttnpokwow/&lnkurl=http : //www.bestylish.com/men-shoes%3Futm_source%3Dtyroo%26utm_medium%3Daffiliate%26utm_campaign%3D12june12_20ercenteos

I also need to have a http:// always before starting www.bestylish.com if its there, it ok, if its not there, then i need to add it otherwise it wont be redirected correctly. 在启动www.bestylish.com之前,我还需要始终有一个http://,如果可以,如果没有,则需要添加它,否则它将无法正确重定向。

The same Kind of thing is here : Change all website links to affiliate links automatically 同样的事情在这里: 自动将所有网站链接更改为会员链接

But this talks about appending the code at the end only, whereas i have to append the code at the beginning too. 但这仅涉及在末尾添加代码,而我也必须在末尾添加代码。 Also this doesn't talk about adding http:// in the beginning everytime. 同样,这也不是说每次都在开头添加http://。 Can anyone help me with this? 谁能帮我这个?

Thanks you. 谢谢。

You can use a very similar jQuery function to update your links, you can just add the new URL info before and after the current link, see below: 您可以使用非常相似的jQuery函数来更新链接,只需在当前链接之前和之后添加新的URL信息,如下所示:

// attach a click even to all <a> elements
$("a").click(function() {
    addAffiliate(this);
});

// your affiliate URL and querystrig variable for redirect
var affiliateURL = "http://affiliates.tyroodr.com/ez/arttnpokwow/?lnkurl=";
// additional querystring values to append
var addQueryString = "&utm_source=tyroo&utm_medium=affiliate&utm_campaign=12june12_20percenteossoffer";

// function called when link is clicked
function addAffiliate(link) {
    // make sure this link does is not to the current site and does not contain the affiliateURL
    if ((link.href).indexOf(location.host) < 0 && (link.href).indexOf(affiliateURL) < 0){
        // update the link with the affiliateURL, the url encoded link, and the additional query string
        link.href = affiliateURL + escape(link.href) + addQueryString;
    }
    alert(link.href);
    // return true to follow the link
    return true;
}

I think you are looking for this type of work. 我认为您正在寻找这类工作。

please visit => http://nullrefer.com/?http://freekaamaal.com/discuss/index.php 请访问=> http://nullrefer.com/?http://freekaamaal.com/discuss/index.php

Join this forum and try to post any link in thread it will convert to affiliate link. 加入这个论坛,尝试在线程中发布任何链接,它将转换为会员链接。 I am also looking for this type of script but unable to figure out how it's dome. 我也在寻找这种类型的脚本,但无法弄清楚它的圆顶。

best regards 最好的祝福

bbpowercis bbpowercis

First of all, if the advertiser change their platform or affiliatet network they are working with probably all the links ( both real and affiliate links ) will change, so you need to do your custom thing for every merchant your promote. 首先,如果广告客户更改了其平台或联属网络,则他们正在使用的所有链接(真实链接和联属链接)都将发生变化,因此您需要为促销的每个商人进行自定义操作。

I can suggest you to try to have some affiliate links cloaking/management plugin or service. 我可以建议您尝试使用一些会员链接伪装/管理插件或服务。 You can try bit.ly to manage and cloak links, and there are many free wordpress plugins that will let you do that: http://wordpress.org/plugins/search.php?q=link+cloak&sort= 您可以尝试bit.ly来管理和隐藏链接,并且有许多免费的wordpress插件可以让您做到这一点: http ://wordpress.org/plugins/search.php?q=link+cloak&sort =

If you want something more advanced, you may have a look at: http://autoaffiliatelinks.com/ 如果您需要更高级的功能,可以查看: http : //autoaffiliatelinks.com/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM