1 (edited by Audiofeeline 2010-08-23 20:55)

Topic: [Solved] No announcement for logged users

Hi all!
I use "announcement" to display ads but I would to find something to hide it for logged users.
Is there a way to hide "announcement" for those?
Thanks!

Re: [Solved] No announcement for logged users

Probably would be an attractive feature as it's a good incentive to register...

3

Re: [Solved] No announcement for logged users

Replacing
header.php, line 176

$gen_elements['<!-- forum_announcement -->'] = ($forum_config['o_announcement'] == '1' && $forum_user['g_read_board'] == '1') ? '<div id="brd-announcement" class="gen-content">'.($forum_config['o_announcement_heading'] != '' ? "\n\t".'<h1 class="hn"><span>'.$forum_config['o_announcement_heading'].'</span></h1>' : '')."\n\t".'<div class="content">'.$forum_config['o_announcement_message'].'</div>'."\n".'</div>'."\n" : '';

With

$gen_elements['<!-- forum_announcement -->'] = ($forum_config['o_announcement'] == '1' && $forum_user['g_read_board'] == '1' && $forum_user['username'] == 'Anonymous') ? '<div id="brd-announcement" class="gen-content">'.($forum_config['o_announcement_heading'] != '' ? "\n\t".'<h1 class="hn"><span>'.$forum_config['o_announcement_heading'].'</span></h1>' : '')."\n\t".'<div class="content">'.$forum_config['o_announcement_message'].'</div>'."\n".'</div>'."\n" : '';

Should work  smile

Eraversum - scifi browser-based online webgame

Re: [Solved] No announcement for logged users

It doesn't work, there's no announcement anymore with that code.  smile

5

Re: [Solved] No announcement for logged users

That's weird... worked fine on localhost  neutral

Eraversum - scifi browser-based online webgame

Re: [Solved] No announcement for logged users

I tried again, it really doesn't work...  neutral

7 (edited by Huuuze 2010-08-21 14:35)

Re: [Solved] No announcement for logged users

FYI, for this code to work in 1.3, you need to do the following on Line 176 of header.php:

$gen_elements['<!-- forum_announcement -->'] = ($forum_config['o_announcement'] == '1' && $forum_user['g_read_board'] == '1' && $forum_user['username'] == 'Guest') ? '<div id="brd-announcement" class="gen-content">'.($forum_config['o_announcement_heading'] != '' ? "\n\t".'<h1 class="hn"><span>'.$forum_config['o_announcement_heading'].'</span></h1>' : '')."\n\t".'<div class="content">'.$forum_config['o_announcement_message'].'</div>'."\n".'</div>'."\n" : '';

8

Re: [Solved] No announcement for logged users

@Huuuze: Ah, haven't thought about another possible Guest aliases...

So, this code, should work for everyone (no matter how is his "guest" called)
[code=php]$gen_elements['<!-- forum_announcement -->'] = ($forum_config['o_announcement'] == '1' && $forum_user['g_read_board'] == '1' && $forum_user['group_id'] == 2) ? '<div id="brd-announcement" class="gen-content">'.($forum_config['o_announcement_heading'] != '' ? "\n\t".'<h1 class="hn"><span>'.$forum_config['o_announcement_heading'].'</span></h1>' : '')."\n\t".'<div class="content">'.$forum_config['o_announcement_message'].'</div>'."\n".'</div>'."\n" : '';[/code]

Eraversum - scifi browser-based online webgame

9 (edited by Audiofeeline 2010-08-23 20:55)

Re: [Solved] No announcement for logged users

Thanks, now it works !  big_smile