สำหรับ SMF 2.0.xxแก้ไขไฟล์:file $sourcedir/Admin.php
ค้นหา -->>
// Mod Authors for a "ADD AFTER" on this line. Ensure you end your change with a comma. For example:
// 'shout' => array($txt['shout']),
// Note the comma!! The setting with automatically appear with the first mod to be added.
เพิ่มไว้หลัง -->>
'backtotop' => array($txt['back_to_top_title']),
ค้นหา -->>
// Mod authors if you want to be "real freaking good" then add any setting pages for your mod BELOW this line!
เพิ่มไว้หลัง -->>
array('ManageBacktoTopSettings', 'area=modsettings;sa=backtotop'),
file $sourcedir/Load.php
ค้นหา -->>
// Detect the browser. This is separated out because it's also used in attachment downloads
detectBrowser();
เพิ่มไว้หลัง -->>
// Labradoodle-360's Back to Top Mod.
if (!empty($modSettings['enable_smoothscroll']))
$context['html_headers'] .='<script type="text/javascript" src="'. $settings['default_theme_url']. '/scripts/smoothscroll.js"></script>';
file $sourcedir/ManageSettings.php
ค้นหา -->>
// Mod authors, once again, if you have a whole section to add do it AFTER this line, and keep a comma at the end.
เพิ่มไว้หลัง -->>
'backtotop' => 'ModifyBacktoTopSettings',
ค้นหา -->>
?>
เพิ่มไว้ก่อน -->>
// Labradoodle-360's Back to Top Mod.
function ModifyBacktoTopSettings($return_config = false)
{
global $txt, $scripturl, $context, $settings, $sc, $modSettings;
$config_vars = array(
array('check', 'enable_smoothscroll'),
);
if ($return_config)
return $config_vars;
$context['post_url'] = $scripturl . '?action=admin;area=modsettings;save;sa=backtotop';
$context['settings_title'] = $txt['back_to_top_settings_title'];
if (empty($config_vars))
{
$context['settings_save_dont_show'] = true;
$context['settings_message'] = '<div class="centertext">' . $txt['back_to_top_desc'] . '</div>';
return prepareDBSettingContext($config_vars);
}
// Saving?
if (isset($_GET['save']))
{
checkSession();
$save_vars = $config_vars;
saveDBSettings($save_vars);
redirectexit('action=admin;area=modsettings;sa=backtotop');
}
prepareDBSettingContext($config_vars);
}
file $themedir/index.template.php
ค้นหา -->>
function template_body_above()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;
เพิ่มไว้หลัง -->>
echo '<a name="forum_top"></a><br />';
ค้นหา -->>
echo '
</div>
</div></div>';
// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
แก้เป็น -->>
echo '
<div align="center" style="text-align: center;"><a href="#forum_top">', $txt['back_to_top_title'], '</a></div> </div>
</div></div>';
// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
file $themedir/languages/Modifications.thai-utf8.php
เพิ่ม -->>
// Labradoodle-360's Back to Top Mod.
$txt['back_to_top_title'] = 'กลับสู่ด้านบน';
$txt['enable_smoothscroll'] = 'เปิดใช้งานเลื่อนขึ้นแบบนิ่มนวล';
$txt['back_to_top_desc'] = 'แก้ไขการตั้งค่ากลับสู่ด้านบน';
$txt['back_to_top_settings_title'] = 'การตั้งค่ากลับสู่ด้านบน';
ดาวน์โหลด: smoothscroll.rar
ขออภัย! ส่วนนี้สงวนไว้เฉพาะสมาชิกเท่านั้น กรุณา เข้าสู่ระบบ หรือ ลงทะเบียนแตกไฟล์แล้วอัพโหลดไปไว้ที่
file smoothscroll.js -->> $themesdir/default
ลิงค์หัวข้อ:
http://dexmore.com/topic/3024