Registering WordPress pages correctly with BBClone
When using BBClone with WordPress, useful page titles do not appear automatically in the statistics. This is a short description of the solution I settled on to solve the problem.
Replace ‘< ?php get_header(); ?>‘ in index.php, page.php in your theme folder with this code:
< ?php
define('_BBC_PAGE_NAME', $_SERVER['REQUEST_URI']);
define('_BBCLONE_DIR', '/location/of/bbclone/');
define('COUNTER', _BBCLONE_DIR . 'mark_page.php');
if (is_readable(COUNTER)) include_once(COUNTER);
get_header();
?>
The statistics will even reflect your chosen permalink/rewrite style and create functional page links on the BBClone lists. To register and discern 404 errors, I use this entry in the 404.php file of my theme:
< ?php
define('_BBC_PAGE_NAME', '404 - ' . $_SERVER['REQUEST_URI']);
define('_BBCLONE_DIR', '/location/of/bbclone/');
define('COUNTER', _BBCLONE_DIR . 'mark_page.php');
if (is_readable(COUNTER)) include_once(COUNTER);
get_header();
?>
Gallery2 will not be covered by adding the line above to the WordPress theme, so if you are using WPG2 to integrate Gallery2 and WordPress, add this below the header comment block in wp-gallery2.php in your WordPress directory:
define(’_BBC_PAGE_NAME’, $_SERVER['REQUEST_URI']);
define(’_BBCLONE_DIR’, ‘/location/of/bbclone/’);
define(’COUNTER’, _BBCLONE_DIR . ‘mark_page.php’);
if (is_readable(COUNTER)) include_once(COUNTER);
Trouble or questions? Please comment.