Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Pasting Code into <body> tag of site

edited April 2012 in Vanilla 2.0 - 2.8

I'm trying to paste code into my forum and was told I needed to place it:

before the tag of your site's HTML file

Does anyone know where that would be in Vanilla Forums?

Really appreciate any help.

Cheers Michael

Tagged:

Best Answers

  • x00x00 MVP
    edited April 2012 Answer ✓

    Get the pockets plugin and enable it. Then go to plugin/pockets/add

    1. Name

    2. enter in Body:

    <script type="text/javascript" charset="utf-8">
       var _btq = _btq || [];
       var _punchtab_settings_badges = {
         key: "15b7d6babf70b0b7eb6f1ebf3564d914",
         position: {x: "right", y: "top"}
       };
     
       (function() {
         var pt = document.createElement('script'); pt.type = 'text/javascript'; pt.async = true;
         pt.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'static.punchtab.com/js/pb.js';
         var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(pt, s);
       })();
    </script>
    
    1. Select Head

    2. Select Before

    3. Save

    grep is your friend.

  • x00x00 MVP
    Answer ✓

    that is just showing you where you can insert the pockets, you need to hide them

    plugin/pockets/hidelocations

    grep is your friend.

Answers

  • There was an error rendering this rich post.

  • I don't think these are related @UnderDog, different question which happen to have some of the same words in them.

    grep is your friend.

  • yeah I think they are different. I want to know where I have to and place a code that I have been given. So what folder would I place a code so that it appears before the equivalent of the body tag of the HTML file.

    I am a newbie so if there is a HTML file inside vanilla forums then if someone can tell me where that is so I can just paste the code there that would be great.

    Cheers Michael

  • what is the code first, then i will tell you how to do correctly.

    grep is your friend.

  • That would be awesome x00. Really appreciate it.

    var _btq = _btq || []; var _punchtab_settings_badges = { key: "15b7d6babf70b0b7eb6f1ebf3564d914", position: {x: "right", y: "top"} }; (function() { var pt = document.createElement('script'); pt.type = 'text/javascript'; pt.async = true; pt.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'static.punchtab.com/js/pb.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(pt, s); })();
  • x00x00 MVP
    edited April 2012 Answer ✓

    Get the pockets plugin and enable it. Then go to plugin/pockets/add

    1. Name

    2. enter in Body:

    <script type="text/javascript" charset="utf-8">
       var _btq = _btq || [];
       var _punchtab_settings_badges = {
         key: "15b7d6babf70b0b7eb6f1ebf3564d914",
         position: {x: "right", y: "top"}
       };
     
       (function() {
         var pt = document.createElement('script'); pt.type = 'text/javascript'; pt.async = true;
         pt.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'static.punchtab.com/js/pb.js';
         var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(pt, s);
       })();
    </script>
    
    1. Select Head

    2. Select Before

    3. Save

    grep is your friend.

  • x00x00 MVP
    edited April 2012

    this is not strictly speaking before the body tag but it doesn't need to be, you could also use theme hooks file using Base_Render_Before hook and $Sender->Head->AddString

    grep is your friend.

  • ok doing that sent my site crazy but Im guessing it is because I did something wrong.

    All I get is huge yellow banners everywhere now at the top, middle and bottom of the page saying Head (before) Head (After) Content (Before) Content (After) Foot (Before) Foot (After) etc

  • x00x00 MVP
    Answer ✓

    that is just showing you where you can insert the pockets, you need to hide them

    plugin/pockets/hidelocations

    grep is your friend.

  • haha. Your a champion x00. That worked perfect.

    Just wanted to thank you for taking the time to help me with this.

    It is really nice to know there are people like yourself out there who are are kind enough to help.

    Thank You!

    Cheers Michael

Sign In or Register to comment.