Mod Name:Add Favicon (favorites/bookmark icon)
http://custom.simplemachines.org/mods/index.php?mod=702 Type:Archived
For Custom Themesหากลงม็อดแล้วไม่ผ่านธีมที่ใช้ ให้แมนวลดังนี้
./Themes/{your_theme}/Settings.template.php
Find:
'description' => $txt['header_logo_url_desc'],
'type' => 'text',
),
Add after:
array(
'id' => 'header_favicon_url',
'label' => $txt['header_favicon_url'],
'description' => $txt['header_favicon_url_desc'],
'type' => 'text',
),
SMF 2.0 ONLY:
In SMF 2.0 you will also have to edit your index.template.php file of the same directory as above, search for:
<title>', $context['page_title_html_safe'], '</title>';
add after:
// Favicon Edits
$link_rel = '';
if (!empty($settings['header_favicon_url']))
{
if(preg_match('~http://(?:.*?)\.(png|ico|gif)(?:\?(?:.*?)|)~i', $settings['header_favicon_url'], $type))
{
// Append to html headers
$link_rel .= '
<link rel="'. (!empty($context['browser']['is_ie']) ? 'shortcut icon' : 'icon' ) .'" href="'. $settings['header_favicon_url'] . '" type="'. (($type[1] == 'ico') ? 'image/vnd.microsoft.icon' : 'image/'.$type[1] ) .'" />';
unset($type);
}
}
echo $link_rel;