Store
Community Documentation

v3 Knowledgebase

Counters - Make "Every" View Count

"Thanks to whomever originally contributed these". Though if I'm not mistaken I think it was Coolworks whom originally shared the profile, photo and video view fixes. and for the Forum Fix special thanks to DMAN and Ling

Ok here I'm going to show you how to make all views count regardless of viewers ip, members or anything, it will always count the view.


(Profile Views)........

Go to your AdminCP/Extentions/Plugins/Create New Plugin

now create it as shown here



hit save and your done, btw here is the code that goes in the phpcode input area

Phpfox::getService('user.field.process')->update($aRow['user_id'], 'total_view', ($aRow['total_view'] + 1));



(Photo Views)........

Go to your AdminCP/Extentions/Plugins/Create New Plugin

now create it as shown here



hit save and your done, btw here is the code that goes in the phpcode input area

Phpfox::getService('photo.process')->updateCounter($aPhoto['photo_id'], 'total_view');



(Video Views)........

Go to your AdminCP/Extentions/Plugins/Create New Plugin

now create it as shown here



hit save and your done, btw here is the code that goes in the phpcode input area

$this->database()->updateCounter('video', 'total_view', 'video_id', $aVideo['video_id']);



(Forum Views)........

Reminder: this one does edit a core file

Go to module\forum\include\component\controller\thread.class.php

find (around line 130 in V2) (Look around line 117 in V3)

if (!$aThread['is_seen'])
        {
            if ($aCallback === null)
            {
                Phpfox::getService('forum.process')->updateTrack($aForum['forum_id']);
            }
            Phpfox::getService('forum.thread.process')->updateTrack($aThread['thread_id']);
        }


and replace it with

if ($aCallback === null)
            {
                Phpfox::getService('forum.process')->updateTrack($aForum['forum_id']);
            }
            Phpfox::getService('forum.thread.process')->updateTrack($aThread['thread_id']);