The Road to Elysium

March 27, 2008

WordPress and bbclone

Filed under: Linux — jorge @ 08:20

bbclone to strike my fancy, but the thing is that for some time I didn’t quite figure out how to integrate the software with WordPress. So, I found this solution. The following code goes into the file wp-blog-header.php immediately after the php declaration:

// Begin bbclone
 
if (!function_exists("nice_titles_for_wp")) {
 
function nice_titles_for_wp() {
 
$str = $_SERVER['REQUEST_URI'];
 
$str = $str[strlen($str) - 1] == "/" ?
 
substr($str, 0, -1) : $str;
 
$str = (($tmp = strrpos($str, "/")) !== false) ?
 
substr($str, ($tmp + 1)) : "index";
 
$str = ($str == "index") ? $str :
 
ucwords(str_replace("-", " ", $str));
 
return $str;
 
}// BBCode code (from help.bbclone.de)
 
define("_BBC_PAGE_NAME", nice_titles_for_wp());
 
define("_BBCLONE_DIR", "your-bbclone-directory/");
 
define("COUNTER", _BBCLONE_DIR."mark_page.php");
 
if (is_readable(COUNTER)) include_once(COUNTER);
 
}
 
// END bbclone

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress