<?php
/*
Backward compatibility for "custom_reg_fields", which was re-formatted in v3.2.7 to a JSON encoded array of fields.
*/
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"] && !is_array (json_decode ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"])))
{
$fields = array (); /* Initialize the new array of field objects. */
/**/
foreach (preg_split ("/[\r\n\t;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) as $field)
{
$required = (preg_match ("/\*/", $field)) ? 'yes' : 'no';
$editable = (preg_match ("/\^/", $field)) ? 'no' : 'yes';
/**/
if ($field = trim ($field, "^* \t\n\r\0\x0B"))
{
$fields[] = array ("id" => $field, "label" => $field, "type" => "text", "options" => "", "expected_format" => "", "required" => $required, "levels" => "all", "editable" => $editable, "classes" => "", "styles" => "", "attrs" => "");
}
}
/**/
$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"] = json_encode ($fields);
/**/
unset ($une, $editable, $req, $required, $field, $fields);
}
?>
Statistics: Posted by Jason Caldwell — April 3rd, 2011, 7:48 am
Statistics: Posted by Cristián Lávaque — April 1st, 2011, 7:33 pm
UPDATE wp_usermeta
SET meta_value = replace(meta_value, 's:52:"my_super_duper_extra_long_field_id_that_will_not_fit"', 's:11:"my_short_id"')
FROM wp_usermeta
WHERE meta_key = 'wp_s2member_custom_fields';
Statistics: Posted by dmasciangelo — April 1st, 2011, 7:02 pm
Statistics: Posted by Cristián Lávaque — April 1st, 2011, 1:38 pm
Statistics: Posted by dmasciangelo — April 1st, 2011, 1:25 pm
Statistics: Posted by Cristián Lávaque — April 1st, 2011, 1:14 pm
Statistics: Posted by dmasciangelo — April 1st, 2011, 12:58 pm
Statistics: Posted by Cristián Lávaque — March 31st, 2011, 11:39 pm
Statistics: Posted by dmasciangelo — March 31st, 2011, 10:55 pm