-
Brandon Allen posted on the forum topic Change Reply button on activty stream posting for Forums! in the group How-To and Troubleshooting: 13 years, 7 months ago
In your theme’s activity/entry.php file change:
<a href="" class="acomment-reply" id="acomment-comment- "> ( <span></span>)</a>
to:if ( my_bp_activity_type_is_new_forum_post() ) { <a href="" class="acomment-reply" id="acomment-comment- "> </a> } else { <a href="" class="acomment-reply" id="acomment-comment- "> ( <span></span>)</a>…
[Read more] -
Brandon Allen posted on the forum topic Need help with PM function in forums in the group How-To and Troubleshooting: 13 years, 7 months ago
I would start with adding $bp to your global statement.
global $bp, $topic_template;
-
Brandon Allen posted on the forum topic Get IP address that can pass current $user_ID? in the group How-To and Troubleshooting: 13 years, 7 months ago
I have not tested it. I have no way of testing it on your site. That’s why I gave the code to you, so that you could test it. It’s there forever. It will be updated each time the user logs in, so if their IP address changes, which most will, the old IP will […]
-
Brandon Allen posted on the forum topic Get IP address that can pass current $user_ID? in the group How-To and Troubleshooting: 13 years, 7 months ago
Should be the same code as you use within the group members loop, just use
bp_get_the_topic_poster_id()
instead ofbp_get_group_member_id()
.<span class="activity"></span>
-
Brandon Allen posted on the forum topic How do I enforce users to complete their profile before they can access content? in the group How-To and Troubleshooting: 13 years, 7 months ago
One option is to do as @embergermedia stated. To catch everyone, you could hook in a profile edit action and check to see if all the fields you require have been completed. If they have, then you could add something in their usermeta saying they’ve completed everything. Then you could hook into bp_init, check that usermeta […]
-
Brandon Allen posted on the forum topic Get IP address that can pass current $user_ID? in the group How-To and Troubleshooting: 13 years, 7 months ago
It will likely take a while before everyone has logged in and had their IP’s updated. With cookies and general delay between an individual user’s login, not everyone will end up logging in every day, or especially multiple times a day. With the current code, the user has to log in before their IP address […]
-
Brandon Allen posted on the forum topic Get IP address that can pass current $user_ID? in the group How-To and Troubleshooting: 13 years, 7 months ago
Are you using the code exactly as I’ve placed it? Are you putting the html below
but before
?
-
Brandon Allen posted on the forum topic Add custom metadata to forum topics for sorting purposes in the group Creating & Extending: 13 years, 7 months ago
Looks okay. I would change:
foreach ($postcat as $value)
to
foreach ((array)$postcat as $value)
just in case something happens and $postcat isn’t an array.Have you tried r-a-y’s suggestion for using the
bb_get_postmeta()
andbb_update_postmeta()
functions rather than a direct query? -
Brandon Allen posted on the forum topic Get IP address that can pass current $user_ID? in the group How-To and Troubleshooting: 13 years, 7 months ago
Yes I have tested it, which means it works on my site. It saves and outputs the IP address. It’s a local installation, so as I said above, I can’t speak to the validity of the IP address. I haven’t tested that portion, as I have no easy way to test. Where are you placing […]
-
Brandon Allen posted on the forum topic Get IP address that can pass current $user_ID? in the group How-To and Troubleshooting: 13 years, 7 months ago
Okay. I’ve finally been able to test the code I gave you. There was an issue with the retrieval of the $user_id during log in, so nothing was being saved. I’ll post below with the updated code. The code works as far as saving/retrieving/displaying the IP address. If the IP address continues to be your […]
-
Brandon Allen posted on the forum topic Having trouble with IP in the group How-To and Troubleshooting: 13 years, 7 months ago
After seeing more of what you’re trying to do here (https://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/how-to-display-the-user-post-count-in-topic-php/#post-96750) I should also point out, that this will only work if the person has logged in since you started using the code. What the code I gave does is to retrieve and…[Read more]
-
Brandon Allen posted on the forum topic Having trouble with IP in the group How-To and Troubleshooting: 13 years, 7 months ago
Nowhere. If you’re placing the html I posted within the bp_has_members() loop, you don’t need
$members_template->member->user_id;
. The code I gave you handles it. Besides, as I’ve stated before$members_template->member->user_id;
isn’t valid. -
Brandon Allen posted on the forum topic Having trouble with IP in the group How-To and Troubleshooting: 13 years, 7 months ago
Did you put both functions in your bp-custom.php file? Then did you put the html in the theme file where you’d like it to appear?
-
Brandon Allen posted on the forum topic Having trouble with IP in the group How-To and Troubleshooting: 13 years, 7 months ago
No. They are two separate functions with two different names. There were syntax errors in both fuctions. I fixed one a few hours ago, and the other I just fixed. Make sure you copy and paste each exactly as I have them.
-
Brandon Allen posted on the forum topic require users to login to see rest of pages? in the group How-To and Troubleshooting: 13 years, 7 months ago
Have you read over the FAQs here: (https://buddypress.org/community/groups/private-buddypress/)?
-
Brandon Allen posted on the forum topic Having trouble with IP in the group How-To and Troubleshooting: 13 years, 7 months ago
Found another error. Try this:
function my_get_IP( $user_id = false ) {
if ( empty( $user_id ) )
return false;$ip_address = esc_attr( trim( get_user_meta( $user_id, 'ip_address', true ) ) );
if ( $ip_address = esc_attr( trim( get_user_meta( $user_id, 'ip_address', true ) ) ) )
return $ip_address;
else
return false;
} -
Brandon Allen posted on the forum topic Organize / Hierarchy Blogs in the group Creating & Extending: 13 years, 7 months ago
-
Brandon Allen posted on the forum topic Having trouble with IP in the group How-To and Troubleshooting: 13 years, 7 months ago
There was an error in the code I gave you. Try this instead: `function my_update_user_IP() { $user_id = (int) get_current_user_id(); if(!empty($_SERVER)) { $ip_address = $_SERVER; } else if(!empty($_SERVER)) { $ip_address = $_SERVER; } else if(!empty($_SERVER)) { $ip_address = $_SERVER; } else { $ip_address = ”; } if(strpos($ip_address, ‘,’) !==…[Read more]
-
Brandon Allen posted on the forum topic Having trouble with IP in the group How-To and Troubleshooting: 13 years, 7 months ago
I don’t know what you mean by “first code”
-
Brandon Allen posted on the forum topic Having trouble with IP in the group How-To and Troubleshooting: 13 years, 7 months ago
You use the two functions I listed, my_update_user_IP and my_get_IP, and then you’ll add
<span class="activity"></span>
to your template where you want the IP address displayed. You don’t need the my_member_list_id() function.
- Load More
@cnorris23
Active 2 months, 2 weeks ago