Jump to content

Hide all but first posts from guests?


AlexWebsites

Recommended Posts

Posted

Does anyone know if in 4.1 there is a way or a plugin available that will allow you to show only the first post to guests and the additional would be hidden. I have been using Wolfie's mod for version 3, and have not upgraded the site yet to version 4 that I'm using it on.

 

Posted

Thanks for posting this. I want to be able to show the first post only to guests and search engines. The remainder hidden unless logged in.

Using the permission settings will hide all posts to guests I believe. 

Posted

got to one of your forums and just edit the permission guest so they can see the forum if that's what you mean..so if you want the guest to only see a forum that you want and the others they can intill they sing up

Posted
7 hours ago, sweethoney said:

got to one of your forums and just edit the permission guest so they can see the forum if that's what you mean..so if you want the guest to only see a forum that you want and the others they can intill they sing up

The requirement is that he allows guests to view the forum, and its topics.....but within the topic the guest can only read the first post. All other posts cannot be read by the guest....so they have to login. Like so:

Screenshot_2.png

It can't be done with the IPS software 'out of the box' and would need a plugin, or a theme edit, to achieve this (just like with IPB 3.4.x, which is where the above screenshot is taken...uses a hook called HidePost) and none of your suggestions will make it work like that.

Posted

Edit your theme, specifically forums -> front -> topics -> post

Locate:

			{$comment->content()|raw}
			{{if $comment->editLine()}}
				{$comment->editLine()|raw}
			{{endif}}

Enclose it with an if/else/endif that checks for group membership and to see if the post is NOT the first in the topic:

{{if \IPS\Member::loggedIn()->member_id === NULL and !$comment->mapped('first')}}
	NOPE!!!! You're a guest so you're not reading this!!!
{{else}}
			{$comment->content()|raw}
			{{if $comment->editLine()}}
				{$comment->editLine()|raw}
			{{endif}}
{{endif}}

and save.

Screenshot_3.png

Posted

Cool - will send over an xml file for you to try, once I'm done with my testing. It's pretty basic, just following the dev docs guide on creating one...but at least you'll be able to modify the message without having to edit the theme each time (and obviously, won't need to put the theme edit in there in the first place)

Posted
3 hours ago, Nathan Explosion said:

Cool - will send over an xml file for you to try, once I'm done with my testing. It's pretty basic, just following the dev docs guide on creating one...but at least you'll be able to modify the message without having to edit the theme each time (and obviously, won't need to put the theme edit in there in the first place)

Sounds great!

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...