[support] Print 20 user prictures in a table

Abdu Rahiman abdurahiman at netlinkindia.com
Thu Nov 15 04:19:13 UTC 2007


Hi Sudheer,

Hope U Got the code snippet

----- 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/ ] 



More information about the support mailing list