Hi,
I’m busy with some plugin that will do some SEO tasks for bbpress.
On thing seem to be harder than I thought. I would like to write new page titles in some circumstances. The next “filter” code doesn’t work:
remove_filter('bb_get_header', 'bb_get_title');
apply_filters('bb_get_title', 'PHP Scripts Development Forum');
which function is called before I need to use the remove filter funtion? (the guy from the WP SEO plugin is using some str_replace function, very strange)
Thanks
I apologise – was writing it from memory and in a rush!
(excuses excuses
)
I personally needed to use href to append more to the end.
I’ve just noticed that the post prior to mine is months old anyway, I guess he figured it out in the end!
no, bb_get_profile_link
does not self echo but it does return a full formed url apparently, so I was half wrong to use it inside of a href.
The direct link is via get_user_profile_link( $id )
byles, your code is wrong in that it doesn’t need an echo
<?php bb_profile_link('link text here'); ?>
bb_get_profile_link does self echo, so you could try:
<a href="<?php echo user_profile_link(bb_get_current_user_info('id')); ?>/">
…or if you don’t want to use it amongst another href, just use:
<?php echo bb_profile_link('link text here'); ?>
i figured out the problem!!
I just had a bunch of repeated text that did a great job of looking like it should have been there.
thanks!
Well, just to tell anyone who – in the future – might be stuck on the same or a similar problem.
I went with the following workaround:
Find a hook (action/filter) that gets called early in the process like bb_location.
Define a filter function for it.
In that function, add the following peace of code.
global $bb_locale;
$bb_locale->datetime_formatstring = __(‘j M, Y’);
Obviously, you can call your time format something else.
Not the prettiest of solutions, but it works and I get to keep my bb_press installation free of code that I’ll surely forget to update.
There is a bug in the older template you are using.
Find these line in your header.php
in your template folder:
<?php bb_enqueue_script('topic'); bb_head(); ?>
<?php endif; ?>
and change it to this:
<?php bb_enqueue_script('topic'); ?>
<?php endif; ?>
<?php bb_head(); ?>
Hi I do have a version working(I downgraded bbpress to the last version bbsync worked because I was tired of using a alpha version of bbpress) it’s completely new code, but it’s very basic on the feature set and a bit hacked together, as I could never get the bbpress functions to work in a wordpress plugin.
I’m at a public library at the moment so I don’t have the code with me but I can work on the code a little bit when I get home.
Also please note, this was just made for me and I probably have different needs to what you needed, for example I wanted all wordpress posts to make a new topic so there isn’t options on a per post basis to post to a forum. Also comments don’t replicate between bbpress and wordpress(I was just going to disable commenting and make all users use the topic) but depending on how much time I have tonight I might add this functionality as I don’t see the difficulty in it.
Also F.Y.I. if anyone is interested I do it the úber ghetto way and manually manipulate the database and don’t go through any of the wordpress or bbpress functions so use at your own risk, but I haven’t run into any problems on my test site.
Maybe it’s accidentally eating the comments? I can’t remember.
Also, hey, look at that – september has almost rolled through and it’s still very, very broken.
Maybe Benzilla can help you? In any case, the basic ideas are pretty obvious in bbsync; just create meta-entries for each sync’d item on both sides, so you can use them in functions to make links and the like. Comments -> posts just uses a standard comments hook and the bb api to create a post. If I were trying to fix this I’d probably go back to basics and work it again from there, using the old (bad) code as a reference only; that could be the approach to take with this.
I have uploaded this plugin to the Plugin Repository.
I found some problems in the earlier version, but it now works 
https://bbpress.org/plugins/topic/user-photo-for-bbpress/
Is there a way to extend BB_Locale?
Today, BB_Locale calls init and that’s that. No hooks/event handling at all, as far as I can tell.
In method init, among other things, the following loads:
$this->datetime_formatstring['datetime'] = __('F j, Y - h:i A');
$this->datetime_formatstring['date'] = __('F j, Y');
$this->datetime_formatstring['time'] = __('h:i A');
The Question
What if anything can I do if I want to have a datetime_formatstring['special-date'] = __('Y F j - h');
added to BB_Locale. I’m using the three existing formats as listed above already and I want to add a fourth alternative without adding a row in core BB-files.
Just to be clear, I want to be able to do this:
_e("Today's date, formatted in a special way is:") . bb_datetime_format_i18n( bb_current_time(), 'special-date' );
Am I missing something obvious here or is the only solution right now to modify the locale.php file?
Appreciate the help.
Thanks chrishajer.. I will take a look. bbSync seems good.. i just read too many comments of people complaining about it… but maybe they don’t know how to use it 
I will give it a try this next couple of weeks and let you know of results.
If you include bb-load.php in that file, you will have access to bbpress functions. Why not do something like this in that page:
require_once(/full/path/to/bbpress/bb-load.php)
I want to login function on a straight html page that is outside of the bbpress .9 standalone. Once the person logsin, then they are moved to the front-page.
I used this in the html page
<?php login_form(); ?>
and of course I get an error, Fatal error: Call to undefined function login_form()
In straight html, I would code the full url. How can I call this function from outside of its directory? What is the full function path?
It’s not there now. Maybe you resolved it?
The bb-config.php might have been missing the beginning <?php or maybe the web server was not configured to parse .php files?
It’s because you are destroying $user_id
This is wrong:
$user_id = bb_get_user( $user_id );
$bb_twitter = $user_id->social_twitter;
You should do:
$user = bb_get_user( $user_id );
$bb_twitter = $user->social_twitter;
$user_id
holds the id number, not the entire user object.
Hi,
I can not figure out what is causing one function in a plugin I am trying to make (modify) to cancel out another function from the same plugin on the same page.
OK, did that make sense.
Here are my examples.
bbSocialize – IF (and this is only an example) I want to display all the information from bbSocialize at the top of the profile and at the bottom of the profile, then it is ONLY displayed at the top (canceling the one one the bottom).
Avatar Upload – I can put the code in to display my avatar as many times as I want and it shows all of them.
I am not understanding why the bbSocialize code or functions are causing the second one to cancel out.
That is basically my problem.
I have modified bbSocialize in the sense that I have added A LOT to it including customizable fields. What I would like to do is have 2 or 3 functions pulling out certain information so that instead of all that info (or whatever you choose) being displayed in one area, you could break it up on the profile page and put some up top, some down on bottom, some in the middle or possibly floating to the right…..whatever. And of course the main function would be available to display all your selections.
I hope I made that clear enough.
Almost like the functions are not closing properly — but I really don’t know.
Ok, here is the basic bbsocialize funtion to display on the profile page.
// The following function can be used to display profiles on user-profile-page
function get_socialize() {
global $user_id, $bb_current_user, $bb_socialize;
$user_id = bb_get_user( $user_id );
$bb_twitter = $user_id->social_twitter;
echo '<div class="socialize_wrap">';
if ( $bb_socialize['twitter'] == true ) { if ( !empty( $bb_twitter ) ) { echo '<dd><img src="'.$bb_socialize['images_url'].'/bb_twitter.png" width="16" height="16" border="0" /> <a href="http://twitter.com/'.$bb_twitter.'" title="User Twitter account" rel="'.$bb_socialize['links_rel'].'"><span>'.$bb_twitter.'</span></a></dd>'; } }
echo '</div>';
}
Remember, the problem with MATCH AGAINST is it will not do partial words or words under 4 characters.
It’s not too hard to replace the search, you just have to decide which way you want to go. The regular expression will at least do 3 character words which I find is more common than you’d imagine.
The problem is that the time for any way without an index is going to increase dramatically once you start adding sorting and other options that cause full table scans. You can see this happen if you try to add a simple option to the regex demo like sorting by reverse post_id (which is a trick that should be a little faster than sorting by date).
SELECT * FROM bb_posts WHERE post_text LIKE '%test%' LIMIT 5 ORDER BY post_id DESC;
and
SELECT * FROM bb_posts WHERE post_text LIKE '%test%' AND REGEXP ':<:%test%:>:' LIMIT 5 ORDER BY post_id DESC;
You might want to test a worse case scenario by using three character nonsense words that will cause a cache-miss like “zzz” and “aaa”. Change them each time so mysql cannot cache the results and give you faster times.
If the above example returns in an acceptable amount of time you can just replace bbpress’s built in search with that simple method. By parsing a query you can also AND words together instead of bbPress’s default OR which to me is incredibly annoying and useless (you’ll notice no major search engine like Yahoo or Google does OR by default).
Some of the code for bb-config. php is showing at the top of my bulletin board.
http://www.comicbooksyndicate.com/syndicatebb/
How do I get rid of this?
please, i would like to understand my error in the code
@_ck_:
I currently have:
have_query_cache: YES
query_cache_limit 1048576
query_cache_min_res_unit 4096
query_cache_size 16777216
query_cache_type ON
query_cache_wlock_invalidateOFF
though I’ve got plenty of RAM to tweak this. I don’t want to just throw RAM at poorly optimised queries though.
The simple query you mentioned takes 2 seconds for me (uncached). MATCH AGAINST with a full-text index takes 0.3 seconds. Keeping a full-text index only increased the database size by 30% in my case. That’s well worth while in the days where disk space is so cheap. The regular expression executes even quicker (0.2s), but as you say does not do partial words.
There’s no reason why the core can’t have an option for full-text in the settings page, with two different search methods depending on what is chosen. It would only take 20 or so lines of code.
Well you have a point in that it’s important to you and you are expressing your feedback in the feedback section, however again, it’s an alpha issue so I can’t be motivated.
Oh and I would never actually delete you.
It was a just my own “feedback” you might say 
So don’t take it personally.
Oh and looking at a MySQL performance guide for text search, apparently bbPress’s search is using ALL of the slowdown triggers:
order by
group by
and worst of all SQL_CALC_FOUND_ROWS
How long does this query take without the modifiers:
SELECT * FROM bb_posts WHERE post_text LIKE '%test%' LIMIT 5;
because that’s as fast as it can possibly get without an index and should be used as a baseline.
Looking at the original query, I believe they are causing a FULL scan of the entire table to rank and group it first. That’s going to be insanely slow.
You might be able to just use LIKE with a simple sort by post date DESC.
The largest bbPress install I have access to has nearly 100,000 rows and still only takes 0.04 seconds for that trimmed query. The original queries you posted take 0.5 seconds so that’s 10x slower.
If I had the ability to delete accounts it would be for people who insist their “missing feature” is the most important 
Fortunately they are smart enough to not let me delete accounts, lol. Your missing feature is the least needed feature for thousands of other people.
Let me express this for the 100th time (not just to you, to everyone). 1.0 is *alpha* – it’s not stable, it’s not final, it’s not even close to final. They are adding and changing things daily. Sam just changed something this morning.
The bb-sync author (fel64?) did a fantastic job. But bbPress changing is not their fault (or their problem unless they want it to be).
If they go and spend hours to make it work now under 1.0 alpha, it may break again tomorrow. And the day after that. They are still changing 1.0 alpha and will change it again.
You running 1.0 alpha right now for a live, active site is exactly one person’s problem, yours.
I think that’s one of the default javascripts scripts loaded in the topic.php page.
It only shows in mini-track because it’s generated by a php file.
Most of the javascript in bbPress can be disabled and makes for faster loading pages (ajax goes away however).
So the answer is no, it’s not hacking. But you will see the attempts sooner or later – there are thousands of bots out there scanning sites and most people are unaware.
I’ll put in some code to exclude bb-includes in the next mini-track.