latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

About: Jim Meyer

Sorry, I've not written a description yet. I'll get to it soon!


Topics I'm Subscribed To

Viewing 2 topics - 1 through 2 (of 2 total)
Topic Count Last Reply
process_list_servers

By:  Jim Meyer in: Community Forum

voices: 1
replies: 1

3 years, 1 month ago  Jim Meyer

Importing content for serialized s2m field

By:  Jim Meyer in: Community Forum

voices: 1
replies: 3

3 years, 3 months ago  Jim Meyer

Viewing 2 topics - 1 through 2 (of 2 total)

Topics I've Started

Viewing 2 topics - 1 through 2 (of 2 total)
Topic Count Last Reply
process_list_servers

By:  Jim Meyer in: Community Forum

voices: 1
replies: 1

3 years, 1 month ago  Jim Meyer

Importing content for serialized s2m field

By:  Jim Meyer in: Community Forum

voices: 1
replies: 3

3 years, 3 months ago  Jim Meyer

Viewing 2 topics - 1 through 2 (of 2 total)

My Latest Replies (From Various Topics)

Viewing 4 replies - 1 through 4 (of 4 total)
Author Replies
Author Replies
Posted: Wednesday Nov 20th, 2013 at 7:49 am #61249
Jim Meyer
Username: robobrief

I have answered my own question.

If I call the function…

c_ws_plugin__s2member_list_servers::process_list_servers

it works!

This is the revised code:

add_action('ws_plugin__s2member_after_handle_profile_modifications', 'update_mailchimp_after_profile_modification');				
	function update_mailchimp_after_profile_modification($vars = array())
	{
$user_id = $vars['user_id'];
		$user_role = get_user_field("s2member_access_role", $user_id); 
		$user_level = get_user_field("s2member_access_level", $user_id);  
		$user_login = get_user_field("user_login", $user_id);	
		$user_email = get_user_field("user_email", $user_id);
		$user_first_name = get_user_field("first_name", $user_id);				
		$user_last_name = get_user_field("last_name", $user_id);
		if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
			$user_ip = $_SERVER['HTTP_CLIENT_IP'];
		} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
			$user_ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
		} else {
			$user_ip = $_SERVER['REMOTE_ADDR'];
		}	
		return c_ws_plugin__s2member_list_servers::process_list_servers($user_role, $user_level, $user_login, "XXX", $user_email, $user_first_name, $user_last_name, $user_ip, 'true', 'false', $user_id);	
	}
Posted: Thursday Sep 12th, 2013 at 5:08 am #59490
Jim Meyer
Username: robobrief

OK. I have finally worked out the problem. It looks as though a serializised field should not be enclosed with quotation marks. If I’m right, I recommend the help document at http://www.s2member.com/kb/importing-updating-users/ is amended so that the example looks like:

...,a:3:{i:0;s:7:"Florida";i:1;s:7:"Georgia";i:2;s:6:"Alaska";},...
Posted: Thursday Sep 12th, 2013 at 5:02 am #59488
Jim Meyer
Username: robobrief

Just an update to add to the mystery (I realise I am a lone voice). Looking at the s2member import routine, it relies on the wordpress function “maybe_unserialize”. The odd thing is, looking at the data that is sorted in wp_usermeta after the import routine, the first &quote; is dropped and an additional one is added on to the end!

This is the field before importation:

“a:5:{i:0;s:29:Administrative and public law”;i:1;s:13:”Children law”;i:2;s:32:”Civil liberties and human rights”;i:3;s:13:”Education law”;i:4;s:14:”Regulatory law”;}”

This is it after:

“a:5:{i:0;s:29:Administrative and public law”;i:1;s:13:”Children law”;i:2;s:32:”Civil liberties and human rights”;i:3;s:13:”Education law”;i:4;s:14:”Regulatory law”;}”

Posted: Monday Sep 9th, 2013 at 5:54 pm #59326
Jim Meyer
Username: robobrief

bump

Viewing 4 replies - 1 through 4 (of 4 total)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.