Search Results for 'code'
-
Search Results
-
My server is showing this error repeatedly:
“PHP Parse error: syntax error, unexpected ‘new’ (T_NEW) in /home/…/bb-settings.php on line 188”When I look at line 186 thru 190 of bb-settings.php, it shows this statement:
// Setup the global database connection $bbdb_class = BB_DATABASE_CLASS; $bbdb =& new $bbdb_class( array( 'name' => BBDB_NAME, 'user' => BBDB_USER,
I am trying to troubleshoot what it is about that line with the “new” statement that causes this parse/syntax error repeatedly by the server. Any thoughts are appreciated. Thank-you.
Topic: Add emoticons
I migrated a forum from vbulletin but now the customized smileys do not appear but I only see their code such as the writing: cgrd: or: by2:, how can I connect their codes to the smileys that I upload in ftp?
Thank
Topic: Help footer display as text
The footer of the page was broken when I enter any page of the forum but the rest of the page works perfectly, only when I enter the pages of the forum it broke. I use wpbakery to build the page.
The only page of the forum that works well is the one that I created by placing the shortcode: https://dermomen.com/foros-dermomen/ the rest of the pages break the footer and show it in text.
I hope you can help me. Thanks.
WordPress 5.8
bbPress 2.6.6
BuddyPress 9.0.0
Astra Theme 3.6.5Help! I have read every forum post about creating new custom roles in bbPress, but it still isn’t working for me. The created role names are displaying on my Users page in my Admin dashboard, but the roles themselves are not working as intended. When I assign a user a forum role, it is adding it under the “Roles” [i.e., Subscriber (WP Role), Founder (bbPress Role)] and not “Forum Roles.” I tested the different user role settings and they, too, are not working.
Am I missing something or doing something wrong? I’m new to bbPress and very frustrated after spending hours trying to get this to work.
This is the code I have create and placed in my Code Snippet plugin. The forum is being added to a paid members only website, so the URL would not be useful.
function authorready_add_new_roles( $bbp_roles ) {
$bbp_roles['bbp_probation'] = array(
'name' => 'Probation',
'capabilities' => custom_capabilities( 'bbp_probation' )
);$bbp_roles['bbp_subscriber'] = array(
'name' => 'Subscriber',
'capabilities' => custom_capabilities( 'bbp_subscriber' )
);$bbp_roles['bbp_founder'] = array(
'name' => 'Founder',
'capabilities' => custom_capabilities( 'bbp_founder' )
);$bbp_roles['bbp_leader'] = array(
'name' => 'Group Leader',
'capabilities' => custom_capabilities( 'bbp_leader' )
);$bbp_roles['bbp_moderator'] = array(
'name' => 'Moderator',
'capabilities' => custom_capabilities( 'bbp_moderator' )
);$bbp_roles['bbp_administrator'] = array(
'name' => 'Administrator',
'capabilities' => custom_capabilities( 'bbp_administrator' )
);return $bbp_roles;
}add_filter( 'bbp_get_dynamic_roles', 'authorready_add_new_roles', 1 );
function authorready_add_role_caps_filter( $caps, $role )
{
/* Only filter for roles we are interested in! */
if( $role == 'bbp_probation' )
$caps = custom_capabilities( $role );if( $role == 'bbp_subscriber' )
$caps = custom_capabilities( $role );if( $role == 'bbp_founder' )
$caps = custom_capabilities( $role );if( $role == 'bbp_leader' )
$caps = custom_capabilities( $role );if( $role == 'bbp_moderator' )
$caps = custom_capabilities( $role );if( $role == 'bbp_administrator' )
$caps = custom_capabilities( $role );return $caps;
}add_filter( 'bbp_get_caps_for_role', 'authorready_add_role_caps_filter', 10, 2 );
function custom_capabilities( $role )
{
switch ( $role )
{/* Capabilities for 'probation' role */
case 'bbp_probation':
return array(
// Primary caps
'spectate' => true,
'participate' => false,
'moderate' => false,
'throttle' => false,
'view_trash' => false,// Forum caps
'publish_forums' => false,
'edit_forums' => false,
'edit_others_forums' => false,
'delete_forums' => false,
'delete_others_forums' => false,
'read_private_forums' => false,
'read_hidden_forums' => false,// Topic caps
'publish_topics' => false,
'edit_topics' => false,
'edit_others_topics' => false,
'delete_topics' => false,
'delete_others_topics' => false,
'read_private_topics' => false,// Reply caps
'publish_replies' => false,
'edit_replies' => false,
'edit_others_replies' => false,
'delete_replies' => false,
'delete_others_replies' => false,
'read_private_replies' => false,// Topic tag caps
'manage_topic_tags' => false,
'edit_topic_tags' => false,
'delete_topic_tags' => false,
'assign_topic_tags' => false,
);/* Capabilities for 'subscriber' role */
case 'bbp_subscriber':
return array(
// Primary caps
'spectate' => true,
'participate' => true,
'moderate' => false,
'throttle' => false,
'view_trash' => false,// Forum caps
'publish_forums' => false,
'edit_forums' => false,
'edit_others_forums' => false,
'delete_forums' => false,
'delete_others_forums' => false,
'read_private_forums' => true,
'read_hidden_forums' => false,// Topic caps
'publish_topics' => false,
'edit_topics' => false,
'edit_others_topics' => false,
'delete_topics' => false,
'delete_others_topics' => false,
'read_private_topics' => true,// Reply caps
'publish_replies' => true,
'edit_replies' => true,
'edit_others_replies' => false,
'delete_replies' => true,
'delete_others_replies' => false,
'read_private_replies' => true,// Topic tag caps
'manage_topic_tags' => false,
'edit_topic_tags' => false,
'delete_topic_tags' => false,
'assign_topic_tags' => false,
);/* Capabilities for 'founder' role */
case 'bbp_founder':
return array(
// Primary caps
'spectate' => true,
'participate' => true,
'moderate' => false,
'throttle' => false,
'view_trash' => false,// Forum caps
'publish_forums' => false,
'edit_forums' => false,
'edit_others_forums' => false,
'delete_forums' => false,
'delete_others_forums' => false,
'read_private_forums' => true,
'read_hidden_forums' => false,// Topic caps
'publish_topics' => false,
'edit_topics' => false,
'edit_others_topics' => false,
'delete_topics' => false,
'delete_others_topics' => false,
'read_private_topics' => true,// Reply caps
'publish_replies' => true,
'edit_replies' => true,
'edit_others_replies' => false,
'delete_replies' => true,
'delete_others_replies' => false,
'read_private_replies' => true,// Topic tag caps
'manage_topic_tags' => false,
'edit_topic_tags' => false,
'delete_topic_tags' => false,
'assign_topic_tags' => false,
);/* Capabilities for 'group leader' role */
case 'bbp_leader':
return array(
// Primary caps
'spectate' => true,
'participate' => true,
'moderate' => true,
'throttle' => false,
'view_trash' => false,// Forum caps
'publish_forums' => false,
'edit_forums' => false,
'edit_others_forums' => false,
'delete_forums' => false,
'delete_others_forums' => false,
'read_private_forums' => true,
'read_hidden_forums' => false,// Topic caps
'publish_topics' => false,
'edit_topics' => false,
'edit_others_topics' => false,
'delete_topics' => false,
'delete_others_topics' => false,
'read_private_topics' => true,// Reply caps
'publish_replies' => true,
'edit_replies' => true,
'edit_others_replies' => true,
'delete_replies' => true,
'delete_others_replies' => true,
'read_private_replies' => true,// Topic tag caps
'manage_topic_tags' => false,
'edit_topic_tags' => false,
'delete_topic_tags' => false,
'assign_topic_tags' => true,
);/* Capabilities for 'moderator' role */
case 'bbp_moderator':
return array(
// Primary caps
'spectate' => true,
'participate' => true,
'moderate' => true,
'throttle' => true,
'view_trash' => true,// Forum caps
'publish_forums' => false,
'edit_forums' => false,
'edit_others_forums' => false,
'delete_forums' => false,
'delete_others_forums' => false,
'read_private_forums' => true,
'read_hidden_forums' => false,// Topic caps
'publish_topics' => true,
'edit_topics' => true,
'edit_others_topics' => false,
'delete_topics' => false,
'delete_others_topics' => false,
'read_private_topics' => true,// Reply caps
'publish_replies' => true,
'edit_replies' => true,
'edit_others_replies' => false,
'delete_replies' => true,
'delete_others_replies' => true,
'read_private_replies' => true,// Topic tag caps
'manage_topic_tags' => false,
'edit_topic_tags' => true,
'delete_topic_tags' => true,
'assign_topic_tags' => true,
);/* Capabilities for 'administrator' role */
case 'bbp_administrator':
return array(
// Primary caps
'spectate' => true,
'participate' => true,
'moderate' => true,
'throttle' => true,
'view_trash' => true,// Forum caps
'keep_gate' => true,
'publish_forums' => true,
'edit_forums' => true,
'edit_others_forums' => true,
'delete_forums' => true,
'delete_others_forums' => true,
'read_private_forums' => true,
'read_hidden_forums' => true,// Topic caps
'publish_topics' => true,
'edit_topics' => true,
'edit_others_topics' => true,
'delete_topics' => true,
'delete_others_topics' => true,
'read_private_topics' => true,// Reply caps
'publish_replies' => true,
'edit_replies' => true,
'edit_others_replies' => true,
'delete_replies' => true,
'delete_others_replies' => true,
'read_private_replies' => true,// Topic tag caps
'manage_topic_tags' => true,
'edit_topic_tags' => true,
'delete_topic_tags' => true,
'assign_topic_tags' => true,
);break;
default :
return $role;
}
}
Hello,
I copied the code forms-topic to create a very simple form for use in only one forum.
How I may please pre-select the forum from the drop-down that selects which forum to post by default? I’d assume it would require the forum ID but I do not know how to make it select to that forum by default.Thank you for any assistance.