Modify all outgoing links?

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?


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.


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 =
<script src=""></script>
But that hasn't worked either.

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


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