]>
Commit | Line | Data |
---|---|---|
626eb440 | 1 | Simple example |
2 | ---------------- | |
3 | ||
4 | You must add to top of your files: | |
5 | ||
6 | <?php | |
7 | define("_BBC_PAGE_NAME", $title); | |
8 | define("_BBCLONE_DIR", "/usr/share/bbclone/"); | |
9 | define("COUNTER", _BBCLONE_DIR."mark_page.php"); | |
10 | if (is_readable(COUNTER)) include_once(COUNTER); | |
11 | ?> | |
12 | where $title is uniqued name for pages | |
13 | ||
14 | We can use "access.php" as regular inclusion for other documents as well, | |
15 | if we specify the path to it. The following example demostrates, | |
16 | how we could display the total amount of visits: | |
17 | ||
18 | <?php | |
19 | //------ Display Total Unique ---------------------- | |
20 | require("/usr/share/bbclone/var/access.php"); | |
21 | $totalvisits = $access["stat"]["totalvisits"]; | |
22 | $totalcount = $access["stat"]["totalcount"]; | |
23 | $visitorsmonth = $access["time"]["month"][date("n")-1]; | |
24 | $visitorstoday = $access["time"]["wday"][date("w")]; | |
25 | $wday = $access["time"]["wday"]; | |
26 | ||
27 | echo "Total Visits ".$totalcount."<br />"; | |
28 | echo "Visitors Today ".$visitorstoday."<br />"; | |
29 | ?> |