Jump to content
WebFlake
  • 0

Post background per user group


Guest Angels

Question

Hi guys, I have come across a little conundrum. What I am trying to do is when a member of a certain group posts, I want it to display a certain post background. Now, I have the CSS written, but I am struggling a little with the PHP part. What I have so far is this, I am just unsure how to go about filling in the parts labelled with an 'X'.

 

<if test="X AND X">								<div class="post_body_admin">							</if> 
 
I assume that what I need is something along the lines of:
 
showacplink:|:$this->memberData['g_access_cp'] 

But I became a little stuck on how to set this so it only appears when an admin has posted, rather than when an admin views it, as such any help would be greatly appreciated, and thank you in advance.

Edited by Angels
Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

Sorry for the long reply... :P



For admins, that would be correct.

ACP > Look & Feel > Your Skin > Topic View > post

Find this:

<div class='post_body'>

 

For Admins only, add this directly below this:

<if test="showacplink:|:$this->memberData['g_access_cp'] AND !$this->settings['security_remove_acp_link']"><div class="post_body_admin">

 

Then find this:

           	 <if test="repButtonsLike:|: ! $topic['_isArchived']">                {parse template="repButtons" group="global_other" params="$post['author'], array_merge( array( 'primaryId' => $post['post']['pid'], 'domLikeStripId' => 'like_post_' . $post['post']['pid'], 'domCountId' => 'rep_post_' . $post['post']['pid'], 'app' => 'forums', 'type' => 'pid', 'likeFormatted' => $post['post']['like']['formatted'] ), $post['post'] )"}                </if>

 

And add this below:

 

</div></if>


Result:

Posted Image

 

If you want it to display for Moderators AND Admins, the <if> statement would be:

 

<if test="accessreports:|:$this->memberData['is_mod'] OR !empty($this->memberData['access_report_center']) || ($this->memberData['g_access_cp'] AND !$this->settings['security_remove_acp_link'])">

 

And for just Moderators, I think the <if> statement would be:

<if test="accessreports:|:$this->memberData['is_mod'] OR !empty($this->memberData['access_report_center']) ">

(haven't test, might be wrong.)

 

If you want it to display it for a certain group, use this:

 

<php>$groups = array(1, 2, 3, 5);</php>

 

Then go to ACP > Members > Member Groups.

Look at the left side for the ID number for each group.

Posted Image



and replace them with the ID's for the groups you want.

Then you would use this <if> statement:

 

<if test="in_array($this->memberData['member_group_id'],  $groups)"><div class="your_class_here">

If you need help, PM me and I'll try to help you with getting your results. :)

Need some IPB, MyBB, or HTML/CSS work done? Check out my thread!
:smiley:

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...