/plugins/hitcounter/index.php
PHP | 28 lines | 9 code | 8 blank | 11 comment | 1 complexity | 127f2c719926934f7007ebc97d3f999a MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause
- <?php
- defined( '_INDM' ) or die( 'POSSIBLE HACK ATTEMPT!' );
- /*===========================================================================
- Hitcounter
- Checks cookie to see if if visit to site is unique
- Stores hitcount in configuration parameter $plugin_conf[[hitcounter_value]
- Updates cookie to prevent double hits
- ===========================================================================*/
- if (!isset($_COOKIE['hitcounted'])) {
-
- //increment count
- ++$plugin_conf[hitcounter_value];
-
- //update database
- mysql_query("UPDATE `" . $db_table_prefix . "plugin_conf` SET`value` = '$plugin_conf[hitcounter_value]' WHERE `name` = 'hitcounter_value'");
- //set cookie
- setcookie("hitcounted" , $plugin_conf[hitcounter_value] );
- }
- //set variable for use in template
- $hitcount = $plugin_conf[hitcounter_value];
- ?>