Forum Replies Created
-
In reply to: How do I refer to current user’s name?
OK. Thanks. It turned out bb_head() was only called (as part of an
if ()
statement) when the page is a topic. So I see that my above plugin works on a topic page. Awesome.My long-term project is a forum-access plugin where you can grant or restrict access to individual users. Not roles-based.
Does anyone know a hook to use for intercepting an individual forum listing in front-page.php? You’d think
get_forum
would work, but for some reason … anyway.I’ll keep you posted on my adventures of learning to write plugins.
In reply to: bbPress 0.8What changes will there be in 0.8?
In reply to: How do I refer to current user’s name?This is frustrating. Tell me why this simplest of all plugins does not work.
<?php
/*
Plugin Name: Add something to the header
Plugin URI: http://davidbessler.com
Description: My first plugin
Author: David Bessler
Author URI: http://davidbessler.com
Version: 1.0
*/
function add_something_to_the_header (){
echo "<!--Something I added-->n";
}
add_action ('bb_head' , 'add_something_to_the_header');
?>
In reply to: Looking for the right hookOK look at this:
$forum_restrict_keys = array(
"1" => "davidbessler,testman",
"3" => "davidbessler,",
);
function forum_restrict_check_name() {
global $bb_current_user,$forum_restrict_keys;
if ($bb_current_user){
$allowed = strpos($forum_restrict_keys[get_forum_id()], get_user_name( $bb_current_user->ID ));
if ($allowed == "") {
echo "[blocked]";
add_filter( 'get_forum_name', 'forum_restrict_blank_name');
} else {
echo "[Not blocked]";
}
}
}
function forum_restrict_blank_name (){
echo "";
}
add_action( 'get_forum_name', 'forum_restrict_check_name');
?>
That puts [blocked] instead of the forum name in a forum that user is not allowed to see, and [not blocked] on a forum he is allowed to see. How do I get the forum name back in there instead of [not blocked]?
In reply to: How do I refer to current user’s name?How about a list of hooks?
In reply to: How do I refer to current user’s name?so:
Function BlahBlah () {
global $bb_current_user;
$myName = get_user_name( $bb_current_user->ID );
echo "Hello, my name is ".$myName;
}
Like that?
Where can I find a list of all these variables and functions? Like how did the author of that plugin know there was such a thing as
get_user_name()
?In reply to: Private Forum scriptHow about a plugin allowing admin to select specific users who have access to a forum? … doesn’t even need a GUI, you could enter a list of names in the script.
In reply to: Plugin: Post NotificationI tested it out and it sent me an email when I posted a new topic. That works for now. But, like we said, an “add forum to favorites” plugin is needed. For anyone reading this, what we are talking about is strictly for the plugin called notification_all.php which can be foun here:
In reply to: Private Forum scriptAny news on the roles-based forum permissions. It is the only feature holding me back now … I have been exploring all sorts of options involving more advanced forums (smf, phpbb etc …) but those involve crappy bridges, none of which work well or look nice. I love bbpress’ simplicity … so, any way to restrict certain forums to certain users? I don’t even need it to be roles-based. I’m OK just selecting users individually to have access to a specific forum.
In reply to: Plugin: Post NotificationIf I’m not mistaken Trent, I think that plugin notifies the ADMINISTRATOR of ANY post to ANY topic. Since it does not add any visible subscription option to any forums, I can only assume that’s what it does. The only other possibility is that it emails EVERYONE when ANYONE posts ANYTHING ANYWHERE on bbpress, which would be a disaster. Can anyone verify what exactly notify_all does? I installed it, but could not see a difference.
In reply to: Disallowing Registrationmouse8b, I had the same problem and used your solution. In addition, I commented out the registration link in the file login-form.php and saved it (along with my new registration.php) in my-templates so the modified template gets preserved through upgrades.
-cheers
In reply to: Plugin: Post NotificationCan this plugin be modified to notify of new TOPICS in a forum, rather than new POSTS in a TOPIC. In other words, add the ability to have favorite forums rather than favorite topics? Or is there already a way to do this?