mnctigah

members-loop.php

Jan 16th, 2016
116
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php /* Querystring is set via AJAX in _inc/ajax.php - bp_dtheme_object_filter() */
  2.  
  3. if ( is_user_logged_in() == false )
  4. {
  5.     echo '<h2>Please login to see results</h2>';
  6.     return;
  7. }
  8. if ( current_user_can(EZ_XPF_SUBSCRIBER_MEMBER)  || current_user_can(EZ_XPF_FREE_MEMBER) )
  9. {
  10.     echo '<h2>Sorry, you do not have permission to access this page.</h2>';
  11.     return;
  12. }
  13. ?>
  14.  
  15.  
  16. <?php if (isset($_REQUEST["only_search_result"])) :?>
  17.  
  18. <?php do_action( 'bp_before_members_loop' ) ?>
  19.  
  20. <?php if ( bp_has_members( bp_ajax_querystring( 'members' ) ) ) : ?>
  21.  
  22.     <div id="pag-top" class="pagination">
  23.  
  24.         <div class="pag-count" id="member-dir-count-top">
  25.             <?php bp_members_pagination_count() ?>
  26.         </div>
  27.  
  28.         <div class="pagination-links" id="member-dir-pag-top">
  29.             <?php bp_members_pagination_links() ?>
  30.         </div>
  31.  
  32.     </div>
  33.  
  34.     <?php do_action( 'bp_before_directory_members_list' ) ?>
  35.     <?php
  36.     $first_letter = "";
  37.     ?>
  38.     <ul id="members-list" class="item-list">
  39.     <input type="button" name="smPrintSearchResult" onClick="return SubmitLongSearchForm('smPrintSearchResult');" value="Print This Search Result" />
  40.    
  41.     <?php
  42.     $user_role = GetS2memberInfoInLoop("Access Level Name");
  43.     if (current_user_can(EZ_XPF_DIRECTOR_MEMBER) || current_user_can(EZ_XPF_ADMINISTRATOR) || current_user_can(EZ_XPF_MD_MEMBER)){
  44.         echo  ' <input type="button" onClick="return SubmitLongSearchForm(\'smDownloadExcel\');" name="smDownloadExcel" value="Download Excel Spreadsheet" />';
  45.     }
  46.     if (current_user_can(EZ_XPF_ADMINISTRATOR)){
  47.         //echo  ' <input type="hidden" name="test" value="1" />';
  48.     }
  49.     ?>
  50.     <input type="hidden" name="memberdirectoryAction" id="memberdirectoryAction" value="" />
  51.     <script>
  52.     function SubmitLongSearchForm(action)
  53.     {
  54.         jQuery("#members-directory-form").attr("method","POST");
  55.         jQuery("#memberdirectoryAction").val(action);
  56.         jQuery("#members-directory-form").submit();
  57.         return false;
  58.     }
  59.     </script>
  60.    
  61.     <?php
  62.     if ($_REQUEST["is_show_member_profile"] == "1")
  63.     {
  64.         echo '<input type="hidden" name="show_profile" value="1"/>';
  65.     }
  66.     else
  67.     {
  68.         echo '<input type="hidden" name="show_profile" value="0"/>';
  69.     }
  70.    
  71.     if ((current_user_can(EZ_XPF_ADMINISTRATOR) ||
  72.         current_user_can(EZ_XPF_DIRECTOR_MEMBER) ||
  73.         current_user_can(EZ_XPF_MD_MEMBER)) && $_REQUEST["include_member_detail"] == "1")
  74.     {
  75.         echo '<input type="hidden" name="show_s2m" value="1"/>';
  76.     }
  77.     else
  78.     {
  79.         echo '<input type="hidden" name="show_s2m" value="0"/>';
  80.     }
  81.    
  82.     if ($_REQUEST["is_expired"] == "1")
  83.     {
  84.         echo '<input type="hidden" name="show_unexpired" value="1"/>';
  85.     }
  86.     elseif ($_REQUEST["is_expired"] == "0")
  87.     {
  88.         echo '<input type="hidden" name="show_unexpired" value="0"/>';
  89.     }
  90.    
  91.     ?>
  92.    
  93.     <?php while ( bp_members() ) : bp_the_member(); ?>
  94.        
  95.     <?php
  96.    
  97.     $user_role = GetS2memberInfoInLoop("Access Level Name");
  98.     if ($user_role == EZ_XPF_ADMINISTRATOR ||
  99.         $user_role == EZ_XPF_MD_MEMBER ||
  100.         $user_role == EZ_XPF_ASST_MEMBER ||
  101.         $user_role == EZ_XPF_SUBSCRIBER_MEMBER ||
  102.         $user_role == EZ_XPF_SWAPSHOP_MEMBER)
  103.         continue;
  104.    
  105.     ?>
  106.         <li>
  107.             <!--<div class="item-avatar">
  108.                 <a href="<?php bp_member_permalink() ?>"><?php bp_member_avatar() ?></a>
  109.             </div>-->
  110.  
  111.             <div class="item" style="clear: both;">
  112.             <?php
  113.                
  114.                 $ref = get_user_reference_in_profile_loop();
  115.                 //print_r($ref);
  116.                 if (current_user_can(EZ_XPF_MD_MEMBER) || current_user_can(EZ_XPF_ADMINISTRATOR) || current_user_can(EZ_XPF_DIRECTOR_MEMBER))
  117.                 {
  118.                     foreach ($ref as $key => $value)
  119.                     {
  120.                         $ref[$key] = 0;
  121.                     }
  122.                 }
  123.                 $member_id = GetS2memberInfoInLoop( 'Member #' );
  124.                
  125.                
  126.             $name = GetS2memberInfoInLoop("EZ Member Name");
  127.            
  128.             $street1 = get_buddypress_profile_by_user_loop( EZ_XPF_STREET_ADDRESS ) . ", ";
  129.             if ($ref["hide_street1"] == 1)
  130.                     $street1 = "";
  131.             $street2 = get_buddypress_profile_by_user_loop( EZ_XPF_STREET_ADDRESS_2 );
  132.             if ($ref["hide_street2"] == 1)
  133.                 $street2 = "";
  134.             $city = get_buddypress_profile_by_user_loop( EZ_XPF_CITY ) . ", ";
  135.             if ($ref["hide_city"] == 1)
  136.                 $city = "";
  137.             $state = get_buddypress_profile_by_user_loop( EZ_XPF_STATE ) . ", ";
  138.             if ($ref["hide_state"] == 1)
  139.                 $state = "";
  140.             $zip = get_buddypress_profile_by_user_loop( EZ_XPF_ZIPCODE ) . ", ";
  141.             if ($ref["hide_zip"] == 1)
  142.                 $zip = "";
  143.                
  144.             if ($ref["hide_all"] == 1)
  145.             {
  146.                 if (current_user_can(EZ_XPF_ADMINISTRATOR) || current_user_can(EZ_XPF_MD_MEMBER)){
  147.                     ?><h5><a href="<?php echo bp_member_permalink() . "profile/edit/group/1";?>"><?php echo trim($name," &");?></a></h5><br><?php }
  148.                 else {
  149.                     echo "<h5>".trim($name," &") . "</h5><br>"; }
  150.             }
  151.             else
  152.             {          
  153.                 if (current_user_can(EZ_XPF_ADMINISTRATOR) || current_user_can(EZ_XPF_MD_MEMBER)){
  154.                     ?><h5><a href="<?php echo bp_member_permalink() . "profile/edit/group/1";?>"><?php echo trim($name," &");?></a></h5><br><?php }
  155.                 else {
  156.                     echo "<h5>".trim($name," &") . "</h5><br>"; }
  157.                
  158.                 $temp = trim($street1 . " " . $street2 . ", " .$city . " " . $state . " " . $zip ." ". get_buddypress_profile_by_user_loop( EZ_XPF_COUNTRY ));
  159.                 $temp = trim($temp);
  160.                 $temp = preg_replace('/\s*,\s*,\s*/',', ',$temp);
  161.                 $temp = trim($temp,', ');
  162.                 if ($temp != "")
  163.                 {
  164.                     echo $temp . "<br>";
  165.                 }
  166.                
  167.                 $temp = trim(get_buddypress_profile_by_user_loop( EZ_XPF_CAMPER_YEAR ) . " " . get_buddypress_profile_by_user_loop( EZ_XPF_CAMPER_MAKE ) . " " . get_buddypress_profile_by_user_loop( EZ_XPF_CAMPER_MODEL ));
  168.                 //var_dump($temp);exit;
  169.                 if ($temp != "")
  170.                 {
  171.                     echo $temp . "<br>";
  172.                 }
  173.                 $temp = "";
  174.                
  175.                 if ($ref["hide_phone1"] == 0)
  176.                     $temp = get_buddypress_profile_by_user_loop(EZ_XPF_PHONE);
  177.                 if ($ref["hide_phone2"] == 0)
  178.                     $temp .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" . get_buddypress_profile_by_user_loop(EZ_XPF_PHONE2);
  179.                 $temp = trim($temp);
  180.                
  181.                 if ($temp != "")
  182.                 {
  183.                     echo $temp . "<br>";
  184.                 }
  185.                 $temp = "";
  186.                
  187.                 if ($ref["hide_email1"] == 0 && GetS2memberInfoInLoop( 'Has Email' ) != "NO")
  188.                     $temp = get_buddypress_profile_by_user_loop( EZ_XPF_EMAIL );
  189.                 if ($ref["hide_email2"] == 0 && $temp != "")
  190.                     $temp .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" . get_buddypress_profile_by_user_loop( EZ_XPF_EMAIL2 );
  191.                 elseif ($ref["hide_email2"] == 0 && $temp == "")   
  192.                     $temp .= get_buddypress_profile_by_user_loop( EZ_XPF_EMAIL2 );                 
  193.                 $temp = trim($temp);
  194.                 if ($temp != "")
  195.                 {
  196.                     echo $temp . "<br>";
  197.                 }
  198.                 $temp = "";
  199.                
  200.                 $profile = get_buddypress_profile_by_user_loop( EZ_XPF_PROFILE_INFO );
  201.                 if (isset($_REQUEST["is_show_member_profile"]))
  202.                     echo "Profile: ". str_replace("\\\"",'&quot;',str_replace("\\'",'&apos;',$profile));
  203.                
  204.                 if ($_REQUEST["include_member_detail"] == 1 && (current_user_can(EZ_XPF_ADMINISTRATOR) ||
  205.                     current_user_can(EZ_XPF_DIRECTOR_MEMBER) ||
  206.                     current_user_can(EZ_XPF_MD_MEMBER)))
  207.                 {
  208.                     echo '<table class="search_table">
  209.                         <tr>
  210.                             <td>Member #: ' . GetS2memberInfoInLoop( 'Member #' ).'</td>
  211.                             <td>Member Type: '. GetS2memberInfoInLoop( 'Member Type' ) .'</td>
  212.                         </tr>
  213.                         <tr>
  214.                             <td>Username: ' . GetS2memberInfoInLoop( 'Username' ) .'</td>
  215.                             <td>Has Email: ' . GetS2memberInfoInLoop( 'Has Email' ).'</td>
  216.                         </tr>
  217.                         <tr>
  218.                             <td>Exp Date: ' . GetS2memberInfoInLoop( 'Exp Date' ).'</td>
  219.                             <td>Join Date: ' . GetS2memberInfoInLoop( 'Join Date' ).'</td>
  220.                         </tr>
  221.                         <tr>
  222.                             <td>Last Expire Update: ' . GetS2memberInfoInLoop( 'Last Expire Update' ).'</td>
  223.                             <td>Last Record Update: ' . GetS2memberInfoInLoop( 'Last Record Update' ).'</td>
  224.                         </tr>
  225.                         <tr>
  226.                             <td colspan="2">Member Requests: ' .get_buddypress_profile_by_user_loop( EZ_XPF_SPECIAL_REQUEST ).'</td>
  227.                         </tr>
  228.                         <tr>
  229.                             <td colspan="2">Admin Comments: ' .GetS2memberInfoInLoop( "Comments" ).'</td>
  230.                         </tr>
  231.                     </table>';
  232.                    
  233.                 }              
  234.             }
  235.             ?>
  236.                
  237.                
  238.                 <div class="item-meta"><span class="activity"><?php //bp_member_last_active() ?></span></div>
  239.  
  240.                 <?php do_action( 'bp_directory_members_item' ) ?>
  241.  
  242.             </div>
  243.  
  244.             <div class="action">
  245.  
  246.                 <?php //do_action( 'bp_directory_members_actions' ); ?>
  247.  
  248.             </div>
  249.  
  250.             <div class="clear"></div>
  251.         </li>
  252.  
  253.     <?php endwhile; ?>
  254.     </ul>
  255.  
  256.     <?php do_action( 'bp_after_directory_members_list' ) ?>
  257.  
  258.     <?php bp_member_hidden_fields() ?>
  259.  
  260.     <div id="pag-bottom" class="pagination">
  261.  
  262.         <div class="pag-count" id="member-dir-count-bottom">
  263.             <?php bp_members_pagination_count() ?>
  264.         </div>
  265.  
  266.         <div class="pagination-links" id="member-dir-pag-bottom">
  267.             <?php bp_members_pagination_links() ?>
  268.         </div>
  269.  
  270.     </div>
  271.  
  272. <?php else: ?>
  273.  
  274.     <div id="message" class="info">
  275.         <p><?php _e( "Sorry, no members were found.", 'buddypress' ) ?></p>
  276.     </div>
  277.  
  278. <?php endif; ?>
  279.  
  280. <?php do_action( 'bp_after_members_loop' ) ?>
  281. <?php endif;?>
RAW Paste Data