Advertisement
SRD75

members-directory

Dec 19th, 2021
1,138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 22.66 KB | None | 0 0
  1. <?php
  2.  error_reporting(0);
  3.  session_start();
  4. ?>
  5. <?php get_header();
  6.  
  7. //Pagination Class
  8.   class pagination
  9.   {
  10.  
  11.     /**
  12.      * Properties array
  13.      * @var array
  14.      * @access private
  15.      */
  16.     private $_properties = array();
  17.  
  18.     /**
  19.      * Default configurations
  20.      * @var array
  21.      * @access public
  22.      */
  23.     public $_defaults = array(
  24.       'page' => 1,
  25.       'perPage' => 20
  26.     );
  27.  
  28.     /**
  29.      * Constructor
  30.      *
  31.      * @param array $array   Array of results to be paginated
  32.      * @param int   $curPage The current page interger that should used
  33.      * @param int   $perPage The amount of items that should be show per page
  34.      * @return void
  35.      * @access public
  36.      */
  37.     public function __construct($array, $curPage = null, $perPage = null)
  38.     {
  39.       $this->array   = $array;
  40.       $this->curPage = ($curPage == null ? $this->defaults['page']    : $curPage);
  41.       $this->perPage = ($perPage == null ? $this->defaults['perPage'] : $perPage);
  42.     }
  43.  
  44.     /**
  45.      * Global setter
  46.      *
  47.      * Utilises the properties array
  48.      *
  49.      * @param string $name  The name of the property to set
  50.      * @param string $value The value that the property is assigned
  51.      * @return void
  52.      * @access public
  53.      */
  54.     public function __set($name, $value)
  55.     {
  56.       $this->_properties[$name] = $value;
  57.     }
  58.  
  59.     /**
  60.      * Global getter
  61.      *
  62.      * Takes a param from the properties array if it exists
  63.      *
  64.      * @param string $name The name of the property to get
  65.      * @return mixed Either the property from the internal
  66.      * properties array or false if isn't set
  67.      * @access public
  68.      */
  69.     public function __get($name)
  70.     {
  71.       if (array_key_exists($name, $this->_properties)) {
  72.         return $this->_properties[$name];
  73.       }
  74.       return false;
  75.     }
  76.  
  77.     /**
  78.      * Set the show first and last configuration
  79.      *
  80.      * This will enable the "<< first" and "last >>" style
  81.      * links
  82.      *
  83.      * @param boolean $showFirstAndLast True to show, false to hide.
  84.      * @return void
  85.      * @access public
  86.      */
  87.     public function setShowFirstAndLast($showFirstAndLast)
  88.     {
  89.         $this->_showFirstAndLast = $showFirstAndLast;
  90.     }
  91.  
  92.     /**
  93.      * Set the main seperator character
  94.      *
  95.      * By default this will implode an empty string
  96.      *
  97.      * @param string $mainSeperator The seperator between the page numbers
  98.      * @return void
  99.      * @access public
  100.      */
  101.     public function setMainSeperator($mainSeperator)
  102.     {
  103.       $this->mainSeperator = $mainSeperator;
  104.     }
  105.  
  106.     /**
  107.      * Get the result portion from the provided array
  108.      *
  109.      * @return array Reduced array with correct calculated offset
  110.      * @access public
  111.      */
  112.     public function getResults()
  113.     {
  114.       // Assign the page variable
  115.       if (empty($this->curPage) !== false) {
  116.         $this->page = $this->curPage; // using the get method
  117.       } else {
  118.         $this->page = 1; // if we don't have a page number then assume we are on the first page
  119.       }
  120.  
  121.       // Take the length of the array
  122.       $this->length = count($this->array);
  123.  
  124.       // Get the number of pages
  125.       $this->pages = ceil($this->length / $this->perPage);
  126.  
  127.       // Calculate the starting point
  128.       $this->start = ceil(($this->page - 1) * $this->perPage);
  129.  
  130.       // return the portion of results
  131.       return array_slice($this->array, $this->start, $this->perPage);
  132.     }
  133.  
  134.     /**
  135.      * Get the html links for the generated page offset
  136.      *
  137.      * @param array $params A list of parameters (probably get/post) to
  138.      * pass around with each request
  139.      * @return mixed  Return description (if any) ...
  140.      * @access public
  141.      */
  142.     public function getLinks($params = array())
  143.     {
  144.       // Initiate the links array
  145.       $plinks = array();
  146.       $links = array();
  147.       $slinks = array();
  148.  
  149.       // Concatenate the get variables to add to the page numbering string
  150.       $queryUrl = '';
  151.       if (!empty($params) === true) {
  152.         unset($params['page']);
  153.         $queryUrl = '&amp;'.http_build_query($params);
  154.       }
  155.  
  156.       // If we have more then one pages
  157.       if (($this->pages) > 1) {
  158.         // Assign the 'previous page' link into the array if we are not on the first page
  159.         if ($this->page != 1) {
  160.           if ($this->_showFirstAndLast) {
  161.             $plinks[] = ' <a href="?page=1'.$queryUrl.'">&laquo;&laquo; First </a> ';
  162.           }
  163.           $plinks[] = ' <a href="?page='.($this->page - 1).$queryUrl.'">&laquo; Prev</a> ';
  164.         }
  165.  
  166.         // Assign all the page numbers & links to the array
  167.         for ($j = 1; $j < ($this->pages + 1); $j++) {
  168.           if ($this->page == $j) {
  169.             $links[] = ' <a class="selected">'.$j.'</a> '; // If we are on the same page as the current item
  170.           } else {
  171.             $links[] = ' <a href="?page='.$j.$queryUrl.'">'.$j.'</a> '; // add the link to the array
  172.           }
  173.         }
  174.  
  175.         // Assign the 'next page' if we are not on the last page
  176.         if ($this->page < $this->pages) {
  177.           $slinks[] = ' <a href="?page='.($this->page + 1).$queryUrl.'"> Next &raquo; </a> ';
  178.           if ($this->_showFirstAndLast) {
  179.             $slinks[] = ' <a href="?page='.($this->pages).$queryUrl.'"> Last &raquo;&raquo; </a> ';
  180.           }
  181.         }
  182.  
  183.         // Push the array into a string using any some glue
  184.         return implode(' ', $plinks).implode($this->mainSeperator, $links).implode(' ', $slinks);
  185.       }
  186.       return;
  187.     }
  188.   }
  189.  
  190.  
  191. ?>
  192. <script type="text/javascript" src="<?php echo bloginfo( 'template_directory' ); ?>/js/jquery.members.js"></script>
  193.  
  194. <div id="bodyMain">
  195. <?php
  196.  
  197. ?>
  198. <div class="content">
  199.   <div class="leftBody">
  200.    
  201.     <!--<div class="img"></div>-->
  202.    
  203.     <div class="singleContent">
  204.       <?php
  205.         if (have_posts()) : while (have_posts()) : the_post();
  206.       ?>
  207.       <div>
  208.         <?php if(is_user_logged_in())   { ?>
  209.         <form action="<?php the_permalink(); ?>" method="post">
  210.           <div class="fieldSep">
  211.             <div id="KeywordSearch"> <b>Name:</b> <br />
  212.               <input type="text" name="key_search" class="inputtxtbox" value="<?php if(isset($_POST['searchMem']) && $_POST['search']=='SEARCH') echo $_POST['key_search'];  ?>" />
  213.             </div>
  214.             <div id="State"><b>State:</b><br />
  215.               <select name="stateList">
  216.                 <!--<option value="State" <?php if(isset($_POST['searchMem']) && $_POST['stateList']=='State') {?> selected="selected" <?php }?>>State</option>-->
  217.                 <option value="Any" <?php if(isset($_POST['searchMem']) && $_POST['stateList']=='Any') {?> selected="selected" <?php }?>>Any</option>
  218.                 <option value="NSW" <?php if(isset($_POST['searchMem']) && $_POST['stateList']=='NSW') {?> selected="selected" <?php }?>>NSW</option>
  219.                 <option value="VIC" <?php if(isset($_POST['searchMem']) && $_POST['stateList']=='VIC') {?> selected="selected" <?php }?>>VIC</option>
  220.                 <option value="QLD" <?php if(isset($_POST['searchMem']) && $_POST['stateList']=='QLD') {?> selected="selected" <?php }?>>QLD</option>
  221.                 <option value="SA" <?php if(isset($_POST['searchMem']) && $_POST['stateList']=='SA') {?> selected="selected" <?php }?>>SA</option>
  222.                 <option value="WA" <?php if(isset($_POST['searchMem']) && $_POST['stateList']=='WA') {?> selected="selected" <?php }?>>WA</option>
  223.                 <option value="NT" <?php if(isset($_POST['searchMem']) && $_POST['stateList']=='NT') {?> selected="selected" <?php }?>>NT</option>
  224.                 <option value="ACT" <?php if(isset($_POST['searchMem']) && $_POST['stateList']=='ACT') {?> selected="selected" <?php }?>>ACT</option>
  225.                 <option value="TAS" <?php if(isset($_POST['searchMem']) && $_POST['stateList']=='TAS') {?> selected="selected" <?php }?>>TAS</option>
  226.               </select>
  227.             </div>
  228.           </div>
  229.           <div class="clear"></div>
  230.           <div class="fieldSep">
  231.             <div style="line-height:26px;"> <b>Experience: </b> <br />
  232.               <div id="SelcetIcon">
  233.                 <input type="checkbox" class="styled" name="f_film" value="Featured Film" <?php if(isset($_POST['searchMem']) && $_POST['search']=='SEARCH' && $_POST['f_film'] == 'Featured Film' ) {?> checked="checked" <?php } ?> />
  234.                 Feature Film</div>
  235.               <div id="SelcetIcon">
  236.                 <input type="checkbox" class="styled" name="docum" value="Documentary" <?php if(isset($_POST['searchMem']) && $_POST['search']=='SEARCH' && $_POST['docum'] == 'Documentary' ) {?> checked="checked" <?php } ?>/>
  237.                 Documentary</div>
  238.               <div id="SelcetIcon">
  239.                 <input type="checkbox" class="styled" name="tel_drama" value="Television Drama" <?php if(isset($_POST['searchMem']) && $_POST['search']=='SEARCH' && $_POST['tel_drama'] == 'Television Drama' ) {?> checked="checked" <?php } ?>/>
  240.                 Television Drama</div>
  241.               <div id="SelcetIcon">
  242.                 <input type="checkbox" class="styled" name="tel_non_drama" value="Television Non-Drama" <?php if(isset($_POST['searchMem']) && $_POST['search']=='SEARCH' && $_POST['tel_non_drama'] == 'Television Non-Drama' ) {?> checked="checked" <?php } ?>/>
  243.                 Television Non-Drama</div>
  244.               <div id="SelcetIcon">
  245.                 <input type="checkbox" class="styled" name="commercial" value="Commercial" <?php if(isset($_POST['searchMem']) && $_POST['search']=='SEARCH' && $_POST['commercial'] == 'Commercial' ) {?> checked="checked" <?php } ?>/>
  246.                 Commercial</div>
  247.               <div id="SelcetIcon">
  248.                 <input type="checkbox" class="styled" name="s_film" value="Short Film" <?php if(isset($_POST['searchMem']) && $_POST['search']=='SEARCH' && $_POST['s_film'] == 'Short Film' ) {?> checked="checked" <?php } ?>/>
  249.                 Short Film</div>
  250.               <div id="SelcetIcon">
  251.                 <input type="checkbox" class="styled" name="m_video" value="Music Video" <?php if(isset($_POST['searchMem']) && $_POST['search']=='SEARCH' && $_POST['m_video'] == 'Music Video' ) {?> checked="checked" <?php } ?>/>
  252.                 Music Video</div>
  253.               <div class="clear"></div>
  254.             </div>
  255.           </div>
  256.           <div class="fieldSep">
  257.             <div style="line-height:26px;"> <b>Role:</b> <br />
  258.               <div id="SelcetIcon">
  259.                 <input type="checkbox" class="styled" name="editor" value="Editor" <?php if(isset($_POST['searchMem']) && $_POST['search']=='SEARCH' && $_POST['editor'] == 'Editor' ) {?> checked="checked" <?php } ?> />
  260.                 Editor</div>
  261.               <div id="SelcetIcon">
  262.                 <input type="checkbox" class="styled" name="assis_editor" value="Assistant Editor" <?php if(isset($_POST['searchMem']) && $_POST['search']=='SEARCH' && $_POST['assis_editor'] == 'Assistant Editor' ) {?> checked="checked" <?php } ?> />
  263.                 Assistant Editor</div>
  264.               <div id="SelcetIcon">
  265.                 <input type="checkbox" class="styled" name="online_editor" value="Online Editor" <?php if(isset($_POST['searchMem']) && $_POST['search']=='SEARCH' && $_POST['online_editor'] == 'Online Editor' ) {?> checked="checked" <?php } ?>  />
  266.                 Online Editor</div>
  267.               <div id="SelcetIcon">
  268.                 <input type="checkbox" class="styled" name="post_supervise" value="Post-Production Supervisor" <?php if(isset($_POST['searchMem']) && $_POST['search']=='SEARCH' && $_POST['post_supervise'] == 'Post-Production Supervisor' ) {?> checked="checked" <?php } ?> />
  269.                 Post Supervisor</div>
  270.               <div class="clear"> </div>
  271.             </div>
  272.           </div>
  273.           <div class="fieldSep">
  274.             <div style="line-height:26px;"> <b>Membership:</b> <br />
  275.               <div id="SelcetIcon">
  276.                 <input type="checkbox" class="styled" name="life" value="member_life" <?php if(isset($_POST['searchMem']) && $_POST['search']=='SEARCH' && $_POST['life'] == 'member_life' ) {?> checked="checked" <?php } ?> />
  277.                 Life</div>
  278.               <div id="SelcetIcon">
  279.                 <input type="checkbox" class="styled" name="full" value="member_full" <?php if(isset($_POST['searchMem']) && $_POST['search']=='SEARCH' && $_POST['full'] == 'member_full' ) {?> checked="checked" <?php } ?>  />
  280.                 Full</div>
  281.               <div id="SelcetIcon">
  282.                 <input type="checkbox" class="styled" name="accredited" value="member_accredited" <?php if(isset($_POST['searchMem']) && $_POST['search']=='SEARCH' && $_POST['accredited'] == 'member_accredited' ) {?> checked="checked" <?php } ?>/>
  283.                 Accredited</div>
  284.               <div id="SelcetIcon">
  285.                 <input type="checkbox" class="styled" name="associate" value="member_associate" <?php if(isset($_POST['searchMem']) && $_POST['search']=='SEARCH' && $_POST['associate'] == 'member_associate' ) {?> checked="checked" <?php } ?>/>
  286.                 Associate</div>
  287.               <div id="SelcetIcon">
  288.                 <input type="checkbox" class="styled" name="student" value="student" <?php if(isset($_POST['searchMem']) && $_POST['search']=='SEARCH' && $_POST['student'] == 'student' ) {?> checked="checked" <?php } ?> />
  289.                 Student</div>
  290.               <div class="clear"> </div>
  291.             </div>
  292.           </div>
  293.           <input type="submit" value="SEARCH" name="search" class="searchbtn" />
  294.           <input type="hidden" value="searchMem" name="searchMem" />
  295.         </form>
  296.         <?php }?>
  297.       </div>
  298.       <div class="clear"> </div>
  299.       <div id="membersList">
  300.         <?php
  301.           if(isset($_POST['searchMem']) && $_POST['search']=='SEARCH')      {
  302.  
  303.              if(!empty($_POST['key_search']) || !empty($_POST['f_film']) || !empty($_POST['docum']) || !empty($_POST['tel_drama']) || !empty($_POST['tel_non_drama']) || !empty($_POST['s_film'])||!empty($_POST['commercial'])||!empty($_POST['m_video'])||!empty($_POST['editor'])||!empty($_POST['assis_editor'])||!empty($_POST['online_editor'])||!empty($_POST['post_supervise'])|| $_POST['stateList'] != 'Any' || !empty($_POST['life']) || !empty($_POST['full']) || !empty($_POST['accredited']) || !empty($_POST['associate']) || !empty($_POST['student'])) {
  304.  
  305.             if( (isset($_POST['key_search']) || ($_POST['stateList'] != 'Any')) || (isset($_POST['f_film']) || isset($_POST['docum']) || isset($_POST['tel_drama'])|| isset($_POST['tel_non_drama']) || isset($_POST['s_film']) || isset($_POST['commercial']) || isset($_POST['m_video'])) || (isset($_POST['editor']) || isset($_POST['assis_editor']) || isset($_POST['online_editor']) || isset($_POST['post_supervise'])) || (isset($_POST['life']) || isset($_POST['full']) || isset($_POST['accredited']) || isset($_POST['associate']) || isset($_POST['student'])))    {
  306.  
  307.         $r = $wpdb->get_col("select meta_value from $wpdb->usermeta WHERE `meta_key` = 'mgm_member_options'");
  308.  
  309.         $total_items = 0;
  310.  
  311.               ?>
  312.         <div class="memberLabel"> <b>MEMBER</b> </div>
  313.         <?php
  314.  
  315.             foreach ( $r as $urR ) :
  316.  
  317.             $unserialize_meta = unserialize($urR);
  318.  
  319.             if(($unserialize_meta['membership_type'] == 'member_full' || $unserialize_meta['membership_type'] == 'member_associate' || $unserialize_meta['membership_type'] ==  'member_accredited' || $unserialize_meta['membership_type'] == 'member_life'  ||   $unserialize_meta['membership_type'] =='member_life_accredited') && $unserialize_meta['status'] == 'Active') {
  320.  
  321.  
  322.             if(is_array($unserialize_meta['custom_fields']['experience']) && is_array($unserialize_meta['custom_fields']['role']) ) {
  323.  
  324.             $user_id = get_userdata($unserialize_meta['id']);
  325.  
  326.  
  327.             if( (($unserialize_meta['custom_fields']['state']== $_POST['stateList']) &&
  328.  
  329.                  (strcasecmp($user_id->first_name,$_POST['key_search']) == 0) || (strcasecmp($user_id->last_name,$_POST['key_search']) == 0)) ||
  330.    
  331.                  (($_POST['stateList']== 'Any') &&
  332.    
  333.                  (strcasecmp($user_id->first_name,$_POST['key_search']) == 0) || (strcasecmp($user_id->last_name,$_POST['key_search']) == 0)) ||
  334.    
  335.                 ((in_array($_POST['f_film'],$unserialize_meta['custom_fields']['experience']) || in_array($_POST['docum'],$unserialize_meta['custom_fields']['experience'])|| in_array($_POST['tel_drama'],$unserialize_meta['custom_fields']['experience'])|| in_array($_POST['tel_non_drama'],$unserialize_meta['custom_fields']['experience'])|| in_array($_POST['s_film'],$unserialize_meta['custom_fields']['experience'])|| in_array($_POST['commercial'],$unserialize_meta['custom_fields']['experience'])|| in_array($_POST['m_video'],$unserialize_meta['custom_fields']['experience']))   ||
  336.    
  337.                 ( in_array($_POST['editor'],$unserialize_meta['custom_fields']['role']) || in_array($_POST['assis_editor'],$unserialize_meta['custom_fields']['role'])|| in_array($_POST['online_editor'],$unserialize_meta['custom_fields']['role'])|| in_array($_POST['post_supervise'],$unserialize_meta['custom_fields']['role']))
  338.    
  339.                 || ($unserialize_meta['membership_type'] == $_POST['life']|| $unserialize_meta['membership_type'] == $_POST['full'] || $unserialize_meta['membership_type'] == $_POST['accredited'] || $unserialize_meta['membership_type']==  $_POST['associate'] || $unserialize_meta['membership_type'] == $_POST['student']) )) {
  340.    
  341.    
  342.                 if($user_id->first_name != 'admin' || $user_id->last_name != 'admin' || $user_id->user_login != 'admin' || $user_id->first_name != '' || $user_id->last_name!= '')  {
  343.    
  344.                 $noMembers = 'noMembers';
  345.    
  346.                   $member_id[] = $unserialize_meta['id'];
  347.                 }
  348.             } else {
  349.                 $no_members = 'on';
  350.             }
  351.         }
  352.     }
  353.     endforeach;
  354.  
  355.         if ($no_members == 'on')    {
  356.  
  357.  
  358.             echo "<div class=".$noMembers." style=\"height:25px; padding:10px 0 0 5px;\">";
  359.  
  360.             echo "No Members Found.";
  361.  
  362.             echo "</div>";
  363.  
  364.  
  365.             }
  366.  
  367.  
  368.         foreach ($member_id as $member_id_value ) {
  369.  
  370.           $names[] = array(
  371.  
  372.             'memberID' => $member_id_value,
  373.  
  374.           );
  375.  
  376.         }
  377.  
  378.         // If we have an array with items
  379.         if (count($names)) {
  380.           // Create the pagination object
  381.           $pagination = new pagination($names, (isset($_GET['page']) ? $_GET['page'] : 1), 20);
  382.           // Decide if the first and last links should show
  383.           $pagination->setShowFirstAndLast(false);
  384.           // You can overwrite the default seperator
  385.           $pagination->setMainSeperator('');
  386.           // Parse through the pagination class
  387.           $memberPages = $pagination->getResults();
  388.  
  389.           $rowCount = 0;
  390.           // If we have items
  391.           if (count($memberPages) != 0) {
  392.             // Create the page numbers
  393.             $pageNumbers = '<div class="numbers">'.$pagination->getLinks($_GET).'</div>';
  394.             // Loop through all the items in the array
  395.             foreach ($memberPages as $memberArray) {
  396.  
  397.                 $rowCount++;
  398.  
  399.                 $user_id = get_userdata($memberArray['memberID']);
  400.  
  401.                 if($rowCount%2==0) echo "<div style=\"background-color:#FFF; height:25px; padding:5px 0 0 5px;\">";
  402.                     else echo "<div style=\"height:25px; padding:5px 0 0 5px;\">";
  403.  
  404.               // Show the information about the item
  405.               ?>
  406.         <a href="<?php echo site_url(); ?>/author?authorname=<?php if (is_user_logged_in()) { echo $memberArray['memberID']; } ?>">
  407.         <?php
  408.               echo '<b>'.$user_id->first_name.'</b>&nbsp;<b>'.$user_id->last_name.'</b>';
  409.               ?>
  410.         </a>
  411.         <?php
  412.  
  413.               if($rowCount%2==0) echo "</div>";
  414.                     else echo "</div>";
  415.  
  416.             }
  417.             // print out the page numbers beneath the results
  418.  
  419.             echo '<div class="no_display"></div>';
  420.  
  421.             echo $pageNumbers;
  422.           }
  423.         }
  424.  
  425.  
  426.     }
  427.  
  428.     } else  {
  429.             echo "No Fields Selected.";
  430.     }
  431.  
  432.     } else  {
  433.  
  434.         if(is_user_logged_in()) {
  435.           ?>
  436.         <div class="memberLabel"> <b>MEMBER</b> </div>
  437.         <?php
  438.  
  439.             $r = $wpdb->get_col("select meta_value from $wpdb->usermeta WHERE `meta_key` = 'mgm_member_options'");
  440.  
  441.             $rowCount = 0;
  442.  
  443.             foreach ( $r as $urR ) :
  444.  
  445.             $unserialize_meta = unserialize($urR);
  446.  
  447.     if(($unserialize_meta['membership_type'] == 'member_full' || $unserialize_meta['membership_type'] == 'member_associate' || $unserialize_meta['membership_type'] ==  'member_accredited' || $unserialize_meta['membership_type'] == 'member_life'  ||   $unserialize_meta['membership_type'] =='member_life_accredited') && $unserialize_meta['status'] == 'Active') {
  448.  
  449.         $user_id = get_userdata($unserialize_meta['id']);
  450.  
  451.                 if($user_id->first_name != 'admin' || $user_id->last_name != 'admin' || $user_id->user_login != 'admin' || $user_id->first_name != '' || $user_id->last_name!= '')  {
  452.  
  453.             $rowCount++;
  454.             $member_id[] = $unserialize_meta['id'];
  455.                ?>
  456.         <?php
  457.             }
  458.         }
  459.             endforeach;
  460.  
  461.  
  462.         foreach ($member_id as $member_id_value ) {
  463.  
  464.           $names[] = array(
  465.  
  466.             'memberID' => $member_id_value,
  467.  
  468.           );
  469.  
  470.         }
  471.  
  472.         // If we have an array with items
  473.         if (count($names)) {
  474.           // Create the pagination object
  475.           $pagination = new pagination($names, (isset($_GET['page']) ? $_GET['page'] : 1), 20);
  476.           // Decide if the first and last links should show
  477.           $pagination->setShowFirstAndLast(false);
  478.           // You can overwrite the default seperator
  479.           $pagination->setMainSeperator('');
  480.           // Parse through the pagination class
  481.           $memberPages = $pagination->getResults();
  482.  
  483.           $rowCount = 0;
  484.           // If we have items
  485.           if (count($memberPages) != 0) {
  486.             // Create the page numbers
  487.             $pageNumbers = '<div class="numbers">'.$pagination->getLinks($_GET).'</div>';
  488.             // Loop through all the items in the array
  489.             foreach ($memberPages as $memberArray) {
  490.  
  491.                 $rowCount++;
  492.  
  493.                 $user_id = get_userdata($memberArray['memberID']);
  494.  
  495.                 if($rowCount%2==0) echo "<div style=\"background-color:#FFF; height:25px; padding:5px 0 0 5px;\">";
  496.                     else echo "<div style=\"height:25px; padding:5px 0 0 5px;\">";
  497.  
  498.               // Show the information about the item
  499.               ?>
  500.         <a href="<?php echo site_url(); ?>/author?authorname=<?php if (is_user_logged_in()) { echo $memberArray['memberID']; } ?>">
  501.         <?php
  502.                      echo '<b>'.$user_id->first_name.'</b>&nbsp;<b>'.$user_id->last_name.'</b>';
  503.               ?>
  504.         </a>
  505.         <?php
  506.  
  507.               if($rowCount%2==0) echo "</div>";
  508.                     else echo "</div>";
  509.  
  510.             }
  511.  
  512.             echo '<div class="no_display"></div>';
  513.  
  514.              // print out the page numbers beneath the results
  515.             echo $pageNumbers;
  516.           }
  517.         }
  518.         }
  519.     }
  520.     ?>
  521.       </div>
  522.       <?php
  523.  
  524.         // the_content();
  525.  
  526.         endwhile;
  527.         endif;
  528.       ?>
  529.     </div>
  530.    
  531.     <!--</div> End of leftBody Class-->
  532.     <div class="clear"></div>
  533.   </div>
  534.  
  535.   <!--Changing Content End-->
  536.  
  537.   <div class="clear"></div>
  538. </div>
  539. <?php get_footer(); ?>
  540.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement