ผู้เขียน หัวข้อ: แสดงข้อความหน้าฟอรั่ม พร้อมกำหนดกลุ่มที่มองเห็นข้อความ  (อ่าน 720 ครั้ง)

0 สมาชิก และ 1 บุคคลทั่วไป กำลังดูหัวข้อนี้

ออฟไลน์ smf

  • [color=green][i]"ถ้าคุณไม่สามารถอธิบายอย่างง่ายๆ ให้คนอื่นเข้าใจได้แล้วล่ะก็ แสดงว่าคุณยังเข้าใจมันไม่ดีพอ"[/i][/color]
  • Administrator
  • Hero Member
  • *****
  • กระทู้: 1,368
  • พอยท์: 5
    • ดูรายละเอียด
    • pordoo.com
    • อีเมล์
Mod Name:Global Forum Message
http://custom.simplemachines.org/mods/index.php?mod=2629














File Edits
./Themes/default/index.template.php
Find:
โค๊ด: [Select]
// Show the navigation tree.
theme_linktree();
Replace With:
โค๊ด: [Select]
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]
โค๊ด: [Select]
function template_body_below()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;
Replace With:
โค๊ด: [Select]
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.php
Find:
โค๊ด: [Select]
'general' => array($txt['mods_cat_modifications_misc']),Replace With:
โค๊ด: [Select]
'general' => array($txt['mods_cat_modifications_misc']),
'globalmessage' => array($txt['global_message_settings']),

./Sources/ManageSettings.php

Find:
โค๊ด: [Select]
'general' => 'ModifyGeneralModSettings',Replace With:
โค๊ด: [Select]
'general' => 'ModifyGeneralModSettings',
                  'globalmessage' => 'ModifyGlobalMessageSettings',

Find (at the end of the file):
โค๊ด: [Select]
?>
Add Before:
โค๊ด: [Select]
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.php
Find:
โค๊ด: [Select]
'poll_view',Replace With:
โค๊ด: [Select]
'view_globalmessage',
    'poll_view',

Find:
โค๊ด: [Select]
'karma_edit' => array(false, 'general', 'moderate_general'),Replace With:
โค๊ด: [Select]
'karma_edit' => array(false, 'general', 'moderate_general'),
'view_globalmessage' => array(false, 'general', 'view_basic_info'),

./Themes/default/languages/Help.english.php
Find (at the end of the file):
โค๊ด: [Select]
?>Add Before:
โค๊ด: [Select]
$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.php
Find (at the end of the file):
โค๊ด: [Select]
?>Add Before:
โค๊ด: [Select]
$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.php
Find (at the end of the file):
โค๊ด: [Select]
?>
Add Before:
โค๊ด: [Select]
$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.