6 posts in this topic

Posted

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.

1 person likes this

Share this post


Link to post
Share on other sites

Posted

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?

Share this post


Link to post
Share on other sites

Posted

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.

Share this post


Link to post
Share on other sites

Posted

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.

2 people like this

Share this post


Link to post
Share on other sites

Posted

Any luck with this? I've been looking for something similar for a while now.

Share this post


Link to post
Share on other sites

Posted

Nope :(

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.