Announcement

Collapse
No announcement yet.

How do i include a counter in the forumhome template?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Digi-God
    replied
    I think PHP also has a limitation preventing one to call CGI scripts from within a PHP script (security reasons, I believe). If TheCounter uses something CGI, I don't think it will let you use it...

    - Philip

    Leave a comment:


  • WebStyles
    replied
    I would go with wluke's suggestion, because it's probably characters in the JavaScript causing the parse error... Putting the script in its own file will stop that.

    It sounds to me like you only want it to count visits to the forum home page? If so, put the script tags wherever you want in the forumhome template, and not the header / footer.

    Leave a comment:


  • Wayne Luke
    replied
    Have you tried?

    Have you tried putting your counter code in its own Javascript file? Just remove the <SCRIPT> and </SCRIPT> tags and save it as counter.js

    Then in your header or footer try adding:
    <script language="Javascript" src="path/to/counter.js"><!-- Counter Script --></script>

    I would try this and see if it works. This way there is no code that PHP might mistake for its own in the Templates.

    Leave a comment:


  • Jon Salman
    replied
    Putting the code in the footer still comes up with a parse error.

    any reasons why?

    is there somewhere special where i should be putting the code?

    or would the easiest way be to create an index.html with the code in and also a frame for the forum pointing to index.php?

    Leave a comment:


  • JohnM
    replied
    Re: off topic

    Originally posted by the dnuk webmaster
    off topic:

    Hey JimF you have a Yellow smiles campiagn going?
    Yup, we dont like yellow smilies

    Look at my signature too

    Leave a comment:


  • thetakerfan
    replied
    Although putting the code in the footer would have it load for every page, that won't effect the unique hit count, so whats the difference. Just look at the unique hits, not the total hits. That should work fine I believe.

    Leave a comment:


  • Jon Salman
    replied
    this is the code:

    <!-- Start of TheCounter.com Code -->
    <SCRIPT TYPE="text/javascript" LANGUAGE="javascript">
    s="na";c="na";j="na";f=""+escape(document.referrer)
    </SCRIPT>
    <SCRIPT TYPE="text/javascript" LANGUAGE="javascript1.2">
    s=screen.width;v=navigator.appName
    if (v != "Netscape") {c=screen.colorDepth}
    else {c=screen.pixelDepth}
    j=navigator.javaEnabled()
    </SCRIPT>
    <SCRIPT TYPE="text/javascript" LANGUAGE="javascript">
    function pr(n) {document.write(n,"\n");}
    NS2Ch=0
    if (navigator.appName == "Netscape" &&
    navigator.appVersion.charAt(0) == "2") {NS2Ch=1}
    if (NS2Ch == 0) {
    r="&size="+s+"&colors="+c+"&referer="+f+"&java="+j+""
    pr("<A HREF=\"http://www.TheCounter.com\" TARGET=\"_top\"><IMG"+
    " BORDER=0 SRC=\"http://c2.thecounter.com/id=1404177"+r+"\"><\/A>")}
    </SCRIPT>
    <NOSCRIPT><A HREF="http://www.TheCounter.com" TARGET="_top"><IMG
    SRC="http://c2.thecounter.com/id=1404177" ALT="TC" BORDER=0></A>
    </NOSCRIPT>
    <!-- End of TheCounter.com Code -->



    Where do i put it!!

    Leave a comment:


  • JimF
    replied
    Out of curiosity, what's the code you're trying to install?

    -jim

    Leave a comment:


  • George L
    replied
    well putting it on your frontpage only ain't accurate... cause not everyone comes in from the front page... my sites only 5 - 15% of visitors come in from the front door... i have around 600+ pages indexed in search engines for one site so they come from everywhere

    if you only want the frontpage then put it in forumhome template within a new table or existing table

    i don't know why it would give you an error unless you pasted it over some forumhome template code

    Leave a comment:


  • Jon Salman
    replied
    but won't inserting it in the header make it register a page view every time a page on the forum is loaded?

    i am guessing that the header loads up on every page?

    Leave a comment:


  • George L
    replied
    it would be easier to insert it in the header or footer templates

    Leave a comment:


  • How do i include a counter in the forumhome template?

    I have signed up for an invisable counter from http://www.thecounter.com

    i need to put the code on the main forum page which i guess is forumhome?

    when i insert the code i get an error, parse in mainfile.php line 31

    how do i fix this? or does the code need to go elsewhere?


    please help!!


    regards,

    Jon Salman
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...
X