Viewtopic - Changing layout depending on usertype

Temporary forum to obtain support for MODs/Styles while phpbb.com is down
Locked
User avatar
Adzyboy
Registered User
Posts: 3
Joined: Wed Oct 22, 2003 12:44 pm
Location: Burnley, England
Contact:

Viewtopic - Changing layout depending on usertype

Post by Adzyboy » Fri Feb 06, 2009 12:10 am

Hey there,
there's something I've been trying to figure out for a while now. The profile bit (avatar, username, rank etc) in a post in viewtopic.. I have been trying to figure out how to change how that is laid out depending on if the user who posted the post, is an admin/mod or regular user.

I thought at first I could just use the <!-- IF U_ACP --> or <!-- IF U_MCP -->, but ofcourse, that changes how it looks depending on the user viewing the post. I'm trying to work out how to do it depending on the user who posted the post.

I know how to send stuff off to the template and know quite a bit about php, and that you use $auth->acl_get('a_') to check if the user is admin, but I'm not sure how to do it so I could just simply in the template put: <!-- IF USER_ADMIN or USER_MOD -->layout1<!-- ELSE -->layout2<!-- ENDIF -->

I have a feeling I could use the USER_COLOR bit, but can't figure out where the code for that is. I'm gonna keep looking around the files for something that could help, but thought I'd post this here to help me so I wouldn't have to spend the next several hours checking through all the functions.

Cheers :)

ToonArmy
Registered User
Posts: 335
Joined: Fri Mar 26, 2004 7:31 pm
Location: Bristol, UK
Contact:

Re: Viewtopic - Changing layout depending on usertype

Post by ToonArmy » Fri Feb 06, 2009 1:51 am

Teh Pink Box™ wrote:While phpBB.com is offline, support related to styles themselves (code questions, "How do I do XYZ?", etc.) should be asked in the temporary MOD/Styles support forums
Moving ;)
Chris SmithBlogXMOOhlohArea51WikiNo support via PM/IM
Image

User avatar
Adzyboy
Registered User
Posts: 3
Joined: Wed Oct 22, 2003 12:44 pm
Location: Burnley, England
Contact:

Re: Viewtopic - Changing layout depending on usertype

Post by Adzyboy » Fri Feb 06, 2009 2:49 am

Ah sorry, weren't sure which to put it in. I've figured out I can do it using the following:

Code: Select all

<!-- IF postrow.POSTER_ID eq 2 or postrow.POSTER_ID eq 3 -->layout1<!-- ELSE -->layout2<!-- ENDIF -->
Replacing the numbers with the user-ids of the staff, but it ends up a bit long winded, just hoping for a quicker way. But it works for now.

Locked