Mod Name:Global Forum Message
http://custom.simplemachines.org/mods/index.php?mod=2629File Edits./Themes/default/index.template.phpFind:
// Show the navigation tree.
theme_linktree();
Replace With:
if (!empty($modSettings['global_index_show']) && allowedTo('view_globalmessage')) {
echo'<br /><br />
<span class="clear upperframe"><span></span></span>
<div class="roundframe"><div class="innerframe">
<div class="cat_bar">
<h3 class="catbg">' ,parse_bbc($modSettings['global_index_title']), '</h3>
</div>
<p>', parse_bbc($modSettings['global_index_body']), '</p>
</div></div>
<span class="lowerframe"><span></span></span>';
}
// Show the navigation tree.
theme_linktree();
Find: [Select]
function template_body_below()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;
Replace With:
function template_body_below()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;
if (!empty($modSettings['global_footer_show']) && allowedTo('view_globalmessage')) {
echo'<br /><br />
<span class="clear upperframe"><span></span></span>
<div class="roundframe"><div class="innerframe">
<div class="cat_bar">
<h3 class="catbg">' ,parse_bbc($modSettings['global_index_title']), '</h3>
</div>
<p>', parse_bbc($modSettings['global_index_body']), '</p>
</div></div>
<span class="lowerframe"><span></span></span>';
}
./Sources/Admin.phpFind:
'general' => array($txt['mods_cat_modifications_misc']),
Replace With:
'general' => array($txt['mods_cat_modifications_misc']),
'globalmessage' => array($txt['global_message_settings']),
./Sources/ManageSettings.phpFind:
'general' => 'ModifyGeneralModSettings',
Replace With:
'general' => 'ModifyGeneralModSettings',
'globalmessage' => 'ModifyGlobalMessageSettings',
Find (at the end of the file):
?>
Add Before:
function ModifyGlobalMessageSettings($return_config = false) {
global $context, $txt, $scripturl, $modSettings, $settings;
$config_vars = array(
array('check', 'global_index_show'),
array('text', 'global_index_title'),
array('large_text', 'global_index_body'),
'',
array('check', 'global_footer_show'),
array('text', 'global_footer_title'),
array('large_text', 'global_footer_body'),
);
if ($return_config)
return $config_vars;
if (isset($_GET['save'])) {
checkSession();
saveDBSettings($config_vars);
writeLog();
redirectexit('action=admin;area=modsettings;sa=globalmessage');
}
$context['post_url'] = $scripturl . '?action=admin;area=modsettings;save;sa=globalmessage';
prepareDBSettingContext($config_vars);
}
./Sources/ManagePermissions.phpFind:
'poll_view',
Replace With:
'view_globalmessage',
'poll_view',
Find:
'karma_edit' => array(false, 'general', 'moderate_general'),
Replace With:
'karma_edit' => array(false, 'general', 'moderate_general'),
'view_globalmessage' => array(false, 'general', 'view_basic_info'),
./Themes/default/languages/Help.english.phpFind (at the end of the file):
?>
Add Before:
$helptxt['global_index_show'] = 'This will enable or disable the global message at the index page under the menu';
$helptxt['global_index_title'] = 'This is the title of the global message for the index page. You can use html and smileys';
$helptxt['global_index_body'] = 'This is the message body of the global message for the index page.You can use html and smileys';
$helptxt['global_footer_show'] = 'This will enable or disable the global message at the footer area';
$helptxt['global_footer_title'] = 'This is the title of the global message for the footer area.You can use html and smileys';
$helptxt['global_footer_body'] = 'This is the message body of the global message for the footer area. You can use html and smileys';
./Themes/default/languages/Modifications.english.phpFind (at the end of the file):
?>
Add Before:
$txt['globalmessage'] = 'Global Message';
$txt['global_message_settings'] = 'Global Forum Message';
$txt['global_index_show'] = 'Show Message in Index';
$txt['global_index_title'] = 'Index Message Title';
$txt['global_index_body'] = 'Index Message Body';
$txt['global_footer_show'] = 'Show Message in Footer';
$txt['global_footer_title'] = 'Footer Message Title';
$txt['global_footer_body'] = 'Footer Message Body';
$txt['permissionname_view_globalmessage'] = 'View global forum message';
$txt['permissionhelp_view_globalmessage'] = 'This permission determines whether or not members of this group can view the global forum message';
./Themes/default/languages/Modifications.english-utf8.phpFind (at the end of the file):
?>
Add Before:
$txt['globalmessage'] = 'Global Message';
$txt['global_message_settings'] = 'Global Forum Message';
$txt['global_index_show'] = 'Show Message in Index';
$txt['global_index_title'] = 'Index Message Title';
$txt['global_index_body'] = 'Index Message Body';
$txt['global_footer_show'] = 'Show Message in Footer';
$txt['global_footer_title'] = 'Footer Message Title';
$txt['global_footer_body'] = 'Footer Message Body';
This operation isn't vital to the installation of this mod.