Forum Replies Created
-
In reply to: Make Amen plugin BuddyPress compatible
I’m guessing I’ll have to use a hook of some kind to accomplish this
You’re right. But the hook would be supplied by the Amen plugin. You could start by asking the plugin’s support if one is available. I’m guessing here but it will probably be called something like
after_submit_prayer_request.Then you’d build your own function which you can ‘hook’ on to the ‘after_submit_prayer_request’ hook (don’t forget I’m guessing at the hook name).
Your function would simply add an item to the BP activity stream and will look something like this:
function add_prayer_request_to_stream() { bp_activity_add( $args ) } add_action( 'add_prayer_request_to_stream', 'actual_hook_name' );Note: This won’t work until you have the actual hook name and have supplied the
$argsas an array that describes the activity item you’re creating.See here for more info on the
bp_activity_add()functionTake a look at
bp_dtheme_mark_activity_favoriteandbp_dtheme_unmark_activity_favoritein bp-themes/bp-default/_inc/ajax.phpIn reply to: Permalink StructureHey @mcpeanut
Hopefully your new server is working well for you! Just thought I’d give an update on how mine is going.
I went for the managed option to try to save a little time but that was a mistake. I should have opted for the root server because 1and1 refuse to make any changes to the config of the managed servers. I should have guessed that before I signed up. An example is Fast CGI isn’t enabled. And their support team has confirmed the advanced settings panel for the managed option doesn’t work. That said, and aside from bad support (the dedicated server support team aren’t interested in helping if you have a non-trivial problem) the server seems to be quite reliable, and fast. Checking via Pingdom Tools, a basic WordPress page load takes ~ 0.2 seconds. Oh and one last thing, their £3.99 per month SSL certificates (minimum 12 month contract) can’t be migrated if you decide to upgrade your package. My mini-review might sound very negative but I’m persevering with them because the hardware is good for the price (as you already know). Hope this helps you!
In reply to: Changing the layout of the registration pageTake a look at this article from the BP Codex on the Template Hierarchy:
To summarise, you’d create a folder called /buddypress/ in your theme’s directory. Then a subfolder called ‘members’. Then a file called ‘index-register.php’. You should end up with:
/buddypress/members/index-register.php
Your register page’s code will go in that file and any customisations you make will take effect.
In reply to: report user report abuse flag something?Hi @djsteveo
I don’t know of a plugin that can do this but if one was to be built, it would need the following parts:
- The button which does the flagging: The most stylish way for the button to work would be through AJAX. Like a toggle button. If the reporting user clicks by mistake then they can undo the flag by clicking again. Would the reporting user be able to submit text along with the flag click?
- A list which outputs all of the flagged users: This should be accessible to admin users only
- Notifications: Would you want an admin user to receive an email each time a user is flagged?
I doubt a custom database table would be needed for something like this. Recording the flags can be done via user meta. I was thinking of building something like this a while ago but haven’t had the time recently.
In reply to: No of posts in stream@scifikriss glad you got it working! This is what I would have done:
if ( bp_has_activities( bp_ajax_querystring( 'activity' ) . '&per_page=15' ) ) { // code }Sorry I’m a few hours too late 🙂 – I think that should work but its untested.
In reply to: No of posts in streamYou can set a
per_pageparameter when you use thebp_has_activities()function. See here for more info: https://codex.buddypress.org/developer/loops-reference/the-activity-stream-loop/In reply to: buddypress not sending activation emailAre you sure the email is failing to send? Could the email have arrived in the user’s spam mailbox?
In reply to: Image on social networks when post sharedCheck out Facebook meta tags or ‘open graph’ as Facebook likes to call them:
In reply to: Add ad code into activity stream@bhekzin actually, instead of adding the ad as an activity item, you could just modify the activity loop to insert the ad dynamically on every 8th item. This is how you’d do that using a
forloop:for ( $i = 1; $i < 1000; $i++ ) { if ( $i % 8 == 0 ) { // this is the 8th item so insert your ad code } }In reply to: Add ad code into activity stream@bhekzin you’ll need to decide if you’re going to add an ad after X number of items have been added to the stream or if you’re going to add an ad every X number of seconds (or minutes, or hours). If you choose the interval approach, check out
wp_schedule_eventhttps://codex.wordpress.org/Function_Reference/wp_schedule_event
In reply to: Add ad code into activity streamThere’s a function you can use to do that called
bp_activity_add(). See here for the usage:In reply to: Custom classes for profile pages, possible?@jerryskate great! glad you got it working 🙂
In reply to: Custom classes for profile pages, possible?OK, I think I might know what is happening. Try this as the whole thing put together:
function add_body_classes( $classes ) { if ( bp_is_member() ) { $classes[] = 'this-is-a-member-profile'; $classes[] = 'member-profile-of-' . bp_get_displayed_user_username(); } return $classes; } add_filter( 'body_class', 'add_body_classes', 12 );In reply to: Custom classes for profile pages, possible?In bp-custom right after the line
$classes[] = 'member-profile-of-' . bp_displayed_user_username();add this:
return $classes;In reply to: Custom classes for profile pages, possible?@jerryskate if you could post your filter (what you have in bp-custom) and your body tag (from your header.php) i’ll take a look…
cc @modemlooper @hnla – anyone for some healthy foods from the food-pyramid guy? I prefer a good old fashioned burger and fries myself 🙂
In reply to: Custom classes for profile pages, possible?Can you paste your code? The original classes shouldn’t be lost. The filter just adds new ones whilst retaining what classes are already in place.
bp_activity_get_specific()should be used like this:// get activity $activity_get = bp_activity_get_specific( array( 'activity_ids' => YOURACTIVITYID ) ); // single out the activity $activity = $activity_get[0]; // grab specific activity item $activity_body = $activity->content;Ref: https://buddypress.org/support/topic/gettinng-id-of-the-activity-status/#post-112943
In reply to: Custom classes for profile pages, possible?<body jerryclass="" class=" customize-support"seems weird. You shouldn’t be getting that. You should be getting something like<body class="classname">In your CSS file, you’d use:
body.classname { // whatever }In reply to: Custom classes for profile pages, possible?If you want something unique you just have to modify the filter function.
For example, this is very generic:
if ( bp_is_member() ) $classes[] = 'this-is-a-member-profile';This is unique:
if ( bp_is_member() ) $classes[] = 'member-profile-of-' . bp_displayed_user_username();Oops, didn’t see your second post. Glad you solved the problem!
Hi @godavid33
I’m 99% sure you can. I do believe it’s store in
secondary_item_id.I think you can access it by doing something like this:
$notifications = BP_Notifications_Notification::get( array( 'id' => $notification_id, 'user_id' => $user_id ) ); // I assume there will only be one result but i'll do a loop anyway if ( $notifications ) { foreach( $notifications as $notification ) { // this should output the friendship ID echo $notification->secondary_item_id; } }In reply to: Custom classes for profile pages, possible?@jerryskate the body tag in your theme’s header.php file should be
<body <?php body_class( $class ); ?>>– if it is just something like<body>then the filter I suggested above won’t work. Perhaps that was why it wasn’t working?In reply to: Custom classes for profile pages, possible?And you’re sure you have
<body <?php body_class( $class ); ?>>in your template?In reply to: Custom classes for profile pages, possible?Have you tried viewing the page source?
<body class"...">