Jump to content
HWBOT Community Forums

Embed HWBOT Rankings on Blog or Forum


Recommended Posts

2 minutes ago, richba5tard said:

You might! Please check if you have a reference to https://ssl somewhere in the hwbot code snippet.

Here's what I have in my BB Code entry for the HWBot code, should it be something different now?

<script type="text/javascript">
	
    var _hwbtarget = 'hwb_' + Math.round((Math.random() * 100000));
    document.write("<div id='"+ _hwbtarget +"'><img src='//62.182.59.107/img/loader.gif' alt='loading'/> Loading…</div>");

	// uncomment for custom css
    var _hwbcss = "//hwbot.org/css/style.external.custom.ocforums.css";
    var _hwb =  _hwb || [];
    _hwb.push(['type={param}']);
    _hwb.push(['params={option}']);
    _hwb.push([_hwbtarget]);
		
    (function() {
      var hwbex = document.createElement('script'); hwbex.type = 'text/javascript'; hwbex.async = true;
      hwbex.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://') + 'hwbot.org/js/exf2.js';
      var s = document.getElementById(_hwbtarget); s.parentNode.insertBefore(hwbex, s);
    })();
		
</script>

 

Link to comment
Share on other sites

43 minutes ago, richba5tard said:

Please replace:


hwbex.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://') + 'hwbot.org/js/exf2.js';

With:


hwbex.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'hwbot.org/js/exf2.js';
 

OK sorry for the delay, got waylaid. 
I made that change, which took the result from "loading" to a blank element in the thread.

https://www.overclockers.com/forums/showthread.php/646030-HWBOT-Rankings

Link to comment
Share on other sites

On 7/16/2018 at 5:11 PM, ATMINSIDE said:

OK sorry for the delay, got waylaid. 
I made that change, which took the result from "loading" to a blank element in the thread.

https://www.overclockers.com/forums/showthread.php/646030-HWBOT-Rankings

Sorry, not sure why but it keeps using the non https version. You can't mix https with http, the browser will prevent that.

Can you force https by changing above line to:

wbex.src = 'https://hwbot.org/js/exf2.js';
Link to comment
Share on other sites

50 minutes ago, richba5tard said:

Sorry, not sure why but it keeps using the non https version. You can't mix https with http, the browser will prevent that.

Can you force https by changing above line to:


wbex.src = 'https://hwbot.org/js/exf2.js';

Doesn't look like that's fixed it either. I did manage to get the loader.gif to work though, for some reason it was set to a static IP instead of hwbot.org

Here's where I'm at right now:
 

<script type="text/javascript">
	
    var _hwbtarget = 'hwb_' + Math.round((Math.random() * 100000));
    document.write("<div id='"+ _hwbtarget +"'><img src='https://hwbot.org/img/loader.gif' alt='loading'/> Loading…</div>");

	// uncomment for custom css
    var _hwbcss = "https://hwbot.org/css/style.external.custom.ocforums.css";
    var _hwb =  _hwb || [];
    _hwb.push(['type={param}']);
    _hwb.push(['params={option}']);
    _hwb.push([_hwbtarget]);
		
    (function() {
      var hwbex = document.createElement('script'); hwbex.type = 'text/javascript'; hwbex.async = true;
      wbex.src = 'https://www.hwbot.org/js/exf2.js';
      var s = document.getElementById(_hwbtarget); s.parentNode.insertBefore(hwbex, s);
    })();
		
</script>

 

Link to comment
Share on other sites

3 hours ago, richba5tard said:

Typo, it's 


hwbex.src = 'https://www.hwbot.org/js/exf2.js';

not


wbex.src = 'https://www.hwbot.org/js/exf2.js';

The h got lost with copy pasting the code. :)

Sorry, must have made a typo there... still having the same result for some reason though after updating to hwbex.src

Link to comment
Share on other sites

  • 3 years later...

Hey @richba5tard, we recently moved to XenForo and I'm trying to get our BBCode working again. Let me know if you need any other info and I'll be glad to get it!

HTML in use:

<script type="text/javascript">
	
    var _hwbtarget = 'hwb_' + Math.round((Math.random() * 100000));
    document.write("<div id='"+ _hwbtarget +"'><img src='https://hwbot.org/img/loader.gif' alt='loading'/> Loading…</div>");

	// uncomment for custom css
    var _hwbcss = "https://hwbot.org/css/style.external.custom.ocforums.css";
    var _hwb =  _hwb || [];
    _hwb.push(['type={text}']);
    _hwb.push(['params={option}']);
    _hwb.push([_hwbtarget]);
		
    (function() {
      var hwbex = document.createElement('script'); hwbex.type = 'text/javascript'; hwbex.async = true;
      hwbex.src = 'https://hwbot.org/js/exf2.js';
      var s = document.getElementById(_hwbtarget); s.parentNode.insertBefore(hwbex, s);
    })();
		
</script>

Example BBCode usage:

[hwbot=overclockers.com,CPU-Z,20]teamrank[/hwbot]

What happens on the browser is I get the loading.gif showing, and this in the dev console:

<script type="text/javascript">
	
    var _hwbtarget = 'hwb_' + Math.round((Math.random() * 100000));
    document.write("<div id='"+ _hwbtarget +"'><img src='https://hwbot.org/img/loader.gif' alt='loading'/> Loading…</div>");

	// uncomment for custom css
    var _hwbcss = "https://hwbot.org/css/style.external.custom.ocforums.css";
    var _hwb =  _hwb || [];
    _hwb.push(['type=teamrank']);
    _hwb.push(['params=overclockers.com,CPU-Z,20']);
    _hwb.push([_hwbtarget]);
		
    (function() {
      var hwbex = document.createElement('script'); hwbex.type = 'text/javascript'; hwbex.async = true;
      hwbex.src = 'https://hwbot.org/js/exf2.js';
      var s = document.getElementById(_hwbtarget); s.parentNode.insertBefore(hwbex, s);
    })();
		
</script>

This page has my test usage on it: https://www.overclockers.com/forums/help/bb-codes/#hwbot

  • Like 1
Link to comment
Share on other sites

  • 3 months later...

FYI to anyone still using this, who might be on XenForo. Figured this one out today.
Apparently, XF does not like links without www. in some instances. Just adding that in, shown below, to the HTML Replacement got this one working.

 

<script type="text/javascript">



    var _hwbtarget = 'hwb_' + Math.round((Math.random() * 100000));

    document.write("<div id='"+ _hwbtarget +"'><img src='https://www.hwbot.org/img/loader.gif' alt='loading'/> Loading…</div>");



    // uncomment for custom css

    var _hwbcss = "https://www.hwbot.org/css/style.external.custom.ocforums.css";

    var _hwb =  _hwb || [];

    _hwb.push(['type={text}']);

    _hwb.push(['params={option}']);

    _hwb.push([_hwbtarget]);

      

    (function() {

      var hwbex = document.createElement('script'); hwbex.type = 'text/javascript'; hwbex.async = true;

      hwbex.src = 'https://www.hwbot.org/js/exf2.js';

      var s = document.getElementById(_hwbtarget); s.parentNode.insertBefore(hwbex, s);

    })();

      

</script>
  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...