Allow team table theming

ejort - July 9, 2007 - 15:07
Project:OG Teampage
Version:HEAD
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Description

Currently the team table that is output isn't passed through the Drupal theming system. I needed to theme the output of this module to match my site (changed to using a list and some CSS instead of tables) and came up with the attached patch to support theming the output generated by og_teampage_teamtable.

While I was editing the function I also rolled data retrieval in og_teampage_teamtable into a single query. One thing that I wasn't sure of though was the following code:

$res = db_query("SELECT * FROM {og_teampage_members} WHERE uid='".$account->uid."' AND gid='".$gid."'");
if (db_num_rows($res) < 1) {
$res = db_query("SELECT * FROM {og_teampage_members} WHERE uid='".$account->uid."' AND gid='0'");
}

I can't find where gid would be equal to 0? If it's still possible for gid to equal 0 then my change to the query is wrong.

Hopefully this helps integrate Drupal's theming capabilities into this module.

Regards,
Eric

AttachmentSize
og_teampage-theme.patch7.03 KB

#1

MartinSfromB - July 10, 2007 - 06:16

I can't find where gid would be equal to 0? If it's still possible for gid to equal 0 then my change to the query is wrong.

In some installations with first versions of og_teampage images were not be stored by team but by user, so the newer versions should search for such image-paths for a user=x and gid=0 (0=old default image).
There are some other worarounds for use of db entries of older versions. I think it's time to remove them.
I'll bring all together next 2 days, stay tuned!

#2

ejort - July 15, 2007 - 04:06

OK, I thought it must have been there for legacy reasons. In that case maybe you could write an update to change the database entries to be per user so that the current code isn't dealing with legacy issues?

Aside from that it would be great to get the theming changes in.

Eric

 
 

Drupal is a registered trademark of Dries Buytaert.