Add Favicon (favories/bookmark icon)

Started by hadesflames, March 09, 2007, 05:03:51 PM

Previous topic - Next topic

ccbtimewiz


DirtRider

Why do you need a mod to do this. All I do is place the favicon.ico in my root of my forum and it just works straight off.
http://www.triumphtalk.com

"The real question is not whether machines think but whether men do. "

ccbtimewiz

Quote from: DirtRider on November 11, 2008, 12:27:12 AM
Why do you need a mod to do this. All I do is place the favicon.ico in my root of my forum and it just works straight off.

I'm tired of answering this exact question over and over again.

READ THIS: http://www.simplemachines.org/community/index.php?topic=236748.0

justjim

ccbtimewiz

Thank you for your help. I've attached the requested file  :)

gnowak

Hi. I have added a Danish translation for this mod.

Should I post it here or somewhere else?
Curriculum Vitae [nofollow]

justjim

ccbtimewiz

Not to rush, but I uploaded the requested file. I was wondering when you might have a chance to look at it.

Thanks

Gonzalo

Translation to Spanish

Author Traducción: GonZa-Design o Gonzalo




Available languages: spanish, spanish-utf8, spanish_es, spanish_es-utf8, spanish_latin, spanish_latin-utf8




Download




I hope it serves them.

Greetings! GonZa.

DarN71

Well, I couldn't get this to work at all. I found a way though.

In Sources/Load.php, find:
// Some basic information...
if (!isset($context['html_headers']))
$context['html_headers'] = '';

Add after:
// Favicon Edits
if (!empty($settings['header_favicon_url']))
{
if(preg_match('~http://(?:.*?)\.(png|ico|gif)(?:\?(?:.*?)|)~i', $settings['header_favicon_url'], $type))
{
// Append to html headers
$context['html_headers'] .= '
<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);
}
}

With this code in index.php, no header was ever added - don't know what's going on.

robbie93

#148
Installed the mod but there is no option in current theme to apply the addy for the favicon?

Edit :   fixed :D

PHPLearner

Quote from: robbie93 on March 26, 2009, 03:39:53 PM
Installed the mod but there is no option in current theme to apply the addy for the favicon?

Edit :   fixed :D

What did you do to get it robbie? Tanks, Dave

robbie93

Hi dave,   I just installed the mod manually using the parser from the mod page,  after I had finished editing all the files the option to enter the url in current theme appeared  :D

go to the mod page,  select you're version of smf from the drop down then follow the instructions for each file.   http://custom.simplemachines.org/mods/index.php?mod=702


PHPLearner

Thanks man , I really appreciate it,  :D

robbie93


Jez

Quote from: DarN71 on March 05, 2009, 12:30:31 PM


In Sources/Load.php, find:
// Some basic information...
if (!isset($context['html_headers']))
$context['html_headers'] = '';

Add after:
// Favicon Edits
if (!empty($settings['header_favicon_url']))
{
if(preg_match('~http://(?:.*?)\.(png|ico|gif)(?:\?(?:.*?)|)~i', $settings['header_favicon_url'], $type))
{
// Append to html headers
$context['html_headers'] .= '
<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);
}
}



Hi guys just to clarify the above instruction. Do I need to place the first code 'after' the second one? I thought I'd asked because I'm used to seeing 'replace with' rather than 'add after'.

???

Lithriel

Thanks so much DarN71!  I am using SMF 2.0 and my load.php file was never altered either!  I even tried reinstalling it in the package manager and nothing happened.


Father Luke

@ Jez: Yes add after.

For anyone else not able to see this in their custom theme's admin remember to add:

$txt['header_favicon_url'] = 'Favicon Image URL:';
$txt['header_favicon_url_desc'] = 'Must be a 16x16 png/gif/ico image
<br />Use .ico for best compatibility (eg IE7)
<br />Leave blank to disable
<br />(<a href="http://en.wikipedia.org/wiki/Favicon" target="_blank">Help</a>)';


Before the

?>

in your custom theme's Modifications.english.php file


I love this mod.
Thanks!



- -
Okay,
Father Luke

sombra

#156
i have 2.0 rc1-1 and i installed and everithing went nice but i cant see the favicon

i uploaded the favicon to the main folder and gave the url

www.todoilegal.net/favicon.ico

but no favicon :(

well i verified the Settings.template.php modification its not the problem even in default theme i cant see it

sombra

favicons today started working for them self xD so thanks for this great mod

BAMAVAMP

This thing works fine with IE--but I use FF and its not working in FF once I get into the forum/index.php and start browsing around.

Is there a way to fix this in FF? Yes I am using the favicon.ico in everywhere needed.

TurtleKicker

Trying to use this mod on SMF 1.1.9 and it's only partially working. It installs fine. I created a 16x16 256 color favicon.ico file, set up everything, and it works fine in Opera and Chrome. But nothing shows in Firefox 3.5. I've tried clearing the cache but that doesn't help.

Any thoughts?

I see all sorts of suggestions about manual edits you can do, but if I'm going to start manually-editing files then that defeats the whole point of this mod (and potentially prevents other mods from installing or uninstalling).

Advertisement: