Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 25 replies - 51 through 75 (of 162 total)
  • @cnorris23

    Participant

    Nope. They have a history of going to spam boxes, so you might check there.

    @cnorris23

    Participant

    The links are nonced, so I can’t recreate the link for you. It looks like http://example.com/members/username/admin/delete-user/?_wpnonce={random string} or http://example.com/members/username/admin/mark-spammer/?_wpnonce={random string}. You could create widget that shows up when an admin visits a user page.

    @cnorris23

    Participant

    When a user registers, an email is sent out with an activation link. The user must visit this link to activate their account before they can log in. I’m in a hurry, so I can’t do it right now, but there are a few plugins, and even some code snippets on this forum that will allow you to bypass activation. It’s not recommended on a live site to help block spam users.

    @cnorris23

    Participant

    Try changing `bp_format_time( $last_edited_date )` to `bp_format_time( strtotime( $last_edited_date ) )`

    @cnorris23

    Participant

    Yes there is. As long as you are a super admin, just visit the spam user’s profile page, and you’ll see “Admin Options” show up in the buddybar (the toolbar at the top of the page). In the drop-down you’ll see the options to delete/spam.

    @cnorris23

    Participant

    Well that could be the reason. Do you have `do_action( ‘bp_group_forum_post_meta’ );` anywhere in your template in the meta section? My guess is no, which is why nothing is displaying. You can try adding `my_display_forum_post_last_edited()` where you’d like the “Last edited…” text to appear.

    @cnorris23

    Participant

    Theoretically it should show up at the top of the post that was edited, right beside the #. Are you using the bp-default theme?

    In reply to: hide from source code

    @cnorris23

    Participant

    You can’t do that. You can use one of WP’s constants to change the wp-content folder name (https://codex.wordpress.org/Editing_wp-config.php#Moving_wp-content), but those folders will still show in source code. That’s just the nature of the internet.

    @cnorris23

    Participant

    Apparently I have an issue today with fat fingers or bad copy/paste-itus. Try this:

    `my_update_forum_post_last_edited( $post_id ) {
    global $bp;

    do_action( ‘bbpress_init’ );

    $post_id = (int) $post_id;

    if ( empty( $post_id ) )
    return;

    bb_update_postmeta( $post_id, ‘last_edited_date’, bp_core_current_time() );
    bb_update_postmeta( $post_id, ‘last_edited_user’, $bp->loggedin_user->id );
    }
    add_action( ‘groups_edit_forum_post’, ‘my_update_forum_post_last_edited’ );`

    @cnorris23

    Participant

    Try adding `define( ‘BP_ENABLE_USERNAME_COMPATIBILITY_MODE’, true );` to your wp-config.php or bp-custom.php file.

    @cnorris23

    Participant

    Yeah, that’s because I put in the wrong variable so nothing was saving. Replace the first function with this, and then see what happens. You’ll need to edit a post again.

    `my_update_forum_post_last_edited( $post_id ) {
    global $bp;

    do_action( ‘bbpress_init’ );

    $post_id = (int) $post_id;

    if ( empty( $post_id ) )
    return;

    bb_update_postmeta( $post_id, ‘last_edited_date’, bp_core_current_time() );
    bb_update_postmeta( $post_id, ‘last_edited_user’, $bp->loggedin_user->id );
    }
    add_action( ‘groups_edit_forum_post’, ‘my_update_post_lasted_edited’ );`

    @cnorris23

    Participant

    Also, I haven’t tested any of this, so you may need to play around a little more to make it functional.

    @cnorris23

    Participant

    You’ll also need to edit a post before anything will show.

    @cnorris23

    Participant

    No, the code goes in your functions.php file. You won’t need to make any other changes.

    @cnorris23

    Participant

    Nope. Just make the changes @aces gave you, and you’ll be ready to edit how you please :) You’ll only to change the css in your new my_columns theme.

    @cnorris23

    Participant

    Try it. I should do everything for you. “Get you started” means just that. It will get you started, and then you can tweak it to your needs.

    @cnorris23

    Participant

    Yeah, but there’s talk of a 1.2.9, so we might be able to slip it in.

    @cnorris23

    Participant

    This would take some code work, because neither bbPress or BuddyPress store this information. You would need to hook into ‘groups_edit_forum_post’ and the use bb_update_postmeta() and bb_get_postmeta() to save/retrieve the information. The following will get you started:

    `my_update_forum_post_last_edited( $post_id ) {
    global $bp;

    do_action( ‘bbpress_init’ );

    $post_id = (int) $post_id;

    if ( empty( $post_id ) )
    return;

    bb_update_postmeta( $post_meta, ‘last_edited_date’, bp_core_current_time() );
    bb_update_postmeta( $post_meta, ‘last_edited_user’, $bp->loggedin_user->id );
    }
    add_action( ‘groups_edit_forum_post’, ‘my_update_post_lasted_edited’ );

    function my_display_forum_post_last_edited() {
    do_action( ‘bbpress_init’ );

    $last_edited_user = bb_get_postmeta( bp_get_the_topic_post_id(), ‘last_edited_user’ );
    $last_edited_date = bb_get_postmeta( bp_get_the_topic_post_id(), ‘last_edited_date’ );

    if ( empty( $last_edited_user ) || empty( $last_edited_date ) )
    return;

    echo ‘Last edited by ‘ . bp_core_get_user_display_name( $last_edited_user ) . ‘ on ‘ . bp_format_time( $last_edited_date ) . ‘ ‘;
    }
    add_action( ‘bp_group_forum_post_meta’, ‘my_display_forum_post_last_edited’ );`

    @cnorris23

    Participant

    No problem. Glad it works now

    @cnorris23

    Participant

    Could you post a bug report on Trac for this? Reference this topic. You can use the same username/password as you did to log in here. http://trac.buddypress.org

    @cnorris23

    Participant

    Well that’s why I asked. Right now the logic tranlates to this:

    “If this topic is not mine, or the user is not logged in, don’t show a link.”

    You want it to say:

    “If this post is mine, or the user is not logged in, don’t show a link.”

    Here’s your new code:

    `function bp_forum_send_private_message_link() {
    echo bp_forum_get_send_private_message_link();
    }
    function bp_forum_get_send_private_message_link() {
    global $bp, $topic_template;

    if ( bp_get_the_topic_post_is_mine() || !is_user_logged_in() )
    return false;

    return apply_filters( ‘bp_forum_get_send_private_message_link’, wp_nonce_url( $bp->loggedin_user->domain . $bp->messages->slug . ‘/compose/?r=’ . bp_core_get_username( $topic_template->post->poster_id, $topic_template->post->poster_nicename, $topic_template->post->poster_login ) ) );
    }`

    @cnorris23

    Participant

    Question… Are you trying to put the link on every post as long as it’s not your own post?

    @cnorris23

    Participant

    Instead of clicking the link, right-click and choose “copy shortcut” or “copy url” or “copy link”… whatever the text may be. I would change your web domain to example.com before posting the link if you don’t want people poking around your site.

    @cnorris23

    Participant

    What is the link it’s producing?

    @cnorris23

    Participant

    Yeah, that’s why. Try this:

    `bp_core_get_username( $topic_template->post->poster_id, $topic_template->post->poster_nicename, $topic_template->post->poster_login )`

Viewing 25 replies - 51 through 75 (of 162 total)
Skip to toolbar