Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Remember create column hits with type int
- // Create plugin with any name and check in events OnWebPageInit
- $e = &$modx->Event;
- if($e->name == 'OnWebPageInit') {
- if(!isset($_SESSION['usertype'])) {
- $_SESSION['usertype'] = '';
- }
- if($_SESSION['usertype'] != 'manager') {
- $modx->db->query("UPDATE " . $modx->getFullTableName('site_content') . " SET hits=IFNULL(hits, 0)+1 WHERE id=" . $modx->documentIdentifier);
- }
- }
Add Comment
Please, Sign In to add comment