Community Support Forums — WordPress® ( Users Helping Users ) — 2011-05-14T19:56:51-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=6433 2011-05-14T19:56:51-05:00 http://www.primothemes.com/forums/viewtopic.php?t=6433&p=15036#p15036 <![CDATA[Re: Tips to customize Member Profile Modification page]]>

Statistics: Posted by Cristián Lávaque — May 14th, 2011, 7:56 pm


]]>
2011-05-14T15:12:22-05:00 http://www.primothemes.com/forums/viewtopic.php?t=6433&p=15032#p15032 <![CDATA[Tips to customize Member Profile Modification page]]>
1) HIDE CERTAIN ROWS
Since the username is not an editable value, I don't want to show it as a disabled input field, which could confuse a user. I am displaying it simply as text elsewhere on the page, above the shortcode, using php to get the value. To hide the Username row, I looked at s2member/includes/profile.inc.php, and found Action Hooks before and after each TR, so i use those hooks to add html comments around the row i want to hide:

in my mu-plugins/s2-hacks.php:
Code:
add_action('ws_plugin__s2member_during_profile_during_fields_before_username','my_hide_start',10);
function my_hide_start ( $vars = array() ) {
   echo "<!--  \n";
}

add_action('ws_plugin__s2member_during_profile_during_fields_after_username','my_hide_end',10);
function my_hide_end ( $vars = array() ) {
   echo " --> \n";
}


I'd prefer to somehow use the hooks to prevent the php from ever outputting the html in the first place, but couldn't figure out how, since the html is just echo'd out line by line in profile.inc.php.


2) ADJUST WIDTH OF INPUT FIELDS
On the Profile Modification panel (again, from profile.inc.php), the input fields all have a hardcoded width from a style="width:99%;" attribute. I could use CSS to make the container less wide, but that also make the Labels wrap prematurely/unnecessariy (particularly the Password label). So i'm using jQuery (in header.php) to REMOVE that hardcoded style attribute:

Code:
<script type="text/javascript">
   jQuery(document).ready(function() {
      jQuery('form#ws-plugin--s2member-profile input').removeAttr("style");
   });
</script>

Statistics: Posted by toddz88 — May 14th, 2011, 3:12 pm


]]>