Forum Replies Created
-
In reply to: Need help with PM function in forums
Yes, I copied right from the template-tags for the send_private_message_link function.
In reply to: Need help with PM function in forumsthe function still redirects to the same page.
In reply to: Need help with PM function in forumsi changed it! see in the code above?
In reply to: Need help with PM function in forumsThought for sure this would work but it didn’t
`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_the_topic_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( $bp->topic_template->post->poster_id, $bp->topic_template->displayed_user->userdata->user_nicename, $bp->topic_template->displayed_user->userdata->user_login ) ) );
}`In reply to: Get IP address that can pass current $user_ID?have you tested it on your site? Like mine?
So once the user logs in, it’s there forever right?
In reply to: Get IP address that can pass current $user_ID?ok, actually this looks fine so far, because it seems like once they have logged in, wordpress saves it for good.
ray, if i put the function for the IP above, and the topic poster Id i was talking about before, it would work?
In reply to: Get IP address that can pass current $user_ID?so everybody has to log in in one day for all of them to be showed?
wow, bummer…why can’t we change that?
In reply to: Get IP address that can pass current $user_ID?How weird. Now the IP showed, but only with the admin account and the group owner account. All the others it did not appear
In reply to: Get IP address that can pass current $user_ID?im putting the functions in bp-custom
then the call in groups/single/members.php
In reply to: Get IP address that can pass current $user_ID?if you have tested it, does it work on your site?/
When I put your updated code, nothing appears
In reply to: Get IP address that can pass current $user_ID?Huh???? Is that the right code?
doesn’t look like it
In reply to: Get IP address that can pass current $user_ID?In reply to: Get IP address that can pass current $user_ID?Actually, Brandon, do you have a membership at wpmu?
Maybe you could ask this question there for further answers
In reply to: Get IP address that can pass current $user_ID?idk I found one that seemed like it passed the $user_id for the comments
`// applied to the comment author’s IP address prior to saving the comment in the database.
function auto_reverse_proxy_pre_comment_user_ip()
{
if ( !empty($_SERVER) )
{
$X_FORWARDED_FOR=explode(“,”, $_SERVER);
$REMOTE_ADDR=trim($X_FORWARDED_FOR[0]); //take the first element in the array
} else {
$REMOTE_ADDR=$_SERVER;
}
return $REMOTE_ADDR;
}
add_filter ( ‘pre_comment_user_ip’,’auto_reverse_proxy_pre_comment_user_ip’);`but i tried it, and the ips are still all mine.
for some reason when i put your code in bp-custom.php it doesn’t work, so i think what is holding it up is the
`if ( update_user_meta( $user_id, ‘ip_address’, $ip_address ) )`
In reply to: Get IP address that can pass current $user_ID?I tied logging in, loggin out, Your code does not work, it just simply does not appear. Nothing appears.
And I want the IP to display in the group’s member list, and topic page
I have just about given up, seems like it’s just impossible
In reply to: How to display the User Post Count in Topic.phpHey ray, i have a quick question.
I have wp-ban installed, and it adds a function that fetch’s the IP address of the user logged in i think, it’s the standard function for calling it.
the full code is here: https://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/having-trouble-with-ip/#post-96715
What i did is I put the function in the topic.php so it would show the poster’s IP address. Now knowing that that function only retrieves the current logged in user IP, I thought I could override this with your function above, (my_topic_poster_id) so it would display the IP address of the forum poster. (like the member stats), so put in topic.php
`. `
Will it pass the topic poster ID so it shows the forum poster’s IP and not mine?
is there a way around it? I would love both
any ideas ray?
In reply to: Get IP address that can pass current $user_ID?trial and error now…
where is the $members_template->member->user_id; supposed to be?
In reply to: Get IP address that can pass current $user_ID?yeah, i even tried changing it in the plugin file, and nothing changed then either
In reply to: Get IP address that can pass current $user_ID?Thanks…. but to no avail… still. I’m so bummed i could cry.
Nothing appears where i put the function… uhh. ;(
In reply to: Get IP address that can pass current $user_ID?thats the entire thing? or is it
`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 ) ) );
return $ip_address;
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, ‘,’) !== false) {
$ip_address = explode(‘,’, $ip_address);
$ip_address = $ip_address[0];
}if ( update_user_meta( $user_id, ‘ip_address’, $ip_address ) )
return $ip_address;
else
return false;
}
add_action( ‘wp_login’, ‘my_update_user_IP’ );`In reply to: Get IP address that can pass current $user_ID?I still got the Error with the updated code
In reply to: Get IP address that can pass current $user_ID?The first code I get: `Parse error: syntax error, unexpected T_VARIABLE`
In reply to: Get IP address that can pass current $user_ID?im so lost… which code is the one i want to use!?