สำหรับ SMF 2.0.x นะครับ
file $languagedir/Modifications.thai-utf8.php
ค้นหา -->>
?>
เพิ่มไว้ก่อน -->>
// Begin Global Headers and Footers Text Strings
$txt['globalhf_title'] = 'Global Headers and Footers';
$txt['globalhf_globalheaders'] = 'Global Headers:';
$txt['globalhf_globalfooters'] = 'Global Footers:';
$txt['globalhf_settings'] = 'Settings';
$txt['globalhf_saveglobal'] = 'Save Headers Footers';
// END Global Headers and Footers Text Strings
file $boarddir/index.php
ค้นหา -->>
'help' => array('Help.php', 'ShowHelp'),
เพิ่มไว้หลัง -->>
'globalhf' => array('globalhf2.php', 'globalhf'),
file $sourcedir/Subs.php
ค้นหา -->>
global $context, $settings, $modSettings, $time_start, $db_count;
แก้เป็น -->>
global $context, $settings, $modSettings, $time_start, $db_count;
global $boarddir;
ค้นหา -->>
foreach (array_reverse($context['template_layers']) as $layer)
loadSubTemplate($layer . '_below', true);
แก้เป็น -->>
// Global Footers
$footercontents = '';
$noheaders = false;
if (isset($_REQUEST['action']))
{
if ($_REQUEST['action'] == 'dlattach')
$noheaders = true;
}
if(!isset($_REQUEST['xml']) && $noheaders == false)
if(file_exists($boarddir . '/smffooter.txt'))
{
$footercontents = file_get_contents($boarddir . '/smffooter.txt');
echo '<!--Footers-->';
echo $footercontents;
echo '<!--End Footers-->';
}
foreach (array_reverse($context['template_layers']) as $layer)
loadSubTemplate($layer . '_below', true);
ค้นหา -->>
if (isset($settings['use_default_images']) && $settings['use_default_images'] == 'defaults' && isset($settings['default_template']))
{
$settings['theme_url'] = $settings['default_theme_url'];
$settings['images_url'] = $settings['default_images_url'];
$settings['theme_dir'] = $settings['default_theme_dir'];
}
แก้เป็น -->>
if (isset($settings['use_default_images']) && $settings['use_default_images'] == 'defaults' && isset($settings['default_template']))
{
$settings['theme_url'] = $settings['default_theme_url'];
$settings['images_url'] = $settings['default_images_url'];
$settings['theme_dir'] = $settings['default_theme_dir'];
}
// Global Headers
$headercontents = '';
$noheaders = false;
if (isset($_REQUEST['action']))
{
if ($_REQUEST['action'] == 'dlattach')
$noheaders = true;
}
if(!isset($_REQUEST['xml']) && $noheaders == false)
if(file_exists($boarddir . '/smfheader.txt'))
{
$headercontents = file_get_contents($boarddir . '/smfheader.txt');
echo '<!--Headers-->';
echo $headercontents;
echo '<!--End Headers-->';
}
file $sourcedir/Admin.php
ค้นหา -->>
'current_theme' => array(
'label' => $txt['theme_current_settings'],
เพิ่มไว้ก่อน -->>
'globalhf' => array(
'label' => $txt['globalhf_title'],
'file' => 'globalhf2.php',
'function' => 'globalhf',
'custom_url' => $scripturl . '?action=admin;area=globalhf',
'icon' => '',
'subsections' => array(
'view' => array($txt['globalhf_settings']),
),
),
file globalhf2.php -->> $sourcedir
file globalhf2.template.php -->> $themesdir/default
file smfheader.txt -->> $boarddir CHMOD = 777
file smffooter.txt -->> $boarddir CHMOD = 777
ลิงค์หัวข้อ:
http://dexmore.com/topic/7833