TinyPortal

Development => Block Codes => Topic started by: diegolyanky on October 16, 2013, 09:08:57 PM

Title: Show block only to certain groups count based
Post by: diegolyanky on October 16, 2013, 09:08:57 PM
Hi:

I need to show one block, only to members into groups based in the count of posts. How can I do this ?

Actually, only can select users in aditional membergroups...

Using TP 1.0 and SMF 1.1.11

Thanks !
Title: Re: Show block only to certain groups count based
Post by: IchBin on October 16, 2013, 10:05:40 PM
Sorry, but Tinyportal does not use post count groups for permissions.
Title: Re: Show block only to certain groups count based
Post by: ramon.cutanda on July 15, 2021, 12:30:50 PM
Hi,

I am looking for exactly the same thing: to show a block ONLY TO USERS WITH NO POSTS with some guidance/instructions on how to make their first post. I see this post is 8 years old and I was wondering if there has been any change since then to make it possible now. Thank you.
Title: Re: Show block only to certain groups count based
Post by: @rjen on July 15, 2021, 03:16:07 PM
No, nothing has changed in that respect, BUT there is a way to do what you want, by using a php block...

This is mentioned here: https://www.tinyportal.net/index.php?topic=14391.msg120508#msg120508

I have a block that is only showing to users with 0 posts, seems pretty much what you want to do:

1. Create a php block, and set the frame options to : Do not use title/frame styles
(this is important, because you don't want the users with posts to see the empty block...
2. Choose the membergroups that will able to see this block. : make the selection out of the regular groups
3. Insert this code in the php block (change the text as you like of course..):


global $user_info;

if($user_info['posts'] < 1)

echo'
<div class="roundframe">
<div style="padding: 0 8px;">
<b>Take notice:</b>
You have not yet introduced yourself on the forum: before you can post messages it is necessary to introduce yourself. You can introduce yourself in this board: <a href="/index.php?board=1.0"><b><u>Forum > Introductions</u></b></a>.<br><br><b>Only after introducing yourself you can also post messages in the other boards and respond to messages</b>.
</div>
</div>';
Title: Re: Show block only to certain groups count based
Post by: Skb on July 23, 2021, 09:29:09 AM
Will the Zero post count member see only this 1 Block, or will see the rest of the blocks as well.
Title: Re: Show block only to certain groups count based
Post by: @rjen on July 23, 2021, 09:56:06 PM
Quote from: Skb on July 23, 2021, 09:29:09 AM
Will the Zero post count member see only this 1 Block, or will see the rest of the blocks as well.

This check is only made in the one block, so they will see all other block as normal