SMF header

Josh

Paragon
Joined
Nov 2, 2008
Messages
1,151
Reaction score
0
FP$
1,671
How would you edit the header in an SMF site? I need to add a java script code but I'm not sure where to put it.
 
Before we can help you any further which version do you use?

1.1.10 or 2.0 rc1.2?
 
So go to FTP and download ./Themes/default/index.template.php and add it in there. Make sure to escape all single quotes in the code you are adding.
 
Kirisute Gomen said:
So go to FTP and download ./Themes/default/index.template.php and add it in there. Make sure to escape all single quotes in the code you are adding.

I don't get the escape part.
 
What is the code you are trying to add?
Put a backslash \ in before every single quote '
For example:
Code:
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-#######-#");
pageTracker._trackPageview();
} catch(err) {}</script>
Would be:
Code:
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src=\'" + gaJsHost + "google-analytics.com/ga.js\' type=\'text/javascript\'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-#######-#");
pageTracker._trackPageview();
} catch(err) {}</script>
 
Kirisute Gomen said:
What is the code you are trying to add?
Put a backslash \ in before every single quote '

Code:
   1. <script src="<strong>http://www.weirdestsite.com/peel.js</strong>" type="text/javascript"></script>
 
Durf said:
Kirisute Gomen said:
What is the code you are trying to add?
Put a backslash \ in before every single quote '

Code:
   1. <script src="<strong>http://www.weirdestsite.com/peel.js</strong>" type="text/javascript"></script>

@Durf: The code you posted will work fine. There are no single quotes ( ' ). 🙂
 
Back
Top Bottom