• 0

IPB 3.4 Show a default message when post is hidden to members


Question

IPB only shows unapproved/hidden/soft deleted content to members in the staff groups, but I would like to hack in a default message that shows to guests and members when a post is hidden via templates before we are forced to screw around with the SQL settings for hidden posts.

 

So here's what we have at the top of the post template (Topic View)

<if test="sDeleted:|:$post['post']['_isDeleted'] AND $post['post']['_softDeleteSee']">
{parse template="softDeletedPostBit" group="topic" params="$post, $displayData['sdData'], $topic"}
</if>
The softDeletedPostBit is completely ignored for non staff members, so I can't put anything in there using an if statement for it to show to other (non staff) groups.
 
Any help is appreciated :)
 
I found a way it could be done on 3.2 by adding a template and an if statement to parse it, but that doesn't work on 3.4 it creates a HTTP 500 error in IE or a blank page in Chrome.
<if test="sDeleted:|:$post['post']['_isDeleted'] AND $post['post']['_softDeleteSee']">
{parse template="softDeletedPostBit" group="topic" params="$post, $displayData['sdData'], $topic"}
                   <else />
                        {parse template="postHidden" group="topic"}</if> 
 
                </if>
postHidden template (data variable set to $post):
<if test="approveUnapprove:|:$post['post']['post_unapprove']">
<p class='desc'>The contents of this message has been hidden.</p>
Also tried using $post variable for postHidden and adding it to the <else /> statement like so:
 {parse template="postHidden" group="topic" params="$post"}

Also didn't work.

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

I have not tested this but what about something like this?

 

<if test="in_array( $this->memberData['member_group_id'], array( '3','6','7' ) )">
<if test="sDeleted:|:$post['post']['_isDeleted'] AND $post['post']['_softDeleteSee']">
Your message goes here!!!
{parse template="softDeletedPostBit" group="topic" params="$post, $displayData['sdData'], $topic"}
</if>
</if>

 

and change the 3, 6, 7 to what ever member groups you are wanting to show it too?

Link to comment
Share on other sites

  • 0

That didn't work, but if I did this:

 

<if test="sDeleted:|:$post['post']['_isDeleted'] AND $post['post']['_softDeleteSee']">

Your message goes here!!!

{parse template="softDeletedPostBit" group="topic" params="$post, $displayData['sdData'], $topic"}
<else />
<if test="in_array( $this->memberData['member_group_id'], array( '2','67','1' ) )">
Your message goes here!!!
</if>
</if>
 
I do get somewhat of a result in the correct member groups, only it looks like this (on every post) :p
 
 post-2-0-46107600-1384156770.png

The problem is the whole call softdeleted bit is ignored unless you are staff.

Link to comment
Share on other sites

  • 0

That didn't work, but if I did this:

<if test="sDeleted:|:$post['post']['_isDeleted'] AND $post['post']['_softDeleteSee']">

Your message goes here!!!

{parse template="softDeletedPostBit" group="topic" params="$post, $displayData['sdData'], $topic"}
<else />
<if test="in_array( $this->memberData['member_group_id'], array( '2','67','1' ) )">
Your message goes here!!!
</if>
</if>
 

I do get somewhat of a result in the correct member groups, only it looks like this (on every post) :p

 

 attachicon.gifSNAG-0000.png

The problem is the whole call softdeleted bit is ignored unless you are staff.

 

Hmm I'll look into it more for you.

  • Like 2
Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.