Topic: Second Announcement for group
before we start I just want to say that I have minimal knowlage with php but I learn.
I have been trying to get a second Announcement to show on my website.
So far I have manage to get 2 announcements there. But if I disabled one, the other one gets removed too
I started by inserting 2 new values to the punbb_config database.
INSERT INTO `punbb_config` ( `conf_name` , `conf_value` )
VALUES (
'o_announcement_saf', '0'
);
INSERT INTO `punbb_config` ( `conf_name` , `conf_value` )
VALUES (
'o_announcement_message_saf', '0'
);
then I went to the admin_options.php file.
and made a new line after this:
if ($form['announcement_message'] != '')
$form['announcement_message'] = pun_linebreaks($form['announcement_message']);
else
{
$form['announcement_message'] = 'Enter your announcement here.';
if ($form['announcement'] == '1')
$form['announcement'] = '0';
}
were I added this:
if ($form['announcement_message_saf'] != '')
$form['announcement_message_saf'] = pun_linebreaks($form['announcement_message_saf']);
else
{
$form['announcement_message_saf'] = 'Enter your announcement here.';
if ($form['announcement_saf'] == '1')
$form['announcement_saf'] = '0';
}
The admin Fieldset for the option
<fieldset>
<legend>SAF Announcement</legend>
<div class="infldset">
<table class="aligntop" cellspacing="0">
<tr>
<th scope="row">Display announcement</th>
<td>
<input type="radio" name="form[announcement_saf]" value="1"<?php if ($pun_config['o_announcement_saf'] == '1') echo ' checked="checked"' ?> /> <strong>Yes</strong> <input type="radio" name="form[announcement_saf]" value="0"<?php if ($pun_config['o_announcement_saf'] == '0') echo ' checked="checked"' ?> /> <strong>No</strong>
<span>Enable this to display the below message in the forums.</span>
</td>
</tr>
<tr>
<th scope="row">Announcement message</th>
<td>
<textarea name="form[announcement_message_saf]" rows="5" cols="55"><?php echo pun_htmlspecialchars($pun_config['o_announcement_message_saf']) ?></textarea>
<span>This text will not be parsed like regular posts and thus may contain HTML.</span>
</td>
</tr>
</table>
</div>
</fieldset>
And then in the header.php I added this to tell the header to show message if 1
if ($pun_config['o_announcement_saf'] == '1')
and the block to show the message
<div id="announce" class="block">
<h2><span>SAF Member Announcement</span></h2>
<div class="box">
<div class="inbox">
<div><?php echo $pun_config['o_announcement_message_saf'] ?></div>
</div>
</div>
</div>
I'm not sure what to do really.
Any help or links to mods that gets me a step closer helps me alot
Thanks,
PhaxeNor