• Resolved Kettercat

    (@kettercat)


    Hey everyone,

    I have a page that shows a list of users that have registered to the site: it’s a grid of their images and each image links to the profile page.

    For some reason the list shows up blank all of a sudden:
    http://uv-tlv.com/%D7%94%D7%A8%D7%A9%D7%99%D7%9E%D7%94-%D7%A9%D7%9C%D7%9B%D7%9D/

    Here’s the page’s code:

    <?php
    /* Template Name: Your List */
    get_header();
    ?>
    
    <div id="content" class="auhtor clearfix row-fluid">
      <div id="main" class="span5 clearfix" role="main">
        <?php get_template_part('module-list-right') ?>
      </div>
      <div class="span7 one-col-center list-left">
        <div class="list_nav">
          <?php wp_nav_menu(array('theme_location' => 'list', 'container' => false)); ?>
        </div>
        <div class="list_wrap"> 
    
          <!-- site author list -->
          <div class="mylist clearfix">
            <div id="content" role="main">
            <div class="clearfix">
    
     <!-- <?php echo "total_users: $total_users, offset: $offset, paged: $paged"; ?> --> 
    
              <?php
    
    			$number 	= 850;
    			$paged 		= (get_query_var('paged')) ? get_query_var('paged') : 1;
    			$offset 	= ($paged - 1) * $number;
    			$users 		= get_users();
    			$query 		= get_users('&role=subscriber&orderby=ID&order=DESC&offset='.$offset.'&number='.$number);
    			$total_users = count($users);
    			$total_query = count($query);
    			$total_pages = intval($total_users / $number) + 1;
    
    			foreach($query as $user) { ?>
              <?php
                if(get_user_meta( $user->ID, 'wp-approve-user', true )) {
    		$list = types_render_usermeta_field( 'userlist', array( 'user_id' => $user->ID ) );
    			if(!!$list) {
    				?>
              <article id="author-<?php echo $user->ID; ?>" class="clearfix list_article" role="article">
                <div class="tape"></div>
                <?php
            // regular expression:
            $matchSrc = "/src=[\"' ]?([^\"' >]+)[\"' ]?[^>]*>/i" ;
            // get the <img src="... from the plugin, via one on various methods explained in the documentation...
            $avatar = get_avatar($user->ID); // for example
    
            // preg match to extract the src= bit
            preg_match($matchSrc, $avatar, $matches);
            $theImageUrl = $matches[1];
    		$theImageUrl = str_replace('.thumbnail', '', $theImageUrl);
           ?>
                <img src="<?php bloginfo('template_url') ?>/timthumb/timthumb.php?w=150&h=150&src=<?php echo $theImageUrl ?>" />
                <?php //userphoto_thumbnail($user->ID); ?>
                <h4 style="display: none"> <a href="<?php echo get_author_posts_url($user->ID) ?>" target="_blank"> <span class="listtitle"><?php echo $user->display_name ?> </span></a> </h4>
              </article>
              <?php
    			}
    		}
    	} 
    
    			?></div>
     <?php
    				if ($total_users > $total_query) {
    					echo '<div id="pagination" class="clearfix pagination">';
    					  $current_page = max(1, get_query_var('paged'));
    					  echo paginate_links(array(
    							'base' => get_pagenum_link(1) . '%_%',
    							'format' => 'page/%#%/',
    							'current' => $current_page,
    							'total' => $total_pages,
    							'prev_next'    => true,
    							'prev_text'    => ' ',
    							'next_text'    => ' ',
    							'type'         => 'list',
    					    ));
    					echo '</div>';
    				}
    			?>
    
            </div>
          </div>
        </div>
      </div>
      <!-- end #main -->
    </div>
    <!-- end #content -->
    
    <?php get_footer(); ?>

    What could be the reason?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Kettercat

    (@kettercat)

    I am seeing some images, and other squares look like blank Post-It notes with some characters on it, a red check mark, and “The List”.

    Is this what you are seeing as well? Some pictures showing and some not? Is this what you mean when you say “blank”? Or are you not seeing any images, either pictures or Post-It notes?

    Thread Starter Kettercat

    (@kettercat)

    Hey tbennettcc, thanks for your reply!
    Yeah, that’s what I see and that’s what I was supposed to see – it showed nothing at first. I accidentally bumped this thread but it’s been fixed now, thanks a lot anyway 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Show list of users’ is closed to new replies.