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.
Options

Increment View only counts Page 1 of discussions

Hi,

I am fairly new to Vanilla (Vanilla 2.1.3).

I have been working my way through all the comment regarding the Increment View plugin. I have not found a solution to my problem or even someone with the same problem:

the plugin works fine as long as the discussion only has 1 page. As soon as there are more than 1 page and all links go to #latest the view count stays the same. That is, if you don't visit page 1 again.

It seems that the function within the plugin isn't even called when only page 2 or higher are viewed. I have checked via FireBug that the DiscussionID on the following pages is correct and it is.

I am really stuck and it would be great if someone could help.

Thanx!

Comments

  • Options
    peregrineperegrine MVP
    edited October 2014

    plugin shouldn't be needed if:

    solves some problems if view count is not incremented.
    
    you could change this:
    
    in php.ini
    
    magic_quotes_gpc = Off
    
    or via .htaccess
    
    php_flag magic_quotes_gpc Off
    

    there was also a cache issue that was going to be fixed....

    meanwhile - @linc whatever became of this https://github.com/vanilla/vanilla/issues/1899

    looks like the solution you guys came up with was removed from the issue - was it incorporated.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options

    Hi peregrine,

    thanx for that fast answer. The php.ini fix did it.
    I added a php.ini in the vanilla Folder with

    ; Turn off magic quotes magic_quotes_gpc = off

    Thank you!

  • Options

    @schuchi said:
    Hi peregrine,

    thanx for that fast answer. The php.ini fix did it.
    I added a php.ini in the vanilla Folder with

    ; Turn off magic quotes magic_quotes_gpc = off

    Thank you!

    no prob. the plugin really shouldn't be needed, and i'll probably have it removed at a later time.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    peregrineperegrine MVP
    edited October 2014

    the plugin works fine as long as the discussion only has 1 page. As soon as there are more than 1 page and all links go to #latest the view count stays the same. That is, if you don't visit page 1 again.

    if anyone has a dying need to use the plugin in 2.1 and have it work in more than one page

    change
    public function DiscussionController_BeforeDiscussionDisplay_Handler($Sender) {

    to

    public function DiscussionController_AfterDiscussionTitle_Handler($Sender) {

    in class.incrementview.plugin.php

    But I would try changing magic quotes solution first.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Sign In or Register to comment.