Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 25 replies - 1,251 through 1,275 (of 2,756 total)
  • @henrywright

    Moderator

    That particular notification is for a private message. See where it says component_name. Post IDs won’t relate to messages

    @henrywright

    Moderator

    My apologies, I missed parentheses. It should be:

    $obj = bp_notifications_get_notification( bp_get_the_notification_id() );
    var_dump( $obj );

    Can you paste what you get with that updated snippet?

    @henrywright

    Moderator

    Inside the notifications loop can you do this and paste what you get?

    $obj = bp_notifications_get_notification( bp_get_the_notification_id );
    var_dump( $obj );

    @henrywright

    Moderator

    You shouldn’t need to do anything to bp-notifications-functions.php so revert those changes an your code should be good to go.

    @henrywright

    Moderator

    You’ll need to replace $id in my snippet with the actual ID of the notification. You should be able to get that with bp_get_the_notification_id() if you’re using my snippet within the loop.

    @henrywright

    Moderator

    Just to note, bp_notifications_get_notification() returns an BP_Notifications_Notification object so to get item_id you’d just access it like this:

    $obj = bp_notifications_get_notification( $id );
    echo $obj->item_id;

    @henrywright

    Moderator

    The post ID should be passed to that function as either item_id or secondary_item_id. Then, if you have the notification ID, you can retrieve the data (post ID) at a later date with bp_notifications_get_notification()

    @henrywright

    Moderator

    You can only get the post ID if it was added at the point bp_notifications_add_notification() was used. How are you adding the notification?

    In reply to: Where to install

    @henrywright

    Moderator

    The reason I suggested you re-word your question is because the debate surrounding WordPress as a subdomain VS WordPress as a primary domain is a popular one which has been addressed lots of times already.

    The answer really does depend on what you’re trying to do, as @shanebp already pointed out.

    Hopefully this helps.

    @henrywright

    Moderator

    See the Members Navigation Menus article.

    In reply to: Where to install

    @henrywright

    Moderator

    You install BuddyPress as a WordPress plugin so perhaps your question should be where should you install WordPress?

    In reply to: Delete profile fields

    @henrywright

    Moderator

    You could put it in your functions.php file, or even your bp-custom.php file if you have one. It only needs to be run once so make sure you remove it after visiting your website in a web browser.

    Finding the group ID or the field ID is something you’ll need to do yourself. Take a look in your database and find table bp_xprofile_fields. Then look for the id column and the name column. Say the name of the field you want to delete is ‘Social’. Just look for ‘Social’ in the name column and find the id of that particular row. Then you have your field ID.

    In reply to: Delete profile fields

    @henrywright

    Moderator

    To delete a profile field group, you can use xprofile_delete_field_group(). The function accepts the ID of the field group you wish to delete.

    To delete a specific field, you can use xprofile_delete_field(). This function accepts the ID of the field you wish to delete.

    @henrywright

    Moderator

    Have you tried searching the WordPress Plugin Directory? There seems to be lots of plugins that display a geographical map of users.

    @henrywright

    Moderator

    You would need to hook a custom function to the publish_post action. Your custom function would loop through all of your groups, calling groups_post_update() on each loop iteration.

    @henrywright

    Moderator

    wp_delete_user() is the function that can be used to delete users. Be vary careful when using it because once a user has been deleted, there’s no way of restoring their account unless you’ve taken a database backup.

    You’d need to generate a list of the user IDs you’d like to delete and then loop through them, using wp_delete_user() to delete the current user in the loop.

    I know this isn’t a full solution, but hopefully it’ll show you what’ll need to be done.

    @henrywright

    Moderator

    @henrywright thanks for the suggestion, but it does not serve well to my expectation.

    Ah, that’s a shame!

    I don’t think I’ve seen a plugin around that will do exactly what you need. I think you might have to write some custom code to get this done 🙁

    @henrywright

    Moderator

    The snippet I wrote wasn’t designed for copy and pasting. You’d need to modify it to your requirements using PHP.

    @henrywright

    Moderator

    In that case you’d base your condition on the chosen language value. Here’s an example:

    // You'll get $lang from your language switcher plugin.
    
    if ( $lang == 'thai' ) {
        // Redirect to Thai
    } else {
        // Redirect to English
    }

    @henrywright

    Moderator

    Take a look at Unconfirmed.

    @henrywright

    Moderator

    Does anyone have a function that loops through old posts and generates activity records?

    What do you mean by an activity record? Do you mean any kind of activity? Like let’s say, a change of profile photo

    @henrywright

    Moderator

    How does the user select the language?

    @henrywright

    Moderator

    Try asking specific questions relating to exactly what you’re trying to do.

    In reply to: Advice on Hosting

    @henrywright

    Moderator

    Their basic plan offers 5GB of web space, 50GB of monthly bandwidth

    This sounds reasonable. The key point here is they’ve said upgrading is easily done. That’s important because you’re able to scale as your website gains popularity.

    In reply to: Advice on Hosting

    @henrywright

    Moderator

    In my opinion, there’s no point using a sledge hammer to crack a nut so I wouldn’t go crazy to begin with. Hosts are generally able to scale with your needs. So, you could choose a basic VPS package to start and then monitor usage. If at any point you feel you need more horsepower then upgrade. If your host has good support, they’ll do this for you quite easily.

Viewing 25 replies - 1,251 through 1,275 (of 2,756 total)
Skip to toolbar