just tried a registration, process is as I remember it
so page with [bbp-register]
enter username and email, says check email, then I have to click the link in the email to go to the page to enter a password, then I have to login to complete.
In essence you are allowing anyone to register in
dashboard>settings>general
one of the scourges of the internet is the race to get a site listed on page 1 of google – the sites google ranking. One of the parameters google (and other search engines) use is how many times a site is found listed on other websites. There are loads of ‘companies’ that offer to raise your google ranking, and one of the ways they try and do this is to register and add the website to their profile on WordPress sites that allow registration. Sites that allow anyone to register get known, and yes robots are then used to register.
yes, you can go in and delete the bogus users, but you’d need to be satisfied that they have not posted, as otherwise any forum posts by this user might cause the site to error.
you might be better to set the ‘screen options’ in dashboard>users>edit users to 999, and bulk delete a thousand at a time, you can then attribute content or delete it.
for future you might do better to add an approval to registration – there are several – I’ve not used any, as I have a manual registration process, but this one should do what you want
WP Approve User
Our message board (up for a couple years now) probably has a few hundred legitimate users. Yet the total number of users is over 47,000. Mostly these non-legit users, perhaps robot-created, never post, and the only problem the cause is that Google occasionally flags their user data pages for improper content, as they’ll include promotion of a gambling website in the signature field.
What, if anything, should I do about this? I suppose I could go into the database and delete all users that have never posted in one fell swoop. Would that be advisable? (Apart from admin users, there is no reason for someone to register unless they want to post on our message board.) What else? Am I doing something wrong that permits or invites these user registrations?
https://fairmark.com/forum/
How do I check if user has X number of posts inside bbpress forum to allow him to see blog post.
For example, for logged in user, it would be like:
function show_to_logged( $atts, $content = null ) {
if ( is_user_logged_in() ) {
echo 'Welcome, registered user!';
} else {
echo 'Welcome, visitor!';
};
add_shortcode('show_to_logged', 'show_to_logged');
function show_to_bbpress_user_with_x_posts( $atts, $content = null ) {
if ( user_has_X_BBPRESS_topics_or_topic_replies() ) {
echo 'Welcome, registered user!';
} else {
echo 'Welcome, visitor!';
};
add_shortcode('show_to_bbpress_user_with_x_posts', 'show_to_bbpress_user_with_x_posts');
What would be correct function for user_has_X_BBPRESS_topics_or_topic_replies
?
How can participants in the forum get to the page of their standard WP profile?
I mean the page, which looks like the admin backend, but only shows the info of the logged in user. (I have a plugin for extended registering and logging in, but I cannot open that WordPress page with that).
What can I use as a menu item to access to that page? Maybe a shortcode?
It’s also a woocommerce site, and anyone can register to download digital goods without making a purchase. So that’s how they are registering, but they shouldn’t be able to post anything to the forum, yet some how they are able to.
if only registered users can post, then I’d start by looking at how they are registering – bbpress just uses wordpress registration, so how are your users joining ?
so in the statsistics plugin you are changing
$latest_user = get_users(
array(
'number' => 1,
'fields' => array("user_login", "ID", "display_name"),
'orderby' => "registered",
'order' => "DESC",
'meta_key' => 'wp-approve-user',
'meta_value' => '1'
)
);
to
//set up $args with core arguments needed
$args = array(
'number' => 1,
'fields' => array("user_login", "ID", "display_name"),
'orderby' => "registered",
'order' => "DESC",
) ;
//add additional meta data to $args if wp-approve-user is active
if (class_exists ('Obenland_Wp_Approve_User')) {
$args ['meta_key'] = 'wp-approve-user' ;
$args ['meta_value'] = '1' ;
}
//then do the lookup
$latest_user = get_users($args) ;
ok, so final amendment needed, as if you deactivate wp-approve-user then the latest user will be forevermore the last one you approved before decativating the plugin.
If you open the wp-approve-plugin you’ll see the core file wp-appprove-user.php
open this and you’ll see a line 29 which says
class Obenland_Wp_Approve_User extends Obenland_Wp_Plugins_V4 {
so we know that the wp-approve-plugin sets up a class called ‘Obenland_Wp_Approve_User’, so we can use the existence of this class to know if wp-approve-use is active or not.
This is common to many plugins and a good way to ensure parts of code that use another plugin only fire if that plugin is active.
so now we can change the ‘get_uses’ to only add the meta_data is the class exists
//set up $args with core arguments needed
$args = array(
'number' => 1,
'fields' => array("user_login", "ID", "display_name"),
'orderby' => "registered",
'order' => "DESC",
) ;
//add additional meta data to $args if wp-approve-user is active
if (class_exists ('Obenland_Wp_Approve_User')) {
$args ['meta_key'] = 'wp-approve-user' ;
$args ['meta_value'] = '1' ;
}
//then do the lookup
$latest_user = get_users($args) ;
ok, so the function within that code that gets the latest user is this
$latest_user = get_users(
array(
'number' => 1,
'fields' => array("user_login", "ID", "display_name"),
'orderby' => "registered",
'order' => "DESC"
)
);
so this function brings users ordered by registered – DESC means latest is listed first, and number=>1 means just retrieve one, so this gets the latest.
so we just need to add a lookup to say that this must also have meta ‘wp-approve-user’ set to 1 so we amend the function to
$latest_user = get_users(
array(
'number' => 1,
'fields' => array("user_login", "ID", "display_name"),
'orderby' => "registered",
'order' => "DESC",
'meta_key' => 'wp-approve-user',
'meta_value' => '1'
)
);
This (untested) should work for your site.
I don’t plan to support this plugin, but am happy to have it on my site to allow others to use it.
Given that many many other plugins might set meta data it is not possible to cater for all, so I’ll just host the previous version. Anyone downloading will be via this thread so they can see how to update it to cater for the approve plugin.
I have just checked the database and wp-approve-user is always 1 with the exception of one record where it is empty. I assume this is the person that registered on my site this morning whom I have not approved.
so we just need the latest user who has been approved
Correct, but, if this will be part of the plugin you sponsor on your site it will need to factor if for the old way I guess too. Unless this becomes a custom code change just for me.
So it calls:
private function section_latestuser() {
// Grab the latest registered user on the site
return $this->tag_replace( $this->parent->option["title_text_latestuser"] );
}
Which in turn calls:
function get_latestuser( $html ) {
$latest_user = get_users(
array(
'number' => 1,
'fields' => array("user_login", "ID", "display_name"),
'orderby' => "registered",
'order' => "DESC"
)
);
$latest_user = reset( $latest_user );
// Default display is the full name
$name = $latest_user->display_name;
if( $this->parent->option['user_display_format'] == "display_as_username" ) {
$name = $latest_user->user_login;
}
if( $html == true ) {
return "<a href=\"" . bbp_get_user_profile_url( $latest_user->ID ) . "\">" . $name . "</a>";
} else {
return $name;
}
}
I think, if “WP Approve User” is installed then we need to somehow modify the array returned to only include those where the are approved (as per my previous email).
Hi,
I have registered an account on bbpress. I received email with password set option. I have set the password correctly.
However, when I try to log from this section, it doesnt show anything when I click login after entering my username/password created.
When I try to login, I am specifically login from the form created by BBPRESS (not default wordpress login)
https://ibb.co/SNntGYL
This is the link where login form for bbpress can be accessed: https://www.helios7.com/vlog/forums/
After I click login it does not take me anywhere or show I am logged in. Despite entering login details it keeps showing me login window.
HOpe I am able to explain my problem
you are right ! Looks like it change on 2.6.
It now does it on register
so to change back to how it used to work
in
dashboard>settings>forums untick Automatically give registered visitors…etc
Then put this in your child theme’s function file –
ie wp-content/themes/%your-theme-name%/functions.php
where %your-theme-name% is the name of your theme
or use
Code Snippets
add_action('wp_login', 'rew_add_role');
function 'rew_add_role' () {
$user_id = $user->ID ;
$role = bbp_get_user_role( $user_id );
if (empty($role)) {
bbp_set_user_role( $user_id, 'bbp_participant' );
}
}
This code is untested, but should work, if not come back
put this in your themes custom css
a.bbpressloginurl,
a.bbpressregisterurl,
a.bbpresslostpasswordurl
{
font-size : 16px ;
font-weight: bold;
}
I’m sorry, I do not know whether this is a bbpress topic, but because I think, it could be….
At this site the menu terms ‘Anmelden’ (login), Registrieren (Register) and ‘Passwort verloren’ (Lost password), and after logging in also ‘Profile’ and ‘Logout, directly above the right upper cormer of the forums… How can I make them bigger and bold?
Thanks Robin.
I’ve the Login/Signup Popup by XootiX running,, login works, register works, but logout doesn’t. Have to logout using the standard WP logout.
Could it be, that I have to deactivate the standard WP procedure?
If yes, I would probably lose the ‘profile’ option, as that seems part of the standard (above the upper right corner of the list of forums).
That was the background of my initial question.
bbp has its own (WordPress) login/logout-register part. Using that, the WordPress settings for that are used. I don’t like it. Deactivating it and using a plugin where I can modify the popup windows (layout, size) would be an option. (Which plugin would work fine together with bbp?).
But is the also an ‘in-between’ way? Keeping the WordPress standard login/out, but modifying those popups, to make them fitting better to the layout of the site?
Wordpress: 5.6
BBPRESS: 2.6.6
Startseite
@defiance12 – presume you are bumping this for the second element.
can you expand on the issue – not sure what and where you mean.
eg
in dashboard>settings>general >timezone is set to xx#
then new user registers
is then the utc offset not correct or not applied (which), and
is this what the new user sees for all topics/replies on the site, or just their own topics/replies
and what do others see, is the offset correct for their own replies, but not the new user?
etc.
ytParticipant
Hello
I want a code to use in the function file of bbPress to hide all links in the content of forum’s topics and replies for visitors.
I mean until a visitor is not logged in the forum, instead of displaying links, it shows a text message like “displaying links to members only” and a registration link to register and enter his account so that redirects to the last page in the topic or reply.
Additional Explanation:
I Use the code below:
add_filter( 'the_content', 'content_link_for_user_snippets', 1 );
function content_link_for_user_snippets( $content = '' ) {
// Snippets.ir
if( ! is_user_logged_in() ) {
preg_match_all( "#<a(.*?)>(.*?)#i", $content, $matches );
$num = count( $matches[0] );
for( $i = 0; $i < $num; $i++ ) {
$content = str_replace( $matches[0][ $i ], '<a href="' . ( get_permalink() ) . '"><span style="color:#F00;">[displaying links to members only]<span></a>', $content );
}
}
return $content;
}
in My site’s Theme and word very nice but it doesn’t have any effect in form and couldn’t use it in bbPress function’ file.
Perfect. Thx Robin!!
The following now works
/* only run forum script in forum area */
add_action( 'wp_print_scripts' , 'deregister_forum_script');
function deregister_forum_script(){
if ( !is_bbpress() ){
wp_deregister_script('forum-js');
}}
This ticket is now closed. thx!
as I understand it, now it will be given to insert only own feeds after registering a token, and it will not be possible to insert, for example, Leonel Messi. Therefore, no updates to bbpress will help. Now everyone needs to solve this problem independently (((
Hi there,
I’m looking for a general advice if I’m hading in the right direction how to allow users to categorise their topics and replies? I’m making progess but having trouble to display those topics in the term archives, display the terms in the forum posts, etc.
In building in custom taxonomies should I be building on top of the existing topic tags, making them hierarchical –
Or taking the approach of registering two new taxonomies –
- ‘region’ eg ‘Australia, New Zealand, Tasmania’
- ‘issue’ eg ‘homelessness, rough sleeping, couchsurfing
I’ve then added a term picker to the new topic form –
But I’m stuck getting topics/replies to display on the the term archives,
this doesn’t seem to work to eg to display topic on this archive
https://www.forum.backtofrontdesign.co/region/victoria/
am i using the correct post type slugs?
function add_post_types_to_archives( $query ) {
// We do not want unintended consequences.
if ( is_admin() || ! $query->is_main_query() ) {
return;
}
if ( is_category() && empty( $query->query_vars['suppress_filters'] ) ) {
// Add more slugs with the other CPTs.
$post_types = array( 'topic');
$query->set(
'post_type',
array_merge(
array( 'post' ),
$post_types
)
);
}
}
I’ll keep persevering to display the terms on forum archives and single topics, but any advice or assistance from the community would be so much appreciated to get this campaign up and running.
Forums
A project for https://www.oldertenants.org.au/
I take it you have an add action statement
add_action( 'bbp_register_views' ....
View Topic By
I’m creating my own custom forum view using the register_views code. The function works but for some reason the url isn’t working. What am I missing?
function my_custom_register_views() {
// Latest Replies Custom View
bbp_register_view(
'latest-replies',
__( 'Latest Replies', 'my_custom_register_views' ),
apply_filters( 'bbp_register_view_latest_replies', array(
'orderby' => 'meta_value',
'order' => 'DESC',
'meta_key' => '_bbp_last_active_time',
'post_status' => array(bbp_get_public_status_id(), bbp_get_closed_status_id()),
'post_type' => bbp_get_topic_post_type(),
'show_stickies' => false
)
) );
}