Search Results for 'code'
-
Search Results
-
Topic: Image upload advice
Hello,
I’ve been looking into image uploads. It seems that it is not easy for participants to upload photos etc. I take it that users are supposed to type in the path to the file in the Source field in the WYSIWYG editor – I doubt that users would know how to do that.
I found this topic here in this forum.
Could somebody perhaps advise me if the code that is suggested would be the right way to go or would the plugin be better?
Many thanks.Hi,
I’ve added the nickname field to profile so people can add it.
Now I need it to display on the topic and replies under bbp-reply-author.
Everything I’ve tried shows username. Is there a way of tweaking to below to nickname?
<?php $user = get_userdata( bbp_get_reply_author_id() ); if ( !empty( $user->user_nicename ) ) { $user_nicename = $user->user_nicename; echo "@".$user_nicename; } ?>Hi all,
I hope you can help me. I am trying to create and attach a bbp forum automatically after a BuddyPress group is created.
I have “unset” the BuddyPress group creation steps, and only the “group settings” step remains.
I have been digging in bbp code to try to reproduce the forum creation process, and this is what I put together (though it is not working):
<?php $bbpforum = new BBP_Forums_Group_Extension; ?>
<?php $bbpforum->__construct(); ?><!-- Reproducing parts of public edit_screen() -->
<!-- Reproducing fieldset return -->
<?php $_POST['bbp-edit-group-forum'] = true; ?> <!-- this comes from the edit screen; this form field is sent -->
<!-- end of fieldset return -->
<!-- start of edit_screen_save -->
<?php
if ( empty( $group_id ) ) {
$group_id = bp_get_new_group_id();
}$create_forum = true; // Changed this to true (there was a switch structure down and I kept the true case only
$forum_id = 0;
$forum_ids = bbp_get_group_forum_ids( $group_id );if ( !empty( $forum_ids ) )
$forum_id = (int) is_array( $forum_ids ) ? $forum_ids[0] : $forum_ids;// Set the default forum status
$status = bbp_get_public_status_id();
// Create the initial forum
$forum_id = bbp_insert_forum( array(
'post_parent' => bbp_get_group_forums_root_id(),
'post_title' => bp_get_new_group_name(),
'post_content' => bp_get_new_group_description(),
'post_status' => $status
) );// Run the BP-specific functions for new groups
$bbpforum->new_forum( array( 'forum_id' => $forum_id ) );// Update forum active
groups_update_groupmeta( bp_get_new_group_id(), '_bbp_forum_enabled_' . $forum_id, true );// Toggle forum on
$bbpforum->toggle_group_forum( bp_get_new_group_id(), true );?>
It is placed in create.php, right after the create group form submission entry.
As you see, I have erased the wp_nonce_field functions and the associated admin_referrer functions to avoid the “Are you sure you want to do this?” screen.
If it is not clear, please, let me know what else would be needed to try get the automatic forum, and of course, if you know a better and easier way of doing it.
Thank you very much!