Okay I’ll play with it some more and see what I can do.
update: the problem lies within make_clickable which has nofollow hard coded and impossible to “unfilter” at that level
I’ll have to come up with a way to do it at display time and cleanup the mess bbpress (actually wordpress functions) create
You don’t normally need to set anything there. The installation will continue fine without it.
Every MySQL database uses character collation, but it’s normally hidden from sight. For my bbPress installation, the collation is utf8_general_ci. But I didn’t have to set it, it’s already there. In a unique situation you might need to set it, but I’ve never messed with it.
Hmmm…..okay well I did add this code to bb_tweaks……I replaced the function bb_target_blank section with what you have here, and I removed the add_filter('pre-post','bb_rel_nofollow'); and added the remove_filter actions above…….but it did not seem to have any effect – bbPress still strips out any “target” reference and still adds the rel=”nofollow” to all links…..
I haven’t made any other tweaks to this….
Okay, now it’s weird. It works perfect for bb_closed_label, but remove_filter('bb_topic_labels', 'bb_sticky_label'); does nothing.
What I tried was
remove_filter('bb_topic_labels', 'bb_sticky_label');
function my_sticky_label( $label ) {
global $topic;
if (is_front()) {
if ( '2' === $topic->topic_sticky ) {
return sprintf(__('<img src="/images/sticky.png" /> %s'), $label);
}
} else {
if ( '1' === $topic->topic_sticky || '2' === $topic->topic_sticky ) {
return sprintf(__('<img src="/images/sticky.png" /> %s'), $label);
}
}
return $label;
}
add_filter('bb_topic_labels', 'my_sticky_label');
When I do that I get [sticky] and then my image. Which is close…
My first thought on just copying index.php over and changing require('./bb-load.php'); to require('./forums/bb-load.php'); didn’t work (which is how it works for wordpress), though it may work if you do that and then changed the location in settings.
See https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory for ideas?
You don’t have to hack anything, it’s done via a filter.
ie.
add_filter('bb_topic_labels', 'bb_closed_label', 10);
add_filter('bb_topic_labels', 'bb_sticky_label', 20);
simply remove the filter via a plugin and replace it with your own routine.
remove_filter('bb_topic_labels', 'bb_closed_label');
add_filter('bb_topic_labels', 'my_closed_label');
function my_closed_label( $label ) {
global $topic;
if ( '0' === $topic->topic_open )
return sprintf(__('[Read Only] %s'), $label);
return $label;
}
In bb-includes/formatting-functions.php the values of the closed and sticky labels are hard coded:
function bb_closed_label( $label ) {
global $topic;
if ( '0' === $topic->topic_open )
return sprintf(__('[closed] %s'), $label);
return $label;
}
I want to change ‘closed’ to ‘Read Only’. I know I can just hack the file, but there should be a way to use theme functions and I’m just not thawed out enough to think of it.
bb-attachments lets you upload an image and it inserts a simple bbcode for you automatically
Step 3:
Do you need to install a language other than English? If so, you can find a list of language files here:
http://bbshowcase.org/forums/topic/bbpress-translation-internationalization-into-local-languages
If you need to use a language other than English, you need to navigate to the folder bb-includes and create a folder inside that folder, called languages, then put the language files in there.
Step 4:
If your website is http://www.example.com, and you put your forum in a directory called forum, you would open a browser and go to http://www.example.com/forum/ and the installer will start for you.
Here’s a quick tip for anyone running an integrated WP+BB setup…
Sometimes you’ll find users who haven’t been properly mapped into bbPress roles, so here is a quick MySQL statement to make them all members:
insert into wp_usermeta (user_id, meta_key, meta_value) select user_id, 'bb_capabilities' as meta_key, 'a:1:{s:6:"member";b:1;}' as meta_value from wp_usermeta where user_id not in (select user_id from wp_usermeta where meta_key = 'bb_capabilities') group by user_id;
(It adds a bb_capabilities record to the wp_usermeta table for each user who doesn’t have one. Thus, broken accounts become members. Yay!)
Have fun.
Well we could cheat and make the plugin skip links that have your domain name or no http:// in it.
function bb_target_blank( $text ) {
$text = preg_replace('|<a (?=http
//)(?!travel-writers-exchange.com)(.+?)>|i', '<a $3 rel="nofollow" target="_blank">', $text);
return $text;
}
This is untested.
It’s a fancy regex feature called negative lookahead.
Try it and see what happens.
Doing nofollow for only externals is essentially the same thing, I’ve added it to the replacement above.Make sure you have no additional tweaks for nofollow. I don’t think it’s on by default? If so, try
remove_filter('post_text', 'bb_rel_nofollow');
remove_filter('pre_post', 'bb_rel_nofollow');
I use TextWrangler, from BareBones software – it’s a free text editor that has a lot of the features of their pay-for text editor, BBEdit (it replaced BBEdit Lite). To the best of my knowledge it’s not supposed to do something like that (pasting whitespace) and I haven’t had trouble in the past, but you never know – it could have been something in the process of copying it from my browser window after running rewrite-rules.php and then pasting it into TextWrangler that added some whitespace….
I’ll definitely keep that in mind next time I’m copying and pasting anything…….
And you’re welcome for the donation – as mentioned it was very well deserved! I’m self-employed and have a tiny budget, but I always try to reward plugin and theme developers, especially when they are so nice about providing support that goes way above and beyond the norm as you have
Bump – I know this may wind up being a dead issue (at least until a future bbPress update), but is anyone aware of any plugin to give greater control over how links are handled?
I don’t want to dig into the core files, but I need to have internal links handled differently from external links, and need to be able to not have manually entered links (not using the URL button) altered to remove or add anything to the <a>tag…..so I’m hoping a plugin exists that will allow for link customization….
I now have this working as a plugin and will make it available later today. I expect donations from both of you considering the small fortunes you were willing to pay an outsider
I suggested they change this in the core long ago and let the user choose passwords while sending only an activation link via email.
If you don’t need them to verify via a link in the email this could be written in an hour as a plugin. The code for password entry with re-entry verification can be lifted from the 1.0 alpha source.
I do recommend you use my Human Test plugin however.
Hi,
I don’t know what I’m doing, really, but I followed the instructions to integrate bbpress with wp; they are on 2 separate databases, so I did the advanced config option …
After updating the settings I was logged out, and when I attempted to log back in as my bbpress info, I got the below error … I am also not able to login using my wp admin login, I got the same error but with that login name instead.
Any thoughts? Please provide as specific instructions as possible
Many thanks
bbPress database error: [Table ‘bizref_bbpress.wp_users’ doesn’t exist]
SELECT ID FROM wp_users WHERE user_login = ‘allaboutdarien’
bbPress database error: [Table ‘bizref_bbpress.wp_users’ doesn’t exist]
SELECT * FROM wp_users WHERE user_login = ‘allaboutdarien’
Well I am THRILLED to report that it finally ALL works as it should!
The odd part is that I never found any errors when I added the RewriteRule lines back in one by one – it was time consuming but worth it in the end (seems strange that copying & pasting the whole block in at once triggered the 500 error, but doing them one by one did not, but oh well – sometimes it’s just better to not question things too deeply)….
I even added in the three lines needed for the plugin and had no trouble, so now the page numbers are working perfectly on the front page.
I can’t thank you enough for all your patience and perseverance with this problem….I just sent you a well-deserved donation via your link on the showcase…….if I were ever going to have kids I’d seriously consider naming my firstborn _ck_
Ok – thanks! I understand you need to leave – no worries (i know we all have day jobs
)
I did add back in the remaining RewriteRule lines, but that triggered the 500 error. I’ll try adding them one by one until I hit the error, and post back which line it is…..
I have to leave for the rest of the day but essentially if you are able to add the rest of the rules without an error 500, then go back into bb-config.php and put back the line for slugs.
Then the forum should start using slugs.
To finish up after it’s all working, go find those three extra rewriterule lines I posted much earlier and add those to the list and then you should be 100% done.
After those extra three lines are in, remember to test the front-page pagination which is what started this entire exercise in the first place, and hopefully they will be error free.
I think we solved it then.
Try adding the rest of the rules.
RewriteRule ^topic/([^/]+)/page/([0-9]+)/?$ /Forum/topic.php?id=$1&page=$2 [L,QSA]
RewriteRule ^topic/([^/]+)/?$ /Forum/topic.php?id=$1 [L,QSA]
RewriteRule ^tags/([^/]+)/page/([0-9]+)/?$ /Forum/tags.php?tag=$1&page=$2 [L,QSA]
RewriteRule ^tags/([^/]+)/?$ /Forum/tags.php?tag=$1 [L,QSA]
RewriteRule ^tags/?$ /Forum/tags.php [L,QSA]
RewriteRule ^profile/([^/]+)/page/([0-9]+)/?$ /Forum/profile.php?id=$1&page=$2 [L,QSA]
RewriteRule ^profile/([^/]+)/([^/]+)/?$ /Forum/profile.php?id=$1&tab=$2 [L,QSA]
RewriteRule ^profile/([^/]+)/([^/]+)/page/([0-9]+)/?$ /Forum/profile.php?id=$1&tab=$2&page=$3 [L,QSA]
RewriteRule ^profile/([^/]+)/?$ /Forum/profile.php?id=$1 [L,QSA]
RewriteRule ^profile/?$ /Forum/profile.php [L,QSA]
RewriteRule ^view/([^/]+)/page/([0-9]+)/?$ /Forum/view.php?view=$1&page=$2 [L,QSA]
RewriteRule ^view/([^/]+)/?$ /Forum/view.php?view=$1 [L,QSA]
RewriteRule ^rss/?$ /Forum/rss.php [L,QSA]
RewriteRule ^rss/topics/?$ /Forum/rss.php?topics=1 [L,QSA]
RewriteRule ^rss/forum/([^/]+)/?$ /Forum/rss.php?forum=$1 [L,QSA]
RewriteRule ^rss/forum/([^/]+)/topics/?$ /Forum/rss.php?forum=$1&topics=1 [L,QSA]
RewriteRule ^rss/topic/([^/]+)/?$ /Forum/rss.php?topic=$1 [L,QSA]
RewriteRule ^rss/tags/([^/]+)/?$ /Forum/rss.php?tag=$1 [L,QSA]
RewriteRule ^rss/profile/([^/]+)/?$ /Forum/rss.php?profile=$1 [L,QSA]
RewriteRule ^rss/view/([^/]+)/?$ /Forum/rss.php?view=$1 [L,QSA]
Okay – so far so good – added the Options +FollowSymLinks after the -Multiviews and added the two lines to RewriteRule – no 500 error yet
Oh I just thought of another possible problem.
Try also adding
Options +FollowSymLinks
after the
Options -MultiViews
That might be the entire 500 error issue.
Some servers require it for mod_rewrite to work properly.
Okay now trying adding the first two forum lines the /Forum/ .htaccess
Options -MultiViews
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /Forum/
RewriteRule ^forum/([^/]+)/page/([0-9]+)/?$ /Forum/forum.php?id=$1&page=$2 [L,QSA]
RewriteRule ^forum/([^/]+)/?$ /Forum/forum.php?id=$1 [L,QSA]
</IfModule>
Ok…..here is what I have in my (root) WP install folder:
Options -MultiViews
RewriteEngine On
RewriteCond %{http_host} ^travel-writers-exchange.com
RewriteRule ^(.*) http://www.travel-writers-exchange.com/$1 [R=301,L]
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/Forum/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
I also modified my .htaccess file in /Forum as follows:
Options -MultiViews
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /Forum/
</IfModule>
No 500 Server error – Yaay! this is progress….slugs are still disabled.
Ah okay. Well the “slugs” part will be the last part after the .htaccess is working to finally get slugs.
We should probably approach this in baby steps to see what triggers it.
That “Multiple Choices” error is not good.
It means MultiViews is still ON for some reason when it should not be. Maybe you did the MultiViews turn off incorrectly?
Right now I assume the webroot has a .htaccess with Options -MultiViews at the top, then the rest of what you listed above for WordPress. Like so:
Options -MultiViews
RewriteEngine On
RewriteCond %{http_host} ^travel-writers-exchange.com
RewriteRule ^(.*) http://www.travel-writers-exchange.com/$1 [R=301,L]
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/Forum/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Now in /Forums/ I want you to make a reduced .htaccess file like this:
Options -MultiViews
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /Forum/
</IfModule>
Make that minimal amount and see if it that still functions without a 500 error. (keep the slugs disabled for now)