I know this is another dumb question...

How do I change the layout of blocks?

I'm building a phptemplate theme. It's going OK, but I can't figure out how to control blocks like 'My groups', 'Who's new' and 'Who's online'. Which php and CSS files should I configure?

Of course I can control most things with CSS, but to get breaks or put certain things in paragraphs or change titles (My groups -> Groups) etc. I probably need to add/change html somewhere.

One particular problem: 'Who's new' has pictures/avatars of the members, but they're all over the place. I need to find a way to put the names neatly next to or above their pictures. Probably a dreaded table...

Comments

angelopc’s picture

This is a little bit of primitive PHP code to get you started (for New Users):


$newMemberQuery = "SELECT uid, name FROM users ORDER BY users.uid DESC LIMIT 5";
$newMemberResults = mysql_query($newMemberQuery);
while($newMemberData = mysql_fetch_assoc($newMemberResults)) {
$newMemberID = $newMemberData['uid'];
$newMemberName = $newMemberData['name'];
$newMember = "<a href='http://www.angelopc.com/user/$newMemberID'>$newMemberName</a>&nbsp;&nbsp;";
print $newMember;
}

Thank you,
Ed Coyne
http://www.angelopc.com

davedelong’s picture

Wow, a topic 3 years old...

Couple things: when dealing with drupal tables, it's usually better to use the db_query() function instead of the built in php functions. db_query() adds some niftiness that you'd have to do manually otherwise (such as escaping, adding the proper prefix, etc).

Also, when building links, it's nicer to use the l() function instead of printing out a straight anchor tag. If the link gets changed or aliased to something else, l() will recognize that, whereas an anchor tag might not.

Dave

Get great Drupal hosting at MM Hosting. (I don't work for them; I'm just a very satisfied customer)