Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

View Counts Stuck At 1

Hi,

I've recently 'gone live' with a Vanilla Forum hosted on my website. It's version 2.1.9. I am using it in conjunction with the Wordpress Embed plugin.

However I have noticed view counts are not incrementing - they are stuck at 1.

I have tried disabling magic quotes via php.ini. This has not resolved the problem.

I have tried disabling the Wordpress embed. I don't think this has made a difference.

I am using the default theme with one change to remove the 'Powered by Vanilla' icon. I have checked for Javascript errors and I can't see any. I did try reverting to the original theme but this hasn't helped.

Plugins I have enabled on the forum are Add Registration Question, All Viewed, Button Bar, Emotify, Quotes.

What else can I try and do to track down / solve this problem?

Many thanks in advance.

Comments

  • R_JR_J Admin

    You have seen those discussions already? I guess, if you have played around with magic quotes... :-/

    http://vanillaforums.org/discussion/29142/view-count-all-1
    http://vanillaforums.org/discussion/27256/views-count-in-v-2-1

  • Yes thanks for your reply. Those were the threads I had found. Any other ideas? Otherwise can I turn the view count off?

  • edited April 2015

    I am using the default theme with one change to remove the 'Powered by Vanilla' icon.

    Did you do this by removing the foot asset ?

     <div id="Foot">
             <div class="Row">
                <a href="{vanillaurl}" class="PoweredByVanilla" title="Community Software by Vanilla Forums">Powered by Vanilla</a>
                {asset name="Foot"}
             </div>
    

    If you did, that may be the cause of your problem...you should not edit the default at all...

  • freesterfreester New
    edited April 2015

    Hi. Thanks for your reply.

    No I just set the 'PoweredByVanilla' class to hidden. I didn't edit the default theme I created a new theme based on the default with the custom css modifications as recommended in the online docs.

    I found another thread talking about JS errors upsetting the counter functions in the footer but I've run with browser console debug on and can't see any JS problems.

  • Ok, do you use any ad blocking software in your browser ?

    Do you have analytics enabled ?

    Or some kind of Voting Plugin enabled ?

    Have you tried using a different theme ?

  • @vrijvlinder said:
    Ok, do you use any ad blocking software in your browser ?

    No

    Do you have analytics enabled ?

    No

    Or some kind of Voting Plugin enabled ?

    No

    Have you tried using a different theme ?

    I've tried the default theme

  • I've tried the default theme

    I meant another theme not the default

    Do you have analytics enabled ? no

    You probably need to enable it.

  • Try this and report if it works or not for you...

  • @vrijvlinder said:
    You probably need to enable it.

    Apologies I thought you were referring to a plugin. I think you meant had I added the $Configuration['Garden']['Analytics']['Enabled'] = FALSE; to the config. Which I haven't so it is enabled.

    I'll give the IncrementView plugin a go and report back.

    Many thanks for your assistance.

  • So. I haven't installed the plugin yet.

    What I did do was install my latest forum/website on a reference installation on my desktop PC with XAMPP server from my website backup. View counts on my 'reference' installation are incrementing. It's got to be something to do with PHP version, magic_quotes, or some other config on my host that is different to my XAMPP versions?

  • R_JR_J Admin

    Save that as a file on your server and open it to see if magic quotes are really off:

    <?php
    echo phpinfo();
    
  • Fixed it!

    1) I had put the php.ini in my 'public_html' website directory, not the forum subdirectory (doh!).

    2) I moved php.ini to the forum subdirectory but this broke the forum with a white screen when trying to navigate to the forum.

    Link here reported something similar...

    http://vanillaforums.org/discussion/29142/view-count-all-1

    So I enabled debug and get the error

    Fatal error: Class 'PDO' not found in /home/bjworguk/public_html/forums/library/database/class.database.php on line 48

    Which is again similar to the thread above.

    PHPINFO was reporting PDO as enabled but in the end I followed the link to stackoverflow in the thread above and it suggested some lines to add to the php.ini

    So final fix was add the following lines to php.ini in my forums subdirectory:

    magic_quotes_gpc=Off

    extension=pdo.so
    extension=pdo_sqlite.so
    extension=sqlite.so
    extension=pdo_mysql.so

  • yep it is php bug.

    grep is your friend.

Sign In or Register to comment.