Advertisement
iamdangavin

Form

Aug 22nd, 2011
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.20 KB | None | 0 0
  1. <?php
  2. /**
  3. * Template Name: Edit Profile
  4. *
  5. * This is the template that displays our custom artists list page layout.
  6. *
  7. * @package WordPress
  8. * @subpackage Twenty_Eleven
  9. * @since Twenty Eleven 1.0
  10. */
  11.  
  12. get_header(); ?>
  13.  
  14.        <div id="primary">
  15.            <div id="content" role="main">
  16.    <?php
  17.         global $user_ID, $current_user;
  18.         if( !$user_ID >= 1) {
  19.            $user_ID = $current_user->ID;
  20.         }
  21.        $user_info = get_userdata($user_ID);
  22.    ?>
  23.                <div class="editprofile-top">
  24.                    Welcome <a href="<?php echo get_author_posts_url($user_ID); ?>"><?php echo $user_info->display_name; ?></a>. You can view your profile <a href="<?php echo get_author_posts_url($user_ID); ?>">here</a>.
  25.                </div><!--END EDIT PROFILE TOP-->
  26.  
  27.                <div id="tabs" class="ui-tabs">
  28.                    <ul class="edit-tabs ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header">
  29.                        <li class="tab edit-profile"><a href="#edit-profile">Edit Profile</a></li>
  30.                        <li class="tab add-work"><a href="#add-work">Add Work</a></li>
  31.                        <li class="tab add-event"><a href="#add-event">Add Event</a></li>
  32.                    </ul>
  33.  
  34.                    <div id="edit-profile" class="ui-tabs-panel ui-widget-content">
  35.                        <?php if(!is_user_logged_in()){
  36.                        _e('You must be logged in to edit your profile.', 'profile');
  37.                        echo '<br/>';
  38.                        login_with_ajax();
  39.                        } else {
  40.                        /* Update user password. */
  41.                        if ( !empty($_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) {
  42.                           if ( $_POST['pass1'] == $_POST['pass2'] ) {
  43.                               wp_update_user( array( 'ID' => $current_user->id, 'user_pass' => esc_attr( $_POST['pass1'] ) ) );
  44.                           } else {
  45.                               $error = __('The passwords you entered do not match. Your password was not updated.', 'profile');
  46.                           }
  47.                        }
  48.                        ?>
  49.                        <?php if ( $error ) {
  50.                           echo '<p class="error">' . $error . '</p>';
  51.                        }?>
  52.                        <form id="your-profile" enctype="multipart/form-data" action="<?php the_permalink(); ?>" method="post">
  53.                        <?php wp_nonce_field('update-user_' . $user_id); ?>
  54.                        <?php if ( $wp_http_referer ) : ?>
  55.                           <input type="hidden" name="wp_http_referer" value="<?php echo esc_url($wp_http_referer); ?>" />
  56.                        <?php endif; ?>
  57.                        <p>
  58.                           <input type="hidden" name="from" value="profile" />
  59.                           <input type="hidden" name="checkuser_id" value="<?php echo $user_ID ?>" />
  60.                        </p>
  61.                           <?php $collective =& Collective::get_instance();
  62.                                $collective->admin_edit_profile();
  63.                           ?>
  64.                        <div class="update">
  65.                        <input type="hidden" name="action" value="update" />
  66.                        <input type="hidden" name="user_id" id="user_id" value="<?php echo esc_attr($user_id); ?>" />
  67.                        
  68.                        <input name="updateuser" type="submit" id="updateuser" class="submit button" value="<?php _e('Update Profile', 'profile'); ?>" />
  69.                        </div><!-- /.update -->
  70.                        </form>
  71.                        <?php } ?>
  72.                    </div><!-- /#edit-profile -->
  73.                    
  74.                    <div id="add-work" class="ui-tabs-panel ui-widget-content">
  75.                        <?php gravity_form(4); ?>
  76.                    </div><!-- /#add-work -->
  77.                    
  78.                    <div id="add-event" class="ui-tabs-panel ui-widget-content">
  79.                        <?php gravity_form(1); ?>
  80.                    </div><!-- /#add-event -->
  81.                    
  82.                </div><!-- /#tabs -->
  83.            </div><!-- #content -->
  84.        </div><!-- #primary -->
  85.  
  86. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement