Deutschland United States United Kingdom
ContentLion - Open Source CMS

activate.php

Rev 15 | Blame | Compare with Previous | Last modification | View Log

<?php

Language::ClearCache();

DataBase::Current()->Execute("

CREATE TABLE IF NOT EXISTS `{'dbprefix'}plugin_usercounter` (
  `tracker_id` varchar(50) NOT NULL,
  `date` date NOT NULL,
  `impressions` int(10) NOT NULL DEFAULT '1',
  `timestamp_first_visit` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`tracker_id`,`date`),
  KEY `ix_date` (`date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

"
);

Database::Current()->Execute("CREATE TABLE IF NOT EXISTS `{'dbprefix'}plugin_usercounter_pages` (
  `tracker_id` varchar(50) NOT NULL,
  `date` date NOT NULL DEFAULT '0000-00-00',
  `time` time DEFAULT NULL,
  `page` varchar(255) NOT NULL,
  `requests` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`tracker_id`,`date`,`page`),
  KEY `ix_date` (`date`),
  KEY `ix_requests` (`requests`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;"
);

EventManager::addHandler("system/plugins/usercounter/events/load.php", "pre_page_load");

?>