View Single Post
  #4  
Old 04-04-2012, 06:40 AM
StarGirl's Avatar
StarGirl StarGirl is offline
Member
 
Join Date: Feb 2012
Posts: 45
Gender: Female
Credits: 11,789
StarGirl is on a distinguished road
Default

I already fixed the showing up twice problem by changing it to..
Code:
	// We did not specify a user, so show the memberlist
	$article_title = "Memberlist";
	$article_content = "Here are all of the members of this site, sorted by registration date.<br /><br />";
    include("classes/class_pagination.php");
    include("css/pagination.css");
	$query = "SELECT * FROM {$prefix}users ORDER BY uid ASC";
	$stmt = $adopts->query($query);
	$rowsperpage = 15;
    $pagination = new Pagination($adopts, $query, $rowsperpage, "http://{$domain}{$scriptpath}/profile.php");
    $pagination->setPage($_GET[page]);

	$query = "SELECT * FROM {$prefix}users ORDER BY uid ASC LIMIT {$pagination->getLimit()},{$rowsperpage}";  
	$stmt = $adopts->query($query);

	while ($row = $stmt->fetchObject()){
		$status = cancp($row->usergroup);
        $star = ($status == "yes")?"<img src='icons/star-rating-full.png' border=0' width='15' length='15' /> ":"";
        
        $getavatar = "SELECT * FROM {$prefix}users_profile ORDER BY uid ASC LIMIT {$pagination->getLimit()},{$rowsperpage}";  
	$stmt2 = $adopts->query($getavatar);

	while ($avatarrow = $stmt2->fetchObject()){
	$avatar = ($avatarrow->avatar);
	}
	
		$article_content .= "<strong><a href='profile.php?user={$row->username}'>{$star}<img src='{$avatar}' width='25' length='25'>{$row->username}</a></strong><br />";
	}
	$article_content .= "<br />{$pagination->showPage()}";

}
Now the users are shown once, all have avatars next to them, but all the avatars shown are the same, and that avatar is the one of the newest user (last one on the list).
Reply With Quote