PDA

View Full Version : Help with disabling code in template


brandon515
08-18-2009, 05:34 PM
In my footer template I have the following code thats for syntax highlighting. It works great but it messes up my vaispy.php page. I am trying to figure out how to write a bit of code that would disable the code on the vaispy page but enable it for all other pages.

<script type="text/javascript" src="js/shCore.js"></script>
<script type="text/javascript" src="js/shBrushPhp.js"></script>
<script type="text/javascript" src="js/shBrushCSharp.js"></script>
<script type="text/javascript" src="js/shBrushCss.js"></script>
<script type="text/javascript" src="js/shBrushJScript.js"></script>
<script type="text/javascript" src="js/shBrushSql.js"></script>
<script type="text/javascript" src="js/shBrushVb.js"></script>
<script type="text/javascript" src="js/shBrushXml.js"></script>
<script type="text/javascript">
window.onload = function () {
dp.SyntaxHighlighter.ClipboardSwf = 'js/clipboard.swf';
dp.SyntaxHighlighter.HighlightAll('code', true, true, false, 1, false);
}
</script>

Any help would be greatly appreciated.
Brandon

Dismounted
08-21-2009, 10:44 AM
<if condition="THIS_SCRIPT != 'REPLACEME'">
<script type="text/javascript" src="js/shCore.js"></script>
<script type="text/javascript" src="js/shBrushPhp.js"></script>
<script type="text/javascript" src="js/shBrushCSharp.js"></script>
<script type="text/javascript" src="js/shBrushCss.js"></script>
<script type="text/javascript" src="js/shBrushJScript.js"></script>
<script type="text/javascript" src="js/shBrushSql.js"></script>
<script type="text/javascript" src="js/shBrushVb.js"></script>
<script type="text/javascript" src="js/shBrushXml.js"></script>
<script type="text/javascript">
window.onload = function () {
dp.SyntaxHighlighter.ClipboardSwf = 'js/clipboard.swf';
dp.SyntaxHighlighter.HighlightAll('code', true, true, false, 1, false);
}
</script>
</if>
Look inside vaispy.php and look for the line near the top like this:
define('THIS_SCRIPT', 'something');
Replace "REPLACEME" in the template code with "something".