Advertisement
Guest User

Untitled

a guest
Feb 24th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.54 KB | None | 0 0
  1. <?php
  2. $a_id = bp_displayed_user_id();
  3. $user = get_userdata($a_id);
  4.  
  5. ?>
  6. <div class="col-lg-8 col-md-8 block">
  7. <div class="title-wrapper">
  8. <h3 class="widget-title"><i class="fas fa-bullhorn"></i> <?php esc_html_e('INTRODUCTION','blackfyre'); ?></h3>
  9. </div>
  10. <div class="wcontainer">
  11. <?php if(get_the_author_meta('description', $a_id)){
  12. echo nl2br(get_the_author_meta('description', $a_id));
  13. } ?>
  14. </div>
  15. </div>
  16.  
  17.  
  18. <div class="col-lg-4 col-md-6">
  19. <div class="block">
  20. <div class="title-wrapper">
  21. <h3 class="widget-title"><i class="fas fa-info-circle"></i> <?php esc_html_e('ABOUT ','blackfyre'); ?> </h3>
  22. </div>
  23. <ul class="about-profile">
  24. <!--rank-->
  25. <li><strong>RANK:</strong>[gamipress_user_rank type="ranks" prev_rank="no" current_rank="yes" next_rank="no" user_id="$user" title="no" link="no"]</li>
  26. <!--rank-->
  27.  
  28.  
  29. <!--name-->
  30. <?php if(get_the_author_meta('first_name', $a_id)){ ?>
  31. <li><strong><?php esc_html_e('NAME: ','blackfyre'); ?></strong>
  32. <?php echo get_the_author_meta('first_name', $a_id); ?>
  33. <?php if(get_the_author_meta('last_name', $a_id)){
  34. echo get_the_author_meta('last_name', $a_id);
  35. } ?> </li>
  36. <?php } ?>
  37. <!--name-->
  38.  
  39.  
  40.  
  41. <!--location-->
  42. <?php
  43. if(get_the_author_meta('usercountry_id', $a_id)){
  44. $cid = get_the_author_meta('usercountry_id', $a_id);
  45.  
  46. global $wpdb;
  47. $table = $wpdb->prefix."user_countries";
  48. $countries = $wpdb->get_results("SELECT * FROM $table ORDER BY name");
  49. foreach ($countries as $country) {
  50. if ($cid==$country->id_country) { $count = $country->name;}
  51. }
  52. ?>
  53. <li><strong> <?php esc_html_e('LOCATION: ','blackfyre');?></strong> <?php echo esc_attr($count);
  54.  
  55. if(get_the_author_meta('city', $a_id))
  56. {echo ', ';echo get_the_author_meta('city', $a_id);} ?>
  57. </li>
  58. <?php } ?>
  59. <!--location-->
  60.  
  61. <!--age-->
  62. <?php if(get_the_author_meta('age', $a_id) && get_the_author_meta('age', $a_id) != 'none'){ ?>
  63.  
  64. <li><strong><?php esc_html_e('AGE: ','blackfyre');?></strong>
  65. <?php
  66. $age_base = get_the_author_meta('age', $a_id);
  67.  
  68. $age = DateTime::createFromFormat('d/m/Y', $age_base);
  69.  
  70. if(!$age){
  71. $age = DateTime::createFromFormat('m/d/Y', $age_base);
  72. }
  73.  
  74. if(!$age){
  75. $age = DateTime::createFromFormat('Y-m-d', $age_base);
  76. }
  77.  
  78. if(!$age){
  79. $age = DateTime::createFromFormat('F j, Y', $age_base);
  80. }
  81.  
  82.  
  83. $age = $age->format('Y-m-d');
  84. $age = floor((time() - strtotime($age)) / 31556926);
  85. echo esc_html($age);
  86.  
  87. } ?>
  88. </li>
  89.  
  90.  
  91. <!--age-->
  92. <li>
  93. <!--joined-->
  94. <strong> <?php esc_html_e('JOINED: ','blackfyre'); ?></strong>
  95. <?php echo date("M, Y", strtotime(get_userdata($a_id)->user_registered)); ?>
  96.  
  97. <!--joined-->
  98. </li>
  99. <?php
  100. global $wpdb;
  101. $custom_profile_fields = $wpdb->get_results('SELECT * FROM '.$wpdb->prefix.'bp_xprofile_fields');
  102.  
  103. if (is_array($custom_profile_fields)) {
  104. foreach ($custom_profile_fields as $field) {
  105. if($field->id == 1)continue;
  106. $query = $wpdb->get_row($wpdb->prepare('SELECT * FROM '.$wpdb->prefix.'bp_xprofile_data WHERE user_id= %s AND field_id= %s LIMIT 1' , $a_id, $field->id ));
  107.  
  108. if (isset($query->value)) {
  109. echo "<li>";
  110. echo "<strong>".strtoupper($field->name).": </strong>";
  111. $first = true;
  112. if (is_serialized($query->value)) {
  113. $row = unserialize($query->value);
  114. foreach ($row as $hold) {
  115. if ($first == true) {
  116. echo esc_attr($hold);
  117. $first = false;
  118. } else {
  119. echo ", ".esc_attr($hold);
  120. }
  121. }
  122. } else {
  123. echo esc_attr($query->value);
  124. }
  125.  
  126.  
  127. echo "</li>";
  128. }
  129.  
  130. }
  131. }
  132.  
  133.  
  134.  
  135. ?>
  136. <!--website-->
  137. <?php if(get_the_author_meta('user_url', $a_id)){ ?>
  138. <li><strong><?php esc_html_e('WEBSITE: ','blackfyre');?></strong>
  139. <a target="_blank" href=" <?php echo get_the_author_meta('user_url', $a_id); ?>"> <?php
  140. echo get_the_author_meta('user_url', $a_id); ?>
  141. </a>
  142. </li>
  143. <?php } ?>
  144. <!--website-->
  145.  
  146. <!--achievements-->
  147. <li><strong>Achievements:</strong> [gamipress_achievements type="all" columns="3" filter="no" filter_value="completed" search="no" load_more="yes" limit="9" user_id="$a_id" title="no" link="no" thumbnail="yes" points_awarded="no" excerpt="no" times_earned="yes" steps="no" toggle="no"]</li>
  148. <!--achievements-->
  149.  
  150. </ul>
  151.  
  152. </div>
  153.  
  154. <!--clan-->
  155.  
  156. <?php $postovi = blackfyre_get_user_clans($a_id);
  157.  
  158. if(!empty($postovi)){ ?>
  159.  
  160. <div class="block profile-clans">
  161.  
  162. <div class="title-wrapper">
  163. <h3 class="widget-title"><i class="fas fa-crosshairs"></i> <?php esc_html_e('Clans ','blackfyre'); ?> </h3>
  164. </div>
  165.  
  166. <ul class="about-profile">
  167. <?php
  168. foreach ($postovi as $post) {
  169. $post = get_post($post);
  170. $photo = get_post_meta($post->ID, 'clan_photo',true);
  171. if(empty($photo))
  172. $photo = get_theme_file_uri('img/defaults/default-clan-50x50.jpg');
  173. echo '<li><a href="'.get_permalink($post->ID).'"><div class="pclan-img"><img alt="img" src="'.esc_url($photo).'"/></div> <div class="pclan-title">'.esc_attr($post->post_title).'</div><div class="clear"></div></a></li>';
  174. }
  175.  
  176. wp_reset_query(); ?>
  177. </ul>
  178. </div>
  179. <?php } ?>
  180. <!--clan-->
  181.  
  182. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement