Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

how to add a bit of java script to every page? (reinvigorate)

edited February 2007 in Vanilla 1.0 Help
Trying to set up reinvigorate on my forum to track stats, and would like to add a little bit of javascript to every page. is there an easy way to do this? Sorry if this is a totally basic question, while i've managed to maintain a pretty successful forum, im still not particularly tech savvy :)

has anyone else tried using reinvigorate with vanilla? how did you like it? how did it work? I just got into the beta.


  • never mind. i realized the sidepanel extension would be perfect for this.
  • Or you could create your own extension that would allow others to setup reinvigorate on their forums as well ;) Something like this...
    <?php /* Extension Name: Reinvigorate Extension Url: x Description: Adds the Reinvigorate stats JS to the specified pages. Version: 1.0 Author: x Author Url: http://x/ */ $Configuration["REINVIGORATE_PATH"] = 'extensions/Reinvigorate/'; // Specify which pages to add JavaScript to Head Control and do it. if (in_array($Context->SelfUrl, array( 'account.php', 'categories.php', 'comments.php', 'extension.php', 'index.php', 'people.php', 'post.php', 'search.php', 'settings.php', 'termsofservice.php'))) { $Head->AddScript($Context->Configuration['REINVIGORATE_PATH'].'reinvigorate.js'); } ?>
  • edited January 2007
    i totally could but i can't code my way out of a paper bag. fortunately it looks like you just did :)

    the sidepanel thing is working flawlessly, though.
  • Hell no. I just copy other people's work =)

    Ofc if you do like above, it gets cached and benefits others ;)
  • edited January 2007
    Reusability, that's the key. Copying is the perfect form of flattery.

    Edit: Of course, I always give credit where credit is due.
  • ...when credit's given ;) /me hopes he's credited people properly in his extensions...
  • edited January 2007
    how to i modify the above code to put the JS in the body, not the head? just change $head to $body?
  • Why would you put the JS in the body? You are supposed to load JS in the head...
  • edited February 2007
    don't ask me, its what reinvigorate wants... "Cut and paste the following code onto any page you want tracked. We recommend placing this code anywhere between the opening and closing <body> tags." <script type="text/javascript" src=""></script> <script type="text/javascript"> //<![CDATA[ re_("12345-numbernumbernumber"); //]]> </script>
  • Thinking about it, maybe I just made it up that JS has to go in the head :) I think I did, although it's best practice to do so as much as possible.
  • right... so is it possible to modify that extension you whipped up to put that code in the body? its not working in the head.
  • Instead of $Head->AddScript() you can use $Panel->AddString()
This discussion has been closed.