I tried writing my own plugin–less functionality, really just a simple filter plugin with some preg_replace’s to get the most basic wiki markup, but even this isn’t working. Can anyone see what might be going awry here? I’ve tested all the regular expressions in a plain PHP file, so I know they’re working; it’s putting it all into a plugin and getting bbPress to use it that seems problematic.
/*
These parameters specify the functioning of this plugin.
Edit accordingly for your specific situation.
*/
$mediawiki_filter_params["wiki"] = "http://en.wikipedia.org/wiki/";
/*
Stop editing; actual plugin functionality follows.
*/
function filter_mediawikitext($content) {
global $mediawiki_filter_params;
// BASIC FORMATTING
// Bold and italic
$content = preg_replace("|(''''')(.*?)(''''')|",
"<strong><em>2</em></strong>", $content);
// Bold
$content = preg_replace("|(''')(.*?)(''')|",
"<strong>2</strong>", $content);
// Italic
$content = preg_replace("|('')(.*?)('')|",
"<em>2</em>", $content);
// LINKS
// Internal links
$content = preg_replace("|()(.*?)()|",
"<a>2</a>",
$content);
// External links with descriptions
$content = preg_replace("|([)(.*?) (.*?)(])|",
"<a>3</a>", $content);
// External links with no description
$count = 1;
$replace = TRUE;
while ($replace) {
$before = $content;
$content = preg_replace("|([)(.*?)(])|",
"<a>[".$count."]</a>",
$content, 1);
if ($before==$content) { $replace = FALSE; }
$count++;
}
// HEADINGS
$content = preg_replace("|(=====
(.*?)(=====
|",
"<h6>2</h6>", $content);
$content = preg_replace("|(====
(.*?)(====
|",
"<h5>2</h5>", $content);
$content = preg_replace("|(===
(.*?)(===
|",
"<h4>2</h4>", $content);
$content = preg_replace("|(==
(.*?)(==
|",
"<h3>2</h3>", $content);
$content = preg_replace("|(=
(.*?)(=
|",
"<h2>2</h2>", $content);
// RETURN
return $content;
}
add_filter("the_content", "filter_mediawikitext");
I am using the following code in my graphic-display-ranks plugin running bbPress 0.8:
$path_to_subdirectory = bb_get_option('uri') . "my-plugins/ranks/";
later on in the plugin I call that path using:
$display_text = $path_to_subdirectory . $image_for_special_rank_1 . "" alt="#Posts:" . $rank_count . "" title="#Posts: " . $rank_count . """;
$display_text is inserted into an image tag for display. Everything works, but when I look at the source code of the page I see:
<img src="my-plugins/ranks/metalic_modo.png" alt="#Posts: 1" title="#Posts: 1" />
It’s as if it’s not pulling in the base part of the uri at all. Am I missing something here?
i’ve tried that! Both of the solutions, but i still can’t use my own template!
I can’t see the thumbnail of either my template or kakumeis.
EDIT: I saw what maybe could be the problem. It uses doubleslashes to the link to both Kakumei and my template. Maybe it’s because of that i have my problem? Maybe this could help someone to help me too. (?)
http://localhost/ungodum/bbpress/bb-admin/themes.php?theme=
\webb\xampp\htdocs\ungodum\bbpress/my-templates/ungodum/&_wpnonce=538f668ad4
Trent,
First of all, thanks for all your help with getting this all straightened out. I’ve gotten a lot done thanks to your help alone.
As for the 1 header approach, maybe I am creating a “complexity by simplicity” approach, and if what you are saying is correct, then I’m probably better just making the wp side have a wp header, and the bb side have a bb header. I guess I just thought in the long run it would be simpler and more effective to have one-size-fits-all header with the necessary bb code and wp code being selected only when it was needed. That was before now, when I just assumed that since you could call wp code in bbpress, that you could also just as easily call bb code in wordpress.
So, I will create a second, separate header file for bbpress, and I will see where that takes me in this process. Thanks for your help with this. I hope my reasoning at least makes sense now, even though it is probably faulty reasoning at that.
ron
I’ve integrated the icons into the support-forum code. I’ll see if I can commit it.
bbPress has a function called bb_rel_nofollow() which can be added via filter to functions which output a link (… not functions that output a URL).
For example:
add_filter('post_author_link', 'bb_rel_nofollow');
Hi,
bbPress 0.80 is really nice, thank you. 
Turkish version of bbPress 0.80 is ready, we have a bbPress page on WordPress Türkiye.
Downloads and docs:
bbPress Turkish version 0.80 (whole package)
bbPress Turkish .mo file
bbPress Turkish .po file
Documentation
I would imagine that you could do this without affecting any core files through a plugin as the links portion for posts is pluggable. Now, saying that, we need someone with some experience working with the code to make this a plugin.
Trent
We all know that the AutoMattic guys use their own stuff, but after each site has been skinned with all their CSS magic, sometimes it’s hard to see… I thought we should savour the moment the wordpress.org forums ran with the default bbpress theme
Does anybody know if this script is supposed to work with the latest release of bbpress (.
? I ran into some problems importing some of the tables.
Thanks, Len
Hello, I’ve upgraded to Desmond now, yay 
But i can’t get my theme to work, i’m getting the message “Theme not found. Default theme applied.” when i try to change theme to both my own and kakumei!
I’m trying on my localhost and made a new fresh install into another directory, but i still can’t get it work :S
Awesome! Glad to hear it’s working now!
I should not attempt software updates just before bedtime.
LOL! I know how that is..
spencerp
Ah.. Okay, I’m sure Trent’s reply contains the right answer ..
spencerp
Save this file as patch-to-URL.php and upload to /my-plugins/ directory:
<?php
function fix_bb_path_to_url( $url ) {
return preg_replace( '|
([^/])|', '
/$1', $url );
}
add_filter( 'bb_path_to_url', 'fix_bb_path_to_url', 1, -1 );
?>
Trent
Hmm, how about the .htaccess file? I’m trying to figure out where there’s a missing one, if it’s not in the config.php file.. then I’m not really sure.. 
spencerp
[Takes a bow to the audience]… Thank you! Thank you! No really you shouldn’t! Haha.. nah, just kidding lol. 
I guess I’m just used to doing that stuff on the WP.org forums, I bring that awesomeness over here.. seems to work well I think..

spencerp
Good work tracking that down!
<link rel="stylesheet" href="http:/forums.pfdebate.com/bb-templates/kakumei/style.css" type="text/css" />
What really is strange for me is safari on Mac OS X shows the page correctly anyways. What a smart browser.
Why that link is like that and the rest of the content is showing up right is strange though.
Trent
I would agree. Not really a tasteful joke, but it seems like it really was a joke. I can’t see one thing in that code that would send any information that it gets to anyone but the database you are connecting to or the file that you can have it create. I could be missing something and would appreciate it if others would also check this, but I don’t think there is anything wrong here.
Trent
I have looked over the code of this plugin and it doesn’t send your email to spammers. Jaim3 even put this in the code:
// DISCLAIMER: This is a joke
echo "<li><h3>Sending all your database e-mails to all major world-wide spam sending mafias...</h3></li>";
If someone else wants to look to confirm, but it does what it is intended to as far as I am concerned.
Trent
Thanks for the reply Trent..
Yeah, you have a good point there! I guess I was just tired of too many dang folders in the forum’s root directory lol..
Oh well.. when I do the actual upgrading here, I’ll re-add that folder and such..
spencerp
Awesome! Thanks Sam..
I’ll apply this path on the PC first, modify my theme files accordingly.. then upload them all.. 
spencerp
I’m assuming this path works just as good right?
/root directory/bb-templates/your-theme/
That’s what I am doing at the present time, w/o the latest upgrade though of course..
I’ll get on updating it here soon.. just wanted to wait until ALL the dang commits were really over lmao.. 
spencerp
Well, in this case I am calling the header file from wordpress on the bbpress pages. The only problem is that I have things in the bbpress header like
bb_is_user_logged_in()
and
is_topic()
which create tons of problems when I put that code in the wp header file. I was able to load wp when bbpress loads, but it seems like the opposite would also be useful, to register bbpress when wp loads. I suppose through reverse engineering, I could figure that out on my own?! Otherwise, I would like to just be able to tell the page, “Hey, are you wordpress, then load this…otherwise, don’t load it. And if your BBPress, then load this, otherwise don’t load it”.
Currently I am also trying to specify which stylesheets to load. If it’s wp, I want the wp stylesheet, and if it’s bb, I want the bb stylesheet, and I don’t want the conflicts when both load.
1 – Does this make sense?
B – Is there a solution? and
4 – Am I overlooking a more obvious solution?
Ron
What kind of content are you trying to distinguish between? Theme content or actual content? With wordpress being a blog and bbPress a forum, the content itself would be different. I guess I don’t quite understand exactly what you are trying to do. Could you explain to me like I am 5 years old (my wife says I act that old anyways 
Trent
Ok, I am trying to serve up content based on whether a user is on the WP side of my site, or on the BB side. Trent, you helped me with this earlier, but you helped me find a much more common sense solution to the problem in that situation.
Here’s what I’m wondering: Is there any way to say “if bbpress” then do this, or “if wordpress” then do this? I can’t seem to find the code I need to tell wordpress AND bbpress to both understand and accept this discrimination. Thanks
Ron