[Paid] Adding external javascript to default Theme and use it in House Ads

Hi Guys,

This Task is not so hard I think but I was not able to solve it becouse the js is not firing.

Im Trying to add javascript from a afflilate Network and want use it in House ads. Details i can give in 1to1 or in PM.

I have Example where the Scripts are functional in a minimal bootstrap html file
And i want a integration in my self hosted discourse. Who can help?

Tell me what u want per h. I think this task is for a experienced User solvable in 1 - max 2 Hours.

1 Like

I don’t even think it has to be paid for - have you checked your content security politics?


Hi Linca,

Thank you for your response.

Yes I did, I added the 2 scripts in security policy - but the part with parameters seems not work.

Here is the code when it is standalone in a “hello world envoirment”
I dont have security Issues if my partnernumber are visible. Dont worry.
But be careful there are erotic ads if you try it :smiley: nsfw.

<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8">
    <meta name = "viewport" content = "width = device-width, initial-scale=1">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
    <link id="0" rel="stylesheet" type="text/css" href="//cdn.solads.media/css/as/728x90.min.css" media="all">
    <link id="1" rel="stylesheet" type="text/css" href="//cdn.solads.media/css/as/300x250.min.css" media="all">
    <link id="2" rel="stylesheet" type="text/css" href="//cdn.solads.media/css/as/160x600.min.css" media="all">
<div id="solads-advert-n1"></div>

<div id="solads-adverts">
    <script type="text/javascript" data-params="jsads">
        m3ads_system = "Solads";
        m3ads_debug = true;
        m3ads_partnernumber = 759980;
        m3ads_sectors = "2007";
        m3ads_numberadverts = 3;
        m3ads_logoimagewidth = 120;
        m3ads_logoimageheight = 60;
        solads_Acontainer = [
            [0,'solads-advert-n1','M3Lbrd group',1],
            [1,'solads-advert-n1','M3Lbrd group',1],
            [2,'solads-advert-n1','M3Lbrd group',1],
        solads_mode = "auto";
    <script type="text/javascript" src="//cdn.feed.solads.media/resources/scripts/jsAds-1.4.min.js"></script>
    <script type="text/javascript" src="//cdn.solads.media/js/jsads-distribute-1.3.min.js" defer></script>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.12.9/dist/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>

my Discourse Settings:

Do you have any Idea what i can do. I see the part with params not working. There is an error from remote side with empty params.

Kind Regards.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.