[support] Print 20 user prictures in a table
Sudheer Satyanarayana
sudheer.s at binaryvibes.co.in
Thu Nov 1 10:41:36 UTC 2007
Hello,
I am using the below code snippet to print the latest users with
pictures. Can some kind soul tell me how to modify the code snippet to
print last 20 users with pictures? I want to print 4 pictures in a row.
Hence the table would require 5 rows. I tried lot of permutations and
combinations to no avail.
Any help is appreciated.
<?php
//show user pictures ---------------------------
//Will only show those users who have a picture
$count = 4; //how many userpictures, edit this value
global $user;
$output = '<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0"
WIDTH="100%"><TR><TD ><center>';
$result = db_query_range("SELECT * FROM {users} as u where status=1
AND picture <> '' ORDER BY created DESC",0,$count);
while ($user_info = db_fetch_object($result)) {
$output .= '<a href="/user/'.$user_info->uid.'">
<img src="/'.$user_info->picture.'" hspace=0 height="90" ></a>';
}
$output .= '</center></TD></TR></TABLE>';
//------------------------------------------------------
print $output;
?>
You must be a registered user to view other users' profiles.
--
With Warm Regards,
Sudheer. S
http://www.binaryvibes.co.in
-------------- next part --------------
An embedded message was scrubbed...
From: MAILER-DAEMON at mailer2.myorderbox.com
Subject: failure notice
Date: 31 Oct 2007 13:56:16 -0000
Size: 4432
Url: http://lists.drupal.org/pipermail/support/attachments/20071101/01874947/attachment.eml
More information about the support
mailing list