1

Topic: How i make the Announcement only show for a special usergroup!

Yeah is it possible to make so the Announcement only be visible for a certain usergroup.


And is it easy to make a certain usergroup having a bold username.

THANKS!

Re: How i make the Announcement only show for a special usergroup!

There's no built-in support for that, but you could create your own PHP-script. Something like this:

if ($pun_user['g_id'] == 4)  // Replace 4 with the id of the group in question
{
    // output your announcement markup here
}

And put this script it in the include/user/ folder and then include it from your template via pun_include.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

3

Re: How i make the Announcement only show for a special usergroup!

Rickard wrote:

There's no built-in support for that, but you could create your own PHP-script. Something like this:

if ($pun_user['g_id'] == 4)  // Replace 4 with the id of the group in question
{
    // output your announcement markup here
}

And put this script it in the include/user/ folder and then include it from your template via pun_include.

Well, I dont understand so much about what you said but i am going to try tongue

Thanks rickard !:P

Re: How i make the Announcement only show for a special usergroup!

Wouldn't it be easier to just replace

if ($pun_config['o_announcement'] == '1')

in header.php with

if ($pun_config['o_announcement'] == '1' && $pun_user['g_id'] == 4)

(assuming he doesn't want to specify the group on a per-announcement basis)

Looking for a certain modification for your forum? Please take a look here before posting.

5 (edited by srkris 2006-09-03 22:09)

Re: How i make the Announcement only show for a special usergroup!

I followed this approach but when I uploaded the modified files (main.php and the new one), nothing shows up on the index page, not even the forums.

So is this pun_include code correct?

<?php

if($pun_user['is_guest'])

{

<center><b>xyz</b></center>

}

?>

I dont know any php coding, so sorry if I sound like a rank noob.

Re: How i make the Announcement only show for a special usergroup!

No, that is not right. This should work though:

<?php

if($pun_user['is_guest'])

{

?>

<center><b>xyz</b></center>

<?php

}

?>
Looking for a certain modification for your forum? Please take a look here before posting.

Re: How i make the Announcement only show for a special usergroup!

Thanks a lot smile