The forum of the forums

Would you like to react to this message? Create an account in a few clicks or log in to continue.
The forum of the forums
3 posters

    Liveracers widget in sidebar/s

    OldCroc
    OldCroc
    Forumember


    Posts : 46
    Reputation : 1
    Language : English

    In progress Liveracers widget in sidebar/s

    Post by OldCroc Mon 12 Oct - 18:43

    Hi all,
    I have a dedicated server running rFactor and GSC extreme racing sims. I have joined liveracers and followed their instructions to put a different domain key into the dedicated servers of both sims. The html code is very similar for both dedicated servers however I cannot get both to show up at the same time. Only one shows. I had the same problem with the TS3 and Mumble servers. Only one will show in one sidebar. Dunno what happens to the second one lol.
    Need a bit of advice, thanks bwi bwi
    OldCroc
    OldCroc
    Forumember


    Posts : 46
    Reputation : 1
    Language : English

    In progress Re: Liveracers widget in sidebar/s

    Post by OldCroc Mon 12 Oct - 18:52

    This is the different html code for the 2 games.
    Liveracers widget in sidebar/s Lrcode10
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51499
    Reputation : 3523
    Language : English
    Location : United States

    In progress Re: Liveracers widget in sidebar/s

    Post by SLGray Mon 12 Oct - 21:33

    So you are adding both codes to a widget on your forum hosted by Forumotion?  One is not appearing?



    Liveracers widget in sidebar/s Slgray10

    When your topic has been solved, ensure you mark the topic solved.
    Never post your email in public.
    OldCroc
    OldCroc
    Forumember


    Posts : 46
    Reputation : 1
    Language : English

    In progress Re: Liveracers widget in sidebar/s

    Post by OldCroc Mon 12 Oct - 21:50

    Yes. And the moment I put the second code in a new widget, it replaces the other one.

    Here is a link to my website. If you scroll down you will see that both widgets shows. One for rFactor and one for Game Stock car. But not on my forum.

    http://oldcroc.wix.com/crocodileracing
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    In progress Re: Liveracers widget in sidebar/s

    Post by Ange Tuteur Mon 12 Oct - 23:35

    Hi @OldCroc,

    Is the problem occurring on a Forumotion forum you administrate ? If so, it would be best if you provide the link of that forum instead. However.. by examining the codes you posted, they're both utilizing the same id ; lr-servers. Ids, unfortunately are one-of-kind, and when referenced in JavaScript the first node with that id is usually returned. Not to mention, they're both creating the same global variable which means one is going to overwrite the other.

    To be honest, both codes look identical aside from the domain.. blackeye
    OldCroc
    OldCroc
    Forumember


    Posts : 46
    Reputation : 1
    Language : English

    In progress Re: Liveracers widget in sidebar/s

    Post by OldCroc Tue 13 Oct - 8:15

    Hi Ange,

    Thank you for your reply. The reason I sent the link to the website, was to point out that these codes, although very similar, works well on the website but not on the forum.
    The link to the forum is http://crocracing.africamotion.net
    Thank you
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51499
    Reputation : 3523
    Language : English
    Location : United States

    In progress Re: Liveracers widget in sidebar/s

    Post by SLGray Tue 13 Oct - 12:04

    Are you sure that you did not copy the same code twice, because both are the same?



    Liveracers widget in sidebar/s Slgray10

    When your topic has been solved, ensure you mark the topic solved.
    Never post your email in public.
    OldCroc
    OldCroc
    Forumember


    Posts : 46
    Reputation : 1
    Language : English

    In progress Re: Liveracers widget in sidebar/s

    Post by OldCroc Tue 13 Oct - 12:09

    The only difference seems to be the domain name under liveracers. However this is the way the html code was pasted on the website and it shows both widgets but the same code/s on forum overwrites the other one.
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    In progress Re: Liveracers widget in sidebar/s

    Post by Ange Tuteur Tue 13 Oct - 12:12

    Could you paste both codes here for me to test ? I should have a better idea of what's going on if I can manipulate the code firsthand.

    Sorry, and thanks. Smile
    OldCroc
    OldCroc
    Forumember


    Posts : 46
    Reputation : 1
    Language : English

    In progress Re: Liveracers widget in sidebar/s

    Post by OldCroc Tue 13 Oct - 12:34

    Hi Ange,

    I am inserting document showing the two codes as reguested.

    Cheers
    Liveracers widget in sidebar/s Lrcode11
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    In progress Re: Liveracers widget in sidebar/s

    Post by Ange Tuteur Tue 13 Oct - 12:46

    I'm sorry, I meant the code you're pasting in the widgets. Otherwise I'm going to have to rewrite everything from the image you posted.
    OldCroc
    OldCroc
    Forumember


    Posts : 46
    Reputation : 1
    Language : English

    In progress Re: Liveracers widget in sidebar/s

    Post by OldCroc Tue 13 Oct - 12:56

    Sorry Ange,

    Here is the code for the two widgets. The red coloured not part of the widget code.

    1: Rfactor game

    <script type="text/javascript">
    window._lr = {
    url: 'http://crocodileracing.liveracers.com' // where [domain].liveracers.com is the address of the domain you want to monitor
    };
    (function () {
    var lr = document.createElement('script'); lr.type = 'text/javascript'; lr.async = true;
    lr.src = window._lr.url + '/Scripts/api.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(lr, s);
    })();
    </script>
    <div theme="dark" id="lr-servers">
    </div>

    02b8ad79-31e2-4e90-981d-2f9898c89d27 Domainkey pasted into game liveracers.ini file.

    2: GSC game

    <script type="text/javascript">
    window._lr = {
    url: 'http://crocodilesim.liveracers.com' // where [domain].liveracers.com is the address of the domain you want to monitor
    };
    (function () {
    var lr = document.createElement('script'); lr.type = 'text/javascript'; lr.async = true;
    lr.src = window._lr.url + '/Scripts/api.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(lr, s);
    })();
    </script>
    <div id="lr-servers" theme="dark">
    </div>

    887f840-26d7-4a2d-8734-60b7cbab3134 Domainkey pasted into game liveracers.ini file.

    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    In progress Re: Liveracers widget in sidebar/s

    Post by Ange Tuteur Tue 13 Oct - 13:11

    I really think it comes down to using multiple Ids which are the same. For your second widget, try changing id="lr-servers" to id="lr-servers-2" and I assume you can edit the API script, correct ? If so, edit this file : http://crocodilesim.liveracers.com/Scripts/api.js

    and change document.getElementById('lr-servers') to document.getElementById('lr-servers-2')

    From what I can tell, the latter code is overwriting the former code. The global variable that's being overwritten ( window._lr ) shouldn't be a problem, but the shared ids on the other hand seem to be.
    OldCroc
    OldCroc
    Forumember


    Posts : 46
    Reputation : 1
    Language : English

    In progress Re: Liveracers widget in sidebar/s

    Post by OldCroc Tue 13 Oct - 13:13

    Thanks Ange. Will give it a try and come back to you Hello
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    In progress Re: Liveracers widget in sidebar/s

    Post by Ange Tuteur Tue 13 Oct - 13:13

    Sure thing. You only need to do this for one widget, but if you have more widgets like this in the future you may need to do the same thing. That's if it works of course. Razz

      Current date/time is Mon 23 Sep - 15:25