Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Aiheen aloitti: swampy - helmikuu 26, 2009, 11:43:28 AP

Otsikko: Inserting a quantcast script tag
Kirjoitti: swampy - helmikuu 26, 2009, 11:43:28 AP
Inserting a quantcast script tag

How would I go about inserting a Quantcast script take in the default theme please?

Thanks in advance.
Otsikko: Re: Inserting a quantcast script tag
Kirjoitti: karlbenson - helmikuu 26, 2009, 11:52:46 AP
Themes/default/index.template.php

(note if your script includes any single quotes, they will need escaping with a backslash to avoid a template parse error)

eg
' becomes \'
Otsikko: Re: Inserting a quantcast script tag
Kirjoitti: swampy - helmikuu 26, 2009, 12:06:38 IP
so how would I do that with this?

<script type="text/javascript" src="http://edge.quantserve.com/quant.js"></script>
<script type="text/javascript">_qacct="p-afC_K6yY-mbos";quantserve();</script>
<noscript>
<a href="http://www.quantcast.com/p-afC_K6yY-mbos" target="_blank"><img src="http://pixel.quantserve.com/pixel/p-afC_K6yY-mbos.gif" style="display: none;" border="0" height="1" width="1" alt="Quantcast"/></a>
</noscript>
Otsikko: Re: Inserting a quantcast script tag
Kirjoitti: karlbenson - helmikuu 26, 2009, 12:08:49 IP
that that doesn't use any single quotes, so just add it in somewhere in index.template.php

it might need to be echoed as php

echo '{codehere}';
Otsikko: Re: Inserting a quantcast script tag
Kirjoitti: swampy - helmikuu 26, 2009, 12:35:22 IP
call me brain dead, all I ti is the following!

Template Parse Error!
There was a problem loading the /Themes/default/index.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.
Otsikko: Re: Inserting a quantcast script tag
Kirjoitti: swampy - helmikuu 26, 2009, 05:28:46 IP
Would someone be kind enough to format this and tell me where to edit it into the index.template.php.  I have tried several times and juist keep screwing it up.

Much thanks in advance

<script type="text/javascript" src="http://edge.quantserve.com/quant.js"></script>
<script type="text/javascript">_qacct="p-afC_K6yY-mbos";quantserve();</script>
<noscript>
<a href="http://www.quantcast.com/p-afC_K6yY-mbos" target="_blank"><img src="http://pixel.quantserve.com/pixel/p-afC_K6yY-mbos.gif" style="display: none;" border="0" height="1" width="1" alt="Quantcast"/></a>
</noscript>
Otsikko: Re: Inserting a quantcast script tag
Kirjoitti: JimM - maaliskuu 15, 2009, 01:26:28 AP
Did you try inserting the code right before the </body> tag  in /Themes/default/index.template.php?