My first plugin for bbpress:
Moderator New Post Notification
Description:
Sends a notification e-mail to all moderators and admins if there is a new post from a regular member.
Enjoy and let me know what do you think.
Great offers not only for geeks!
My first plugin for bbpress:
Moderator New Post Notification
Description:
Sends a notification e-mail to all moderators and admins if there is a new post from a regular member.
Enjoy and let me know what do you think.
The plugin is listed now on the bbpress website:
http://bbpress.org/plugins/topic/75?replies=1
don't forget to vote
I got this installed and I don't get any emails. New users are receiving their emails, but I don't get notifications when anyone posts.
What could be wrong?
Hi,
what is your role on your forum? do you tried a second (admin) account?
Hi, I have a stand alone installation of bbpress and when I use the plugin I get this error:
bbPress database error: [Table 'db164673748.bb_users' doesn't exist]
SELECT um.meta_value AS role FROM bb_users AS u, bb_usermeta AS um WHERE u.ID = um.user_id AND um.meta_key = 'bbpress_capabilities' AND u.user_status = 0 AND u.ID = 1
Warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /homepages/34/d21941373/htdocs/forum/my-plugins/moderator_notification.php on line 40
Warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /homepages/34/d21941373/htdocs/forum/my-plugins/moderator_notification.php on line 40
Warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /homepages/34/d21941373/htdocs/forum/my-plugins/moderator_notification.php on line 40
Warning: Invalid argument supplied for foreach() in /homepages/34/d21941373/htdocs/forum/my-plugins/moderator_notification.php on line 73
Warning: Cannot modify header information - headers already sent by (output started at /homepages/34/d21941373/htdocs/forum/bb-includes/db-mysql.php:130) in /homepages/34/d21941373/htdocs/forum/bb-includes/pluggable.php on line 228
I have read the suggestions, but I still habe no solution for this. Can you help me?
I guess you trapped into the table name bug :)
I guess your user table is not bb_user?
Well, you are right. My tables name was different.. I changed it, but now I have a different error:
Warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /homepages/34/d21941373/htdocs/forum/my-plugins/moderator_notification.php on line 40
Warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /homepages/34/d21941373/htdocs/forum/my-plugins/moderator_notification.php on line 40
Warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /homepages/34/d21941373/htdocs/forum/my-plugins/moderator_notification.php on line 40
Warning: Invalid argument supplied for foreach() in /homepages/34/d21941373/htdocs/forum/my-plugins/moderator_notification.php on line 73
Warning: Cannot modify header information - headers already sent by (output started at /homepages/34/d21941373/htdocs/forum/my-plugins/moderator_notification.php:40) in /homepages/34/d21941373/htdocs/forum/bb-includes/pluggable.php on line 228
first be sure that you have this query in your plugin.
(echo the sql statement, access the plugin file directly and test the output with phpmyadmin) I hope that I don't ask too much ;)
I am Sorry, I don't know how to test the plugin with phpmyadmin. I located the term "array_key_exists()" in \bb_includes\template-functions.php, upgrade-functions.php, profile-edit.php and gettext.php.
Look, I think you get this error because of an empty array, if you test the SQL statement you know the problem.
btw. I forgot to post the modified function:
function is_moderator($user_id) {
global $bbdb;
$mods = array('moderator', 'administrator', 'keymaster');
$is_mod = false;
$row = $bbdb->get_row("SELECT um.meta_value AS role
FROM $bbdb->users AS u, $bbdb->usermeta AS um
WHERE u.ID = um.user_id
AND um.meta_key = 'bb_capabilities'
AND u.user_status = 0
AND u.ID = $user_id
");
$arr = unserialize($row->role);
if (count($mods) > 0) {
foreach($mods as $val) {
if (array_key_exists($val, $arr)) {
$is_mod = true;
break;
}
}
}
return $is_mod;
}You must log in to post.