Search Results for 'buddypress'
-
Search Results
-
I have tried to give my users the option to use rich text editing in forums, both topics and replies, in various ways. After trying several plugins, this is what I ended up doing. I’m sure there are better ways, but this works for me. Hope it may help someone.
Problem:
Only a >textarea< is available in topics and replies in the forums. On some sites a wysiwyg editor is relevant.Solution:
Create your own theme, no .. wait .. stop .. it’s a lot easier than even I thought
and it let’s you change things without having them reset when you update BP. Having your own theme is dead useful for lots of things as I’m still finding out…
If you, as I am, are happy using the bp-default theme, then there is an easy to follow recipe here:
http://codex.buddypress.org/theme-development/building-a-buddypress-child-theme/
Now, if you have added code to bp-default/functions.php you should move it to my-theme/functions.php. That way the code won’t be overwritten at update

Back to wysiwyg editing.
First, add a rich text editor when creating a topic.
Create the folder structure my-theme/groups/single/ and copy the file bp-default/groups/single/forum.php into it. Open the copy of the file in your theme and make the following replacement
`This is how I allowed more HTML tags in my BP forums. Probably there are better ways, but this works for me. Hope it may help someone.
Problem:
Per default BP runs the content of forum topics through a filtering function, bp_forums_filter_kses( ) found in bp-forums/bp-forums-filters.php. This function adds some HTML tags to the _few_ allowed by wp_kses( ).Effect:
Formatting, such as lists, are not displayed. The set of allowed HTML tags in forum topics is much smaller than in ordinary WP posts.Solution:
In the functions.php of your theme, perhaps wp-content/plugins/buddypress/bp-themes/bp-default, add a function similar to the default one.
`function my_forums_filter_kses( $content ){$forums_allowedtags = array(
‘a’ => array(
‘href’ => true,
‘id’ => true,
‘title’ => true,
‘rel’ => true,
‘rev’ => true,
‘name’ => true,
‘target’ => true,
),
‘abbr’ => array(
‘title’ => true,
),
…. and so on to your hearts contend
);
$forums_allowedtags = apply_filters( ‘bp_forums_allowed_tags’, $forums_allowedtags );
return wp_kses( $content, $forums_allowedtags );
}
remove_filter( ‘bp_get_the_topic_post_content’, ‘bp_forums_filter_kses’, 1 );
add_filter( ‘bp_get_the_topic_post_content’, ‘my_forums_filter_kses’, 1 );`The last to lines removes the default, overly restrictive, filtering of forum topic posts, the second adds your own.
Disclaimer:
By defining your own set of allowed HTML tags you may be opening up for unwanted code being posted to your forums. Be conscious about what tags you allow.Cheers
Mort3nTopic: @mercime, can you pls help?
Hey mate, you helped me a lot lately and am running again into trouble. DOn’t know how to contact you. Can yyou pls help me on this issue http://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/add-new-users-from-admin/
Just managed to integrate BuddyPress into my article directory site. It may not have all the fancy stuff that make it look fantastic but I think its OK.
Thanks to WordPress Jetpack and SyntaxHighlighter, members are free to insert mathematical formulas and source code (PHP, HTML, etc) into the article.
Any suggestion is appreciated.
Apologies for the caps. But I have made 2 threads over here and no has not responded
I have a simple query. It will be deeply appreciated if someone can point me in the right direction.a. I am working on some custom functionality in buddypress forums. You can see via this image: http://i.imgur.com/pXw5N.jpg Whenever the user clicks the ‘Reply’ button the @mention along with the user name should appear in the reply textbox. How can I achieve this?
Topic: Settings template
How comes the template functionality doesn’t work in bp in regards to the members settings options?
Currently it goes;
Home.php (contains all major page layout code)
Settings.php (contains the subnav and if statement to load template based on what page you’re on)
General.php (for some reason contains all the layout code again?)`<?php
/**
* BuddyPress Member Settings
*
* @package BuddyPress
* @subpackage bp-default
*/get_header( ‘buddypress’ ); ?>
<form action="” method=”post” class=”standard-form” id=”settings-form”>
<a href=" ‘lostpassword’ ), ‘wp-login.php’ ), ‘login’ ); ?>” title=””>
<input type="text" name="email" id="email" value="” class=”settings-input” />
<input type="submit" name="submit" value="” id=”submit” class=”auto” />`
How comes it’s done like this when all the other pages work on a functioning template system?