Habe das {$boardmsg} im header eingefügt und auch nochmal den Plugin neu gestartet aber da ist keine Forenansicht zu sehen.
Code:
<?php
/**
* Board Message Plugin for MyBB
* Copyright © 2005 MyBB Mods
* URL: http://mods.mybboard.com/
*
* By: Musicalmidget
* Website: http://www.musicalmidget.com/
*/
$plugins->add_hook('global_start', 'boardmsg');
function boardmsg_info()
{
return array(
'name' => 'Board Message',
'description' => 'Allows administrators to add a global message to the forums header from the settings administration.',
'website' => 'http://mods.mybboard.com/',
'author' => 'Musicalmidget',
'authorsite' => 'http://www.musicalmidget.com/',
'version' => '1.0.1',
);
}
function boardmsg_activate()
{
require MYBB_ROOT.'/inc/adminfunctions_templates.php';
global $db;
$boardmsg_group = array(
'name' => 'boardmsg',
'title' => 'Board Message Settings',
'description' => 'Settings for the Board Message plugin.',
'disporder' => 3,
'isdefault' => 'no',
);
$db->insert_query(TABLE_PREFIX.'settinggroups', $boardmsg_group);
$gid = $db->insert_id();
$boardmsg_setting_1 = array(
'name' => 'showboardmsg',
'title' => 'Enable Board Message',
'description' => 'Display the board message in the forum header?',
'optionscode' => 'onoff',
'value' => 'on',
'disporder' => 1,
'gid' => intval($gid),
);
$boardmsg_setting_2 = array(
'name' => 'boardmsg',
'title' => 'Board Message',
'description' => 'Enter the message you would like to be displayed in the forum header when the board message is enabled.',
'optionscode' => 'textarea',
'value' => 'This is a global board message which administrators can modify from the \"Board Message Settings\" category of the Settings area in the Admin CP.',
'disporder' => 2,
'gid' => intval($gid),
);
$db->insert_query(TABLE_PREFIX.'settings', $boardmsg_setting_1);
$db->insert_query(TABLE_PREFIX.'settings', $boardmsg_setting_2);
$boardmsg_template = array(
"title" => 'global_boardmsg',
"template" => "<table border=\"0\" cellspacing=\"1\" cellpadding=\"4\" class=\"tborder\">
<tbody>
<tr>
<td class=\"trow1\">\$boardmessage</td>
</tr>
</tbody>
</table>
<br />",
"sid" => -1,
"version" => 120,
"status" => '',
"dateline" => 1134703642,
);
$db->insert_query(TABLE_PREFIX.'templates', $boardmsg_template);
find_replace_templatesets('header', '#<navigation>#', "{\$boardmsg}\n\t\t\t<navigation>");
}
function boardmsg_deactivate()
{
require MYBB_ROOT.'/inc/adminfunctions_templates.php';
global $db;
$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name IN('showboardmsg', 'boardmsg')");
$db->query("DELETE FROM ".TABLE_PREFIX."settinggroups WHERE name='boardmsg'");
$db->query("DELETE FROM ".TABLE_PREFIX."templates WHERE title='global_boardmsg'");
find_replace_templatesets('header', '#{\$boardmsg}\n\t\t\t#', '', 0);
}
function boardmsg()
{
global $mybb, $templates, $boardmsg;
if($mybb->settings['showboardmsg'] != 'off')
{
$boardmessage = $mybb->settings['boardmsg'];
eval("\$boardmsg = \"".$templates->get('global_boardmsg')."\";");
}
}
?>