1 |
matthys |
18 |
<?php |
2 |
|
|
/* This file is part of BBClone (A PHP based Web Counter on Steroids) |
3 |
|
|
* |
4 |
matthys |
19 |
* SVN FILE $Id$ |
5 |
matthys |
18 |
* |
6 |
|
|
* Copyright (C) 2001-2013, the BBClone Team (see doc/authors.txt for details) |
7 |
|
|
* |
8 |
|
|
* This program is free software: you can redistribute it and/or modify |
9 |
|
|
* it under the terms of the GNU General Public License as published by |
10 |
|
|
* the Free Software Foundation, either version 3 of the License, or |
11 |
|
|
* (at your option) any later version. |
12 |
|
|
* |
13 |
|
|
* This program is distributed in the hope that it will be useful, |
14 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 |
|
|
* GNU General Public License for more details. |
17 |
|
|
* |
18 |
|
|
* See doc/copying.txt for details |
19 |
|
|
*/ |
20 |
|
|
|
21 |
|
|
global $BBC_ROOT_PATH, $BBC_VERSION, $BBC_CACHE_PATH, $BBC_CONF_PATH, |
22 |
|
|
$BBC_CSS_PATH, $BBC_IMAGES_PATH, $BBC_LANGUAGE_PATH, $BBC_LIB_PATH, |
23 |
|
|
$BBC_PLUGIN_PATH, $BBC_IP2EXT_PATH, $BBC_ACCESS_FILE, $BBC_LAST_FILE, |
24 |
|
|
$BBC_CONFIG_FILE, $BBC_TIMESTAMP, $BBC_COUNTER_FILES, $BBC_COUNTER_PREFIX, |
25 |
|
|
$BBC_COUNTER_SUFFIX, $BBC_LOCK, $BBC_SEP, $BBC_COUNTER_COLUMNS, |
26 |
|
|
$BBC_COUNTER_COLUMN_NAMES, $BBC_LOG_PROCESSOR; |
27 |
|
|
|
28 |
|
|
// BBClone's location relative from where it's been called |
29 |
|
|
$BBC_ROOT_PATH = defined("_BBCLONE_DIR") ? _BBCLONE_DIR : ""; |
30 |
|
|
// BBClone version |
31 |
matthys |
27 |
$BBC_VERSION = "0.6.2-snapshot"; |
32 |
matthys |
18 |
// Directory paths |
33 |
|
|
$BBC_CACHE_PATH = $BBC_ROOT_PATH."var/"; |
34 |
|
|
$BBC_CONF_PATH = $BBC_ROOT_PATH."conf/"; |
35 |
|
|
$BBC_CSS_PATH = "css/"; |
36 |
|
|
$BBC_IMAGES_PATH = "images/"; |
37 |
|
|
$BBC_LANGUAGE_PATH = $BBC_ROOT_PATH."language/"; |
38 |
|
|
$BBC_LIB_PATH = $BBC_ROOT_PATH."lib/"; |
39 |
|
|
$BBC_PLUGIN_PATH = $BBC_LIB_PATH."plugin/"; |
40 |
|
|
$BBC_IP2EXT_PATH = $BBC_ROOT_PATH."ip2ext/"; |
41 |
|
|
// File paths |
42 |
|
|
$BBC_ACCESS_FILE = $BBC_CACHE_PATH."access.php"; |
43 |
|
|
$BBC_LAST_FILE = $BBC_CACHE_PATH."last.php"; |
44 |
|
|
$BBC_CONFIG_FILE = $BBC_CONF_PATH."config.php"; |
45 |
|
|
// Timestamp at run-time |
46 |
|
|
$BBC_TIMESTAMP = time(); |
47 |
|
|
// Amount of counter files |
48 |
|
|
$BBC_COUNTER_FILES = 8; |
49 |
|
|
// Name of the counter files |
50 |
|
|
$BBC_COUNTER_PREFIX = "counter"; |
51 |
|
|
$BBC_COUNTER_SUFFIX = ".inc"; |
52 |
|
|
$BBC_LOCK = $BBC_CACHE_PATH.".htalock"; |
53 |
|
|
// Global separator |
54 |
|
|
$BBC_SEP = chr(173); |
55 |
|
|
// How many columns they contain |
56 |
|
|
$BBC_COUNTER_COLUMNS = 8; |
57 |
|
|
// What titles are assigned to them |
58 |
|
|
$BBC_COUNTER_COLUMN_NAMES = array("time", "prx_ip", "ip", "dns", "agent", "referer", "uri", "page"); |
59 |
|
|
// File path Log Processor |
60 |
|
|
$BBC_LOG_PROCESSOR = $BBC_ROOT_PATH."log_processor.php"; |
61 |
|
|
|
62 |
|
|
/////////////////////////////////////////////////////////////////////// |
63 |
|
|
// Do not touch the stuff below if you have no clue what it's doing! // |
64 |
|
|
/////////////////////////////////////////////////////////////////////// |
65 |
|
|
|
66 |
|
|
// Message handling, needs to be globally available |
67 |
|
|
function bbc_msg($item, $state = "r") { |
68 |
|
|
return "<div style=\"border: solid 2px red; background-color: yellow; padding: 4px; font-weight: bold;\">Error bbc_msg; item: " . $item . " / state: " . $state . "</div>"; |
69 |
|
|
} |
70 |
|
|
|
71 |
|
|
// PHP version number |
72 |
|
|
define("_BBC_PHP", substr(str_replace(".", "", PHP_VERSION), 0, 3)); |
73 |
|
|
?> |