Sweet. In my plugin, I just made this:
if ( isset($_GET['poster_ip']) && !empty($_GET['poster_ip']) ) {
$bbdb->query( $bbdb->prepare( "UPDATE $bbdb->posts SET poster_ip = %s WHERE post_id = %d", $_GET['poster_ip'], $post_id ) );
}
And the .'&poster_ip='.$_SERVER['REMOTE_ADDR']
is in bbPress Mobile.
It would probably be better doing it a different way, can anyone suggest something?
Sweet. In my plugin, I just made this:
if ( isset($_GET['poster_ip']) && !empty($_GET['poster_ip']) ) {
$bbdb->query( $bbdb->prepare( "UPDATE $bbdb->posts SET poster_ip = %s WHERE post_id = %d", $_GET['poster_ip'], $post_id ) );
}
And the .'&poster_ip='.$_SERVER['REMOTE_ADDR']
is in bbPress Mobile.
It would probably be better doing it a different way, can anyone suggest something?
Just managed another way by patching bbPress’ xmlrpc.php and overwriting $_SERVER with the desired value.
// Poster IP
$_SERVER['REMOTE_ADDR'] = isset( $structure['poster_ip'] ) ? $structure['poster_ip'] : $_SERVER['REMOTE_ADDR'];
Then what I do on the bbPress Mobile side is send the data:
$params_array = new xmlrpcval(
array(
"title" => new xmlrpcval($title, "string"),
"text" => new xmlrpcval($text, "string"),
"forum_id" => new xmlrpcval($forum_id, "int"),
"tags" => new xmlrpcval($tags, "string"),
"poster_ip" => new xmlrpcval($_SERVER['REMOTE_ADDR'], "string")),
"struct");
Just managed another way by patching bbPress’ xmlrpc.php and overwriting $_SERVER with the desired value.
// Poster IP
$_SERVER['REMOTE_ADDR'] = isset( $structure['poster_ip'] ) ? $structure['poster_ip'] : $_SERVER['REMOTE_ADDR'];
Then what I do on the bbPress Mobile side is send the data:
$params_array = new xmlrpcval(
array(
"title" => new xmlrpcval($title, "string"),
"text" => new xmlrpcval($text, "string"),
"forum_id" => new xmlrpcval($forum_id, "int"),
"tags" => new xmlrpcval($tags, "string"),
"poster_ip" => new xmlrpcval($_SERVER['REMOTE_ADDR'], "string")),
"struct");
https://trac.bbpress.org/ticket/1355
I have opened a ticket that provides a patch for xmlrpc.php.
https://trac.bbpress.org/ticket/1355
I have opened a ticket that provides a patch for xmlrpc.php.