Advertisement
Guest User

dasdasdasdas

a guest
Nov 28th, 2011
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 8.63 KB | None | 0 0
  1. <?php
  2. global $current_user, $wp_roles;
  3. get_currentuserinfo();
  4.  
  5. ?>
  6. <div class="entry-content entry">
  7.     <?php the_content();
  8.  
  9.       if ( isset($_REQUEST['error']) && $_REQUEST['error'] == 'true' ){
  10.           $error = __('Girmiş olduğunuz şifreler birbirini tutmuyor.  Şifreniz güncellenemedi.', 'cosmotheme');
  11.       }elseif( isset($_REQUEST['success']) && $_REQUEST['success'] == 'true' ){
  12.           $success = __('Profiliniz güncellendi.', 'cosmotheme');
  13.       }
  14.      
  15.      
  16.       if ( $error ) echo '<p class="error">' . $error . '</p>';
  17.       if ( isset($success) ) echo '<p class="success">' . $success . '</p>';
  18.  
  19.     ?>
  20.  
  21.  
  22.     <?php if ( !is_user_logged_in() ) : ?>
  23.             <p class="warning">
  24.                 <?php _e('Profilinizi düzenleyebilmek için giriş yapmalısınız.', 'cosmotheme'); ?>
  25.             </p><!-- .warning -->
  26.     <?php else : ?>
  27.         <?php
  28.            
  29.                
  30.         ?>
  31.         <form method="post" id="adduser" action="<?php the_permalink(); ?>">
  32.             <div class="tabs-container form-profile-pic">
  33.                 <?php
  34.  
  35.  
  36.  
  37.                     $action['group'] = 'avatar';
  38.                     $action['topic'] = 'upload';
  39.                     $action['index'] = '';
  40.                     $action['upload_url'] =  home_url().'/wp-admin/media-upload.php?post_id=-1&amp;type=image&amp;TB_iframe=true';
  41.  
  42.                     $custom_avatar_url = '';   
  43.                     $custom_avatar_meta =  get_user_meta($current_user->id, 'custom_avatar', true);
  44.                     if(is_numeric($custom_avatar_meta) && $custom_avatar_meta > 0){
  45.                         $custom_avatar_url = wp_get_attachment_url($custom_avatar_meta);
  46.  
  47.                     }
  48.  
  49.                 ?>
  50.                 <label for="profile-pic"><?php _e('Profil Resmi', 'cosmotheme'); ?></label>
  51.                 <?php
  52.                     $picture = facebook::picture();
  53.                     if( strlen( $picture ) && get_user_meta( $current_user->id , 'custom_avatar' , true ) == ''){
  54.                         ?><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
  55.                     }else{
  56.                         echo cosmo_avatar( $current_user->id , 100 , $default = DEFAULT_AVATAR_100 );
  57.                     }
  58.  
  59.                     if( defined('IS_FOR_DEMO' ) && get_the_author_meta( 'user_login', $current_user->id ) == 'demo'){
  60.                         $disabled = 'disabled';
  61.                     }else{
  62.                         $disabled = '';
  63.                     }
  64.                 ?>
  65.                 <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>
  66.                 <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();"  />
  67.                 <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>
  68.                 <input type="hidden" name="avatar_id" id="avatar_upload_id" value="<?php echo $custom_avatar_meta; ?>"  class="generic-record generic-single-record " />
  69.  
  70.             </div><!-- .profile pic -->  
  71.             <div class="tabs-container form-username">
  72.                 <label for="user-name"><?php _e('Username', 'cosmotheme'); ?></label>
  73.                 <input class="text-input" name="user-name" type="text" id="user-name" disabled value="<?php the_author_meta( 'user_login', $current_user->id ); ?>" />
  74.             </div><!-- .form-username -->
  75.             <div class="tabs-container form-username">
  76.                 <label for="first-name"><?php _e('Adınız', 'cosmotheme'); ?></label>
  77.                 <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 ); ?>" />
  78.             </div><!-- .form-username -->
  79.             <div class="tabs-container form-username">
  80.                 <label for="last-name"><?php _e('Soyadınız', 'cosmotheme'); ?></label>
  81.                 <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>
  82.             <div class="tabs-container form-displayname">
  83.                 <label for="email"><?php _e('Nasıl görünsün?', 'cosmotheme'); ?></label>
  84.                 <select name="display_name" id="display_name">
  85.                             <?php
  86.                             $public_display = array();
  87.                             $public_display['display_username']  = $current_user->user_login;
  88.                             $public_display['display_nickname']  = $current_user->nickname;
  89.                             if ( !empty($current_user->user_firstname) )
  90.                                 $public_display['display_firstname'] = $current_user->user_firstname;
  91.                             if ( !empty($current_user->user_lastname) )
  92.                                 $public_display['display_lastname'] = $current_user->user_lastname;
  93.                             if ( !empty($current_user->user_lastname) && !empty($current_user->user_lastname) ) {
  94.                                 $public_display['display_firstlast'] = $current_user->user_firstname . ' ' . $current_user->user_lastname;
  95.                                 $public_display['display_lastfirst'] = $current_user->user_lastname . ' ' . $current_user->user_firstname;
  96.                             }
  97.                             if ( !in_array( $current_user->display_name, $public_display ) ) // Only add this if it isn't duplicated elsewhere
  98.                                 $public_display = array( 'display_displayname' => $current_user->display_name ) + $public_display;
  99.                             $public_display = array_map( 'trim', $public_display );
  100.                             $public_display = array_unique( $public_display );
  101.                             foreach ( $public_display as $id => $item ) {
  102.                                 ?>
  103.                         <option id="<?php echo $id; ?>" value="<?php echo esc_attr($item); ?>"<?php selected( $current_user->display_name, $item ); ?>><?php echo $item; ?></option>
  104.                                 <?php
  105.                             }
  106.                             ?>
  107.                     </select>
  108.             </div><!-- .form-username -->
  109.             <div class="tabs-container form-email">
  110.                 <label for="email"><?php _e('E-posta *', 'cosmotheme'); ?></label>
  111.                 <input class="text-input" name="email" type="text" id="email" <?php echo $disabled ?> value="<?php the_author_meta( 'user_email', $current_user->id ); ?>" />
  112.             </div><!-- .form-email -->
  113.             <div class="tabs-container form-url">
  114.                 <label for="url"><?php _e('Website', 'cosmotheme'); ?></label>
  115.                 <input class="text-input" name="url" type="text" id="url" <?php echo $disabled ?> value="<?php the_author_meta( 'user_url', $current_user->id ); ?>" />
  116.             </div>
  117.             <div class="tabs-container form-twitter">
  118.                 <label for="url"><?php _e('Twitter ID', 'cosmotheme'); ?></label>
  119.                 <input class="text-input" name="twit" type="text" id="twit" <?php echo $disabled ?> value="<?php the_author_meta( 'twitter', $current_user->id ); ?>" />
  120.             </div>
  121.             <div class="tabs-container form-face">
  122.                 <label for="url"><?php _e('Facebook ID', 'cosmotheme'); ?></label>
  123.                 <input class="text-input" name="face" type="text" id="face" <?php echo $disabled ?> value="<?php the_author_meta( 'facebook', $current_user->id ); ?>" />
  124.             </div>
  125.             <div class="tabs-container form-gplus">
  126.                 <label for="url"><?php _e('Google+ URL', 'cosmotheme'); ?></label>
  127.                 <input class="text-input" name="gplus" type="text" id="gplus" <?php echo $disabled ?> value="<?php the_author_meta( 'googleplus', $current_user->id ); ?>" />
  128.             </div>
  129.             <div class="tabs-container form-password">
  130.                 <label for="pass1"><?php _e('Şifre *', 'cosmotheme'); ?> </label>
  131.                 <input class="text-input" name="pass1" <?php echo $disabled ?> type="password" id="pass1" />
  132.             </div><!-- .form-password -->
  133.             <div class="tabs-container form-password">
  134.                 <label for="pass2"><?php _e('Tekrar şifre *', 'cosmotheme'); ?></label>
  135.                 <input class="text-input" name="pass2" <?php echo $disabled ?> type="password" id="pass2" />
  136.             </div><!-- .form-password -->
  137.             <div class="tabs-container form-textarea">
  138.                 <label for="description"><?php _e('Hakkınızda', 'cosmotheme') ?></label>
  139.                 <textarea name="description" id="description" <?php echo $disabled ?> rows="3" cols="50"><?php the_author_meta( 'description', $current_user->id ); ?></textarea>
  140.             </div><!-- .form-textarea -->
  141.             <p class="form-submit button blue">
  142.                 <?php //echo $referer; ?>
  143.                 <input name="updateuser" type="submit" id="updateuser" <?php echo $disabled ?> class="submit button" value="<?php _e('Güncelle', 'cosmotheme'); ?>" />
  144.                 <?php wp_nonce_field( 'update-user' ) ?>
  145.                 <input name="action" type="hidden" id="action" <?php echo $disabled ?> value="update-user" />
  146.             </p><!-- .form-submit -->
  147.         </form><!-- #adduser -->
  148.         <?php endif; ?>
  149.     </div><!-- .entry-content -->
  150.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement