Jump to content

Hide all but first posts from guests?

Featured Replies

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.

 

try this class css and add 

diplay: none;

got to from setting and edit

you can also set

Permissions

  Minimum content count to see forum

37 minutes ago, sweethoney said:

got to from setting and edit

you can also set

Permissions

  Minimum content count to see forum

I have never check this. Seems useful! :) 

  • Author

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. 

you can try it less someone here can show u other wise

  • Author
8 hours ago, sweethoney said:

you can try it less someone here can show u other wise

I just looked and I don't see any way but to shut off all posts for guests, unless I'm missing something.

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

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.

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

  • Author

Yes exactly! Thank you so much for posting this. 

ight thanks for that i was trying to do the same so sorry for all my post!we got the right answer

@ajmboy would you be interested in helping with testing out a plugin I'm developing for this one?

  • Author
38 minutes ago, Nathan Explosion said:

@ajmboy would you be interested in helping with testing out a plugin I'm developing for this one?

Sure!

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)

  • Author
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!

Plugin submitted and pending approval:

 

Archived

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

Recently Browsing 0

  • No registered users viewing this page.