Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- global $current_user, $wp_roles;
- get_currentuserinfo();
- ?>
- <div class="entry-content entry">
- <?php the_content();
- if ( isset($_REQUEST['error']) && $_REQUEST['error'] == 'true' ){
- $error = __('Girmiş olduğunuz şifreler birbirini tutmuyor. Şifreniz güncellenemedi.', 'cosmotheme');
- }elseif( isset($_REQUEST['success']) && $_REQUEST['success'] == 'true' ){
- $success = __('Profiliniz güncellendi.', 'cosmotheme');
- }
- if ( $error ) echo '<p class="error">' . $error . '</p>';
- if ( isset($success) ) echo '<p class="success">' . $success . '</p>';
- ?>
- <?php if ( !is_user_logged_in() ) : ?>
- <p class="warning">
- <?php _e('Profilinizi düzenleyebilmek için giriş yapmalısınız.', 'cosmotheme'); ?>
- </p><!-- .warning -->
- <?php else : ?>
- <?php
- ?>
- <form method="post" id="adduser" action="<?php the_permalink(); ?>">
- <div class="tabs-container form-profile-pic">
- <?php
- $action['group'] = 'avatar';
- $action['topic'] = 'upload';
- $action['index'] = '';
- $action['upload_url'] = home_url().'/wp-admin/media-upload.php?post_id=-1&type=image&TB_iframe=true';
- $custom_avatar_url = '';
- $custom_avatar_meta = get_user_meta($current_user->id, 'custom_avatar', true);
- if(is_numeric($custom_avatar_meta) && $custom_avatar_meta > 0){
- $custom_avatar_url = wp_get_attachment_url($custom_avatar_meta);
- }
- ?>
- <label for="profile-pic"><?php _e('Profil Resmi', 'cosmotheme'); ?></label>
- <?php
- $picture = facebook::picture();
- if( strlen( $picture ) && get_user_meta( $current_user->id , 'custom_avatar' , true ) == ''){
- ?><a href="http://facebook.com/profile.php?id=<?php echo facebook::id(); ?>" class="profile-pic"><img src="<?php echo $picture; ?>" width="32" width="32" /></a><?php
- }else{
- echo cosmo_avatar( $current_user->id , 100 , $default = DEFAULT_AVATAR_100 );
- }
- if( defined('IS_FOR_DEMO' ) && get_the_author_meta( 'user_login', $current_user->id ) == 'demo'){
- $disabled = 'disabled';
- }else{
- $disabled = '';
- }
- ?>
- <p class="button blue"><input type="button" class="button-primary front_post_input" id="upload_btn" value="<?php _e('Gözat','cosmotheme'); ?>" <?php echo fields::action( $action , 'extern-upload-id' ) ?> /></p>
- <input type="text" name="image" value="<?php echo $custom_avatar_url; ?>" class="generic-record front_post_input" id="avatar_upload" onclick="jQuery('#upload_btn').click();" />
- <label class="remove-avatar" for="remove_avatar"><input type="checkbox" name="remove_avatar" <?php echo $disabled ?> value="1" id="remove_avatar"> <?php _e('Resmi sil', 'cosmotheme'); ?></label>
- <input type="hidden" name="avatar_id" id="avatar_upload_id" value="<?php echo $custom_avatar_meta; ?>" class="generic-record generic-single-record " />
- </div><!-- .profile pic -->
- <div class="tabs-container form-username">
- <label for="user-name"><?php _e('Username', 'cosmotheme'); ?></label>
- <input class="text-input" name="user-name" type="text" id="user-name" disabled value="<?php the_author_meta( 'user_login', $current_user->id ); ?>" />
- </div><!-- .form-username -->
- <div class="tabs-container form-username">
- <label for="first-name"><?php _e('Adınız', 'cosmotheme'); ?></label>
- <input class="text-input" name="first-name" type="text" id="first-name" <?php echo $disabled ?> value="<?php the_author_meta( 'user_firstname', $current_user->id ); ?>" />
- </div><!-- .form-username -->
- <div class="tabs-container form-username">
- <label for="last-name"><?php _e('Soyadınız', 'cosmotheme'); ?></label>
- <input class="text-input" name="last-name" type="text" id="last-name" <?php echo $disabled ?> value="<?php the_author_meta( 'user_lastname', $current_user->id ); ?>" /></div>
- <div class="tabs-container form-displayname">
- <label for="email"><?php _e('Nasıl görünsün?', 'cosmotheme'); ?></label>
- <select name="display_name" id="display_name">
- <?php
- $public_display = array();
- $public_display['display_username'] = $current_user->user_login;
- $public_display['display_nickname'] = $current_user->nickname;
- if ( !empty($current_user->user_firstname) )
- $public_display['display_firstname'] = $current_user->user_firstname;
- if ( !empty($current_user->user_lastname) )
- $public_display['display_lastname'] = $current_user->user_lastname;
- if ( !empty($current_user->user_lastname) && !empty($current_user->user_lastname) ) {
- $public_display['display_firstlast'] = $current_user->user_firstname . ' ' . $current_user->user_lastname;
- $public_display['display_lastfirst'] = $current_user->user_lastname . ' ' . $current_user->user_firstname;
- }
- if ( !in_array( $current_user->display_name, $public_display ) ) // Only add this if it isn't duplicated elsewhere
- $public_display = array( 'display_displayname' => $current_user->display_name ) + $public_display;
- $public_display = array_map( 'trim', $public_display );
- $public_display = array_unique( $public_display );
- foreach ( $public_display as $id => $item ) {
- ?>
- <option id="<?php echo $id; ?>" value="<?php echo esc_attr($item); ?>"<?php selected( $current_user->display_name, $item ); ?>><?php echo $item; ?></option>
- <?php
- }
- ?>
- </select>
- </div><!-- .form-username -->
- <div class="tabs-container form-email">
- <label for="email"><?php _e('E-posta *', 'cosmotheme'); ?></label>
- <input class="text-input" name="email" type="text" id="email" <?php echo $disabled ?> value="<?php the_author_meta( 'user_email', $current_user->id ); ?>" />
- </div><!-- .form-email -->
- <div class="tabs-container form-url">
- <label for="url"><?php _e('Website', 'cosmotheme'); ?></label>
- <input class="text-input" name="url" type="text" id="url" <?php echo $disabled ?> value="<?php the_author_meta( 'user_url', $current_user->id ); ?>" />
- </div>
- <div class="tabs-container form-twitter">
- <label for="url"><?php _e('Twitter ID', 'cosmotheme'); ?></label>
- <input class="text-input" name="twit" type="text" id="twit" <?php echo $disabled ?> value="<?php the_author_meta( 'twitter', $current_user->id ); ?>" />
- </div>
- <div class="tabs-container form-face">
- <label for="url"><?php _e('Facebook ID', 'cosmotheme'); ?></label>
- <input class="text-input" name="face" type="text" id="face" <?php echo $disabled ?> value="<?php the_author_meta( 'facebook', $current_user->id ); ?>" />
- </div>
- <div class="tabs-container form-gplus">
- <label for="url"><?php _e('Google+ URL', 'cosmotheme'); ?></label>
- <input class="text-input" name="gplus" type="text" id="gplus" <?php echo $disabled ?> value="<?php the_author_meta( 'googleplus', $current_user->id ); ?>" />
- </div>
- <div class="tabs-container form-password">
- <label for="pass1"><?php _e('Şifre *', 'cosmotheme'); ?> </label>
- <input class="text-input" name="pass1" <?php echo $disabled ?> type="password" id="pass1" />
- </div><!-- .form-password -->
- <div class="tabs-container form-password">
- <label for="pass2"><?php _e('Tekrar şifre *', 'cosmotheme'); ?></label>
- <input class="text-input" name="pass2" <?php echo $disabled ?> type="password" id="pass2" />
- </div><!-- .form-password -->
- <div class="tabs-container form-textarea">
- <label for="description"><?php _e('Hakkınızda', 'cosmotheme') ?></label>
- <textarea name="description" id="description" <?php echo $disabled ?> rows="3" cols="50"><?php the_author_meta( 'description', $current_user->id ); ?></textarea>
- </div><!-- .form-textarea -->
- <p class="form-submit button blue">
- <?php //echo $referer; ?>
- <input name="updateuser" type="submit" id="updateuser" <?php echo $disabled ?> class="submit button" value="<?php _e('Güncelle', 'cosmotheme'); ?>" />
- <?php wp_nonce_field( 'update-user' ) ?>
- <input name="action" type="hidden" id="action" <?php echo $disabled ?> value="update-user" />
- </p><!-- .form-submit -->
- </form><!-- #adduser -->
- <?php endif; ?>
- </div><!-- .entry-content -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement