1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Modify all outgoing links?

Discussion in 'XenForo Questions and Support' started by WiseHollow, Aug 9, 2013.

  1. WiseHollow

    WiseHollow Member

    Hello everyone, I'm trying to figure what I should edit in order to automatically edit all outgoing links and add my adfly link as a prefix to monetize my links. Does anyone know what I should do to achieve this?
  2. Jeremy

    Jeremy Well-Known Member

    You will need to write an add-on to accomplish this. Easiest would be to overwrite the URL bbcode tag to modify the way it functions.
  3. WiseHollow

    WiseHollow Member

    Oh gosh. I have never made one before I'm willing to learn. Do you know of any good tutorials?
  4. Jeremy

    Jeremy Well-Known Member

  5. MegaFora

    MegaFora Member

    I'm looking at doing a similar thing- but since I want the adfly links only to display to guests (and I'd imagine most other admins wouldn't want them showing to members either), and bbcode doesn't work conditionally (afaik), this method wouldn't work, would it?

    I tried putting the following into page_container_js_head:

    <xen:if is="!{$visitor.user_id}">
    <script type="text/javascript">
        var adfly_id = 2520296;
        var adfly_advert = 'int';
        var exclude_domains = megafora.com
    <script src="https://cdn.adf.ly/js/link-converter.js"></script>
    But that hasn't worked either.

    Are there any addons that could be used for this, or any other available workarounds?
  6. Jeremy

    Jeremy Well-Known Member

    Since BBCode is run via PHP you can do it conditionally -- the guide above explains how to modify code.

Share This Page