Jump to content



Photo

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


  • Please log in to reply
5 replies to this topic

#1 Steven P.

Steven P.

    aka Neobond

  • Tech Issues Solved: 55
  • Joined: 09-July 01
  • Location: Neowin HQ

Posted 10 November 2013 - 09:47

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.




#2 ho0kz

ho0kz

    Neowinian

  • Tech Issues Solved: 1
  • Joined: 23-September 13
  • Location: localhost
  • OS: Windows 8.1
  • Phone: HTC One

Posted 11 November 2013 - 01:36

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?



#3 OP Steven P.

Steven P.

    aka Neobond

  • Tech Issues Solved: 55
  • Joined: 09-July 01
  • Location: Neowin HQ

Posted 11 November 2013 - 07:59

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
 
 SNAG-0000.png

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



#4 ho0kz

ho0kz

    Neowinian

  • Tech Issues Solved: 1
  • Joined: 23-September 13
  • Location: localhost
  • OS: Windows 8.1
  • Phone: HTC One

Posted 11 November 2013 - 11:19

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.



#5 SmashT

SmashT

    Resident One Post Wonder

  • Joined: 01-April 07

Posted 06 January 2014 - 12:15

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



#6 OP Steven P.

Steven P.

    aka Neobond

  • Tech Issues Solved: 55
  • Joined: 09-July 01
  • Location: Neowin HQ

Posted 06 January 2014 - 12:21

Nope :(





Click here to login or here to register to remove this ad, it's free!