Support » Fixing WordPress » bbclone w/ WordPress 2

  • Hello folks. I’m not new to bbclone by any means, but this is my first try at putting it in a WordPress site.

    I’ve read many forum and blog posts that suggest adding code to each template file, such as index.php, archive.php, page.php, single.php, etc.

    I’ve also read suggestions about adding a single piece of code to wp-blog-header.php.

    Both of the above suggestions work, but it seems that both incorrectly track visits. For example, if I add code to the wp-blog-header.php file, it seems to add 2-4 hits for every single visit to an archive page. Now, that’s not accurate is it?

    I’m trying to understand why I can’t add bbclone code to my header.php file and be done. There, it doesn’t track at all. However, this seems to be the one template file that is used on every page, and only once.

    I’d like a SINGLE place to add this code.

    The code I’m using is this:

    if (is_home() == true) {
    	$pagetitle = "Home";
    else {
    	$pagetitle = wp_title('', false);
    define("_BBC_PAGE_NAME", $pagetitle);
    define("_BBCLONE_DIR", "bbclone/");
    define("COUNTER", _BBCLONE_DIR."mark_page.php");
    if (is_readable(COUNTER)) { include_once(COUNTER); }
    else { echo "Counter is broken."; }


Viewing 4 replies - 1 through 4 (of 4 total)
  • Thanks for the code. I’d moved my blog to a new host, and needed to install a stats program.

    I found this post while searching for how best to edit code, it works, thanks. As to where we put the code, we added it to template-loader.php in the wp-includes folder.

    So I didn’t forget how, had help, I wrote down the steps on a blog post adding bbclone to wordpress.

    Sadly your link is dead and I’d love to have that content! Ohh why cruel world why!?

    I’ve been grinding on this for awhile now.. Sadly, I can’t quite get bbclone to work. I created a test page and that works fine..

    I’ve confirmed that bbclone is being called using some echo statements. However it seems to quit prematurely in the bbclone code:

    // Don't process anything unless we are told to do so
      if (!defined("_OK")) {
        if (empty($BBC_DEBUG)) return ignore_user_abort(0);
        else exit($i);

    I’m really not sure what is going on here, but it’s sort of driving me totally nuts! 🙂

    Okay, I’ve got it.. Thanks to this site:

    Just in case that site gets nuked or something here’s the info I used:

    Modify wp-blog-header.php:
    //-- Insert BBclone Code from here @
    define("_BBC_PAGE_NAME", get_bloginfo("name") . wp_title("/", false));
    define("_BBCLONE_DIR", "/full/path/to/bbclone/");
    define("COUNTER", _BBCLONE_DIR."mark_page.php");
    if (is_readable(COUNTER)) include_once(COUNTER);
    //-- @ to Here
    require_once(ABSPATH . WPINC . '/template-loader.php');

    my wp-blog-header.php didn’t have that gzip line, I just inserted the bbclone call right before the template-loader and it’s working fine. I’m running this on WP 2.5 and seems good. Yay!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘bbclone w/ WordPress 2’ is closed to new replies.