That worked beautifully! You totally and completely rock….HARD!
A huge thank you! I wish there was a button I could click to thank you with or something but all I can think to do is share my code so it can help others / hopefully prevent you from having to answer the same question again.
Here is what I put to make it work:
<?php
function annointed_admin_bar_remove() {
global $wp_admin_bar, $current_user;
get_currentuserinfo();
$myadmins = array(1, 3); // Add all IDs of the admins in this array
if ( !in_array($current_user->ID, $myadmins) ) {
$wp_admin_bar->remove_menu('wp-logo'); // Remove the WP Logo Menu
$wp_admin_bar->remove_menu('site-name'); // Remove the site name menu
$wp_admin_bar->remove_menu('view-site'); // Remove the view site link
}
}
add_action('wp_before_admin_bar_render', 'annointed_admin_bar_remove');
Hi, I’m writing a plugin that wraps around most of the bbpress pages using add_action
for some reason when I try
add_action('bbp_template_before_search',
it works, but only with text. when I check the source files in the web inspector it’s missing javascript files for my plugins.
I’m using wp_enqueue_script to add my script, it works on /forums so I don’t really understand why It wouldn’t for the search page
So yes I’d love to see how you created that great layout, and maybe share the code to allow others to get the same effect.
Are you up for that?
Hi,
No dumb questions here…
As you might have seen in your database, the ID field is a bigint, so to continue on the IF that you used, you could go for:
$myadmins = array(1, 2); // Add all IDs of the admins in this array
if ( !in_array($current_user->ID, $myadmins) ) {
Pascal.
it’s do-able but I don’t know of anything that already does this.
Suspect you need to pay someone to cut the code for you.
try http://jobs.wordpress.net/
If you look for a coder concerning WP/bbPress, don’t forget to post on http://jobs.wordpress.net/
Pascal.
DLParticipant
Thanks for the codex links.
I did spend several hours trying to modify the phpBB converter to work with the Dizkus database tables before coming here. Was able to get it partly working but was losing meta data like poster name, post time, and it seemed the posts (replies) weren’t always assigned to the right topic. Also, what to do about avatars and signatures.
I’ll try doing it from scratch based on the codex example.phpj. Was just hoping someone had already done it.
As far as Dizkus, here is a small basic forum that uses it.
http://www.deltasailing.com/Dizkus/viewforum/forum/1
And a larger one
http://www.thebeachcats.com/forums
I’ve put this out on Codeable.com to pay to get it done if anyone here does projects there.
I’ve never heard of Dizkus 🙁
You could try making some more changes to the phpBB importer yourself if it already partially works:
Custom Import
Also checkout both of these for SMF and phpBB for the upcoming bbPress 2.6 release.
https://bbpress.trac.wordpress.org/browser/trunk/src/includes/admin/converters/phpBB.php
https://bbpress.trac.wordpress.org/browser/trunk/src/includes/admin/converters/SMF.php
Hi,
Are you sure your $current_user already has data at that moment ?
Just before your if statement, try to run
get_currentuserinfo();
And just to make a quick test, you could always echo the ID just after running the above function to verify
echo 'User ID: ' . $current_user->ID . "\n";
Pascal.
If you look at the phpBB importer it has the callback_html and parses a bunch or regular expressions to manipulate the previous BBCode or HTML strings, will that work for you?
https://bbpress.trac.wordpress.org/browser/trunk/src/includes/admin/converters/phpBB.php#L934
Hi,
You could do this by copying the bbPress php file needed to a (child) theme and then modify it accordingly.
More info here: https://codex.bbpress.org/themes/theme-compatibility/getting-started-in-modifying-the-main-bbpress-template/
Pascal.
Sorry for double posting but I figured the following would be beneficial for anyone who might view this as well.
I decided to go the latter route and used this code:
function annointed_admin_bar_remove() {
global $wp_admin_bar,
$wp_admin_bar->remove_menu('wp-logo'); // Remove the WP Logo Menu
$wp_admin_bar->remove_menu('site-name'); // Remove the site name menu
$wp_admin_bar->remove_menu('view-site'); // Remove the view site link
}
add_action('wp_before_admin_bar_render', 'annointed_admin_bar_remove');
ok, how have you set your forum up ?
Have you been through
Step by step guide to setting up a bbPress forum – Part 1
in particular step 3?
yes you can create new roles with custom capabilities
https://codex.bbpress.org/custom-capabilities/
Try this
function casiepa_mention_gravatar() {
?>
<div>
<label for="bbp-gravatar-notice">Avatar</label>
<fieldset style="width: 60%;">
<span style="margin-left: 0; width: 100%;" name="bbp-gravatar-notice" class="description">Manage your profile picture at <a href="https://gravatar.com" title="Gravatar">Gravatar</a>.</span>
</fieldset>
</div>
<?php
}
add_action( 'bbp_user_edit_after_about', 'casiepa_mention_gravatar' );
I’m assuming you mean that it broke your layout, and not your site, because the code @casiepa posted works. Also, there’s no question mark in the code that he posted.
If you want the link to Gravatar to show only on a user’s edit profile page, try this:
function casiepa_mention_gravatar() {
?>
<div>
<label for="bbp-gravatar-notice">Avatar</label>
<span name="bbp-gravatar-notice" class="description">Manage your profile picture at <a href="https://gravatar.com" title="Gravatar">Gravatar</a>.</span>
</div>
<?php
}
add_action( 'bbp_user_edit_after_about', 'casiepa_mention_gravatar' );
Just went to log into my site which uses the bbp-login shortcode and it just shows me a blank page. logged in using the wp-login, checked the login page with the shortcode, the shortcode is still there.
Also, the forums page is all blank as well. no forums are showing. Go to forums > all forums, they are listed there.
Tried Chrome and IE. Same issue on both.
Several of the wordpress access manager products will allow you to control who can do stuff to what
I think (from memory) that ‘user role editor’
and if you are happy with a bit of code, then this will help you define new roles/admin existing and control access
https://codex.bbpress.org/custom-capabilities/
that’s of my plugins then from a while back!
ok try my
https://wordpress.org/plugins/bbp-style-pack/
and use the
[bsp-display-topic-index show='5' template ='short']
which displays without the header.
If you want it customised just for you, contact me via my website http://www.rewweb.co.uk
Hi there
Its bbP shortcodes by Robin Wilson.
Many thanks for any help.
Hey, Pascal –
I followed up with the theme developer and they pointed me back to the plugin developer.
Any idea on what is causing the layout issue or where I can look to find the code that is causing the problem?
Thanks!
Brandi
What file do you insert that code into?
I’ve been searching for a solution on this for hours, to no avail, and it seems like such a simple thing:
All I want to do is have my website show other users’ basic info when I click their name in a forum post.
For example, if I write a forum post, another user should be able to click on my name and see the profile info that I’ve added to my profile in the backend–e.g. “Contact Info” and “About Yourself” (email address, website, biographical info)–on a page on my site.
Right now, when they click on my name, or when I click on another forum user’s name, it sends to our 404 page.
What gives? Pretty much any site I’ve ever used that has multiple users allows you to click their name to see their bio. It seems insane that WordPress/bbPress doesn’t have this basic feature. And I haven’t even been able to find a plugin or any kinds of codes to make this happen. I’ve found all kinds of plugins that allow you to add additional user fields (like social media info) or prettier front-end login pages, but nothing that just displays another user’s contact/bio info.
Thanks in advance for your help.