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.

Edit Profile Page Layout

Home Forums Community Forum Edit Profile Page Layout

This topic contains 3 replies, has 2 voices. Last updated by  Bruce 3 years, 8 months ago.

Topic Author Topic
Posted: Wednesday Apr 17th, 2013 at 11:40 am #47675

Referring to the discussion posted here (http://www.s2member.com/forums/topic/custom-profile-edit-form/), it pointed me in the right direction but I can’t quite get the results I need.

My goal:
Customize the table output on the “Edit Profile” page.

What I’ve done so far:
Created a “mu-plugins” folder and added a “s2-hacks.php” file. Using the steps provided in the 2nd post of the above discussion, I was able to make some edits to the output.

The problem:
My edits don’t appear after the “ob_start();” function which has a comment saying “// Start buffering. Allows Hooks to echo output like: `/?s2member_profile=1`.”

Here’s a snippet of the code in my “s2-hacks.php” file. If you look at my “test” echoes, #5 doesn’t appear on my page, only 1-4.

add_action('ws_plugin__s2member_before_sc_profile','my_profile_form');

function my_profile_form(){

						c_ws_plugin__s2member_no_cache::no_cache_constants (true); // No caching.

						$tabindex = apply_filters ("ws_plugin__s2member_sc_profile_tabindex", 0, get_defined_vars ());
						echo 'test 01';
						if (($user = (is_user_logged_in ()) ? wp_get_current_user () : false) && ($user_id = $user->ID))
							{
								echo 'test 02';
								$attr = c_ws_plugin__s2member_utils_strings::trim_qts_deep ((array)$attr);

								$attr = shortcode_atts (array (), $attr); // Possible Attributes. None.
								echo 'test 03';
								foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;
								do_action ("ws_plugin__s2member_before_sc_profile_after_shortcode_atts", get_defined_vars ());
								unset /* Unset defined __refs, __v. */ ($__refs, $__v);
								echo 'test 04';
								ob_start (); // Start buffering. Allows Hooks to echo output like: `/?s2member_profile=1`.
								echo 'test 05';
								echo '<form method="post" name="ws_plugin__s2member_profile" id="ws-plugin--s2member-profile">' . "n";

								if ($GLOBALS["ws_plugin__s2member_profile_saved"]) // Respond to successful updates.
									{
										echo '<div id="ws-plugin--s2member-profile-saved">' . "n";
										echo _x ("Profile updated successfully.", "s2member-front", "s2member") . "n";
										echo '</div>' . "n";
									}

								foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&amp;$$__v;
								do_action ("ws_plugin__s2member_during_profile_before_table", get_defined_vars ());
								unset /* Unset defined __refs, __v. */ ($__refs, $__v);
								
								echo '<table cellpadding="0" cellspacing="0" style="width:50%;float:left">' . "n";
								echo '<tbody>' . "n";
								...

List Of Topic Replies

Viewing 3 replies - 1 through 3 (of 3 total)
Author Replies
Author Replies
Posted: Wednesday Apr 17th, 2013 at 11:44 pm #47727
Bruce
Username: Bruce
Staff Member

Thank you for your inquiry.

Sorry, but debugging custom code is out of scope of our Support Policy. If you need further assistance, we recommend http://jobs.wordpress.net, or another freelance web site where WordPress® experts are offering their expertise through a bid on your project.

See: s2Member® » Support Policy » Outside Scope

Posted: Thursday Apr 18th, 2013 at 8:58 am #47781

The only custom code are the ‘echo’ statements.

The rest comes directly from the file in “plugins/s2member/includes/classes/sc-profile-in.inc.php”.

Surely you can help with that at least?

Posted: Thursday Apr 18th, 2013 at 11:24 pm #47839
Bruce
Username: Bruce
Staff Member

The only custom code are the ‘echo’ statements.

The rest comes directly from the file in “plugins/s2member/includes/classes/sc-profile-in.inc.php”.

Surely you can help with that at least?

Sorry, we can’t really give help with custom code of any kind. I can tell you that the ob_start(); at the beginning of this function is storing the data that’s being echo’d here, to return from the function. You should only see this data where you have a profile form being echo’d. You can see where s2Member is returning the data that’s being stored at line 292.

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

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

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.