Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

Try this online visitor counter it is very nice but there is little problem with https can anyone try and solve ?

+2 votes
150 views
asked Feb 14 in Q2A Core by Zeeshan

https://github.com/felladrin/online-visitors-counter

This show how many users are online and also on which page users are.

But if you try it on your site there is little problem with https

Any solution for that?

BTW I already asked the problem to the owner ,,so I think maybe the problem is with Q2A

Q2A version: 1.8

1 Answer

0 votes
answered Feb 15 by Zeeshan
function head_script()
    {
        if ($this->template != 'admin') // check it's not an admin page
            $this->content['script'][]='<SCRIPT src="'.
            qa_html(QA_HTML_THEME_LAYER_URLTOROOT.'ovc/counter.js').
            '" TYPE="text/javascript"></SCRIPT>';

        qa_html_theme_base::head_script();
    }


is this right code and where to put this?
commented Feb 15 by Zeeshan
class qa_html_theme_layer extends qa_html_theme_base
{
    

    function head_script() // add a Javascript file from plugin directory
    {
        if ($this->template=='question') // check it's a question page
            $this->content['script'][]='<SCRIPT src="'.
            qa_html(QA_HTML_THEME_LAYER_URLTOROOT.'online/ovc/counter.js').
            '" TYPE="text/javascript"></SCRIPT>';

        qa_html_theme_base::head_script();
    }

    
}
...