Well you’ll have to test to make sure a wikipost isn’t created yet on that topic (and that topic hasn’t been made yet, and they don’t edit the link to change the topic name,link, etc.).
But adding bbcode style parsing to posts is very straightforward. You’ll need to use preg_match_all on the $post->post_text
something like this:
add_filter('post_text', 'make_wiki_links'); // you can also try 'pre_post' which will make it only process the text once during save and not everytime it's displayed
function make_wiki_links($text) {
if (preg_match_all("/[wiki](.*?)[/wiki]/sim", $text, $wiki_links)) {
foreach ($wiki_links[0] as $wiki_link) {
// do whatever you want to each $wiki_link here
}
}
return $text;
}
You’ve got about a dozen problems to handle with this technique, including replacing the [wiki] parts afterwards with another preg_replace, good luck.
I’m curious about this issue as performance problems always intrigue me. You must be using 0.9 as 1.0 has an index on stickies by default.
As far as fulltext search there is a trick I use because of the multiple issues with fulltext (not only speed but fulltext can’t do words less than 4 characters until you customize and rebuild mysql). The trick is to use regex and do a two pass query where you first exclude all the posts without the words and then allow mysql to do a regular scan of the remaining posts.
Query example from my Super-Search plugin:
WHERE post_text LIKE '%".$term."%'" AND post_text REGEXP ':<:".$term.":>:[^']' "
Compare the performance of that against a fulltext search that uses "MATCH post_text AGAINST $term" I don’t have enough data to do a huge benchmark but some simple tests with the cache off shows 0.4 seconds for the trick and 0.9 for the fulltext.
The only downside to the trick is you cannot do partial word searches that way. ie. $term="cat" will only return posts with the exact word “cat” and not “cats” or “category”. But it should be way faster.
Searching a huge number of posts is a non-trivial problem. It’s been known to crush other forums like vbulletin which has fancy code to prevent users from searching too often/too quickly and even disable search temporarily on high server load. Sites like Wikipedia have to go through several technically complex tricks to keep the search fast on that much data.
Many large sites end up using sphinxsearch to replace fulltext search. You could interface it to bbPress via their PHP api.
You can read more workarounds on the mysql fulltext search page (with far more knowledgeable people than me) http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html
I successfully integrated bbpress alpha with the latest wordpress. The install is pretty flawless.
Now, I want to pull in the header and sidebar from wordpress. Does anyone have any tips for me on how to do this?
http://www.punaji.com/
It’s a bit hard to understand at first, but given time I think the layout is much more usable than normal message boards. I would appreciate giving it that time, but if you want to know a quick rundown of how things work read on.
The left-most links on the “ribbons” are the categories (art and other). Running down the ribbons from left to right are the latest topics that have been posted in. The topic titles are on the ribbons while the last post of the topic shows beneath, and the username of whomever posted that message. Yeah, that’s about it.
There are quirks still, but they’re being worked on. Any insight on how you found the experience to be would be greatly appreciated.
Hi
I have WP 2.6 installed and the latest svn version (updated yesterday) of bbPress. The two are integrated with each other. I had a look at the users and roles in WP and noted that bbPress had changed all the roles to the bbPress role types. The WP roles are now all gone. The problem is that no one of my users can login, only the first admin user which I created when installed WP and bbPress. If I change another user from member to admin he cannot login.
Can I change back the roles to the default WP roles or do you have any clue what have happened?
Can add bbPress poll into wordpress like Bbpress Latest Discussion and embed wordpress post?
The test registered name is not in my database, just the original keymaster user.
I installed the alpha on its own database. When I test register, I am not sent a password, nor password sent when I try to recover password.
I just finished a test integration of bbpress into word-press and all is working very well with one exception. The static front page for word press has stopped functioning when I add the following to the end of the wp-config.php file:
if ( !defined(‘BBDB_NAME’) )
{
require_once(ABSPATH.’forum/bb-load.php’);
}
If I remove this and the couple of bbpress calls that I’m using which require this, the static front page works again. I think I’m just too tired to find the answer in the source.
Has anyone solved this? BTW — this is WP version 2.5.1 and bbpress 0.9.
Thanks in advance for any help.
yes – creating the autoload plugin apperently did the trick !!!
(I still need to test if all functionality works, but at least I can now see the posts
)
thank, this issue is resolved for now
erf, the bbcodes are already not displayed :'( :'(
i try to make:
code strong test /strong /code
but i can’t see the strong balise.
with pre or code, bbcode are not displayed…
i need to see bbcodes in code tags because on my forum i use pre-formatted posts, for many uses
in example for:
pre strong test /strong /pre
i would like to see strong and /strong …
there is no way?
++
changes I made were related to the info being repeated twice and I was messing with the code to get the graphic bar working
I somehow worked out the first problem and the latest version of Karma plugin (0.0.5) solved the second problem so now everything is working perfectly
thank you for the update of the plugin and quick response
Thanks for your replies. After reading / testing your links, I found a quick working fix. Here’s the plugin code :
<?php
/*
Plugin Name: UTF-8 usernames
Plugin URI:
Description: This plugin enable utf-8 characters in usernames. Mbstring must be enabled in the php.ini.
Author: Amir Habibi
Author URI: http://www.residence-mixte.com/
Version: 0.1
*/
function sanitize_user_mbstring( $raw_username, $username, $strict = false ) {
$raw_username = $username;
$username = strip_tags($username);
// Kill octets
$username = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '', $username);
$username = preg_replace('/&.+?;/', '', $username); // Kill entities
// Usage of 'mb_ereg_replace' instead of 'preg_replace' to preserve accents.
if ( $strict )
$username = mb_ereg_replace('|[^a-z0-9 _.-@]|i', '', $username);
return apply_filters('sanitize_user_mbstring', $username, $raw_username, $strict);
}
add_action('sanitize_user', 'sanitize_user_mbstring', 0, 3);
?>
To work, you must have mstring enabled in your php.ini.
Hope this will help !
chrishajer : our board is in french
This is the latest discussion I heard about the issue:
https://bbpress.org/forums/topic/diacritic-letters-i-username-like-goran
What is the primary language of your forum?
bbPress is beta software right now. The latest beta release is 0.9.0.2. That release is not compatible with WordPress 2.6. The decisions are up to you.
The compatibility is only an issue if you want integration. If you don’t need integrated users between bbPress and WordPress, then install bbPress 0.9.0.2.
There is a discussion of changing the number of front page topics here:
https://bbpress.org/forums/topic/how-to-restrict-number-of-latest-discussions-on-front-page
To put the categories first and the latest topics after, you just need to move those things around in your front page template (front-page.php in your template directory).
Never use an alpha of any product for anything other than testing. Otherwise it’s 100% at your own risk.
bbPress 0.9 is very stable.
There are sometimes daily updates to 1.0 alpha (via the SVN of the trunk) but it will not be “finished” for many weeks.
Who is reviewing 1.0 alpha? You can’t review 1.0 alpha, it’s not finished. That’s like reviewing a car that has no interior.
Just a small cosmetic issue I noticed after installing the Version 1.0-alpha-1 zip file: after activating a few plugins, I noticed that the cells were not alternating classes correctly (or at least, what I’d think of as correctly).
To test this, simply go to the Plugins page and activate a plugin. If the plugin row had a white background, it changes to green to show it’s active. If it had a gray background, it stays gray whether it is active or not. It seems to me that we’d want there to be either one or two shades of green to show the active plugins.
The cause between this seems to be the CSS classes of the active rows alternated between <tr class="active"> and <tr class="active alt">; this means that the row with ‘active alt’ takes the properties of the ‘alt’ row, which overrides the background color of the ‘active’ class as it is lower in the style.css template. This derives from the function get_alt_class(), as defined in bb-includes/template-functions.php, which can assign two classes to one element.
Is it possible to only get shown the last 5 topics on the main page, and still list more topics when you go into a category on the forum?
Or just switch them around so the categories will be listed first, and then the latest topics below the categories?
Thanks
Untested. auto-closes a topic on-the-fly when someone visits it and it’s last post is 90 days old (adjustable)
add_action('bb_head','auto_close_topic');
function auto_close_topic() {
global $topic;
if (is_topic() && $topic->topic_open===1) {
$old=time()-3600*24*90; // 90 days default
if (strtotime($topic->topic_time)<$old) {
bb_close_topic($topic->topic_id);
$topic->topic_open=0; // just in case the cache doesn't clear
}
}
}
_ck_
In latest bb-config.php there is no /* Stop editing */
Do I put $bb->load_options = true; at the end of the file ?
Hidden Forums has not been tested yet again 1.0 alpha.
I simply don’t have time to modify every plugin for all the changes.
This is why people should not use the alpha yet for regular sites.
Update: I’m unable to reproduce your problem however.
I have no extra queries with using Hidden Forums on the 1.0 trunk. Are you using the Alpha from the download on bbpress.org, or are you using the SVN trunk?
How well do existing themes work with the latest alpha release? And is that likely to change with the final release? I’ve made lots of modifications to my existing theme, and would hate to have to start from scratch. (Although, admittedly, I knew I was running that risk using a beta release of bbpress!)