Cheetah
|
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 () | |
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.
ChWsbViews::__construct | ( | $sSystem, | |
$iId, | |||
$isMakeView = true |
|||
) |
Constructor
Definition at line 46 of file ChWsbViews.php.
ChWsbViews::_triggerView | ( | ) |
Definition at line 138 of file ChWsbViews.php.
ChWsbViews::getAllSystems | ( | ) |
Definition at line 108 of file ChWsbViews.php.
ChWsbViews::getId | ( | ) |
Definition at line 93 of file ChWsbViews.php.
ChWsbViews::getSystemName | ( | ) |
Definition at line 103 of file ChWsbViews.php.
ChWsbViews::isEnabled | ( | ) |
Definition at line 98 of file ChWsbViews.php.
ChWsbViews::maintenance | ( | ) |
Definition at line 124 of file ChWsbViews.php.
ChWsbViews::makeView | ( | ) |
Definition at line 60 of file ChWsbViews.php.
ChWsbViews::onObjectDelete | ( | $iId = 0 | ) |
Definition at line 114 of file ChWsbViews.php.
ChWsbViews::$_aSystem = array () |
Definition at line 41 of file ChWsbViews.php.
ChWsbViews::$_iId = 0 |
Definition at line 39 of file ChWsbViews.php.
ChWsbViews::$_sSystem = '' |
Definition at line 40 of file ChWsbViews.php.