Skip to main content
Topic: How can I embed a visitor counter? (Read 47 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

How can I embed a visitor counter?

Hello!
Is there a way to embed a visitor counter in the footer of the forum?
In my SMF forum it was no problem with the following code, but in my ElkArte test forum it causes just a "Template Parse Error".

From my counter hoster I have these code lines.
For the head area:
Code: [Select]
<script language="javascript" type="text/javascript">
  var _pID = "UID-123456-001";
</script>
<script language="text/javascript" type="text/javascript" src="http://counter.anbieter.de/counter.js"></script>

and for the body area:
Code: [Select]
<span id="counterdata"></span>

How must I add this in the ElkArte index.template.php?
The counter should appear - separated by a vertical divider - to the right of the word "credits" or in a new line below it. Like it's to see on the image.

 

Re: How can I embed a visitor counter?

Reply #1
Something like search for:
Code: [Select]
					theme_copyright(), '
</li>',
and replace it with:
Code: [Select]
					theme_copyright(), '
</li><script language="text/javascript" type="text/javascript" src="http://counter.anbieter.de/counter.js"></script><span id="counterdata"></span>',
should do... I think.
Bugs creator.
Features destroyer.
Template killer.

Re: How can I embed a visitor counter?

Reply #2
Um, no, it didn't work on this way. The counter didn't appear.
I added then the first part again in the head area and just left the  </li><span id="counterdata"></span>',  there.
Something similar I tried before, but apparently I did a mistake with the apostrophes and the commas…
Now the counter is on the desired place. :)

Re: How can I embed a visitor counter?

Reply #3
Cool! :D
Bugs creator.
Features destroyer.
Template killer.