bbclone and cakePHP
If, like me, you are looking to integrate bbclone within an web application developed using the cakephp framework, here is the rundown. It may save you from having to search through the whole thing yourself.
go into the webroot directory, open the index.php, and add the tracking code in it, on top of the file, before the rest of the php code...
PHP:
-
// STATS COUNTER
-
That's all folks
Author: pixeline
Date: July 2nd, 2006
filed in: Development
Follow the discussion on this entry via RSS 2.0 feed.
so where do I place the bbclone folder then?
according to the above example, it would be:
http://www.domain.com/_stats/
yes, it can sit outside your cake app...
ok so that "_stats_" folder is the renamed "bbclone" folder and it is placed inside the /app/webroot/ folder. So far this works when I manually test BBClone.
However when I integrate from webroot/index.php I do get a
"Notice: Undefined index: url in c:\wamp\www\app\webroot\index.php on line 4"
basically, line 4 is define("_BBC_PAGE_NAME", $_GET['url']);
so the page name cannot be set using $_GET('url) ... any solution?
ehrm answering own post
try replacing
define("_BBC_PAGE_NAME", $_SERVER["PHP_SELF"]);
with
define("_BBC_PAGE_NAME", $_SERVER["PHP_SELF"]);
scusi, I mean ofcourse:
define("_BBC_PAGE_NAME", $_GET['url']);
define("_BBC_PAGE_NAME", $_SERVER["PHP_SELF"]);
mmh, you would not get the url query variables
try this:
define("_BBC_PAGE_NAME", $_SERVER["REQUEST_URI"]);
Putting it on top of the file is not the best solution, as in some cases (especially when you have session and using flash()), doing that will give a blank page everytime you login. I've recently encountered this problem. Putting it in the bottom will also not work as expected.. so I tried putting the bbclone code in the middle of the file (just above the "Do not edit this line"), and now it's working perfectly.