繁体   English   中英

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

[英]Automatically Convert all external links to affiliate links

我希望能够在我的Wordpress和Mybb安装上自动将链接更改为会员链接。 如果您知道将来广告商会不断更改彼此的联属网站,那么将来需要更改代码时,这将有助于减少管理链接的时间。

这是我的bestylish.com会员计划设置。 如果该网址是假定的: http : //www.bestylish.com/men-shoes
我需要这样做-http : //affiliates.tyroodr.com/ez/arttnpokwow/&lnkurl=http : //www.bestylish.com/men-shoes%3Futm_source%3Dtyroo%26utm_medium%3Daffiliate%26utm_campaign%3D12june12_20ercenteos

在启动www.bestylish.com之前,我还需要始终有一个http://,如果可以,如果没有,则需要添加它,否则它将无法正确重定向。

同样的事情在这里: 自动将所有网站链接更改为会员链接

但这仅涉及在末尾添加代码,而我也必须在末尾添加代码。 同样,这也不是说每次都在开头添加http://。 谁能帮我这个?

谢谢。

您可以使用非常相似的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;
}

我认为您正在寻找这类工作。

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

加入这个论坛,尝试在线程中发布任何链接,它将转换为会员链接。 我也在寻找这种类型的脚本,但无法弄清楚它的圆顶。

最好的祝福

bbpowercis

首先,如果广告客户更改了其平台或联属网络,则他们正在使用的所有链接(真实链接和联属链接)都将发生变化,因此您需要为促销的每个商人进行自定义操作。

我可以建议您尝试使用一些会员链接伪装/管理插件或服务。 您可以尝试bit.ly来管理和隐藏链接,并且有许多免费的wordpress插件可以让您做到这一点: http ://wordpress.org/plugins/search.php?q=link+cloak&sort =

如果您需要更高级的功能,可以查看: http : //autoaffiliatelinks.com/

暂无
暂无

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

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