Advertisement
Guest User

Ændrew

a guest
Dec 6th, 2010
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.11 KB | None | 0 0
  1. <?php /* Querystring is set via AJAX in _inc/ajax.php - bp_dtheme_object_filter() */ ?>
  2.  
  3. <?php do_action( 'bp_before_members_loop' ) ?>
  4.  
  5. <?php if ( bp_has_members( bp_ajax_querystring( 'members' ) ) ) : ?>
  6.  
  7.     <div class="pagination">
  8.  
  9.         <div class="pag-count" id="member-dir-count">
  10.             <?php bp_members_pagination_count() ?>
  11.         </div>
  12.  
  13.         <div class="pagination-links" id="member-dir-pag">
  14.             <?php bp_members_pagination_links() ?>
  15.         </div>
  16.  
  17.     </div>
  18.  
  19.     <?php do_action( 'bp_before_directory_members_list' ) ?>
  20.  
  21.     <ul id="members-list" class="item-list">
  22.     <?php while ( bp_members() ) : bp_the_member(); ?>
  23.  
  24.         <li class="member">
  25. <!--            <div class="item-avatar">
  26.                 <a href="<?php bp_member_permalink() ?>"><?php bp_member_avatar() ?></a>
  27.             </div>-->
  28.  
  29.             <div class="item">
  30.                 <div class="item-title">
  31.                 <div>   <div style="width: 25%; float: left;"><a href="<?php bp_member_permalink() ?>">
  32.                 <?php
  33.                     #Quick hack to make the surname display first. -ae
  34.                 $bpmembername = bp_get_member_name();
  35.                 $name = explode(" ", $bpmembername);
  36.                 $nameCount = count($name);
  37.                 $surname = $name[$nameCount-1];
  38.                 echo $surname . ", ";
  39.                 $i = 0;
  40.                 while ($i < ($nameCount-1)) {
  41.                     echo($name[$i] . " ");
  42.                     $i++;
  43.                 }
  44.                 ?>
  45.  
  46.                
  47.                
  48.                
  49.                 </a><br />
  50.                
  51.                 </div>
  52.                    
  53.                 <?php
  54.                  /***
  55.                   * If you want to show specific profile fields here you can,
  56.                   * but it'll add an extra query for each member in the loop
  57.                   * (only one regadless of the number of fields you show):
  58.                   *
  59.                   * bp_member_profile_data( 'field=the field name' );
  60.                   */
  61.                
  62.                 #Format Phone Numbers
  63.                
  64.                 $phone = bp_get_member_profile_data('field=p:');
  65.                 $cell = bp_get_member_profile_data('field=f:');
  66.                 $formatted_phone = preg_replace("/[^\d]/",  "", $phone);
  67.                 $formatted_cell = preg_replace("/[^\d]/",  "", $cell);
  68.                 $thephone[3] = substr($formatted_phone, strlen($formatted_phone) - 4, 4);
  69.                 $thephone[2] = substr($formatted_phone, strlen($formatted_phone) - 7, 3);
  70.                 $thephone[1] = substr($formatted_phone, strlen($formatted_phone) - 10, 3);
  71.                 if (strlen($thephone) > 10) {
  72.                     $thephone[0] = substr($formatted_phone, strlen($formatted_phone) - 11, 1) . "."; }
  73.                 else {
  74.                     $thephone[0] = "";}
  75.                
  76.                 $thecell[3] = substr($formatted_cell, strlen($formatted_cell) - 4, 4);
  77.                 $thecell[2] = substr($formatted_cell, strlen($formatted_cell) - 7, 3);
  78.                 $thecell[1] = substr($formatted_cell, strlen($formatted_cell) - 10, 3);
  79.                 $thecell[0] = substr($formatted_cell, strlen($formatted_cell) - 11, 1) . ".";              
  80.                 if (strlen($thephone) > 10) {
  81.                     $thephone[0] = substr($formatted_phone, strlen($formatted_phone) - 11, 1) . "."; }
  82.                 else {
  83.                     $thephone[0] = "";}
  84.                
  85.                 ?>
  86.  
  87.                
  88.                  <div style="width: 25%; float: left;"><a href="/members/?s=<?php bp_member_profile_data( 'field=Company' ); ?>"><?php bp_member_profile_data( 'field=Company' ); ?></a></div>
  89.                  <div style="width: 50%; float: left;"><?php echo($thephone[0].$thephone[1].".".$thephone[2].".".$thephone[3]); ?><br />
  90.                   <?php echo($thecell[0].$thecell[1].".".$thecell[2].".".$thecell[3]); ?><br />
  91.                   <a href="mailto:<?php bp_member_profile_data( 'field=e:' );?>"><?php bp_member_profile_data( 'field=e:' );?></a>
  92.                  </div>
  93.                 <br/>
  94.             </div>
  95.             </div>
  96.                     <?php if ( bp_get_member_latest_update() ) : ?>
  97.                         <span class="update"> - <?php bp_member_latest_update( 'length=10' ) ?></span>
  98.                     <?php endif; ?>
  99.                 </div>
  100.                 <div class="item-meta"><span class="activity"><?php bp_member_last_active() ?></span></div>
  101.  
  102.                 <?php do_action( 'bp_directory_members_item' ) ?>
  103.  
  104.  
  105.             <div class="action">
  106.                 <?php bp_member_add_friend_button() ?>
  107.  
  108.                 <?php do_action( 'bp_directory_members_actions' ) ?>
  109.             </div>
  110.  
  111.             <div class="clear"></div>
  112.         </li>
  113.  
  114.     <?php endwhile; ?>
  115.     </ul>
  116.  
  117.     <?php do_action( 'bp_after_directory_members_list' ) ?>
  118.  
  119.     <?php bp_member_hidden_fields() ?>
  120.  
  121. <?php else: ?>
  122.  
  123.     <div id="message" class="info">
  124.         <p><?php _e( "Sorry, no members were found.", 'buddypress' ) ?></p>
  125.     </div>
  126.  
  127. <?php endif; ?>
  128.  
  129. <?php do_action( 'bp_after_members_loop' ) ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement