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 do I add a script in the header?
I want to add the following line into the header on all pages, unfortunately I can't seem to find where I would put this...
<script type="text/javascript"> <!-- if( top != self ){ top.location=self.document.location; } //--> </script>
It's to break the page out of frames as otherwise the login doesn't work on my server.
0
This discussion has been closed.
Comments
if (@$Head) { $Head->AddScript($Context->StyleUrl."framebreaker.js"); }
and then have your js in an external file.
i looked at the PanelHider extension and just quickly edited it down.
$Head->AddScript("/path/to/your/js/file.js");
My Extension
<?php /* Extension Name: Break Frames Extension Url: http://soul-scape.com/ Description: Should add a script on every page to allow the site to break free from the constricting frames. Version: 1.0 Author: Ben Author Url: http://www.soul-scape.com/ */ $Head->Addscript("./js/BreakFrames.js"); ?>
My Javascript
if( top != self ){ top.location=self.document.location; }
Now this still doesn't seem to be working, I'm not familiar with the intricacies of JavaScript so any help would be appreciated...
while you're at it, give me a discussion list auto-refresher!
/* Extension Name: Break Frames Extension Url: http://soul-scape.com/ Description: Should add a script on every page to allow the site to break free from the constricting frames. Version: 1.0 Author: Ben Author Url: http://www.soul-scape.com/ */ if (in_array($Context->SelfUrl, array("index.php")) && $Context->Session->UserID > 0) { $Head->Addstring("META TAG TO REFRESH THE PAGE"); } ?>
thhat would probably work
Warning: Cannot modify header information - headers already sent by (output started at /home/soul-sca/public_html/vanilla/extensions/BreakFrames.php:15) in /home/soul-sca/public_html/vanilla/library/Vanilla.Session.class.php on line 27
if (@$Head) { }