[support] Print 20 user prictures in a table

Sudheer Satyanarayana sudheer.s at binaryvibes.co.in
Thu Nov 15 14:16:57 UTC 2007


Abdu Rahiman wrote:
> Hi Sudheer,
>
> Hope U Got the code snippet
>
>   
Hi Abdu Rahiman,

Yes, I got it working. Thanks for the follow-up.

> ----- Original Message ----- 
> From: "Sudheer Satyanarayana" <sudheer.s at binaryvibes.co.in>
> To: <support at drupal.org>
> Sent: Thursday, November 01, 2007 4:11 PM
> Subject: [support] Print 20 user prictures in a table
>
>
>   
>> 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
>>
>>
>>     
>
>
> --------------------------------------------------------------------------------
>
>
>   
>> -- 
>> [ Drupal support list | http://lists.drupal.org/ ] 
>>     
>
>   

-- 
With Warm Regards,
Sudheer. S
http://www.binaryvibes.co.in



More information about the support mailing list