<?php
if (!function_exists("doNothing"))
die("Hacking attempt!");
$index = fopen("../index.php","r");
$index_code = fread($index,filesize("../index.php"));
fclose($index);
if (!strpos($index_code,"<?php include \"./plugins/".$folder."/regstat.php\"; ?>")) {
$index_code .= "<?php include \"./plugins/".$folder."/regstat.php\"; ?>";
unlink("../index.php");
$newindex = fopen("../index.php","w");
fwrite($newindex,$index_code);
fclose($newindex);
dbQuery("CREATE TABLE `".DBPREFIX."plugin_statistics` (
`id` bigint(20) NOT NULL auto_increment,
`ipaddress` varchar(20) NOT NULL,
`referrer` varchar(255) NOT NULL,
`navigator` varchar(255) NOT NULL,
`operatingsystem` varchar(255) NOT NULL,
`visitdate` datetime NOT NULL,
UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1");
} else {
die("Statistics Plugin already installed!");
}
?>