Skip to content
This repository was archived by the owner on Apr 9, 2023. It is now read-only.

Commit 9aca00f

Browse files
committed
Make use of b1settings.php optional
You can now set settings with or without b1settings.php.
1 parent 5b97005 commit 9aca00f

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ There are atleast 4 reasons:
99
* **it's free**
1010

1111
## Usage
12-
Place b1webanalytics.php and b1settings.php in the same directory as your own php scripts.
12+
Place b1webanalytics.php and b1settings.php in the same directory as your own php scripts, and modify the mysql parameters (user, password, database, host) in b1settings.php. (Recommended, makes updates easier)
13+
OR
14+
Place only b1webanalytics in the same directory as your own php scripts and modify the mysql parameters (user, password, database, host) in b1webanalytics.php.
1315

14-
Before using the scripts you need to modify the mysql parameters (user, password, database, host) in b1settings.php else nothing will work:
15-
16-
b1settings.php
16+
b1settings.php / b1webanalytics.php
1717
```php
1818
$b1_analytics_db = new b1_db_manager("user", "password", "database", "localhost");
1919
```
@@ -30,4 +30,4 @@ After collecting enough data you will see a simple report when opening b1statist
3030
* a MySQL Server
3131
* (a webserver of course)
3232

33-
### PLEASE NOTE: b1 web analytics is still in development. We rely on your feedback!
33+
### PLEASE NOTE: b1 web analytics is still in development. We rely on your feedback!

b1webanalytics.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,14 @@
99
#-----------------------------------------
1010
*/
1111

12-
include "b1settings.php";
12+
/*
13+
# Settings
14+
*/
15+
16+
// Set backup settings when including of b1settings.php fails
17+
if((include "b1settings.php") == FALSE) {
18+
$b1_analytics_db = new b1_db_manager("user", "password", "database", "localhost");
19+
}
1320

1421
/*
1522
# Source

0 commit comments

Comments
 (0)