Topic: Announcement on frontpage only

I would like an option to display an announcement only on the frontpage, not on every page - I find it extremely messy, and it's going to affect search engines negatively when they try to index the pages...

2 (edited by bobitt 2004-12-27 20:39)

Re: Announcement on frontpage only

i agree, it would be a nice option. Perhaps this would require pretty lot of coding though

Most people are other people. Their thoughts are someone else's opinions, their lives a mimicry, their passions a quotation - Oscar Wilde

3

Re: Announcement on frontpage only

In 1.2 it won't require any coding. Each page has a different id so you can just do this

#announce {DISPLAY: none}
#punindex #announce {DISPLAY: block}

That should make it vanish for all the pages and then turn it back on for the index page. It won't solve the search engine problem though unless they honour css which is doubtful.

Other than that it's a simple edit in header.php to make the output of the announcement conditional upon it being the index page.

Re: Announcement on frontpage only

Clever - but as you pointed out, it doesn't solve the search engine problem. And it's a waste of bandwidth wink

5

Re: Announcement on frontpage only

95% of the internet is a waste of bandwidth, a little more won't do any harm.

Re: Announcement on frontpage only

Good argument, but the search engine problem remains.

7

Re: Announcement on frontpage only

In 1.2 replacing this

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

with this

if ($pun_config['o_announcement'] == '1' && basename($_SERVER['PHP_SELF']) == "index.php")

does the trick.

I assume something similar works in PunBB 1.1.x