Community Support Forums — WordPress® ( Users Helping Users ) — 2011-10-01T02:24:42-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=15252 2011-10-01T02:24:42-05:00 http://www.primothemes.com/forums/viewtopic.php?t=15252&p=42014#p42014 <![CDATA[Re: Modify Member Profile Form (#!*^'in tables!)]]>

Statistics: Posted by Cristián Lávaque — October 1st, 2011, 2:24 am


]]>
2011-09-28T09:35:38-05:00 http://www.primothemes.com/forums/viewtopic.php?t=15252&p=41842#p41842 <![CDATA[Re: Modify Member Profile Form (#!*^'in tables!)]]> Statistics: Posted by MODassic — September 28th, 2011, 9:35 am


]]>
2011-09-28T03:30:51-05:00 http://www.primothemes.com/forums/viewtopic.php?t=15252&p=41800#p41800 <![CDATA[Re: Modify Member Profile Form (#!*^'in tables!)]]>

Is there a particular reason for the order in which you replaced the tags or was it just random?

Code:
echo str_ireplace(array('<td>', '</td>', '<table cellpadding="0" cellspacing="0">', '<tbody>', '</tbody>', '</table>', '<tr>', '</tr>', '<br />'), '', do_shortcode('[s2Member-Profile /]')); 

Statistics: Posted by Cristián Lávaque — September 28th, 2011, 3:30 am


]]>
2011-09-26T10:08:13-05:00 http://www.primothemes.com/forums/viewtopic.php?t=15252&p=39204#p39204 <![CDATA[Re: Modify Member Profile Form (#!*^'in tables!)]]>
Code:
<?php
/**
* Template Name: Edit Profile
*/

get_header(); ?>

      <div id="content" role="main">

<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>

         <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
            <h1 class="entry-title"><?php the_title(); ?></h1>

            <div class="entry-content">
               <?php
                  
                  function s2_fix_profile_markup ($content) {
                      $table_stuff = array('<td>',/* '<tr>','</tr>', */'</td>', '<table cellpadding="0" cellspacing="0">', '<tbody>', '</tbody>', '</table>');
                      $content = str_ireplace($table_stuff,'',$content);
                      $div_stuff = array('');
                      $content = str_ireplace('<tr>', '', $content);
                     $content = str_ireplace('</tr>', '', $content);
                     $content = str_ireplace('<br />', '', $content);
                      return $content;   
                  }
                  $profile = do_shortcode('[s2Member-Profile /]');
                  $profile = s2_fix_profile_markup($profile);
                  echo $profile;
                  
               ?>
               <?php the_content(); ?>
            </div><!-- .entry-content -->
         </div><!-- #post-## -->

<?php endwhile; // end of the loop. ?>

      </div><!-- #content -->

<?php get_sidebar(); ?>
<?php get_footer(); ?>

Statistics: Posted by MODassic — September 26th, 2011, 10:08 am


]]>
2011-09-25T17:00:49-05:00 http://www.primothemes.com/forums/viewtopic.php?t=15252&p=39112#p39112 <![CDATA[Re: Modify Member Profile Form (#!*^'in tables!)]]>

Statistics: Posted by Cristián Lávaque — September 25th, 2011, 5:00 pm


]]>
2011-09-22T11:24:50-05:00 http://www.primothemes.com/forums/viewtopic.php?t=15252&p=38930#p38930 <![CDATA[Re: Modify Member Profile Form (#!*^'in tables!)]]>
I found the file that outputs the profile page.
/plugins/s2member/includes/classes/profile-in.inc.php
I could directly edit this page to remove the table markup...

There is a hook at the end of the class:
Code:
do_action ("ws_plugin__s2member_after_profile", get_defined_vars ());


So I made a filter:
Code:
function s2_fix_profile_markup ($content) {
    $table_stuff = array('<td>','<tr>','</tr>','</td>');
    $content=str_ireplace($table_stuff,'',$content);
    return $content;   
}
add_filter('ws_plugin__s2member_after_profile', 's2_fix_profile_markup');


But the filter is not working, I dont think that hook actually has the table data, because that file echo's out the information instead of storing it to be echo'ed out later... I'm not too fond of directly editing the plugin files. Do you guys know if there is a hook to filter that output? Or perhaps I bungled my code above... Anyways, help would be greatly appreciated!

Thanks,

Statistics: Posted by MODassic — September 22nd, 2011, 11:24 am


]]>
2011-09-22T10:55:20-05:00 http://www.primothemes.com/forums/viewtopic.php?t=15252&p=38927#p38927 <![CDATA[Re: Modify Member Profile Form (#!*^'in tables!)]]>
I am still looking for the action/hook or template that will let me modify the code being output, but I see the direction you were suggesting. In case anyone else has this issue I would like to expand and explain my thoughts on your method.

First, I would not be adding styles with javascript, the site uses a custom template, so adding s2member styles to the stylesheet is not an issue. I would just add the css instead of using javascript. However, I do think I could use javascript to remove the table markup. Also, I wanted to mention that I would suggest using JQuery instead of regular javascript, since JQuery is part of s2member (and pure js can be brutal to develop if you need cross browser support).
Code:
<script>
$(document).ready(function(){
$("td").each(function () {
    $(this).replaceWith($(this.childNodes));
});
$("tr").each(function () {
    $(this).replaceWith($(this.childNodes));
});
$("tbody").each(function () {
    $(this).replaceWith($(this.childNodes));
});
$("table").each(function () {
    $(this).replaceWith($(this.childNodes));
});
});

Statistics: Posted by MODassic — September 22nd, 2011, 10:55 am


]]>
2011-09-21T18:57:56-05:00 http://www.primothemes.com/forums/viewtopic.php?t=15252&p=38897#p38897 <![CDATA[Re: Modify Member Profile Form (#!*^'in tables!)]]>
You could probably use some javascript and use the document.getElementById (http://www.tizag.com/javascriptT/javasc ... ntbyid.php) to resize and float the elements to where you want them.

Something like

Code:
<script type="javascript">
document.getElementById('custom-form').style.width = "25%";
document.getElementById('custom-form').style.float = "right";
</script>

This could be put in the HTML editor just above or below the [s2Member-Profile /] shortcode.

If you're using FireFox, Firebug (http://getfirebug.com/) can help you find the element names.

Hope that helps!

Statistics: Posted by Bruce C — September 21st, 2011, 6:57 pm


]]>
2011-09-21T15:49:17-05:00 http://www.primothemes.com/forums/viewtopic.php?t=15252&p=38888#p38888 <![CDATA[Modify Member Profile Form (#!*^'in tables!)]]> Nice Job! :ugeek:

But the profile editing form uses a table in the markup :oops: , and that prevents me from stacking fields next to each other :cry: . I have been looking for a where that shortcode lives, to see if I could modify it, but I just can't find it...

So... Edit profile form

Current:
*field*
*field*
*field*
*field*
*field*
*field*
(submit)

What I am looking for:
*field*
*field* *field*
*field* *field*
*field*
(submit)

Thanks in advance Cristian and Jason! (And anyone else who lends a hand. ^_^)

Excellent plugin, it has quite a learning curve... But I think thats what makes it so powerful and great. :D

Statistics: Posted by MODassic — September 21st, 2011, 3:49 pm


]]>