Forums

Unfortunately no one can be told what FluxBB is - you have to see it for yourself.

You are not logged in.

Announcement

FluxBB 1.5.6 and 1.4.12 released

These releases fix a security issue - please update your forums! Download links: v1.5.6 | v1.4.12

#1 2013-10-11 03:54:59

Squiggles
Member
Registered: 2012-12-14
Posts: 246

Display announcement for a single forum id?

I need to add an announcement in a classifieds section of my forum. I know how to add a site wide announcement but just need the bit of code that singles out a particular forum id.

Squiggles.

Offline

#2 2013-10-11 19:00:58

adaur
Developer
From: France
Registered: 2010-01-07
Posts: 675
Website

Re: Display announcement for a single forum id?

Hi Squiggles!

Quick & dirty one: header.php, find

<div id="announce" class="block">
	<div class="hd"><h2><span><?php echo $lang_common['Announcement'] ?></span></h2></div>
	<div class="box">
		<div id="announce-block" class="inbox">
			<div class="usercontent"><?php echo $pun_config['o_announcement_message'] ?></div>
		</div>
	</div>
</div>
<?php

replace with

<div id="announce" class="block">
	<div class="hd"><h2><span><?php echo $lang_common['Announcement'] ?></span></h2></div>
	<div class="box">
		<div id="announce-block" class="inbox">
			<div class="usercontent"><?php echo $pun_config['o_announcement_message'] ?></div>
		</div>
	</div>
</div>
<?php
if (basename($_SERVER['PHP_SELF']) == 'viewforum.php' && $id == YOUR_ID)
{
?>
<div id="announce" class="block">
	<div class="hd"><h2><span><?php echo $lang_common['Announcement'] ?></span></h2></div>
	<div class="box">
		<div id="announce-block" class="inbox">
			<div class="usercontent">Your awesome text</div>
		</div>
	</div>
</div>
<?php
}

Please excuse my bad english, I'm french tongue.

Offline

#3 2013-10-12 08:38:23

Squiggles
Member
Registered: 2012-12-14
Posts: 246

Re: Display announcement for a single forum id?

Thank you adaur, I'll give it a go tomorrow and report back with any problems.

Squiggles.

Offline

#4 2013-10-13 22:35:51

Squiggles
Member
Registered: 2012-12-14
Posts: 246

Re: Display announcement for a single forum id?

I got it working with the following code.

<?php
if ($_SERVER["PHP_SELF"] == '/forum/viewforum.php' && $id == 10 OR $id == 55)
include PUN_ROOT.'alerts/buy-swap-sell-notice.php';
	   ?>

I then included the alert / announcement in the /alerts directory.

Thanks again.

Squiggles.

Offline

Board footer

Powered by FluxBB 1.5.6