December 9, 2013 at 8:19 pm 13545 |
scarey123
| Hi
Thanks for this – I’ll follow each one and see if I can get it to work.
Yes please, if you could send me the code for the login widget and just let me know where to find it that would be great 🙂
I have been using the payment facility with this plugin to create my packages and user levels. Do you know if I can carry on using it or would it be easier to change to paid memberships pro? I just can’t see any way to add a login area using this plugin but it would be easier to stay with them if I can.
Also, where do I add that map shortcode? Will that then create the listing with the map and the icon etc?
Thanks
Clare
|
December 11, 2013 at 8:40 pm 13626 |
elenanik
| Hi, I am using paid memberships pro because this plugin has members levels to district some content and has it’s own registration for packages that the user creates a profile.
But I don’t know what you exactly want to do and what limitations you want members have. I think WPUF is ok for your site.
About the Login You have to change the file in:
directory/AIT/Framework/Widgets/ait-directory-login-widget.php
but before you did it back up your original file 🙂
here’s the code
you’ll find <a href="your-url-here"> there you have to add your own url.
<?php
/**
* Creates widget with login or register to direcotry portal theme
*/
class Directory_Widget extends WP_Widget {
/**
* Widget constructor
*
* @desc sets default options and controls for widget
*/
function Directory_Widget () {
/* Widget settings */
$widget_ops = array (
'classname' => 'widget_directory',
'description' => __( 'Register or login directory users form', 'ait')
);
/* Create the widget */
$this->WP_Widget( 'ait-directory-widget', __( 'Theme → Directory Login', 'ait'), $widget_ops );
}
/**
* Displaying the widget
*
* Handle the display of the widget
* @param array
* @param array
*/
function widget( $args, $instance ) {
extract( $args );
$title = apply_filters('widget_title', $title, $instance, $this->id_base);
echo $before_widget;
if ( $title) {
echo $before_title . $title . $after_title;
}
if ( is_user_logged_in() ){
echo '<div class="logged">';
global $wp_roles;
$currUser = wp_get_current_user();
echo $instance['description_logout'];
echo '<div class="profile-info clear">';
echo '<div class="profile-name"><span>'.__('UserName: ','ait').'</span>'.$currUser->user_nicename .'</div>';
if(isset($currUser->roles[0])){
echo '<div class="profile-role"><span>'.__('Package: ','ait').'</span>'.$wp_roles->role_names[$currUser->roles[0]] .'</div>';
}
echo '<a href="'.wp_logout_url(get_permalink()).'" title="Logout" class="widgetlogin-button-logout">'.__('Logout','ait').'</a>';
echo '</div></div>';
} else {
?>
<div class="not-logged">
<div id="ait-login-tabs">
<h3 style="color:#666;">If you already have an account Login here</h3>
<h3 class="widget-title"><span>MEMBER LOGIN</span></h3>
<?php wp_login_form( array( 'form_id' => 'ait-login-form-widget' ) ); ?>
<br />
<div style="background:#f4f4f4; width:100%; padding:10px; margin:0px;">
<a href="your-url-here" style="color:#c81f93!important;">I Forgot Password!</a><br /><br /><h3 style="color:#666;">You are not member? Register Here!</h3><a href="your-url-here" style="color:#c81f93!important;">Click here to register</a>.</div>
<script>
jQuery(document).ready(function($) {
var tabRegister = $('#ait-dir-register-tab'),
tabLogin = $('#ait-dir-login-tab'),
linkLogin = $('#ait-login-tabs .login'),
linkRegister = $('#ait-login-tabs .register');
linkLogin.click(function(event) {
linkRegister.parent().removeClass('active');
tabRegister.hide();
linkLogin.parent().addClass('active');
tabLogin.show();
event.preventDefault();
});
linkRegister.click(function(event) {
linkLogin.parent().removeClass('active');
tabLogin.hide();
linkRegister.parent().addClass('active');
tabRegister.show();
event.preventDefault();
});
// init and change
var select = tabRegister.find('select[name=directory-role]'),
buttonSubmit = tabRegister.find('input[name=user-submit]'),
freeTitle = '<?php _e('Sign up','ait'); ?>',
buyTitle = '<?php _e('Buy with PayPal','ait'); ?>';
if(select.find('option:selected').hasClass('free')){
buttonSubmit.val(freeTitle);
} else {
buttonSubmit.val(buyTitle);
}
select.change(function(event) {
if(select.find('option:selected').hasClass('free')){
buttonSubmit.val(freeTitle);
} else {
buttonSubmit.val(buyTitle);
}
});
});
</script>
</div>
</div>
<?php
}
echo $after_widget;
}
/**
* Update and save widget
*
* @param array $new_instance
* @param array $old_instance
* @return array New widget values
*/
function update ( $new_instance, $old_instance ) {
$old_instance['title'] = strip_tags( $new_instance['title'] );
$old_instance['description_login'] = $new_instance['description_login'];
$old_instance['description_logout'] = $new_instance['description_logout'];
$old_instance['description_register'] = $new_instance['description_register'];
return $old_instance;
}
/**
* Creates widget controls or settings
*
* @param array Return widget options form
*/
function form ( $instance ) {
$instance = wp_parse_args( (array) $instance, array(
'title' => '',
'description_login' => '',
'description_logout' => '',
'description_register' => ''
) );
?>
<p>
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php echo __( 'Title', 'ait' ); ?>:</label>
<input type="text" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>"class="widefat" style="width:100%;" />
<label for="<?php echo $this->get_field_id( 'description_login' ); ?>"><?php echo __( 'Login Description', 'ait' ); ?>:</label>
<textarea class="widefat" rows="5" cols="20" id="<?php echo $this->get_field_id( 'description_login' ); ?>" name="<?php echo $this->get_field_name( 'description_login' ); ?>"><?php echo htmlspecialchars($instance['description_login']); ?></textarea>
<label for="<?php echo $this->get_field_id( 'description_logout' ); ?>"><?php echo __( 'Logout Description', 'ait' ); ?>:</label>
<textarea class="widefat" rows="5" cols="20" id="<?php echo $this->get_field_id( 'description_logout' ); ?>" name="<?php echo $this->get_field_name( 'description_logout' ); ?>"><?php echo htmlspecialchars($instance['description_logout']); ?></textarea>
<label for="<?php echo $this->get_field_id( 'description_register' ); ?>"><?php echo __( 'Register Description', 'ait' ); ?>:</label>
<textarea class="widefat" rows="5" cols="20" id="<?php echo $this->get_field_id( 'description_register' ); ?>" name="<?php echo $this->get_field_name( 'description_register' ); ?>"><?php echo htmlspecialchars($instance['description_register']); ?></textarea>
</p>
<?php
}
}
register_widget( 'Directory_Widget' );
|
December 11, 2013 at 8:49 pm 13627 |