Cheetah
Public Member Functions | Public Attributes | List of all members
ChWsbViews Class Reference

Public Member Functions

 __construct ($sSystem, $iId, $isMakeView=true)
 
 makeView ()
 
 getId ()
 
 isEnabled ()
 
 getSystemName ()
 
 getAllSystems ()
 
 onObjectDelete ($iId=0)
 
 maintenance ()
 
 _triggerView ()
 

Public Attributes

 $_iId = 0
 
 $_sSystem = ''
 
 $_aSystem = array ()
 

Detailed Description

Track any object views automatically

Add record to sys_object_views table to track object views, to record view just create this class instance with your object id for example: new ChWsbViews('my_system', 25); // 25 - is object id

Description of sys_object_views table fields: name - system name, it is better to use unique module prefix here, lowercase and all spaces are underscored table_track - table to track views period - period in secs to update next views, default is 86400(1 day) trigger_table - table where you need to update views field trigger_field_id - table field id to unique determine object trigger_field_views - table field where total view number is stored is_on - is the system activated

Structure of the track table is the following: CREATE TABLE my_views_track ( id, – this field type must be exact as your object id type viewer int(10) unsigned NOT NULL, – viewer profile id ip int(10) unsigned NOT NULL, – viewer ip address to track guest views ts int(10) unsigned NOT NULL, – timestamp of last recorded view KEY id (id,viewer,ip) ) ENGINE=MyISAM DEFAULT CHARSET=utf8;

Definition at line 37 of file ChWsbViews.php.

Constructor & Destructor Documentation

◆ __construct()

ChWsbViews::__construct (   $sSystem,
  $iId,
  $isMakeView = true 
)

Constructor

Definition at line 46 of file ChWsbViews.php.

Member Function Documentation

◆ _triggerView()

ChWsbViews::_triggerView ( )

Definition at line 138 of file ChWsbViews.php.

◆ getAllSystems()

ChWsbViews::getAllSystems ( )

Definition at line 108 of file ChWsbViews.php.

◆ getId()

ChWsbViews::getId ( )

Definition at line 93 of file ChWsbViews.php.

◆ getSystemName()

ChWsbViews::getSystemName ( )

Definition at line 103 of file ChWsbViews.php.

◆ isEnabled()

ChWsbViews::isEnabled ( )

Definition at line 98 of file ChWsbViews.php.

◆ maintenance()

ChWsbViews::maintenance ( )

Definition at line 124 of file ChWsbViews.php.

◆ makeView()

ChWsbViews::makeView ( )

Definition at line 60 of file ChWsbViews.php.

◆ onObjectDelete()

ChWsbViews::onObjectDelete (   $iId = 0)

Definition at line 114 of file ChWsbViews.php.

Member Data Documentation

◆ $_aSystem

ChWsbViews::$_aSystem = array ()

Definition at line 41 of file ChWsbViews.php.

◆ $_iId

ChWsbViews::$_iId = 0

Definition at line 39 of file ChWsbViews.php.

◆ $_sSystem

ChWsbViews::$_sSystem = ''

Definition at line 40 of file ChWsbViews.php.


The documentation for this class was generated from the following file: