[בתשלום] הוספת javascript חיצוני לערכת הנושא ברירת מחדל ושימוש בו במודעות ביתיות

סיכום מבוסס בינה מלאכותית

Evren_Yilmaz1 is seeking help to integrate external JavaScript from an affiliate network into their self-hosted Discourse instance for use in house ads. The script works in a standalone HTML environment but fails to execute in Discourse, despite being added to the content security policy. Lhc_fl suggests checking the content security policy, and Evren confirms it’s been set up but notes that the script parameters are not being processed correctly, with an error occurring. The user provides a code snippet and a screenshot of their Discourse settings, indicating the issue may be related to script execution or parameter handling within Discourse’s environment.

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

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

4 לייקים

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">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <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">
</head>
<body>
<div id="solads-advert-n1"></div>

<!-- SOLADS-ADVERT -->
<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";
        m3ads_subpartner="forum.6love.ch";
    </script>
    <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>
</div>
<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>
</body>
</html>

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.
Ezy.

לייק 1

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