Page 1 of 1

Integration with specific theme

PostPosted: September 13th, 2010, 12:22 am
by allwinners
Hi guys,

Firstly let me say a big thumbs up for this member management system! It is awesome, and I am only starting to understand the power that it offers.

I have a site with a new theme that has been installed. I am using a pre-built login form that is available with the theme as a widget. So far all good - except,

when I activate the s2member plugin, it takes away the link in the form that says "register" - leaving only the login and recover password links. I am wanting to use this neat and tidy login form in my sidebar, but without the "register" link it seems worthless.

Can I integrate the two items to sync?

My site is http://www.aceslegacy.com

The widget code for the login form is:


<?php
/**
* Widget Name: Login Form Widget
* Description: A widget that allows a Login Form to be added to a sidebar.
* Version: 0.1
*
*/

/**
* Add function to widgets_init that'll load our widget.
* @since 0.1
*/
add_action( 'widgets_init', 'login_form_load_widgets' );

/**
* Register our widget.
* 'Login_Form_Widget' is the widget class used below.
*
* @since 0.1
*/
function login_form_load_widgets() {
register_widget( 'Login_Form_Widget' );
}

/**
* Login Form Widget class.
* This class handles everything that needs to be handled with the widget:
* the settings, form, display, and update. Nice!
*
* @since 0.1
*/
class Login_Form_Widget extends WP_Widget {

/**
* Widget setup.
*/
function Login_Form_Widget() {
/* Widget settings. */
$widget_ops = array( 'classname' => 'loginform', 'description' => __('A user login form.', 'business-success') );

/* Widget control settings. */
$control_ops = array( 'width' => 150, 'height' => 350, 'id_base' => 'loginform-widget' );

/* Create the widget. */
$this->WP_Widget( 'loginform-widget', __('Login Form', 'business-success'), $widget_ops, $control_ops );
}

/**
* How to display the widget on the screen.
*/
function widget( $args, $instance ) {
extract( $args );

/* Our variables from the widget settings. */
$title = apply_filters('widget_title', $instance['title'] );

/* Before widget (defined by themes). */
echo $before_widget;

/* Display the widget title if one was input (before and after defined by themes). */
if ( $title )
echo $before_title . $title . $after_title;



global $user_identity, $user_level;
$redirect = $_SERVER['REQUEST_URI']; ?>
<?php if ( is_user_logged_in() ) : ?>
You are logged in as <strong><?php echo $user_identity ?></strong>.
<ul>
<li><?php wp_register(); ?></li>
<li><a href="<?php echo esc_url( wp_logout_url( $redirect ) ); ?>"><?php echo __('Logout'); ?></a></li>
</ul>
<?php else : ?>
<ul>
<div>
<form action="<?php bloginfo('url') ?>/wp-login.php" method="post">
<p>
<label for="log">User<br />
<input type="text" name="log" id="log" value="<?php echo wp_specialchars( stripslashes($user_login), 1 ) ?>" size="20" />
</label><br />
<label for="pwd">Password<br />
<input type="password" name="pwd" id="pwd" size="20" />
</label>
<div>
<input type="submit" name="submit" value="Login" class="button" />
<label for="rememberme"><input name="rememberme" id="rememberme" type="checkbox" checked="checked" value="forever" /> Remember me</label>
</div>
</p>
<input type="hidden" name="redirect_to" value="<?php echo esc_url( $redirect ); ?>"/>
</form>
</div>
<?php if ( get_option('users_can_register') ) : ?>
<li><a href="<?php bloginfo('url') ?>/wp-register.php"><?php echo __('Register'); ?></a></li>
<?php endif; ?>
<li><a href="<?php bloginfo('url') ?>/wp-login.php?action=lostpassword"><?php echo __('Recover password'); ?></a></li>
</ul>
<?php endif;





/* After widget (defined by themes). */
echo $after_widget;
}

/**
* Update the widget settings.
*/
function update( $new_instance, $old_instance ) {
$instance = $old_instance;

/* Strip tags for title to remove HTML (important for text inputs). */
$instance['title'] = strip_tags( $new_instance['title'] );

return $instance;
}

/**
* Displays the widget settings controls on the widget panel.
* Make use of the get_field_id() and get_field_name() function
* when creating your form elements. This handles the confusing stuff.
*/
function form( $instance ) {

/* Set up some default widget settings. */
$defaults = array( 'title' => __('Login Form', 'business-success') );
$instance = wp_parse_args( (array) $instance, $defaults ); ?>

<!-- Widget Title: Text Input -->
<p>
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e('Title:', 'business-success'); ?></label>
<input id="<?php echo $this->get_field_id( 'title' ); ?>" type="text" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>" style="width:100%;" />
</p>

<?php
}
}

Re: Integration with specific theme

PostPosted: September 13th, 2010, 6:21 am
by bluecafe
If you disable the option to allow registration in your wordpress settings then the registration link should go away.

Re: Integration with specific theme

PostPosted: September 13th, 2010, 6:47 am
by allwinners
Thanks for the response bluecafe, but I want the "register" link to come back! It has already gone away and it only "goes away" when I activate s2member. If I deactivate the s2member plugin, the register link re-appears. I want the s2member plugin activated but I also want the register link to appear.

When s2member is activated, the membership option is set to "open and allow signups at level 0" which is then reflected in the "Super Admin" section on my back end dashboard.

Re: Integration with specific theme

PostPosted: September 13th, 2010, 7:31 am
by bluecafe
Sorry, I didn't read your post thouroughly enough. I am quite new to s2member and discovered only now that s2member deactivates registration by default. Maybe you can set the link manually

by replacing this part
<?php if ( get_option('users_can_register') ) : ?>
<li><a href="<?php bloginfo('url') ?>/wp-register.php"><?php echo __('Register'); ?></a></li>
<?php endif; ?>

with:

<li><a href="http://www.aceslegacy.com/wp-login.php?action=register">Register</a></li>

Re: Integration with specific theme

PostPosted: September 13th, 2010, 7:43 am
by allwinners
LOL no problem bluecafe, I am new to it as well, but it appears you have more knowledge when it comes to coding, so I will give your recommendation a try and let you know the outcome :)

Thanks heaps for the help.

bluecafe wrote:Sorry, I didn't read your post thouroughly enough. I am quite new to s2member and discovered only now that s2member deactivates registration by default. Maybe you can set the link manually

by replacing this part
<?php if ( get_option('users_can_register') ) : ?>
<li><a href="<?php bloginfo('url') ?>/wp-register.php"><?php echo __('Register'); ?></a></li>
<?php endif; ?>

with:

<li><a href="http://www.aceslegacy.com/wp-login.php?action=register">Register</a></li>

Re: Integration with specific theme

PostPosted: September 13th, 2010, 8:05 am
by allwinners
Okay so deleting the code you highlighted and adding the code you suggested, worked, to allow the link "register" to appear on the login form - that's cool.

However, every time I clicked on the link it took me to the wp-login page and the message "registation is not allowed" appeared at the top of the box.

When I checked the Super Admin options and the Multisite options in s2member, the settings were correct reading "allow new registrations"

Re: Integration with specific theme

PostPosted: September 13th, 2010, 4:47 pm
by bluecafe
I too had this problem with my wordpress multisite installation. I had to modify my s2member multisite settings in order to allow free registrations (these settings override the multisite settings). If free registrations are not allowed the registration link is only visible after payment has been made. But if you say you have checked your s2member multisite settings your link should actually work.

Re: Integration with specific theme

PostPosted: September 13th, 2010, 6:20 pm
by allwinners
Hmmm thats interesting, I am wondering if for some reason it is remembering the IP address and only allowing one registration. I am on a static IP - but I did go through a proxy as well and it showed the same thing.

I understand about the Multisite overriding the Admin settings, both were set (and still are) to "allow new registrations"

If someone could visit the site and let me know if they see a "regsiter" link on the login box, that would be cool. If there is one there, it would mean that it is an IP thing. (www.aceslegacy.com)

Thanks
Bryce

Re: Integration with specific theme

PostPosted: September 14th, 2010, 1:09 am
by bluecafe
Yes, I can see the register link but it seems to be the 'normal' wordpress registration not any s2member registration. Did you check these settings? http://i56.tinypic.com/33a5vo6.png

Re: Integration with specific theme

PostPosted: September 14th, 2010, 1:52 am
by allwinners
hi again bluecafe,

Yes I have installed and uninstalled the plugin to see if anything has been done incorrectly. you must have seen the site when the plugin was disabled. I am in the process of reinstalling, so it will be back tom normal soon :)

okay so in a way I am happy that you saw the "register" link on the site previously, because I have ow installed and activated the s2Member system and the 'register" link has gone again.

I have s2member set to "blogfarm" and "allow registrations at level 0"

I have checked the "Super Admin" settings (options) and it is set to "registrations are accepted"

Re: Integration with specific theme

PostPosted: September 14th, 2010, 4:34 am
by bluecafe
yeah, now the register link is gone.
Did you replace the 'normal' register link (including the if-condition)

<?php if ( get_option('users_can_register') ) : ?>
<li><a href="<?php bloginfo('url') ?>/wp-register.php"><?php echo __('Register'); ?></a></li>
<?php endif; ?>

with:

<li><a href="http://www.aceslegacy.com/wp-login.php?action=register">Register</a></li>

Re: Integration with specific theme

PostPosted: September 14th, 2010, 4:38 am
by allwinners
yeah I did this yesterday and although it did "fix" the issue of the "register link" not showing, when I clicked on it (the link) it would take me to the register box.... but

the words "registration is not possible at this time" or something to that effect.

I will try it again now, and see what happens. I am actually using a different login form plugin now, so the code will be different, but I wanted to see if the problem may have been with the original login form plugin. This one is doing the same thing (not showing the "register" link) and this plugin specifically asks if I want to show a register link, which of course I have activated.

Re: Integration with specific theme

PostPosted: September 14th, 2010, 5:11 am
by allwinners
Okay I have figured it out! The code you gave me to replace the existing code needs to have a redirect to wp-signup.php and not wp-login.php as I am offering blogs to clients. So your code would be....

<li><a href="http://www.aceslegacy.com/wp-signup.php?action=register">Register</a></li>

So this leads to another customization question you may be able to assist with....

With the theme I am using it has 3D shadows on the three sections of the page, which can be turned on or off. I have them on, but when the page wp-signup.php is called up, the data entry fields push the "Next" button so that it is sitting underneath the shadow and can't be seen.

Do you have any recommendations about how I would change this so that the "next" bar sits above the 3D shadow? I really don't want to switch the shadow effect off if at all possible. However when I do switch it off, the form fills the page as it should.

Thanks for all your help thus far, I really appreciate it :)

Re: Integration with specific theme

PostPosted: September 14th, 2010, 5:23 am
by allwinners
Okay thats all done as well - I worked out to put line breaks before the code calls up the footer. I am assuming this is the easiest way to achieve the desired results :)

Re: Integration with specific theme

PostPosted: September 14th, 2010, 9:40 am
by bluecafe
Glad you found a solution. Your theme looks very nice by the way. I like the 3-D look.