Author |
Message |
Stylee
New Member


Joined: Aug 15, 2003
Posts: 18
|
Posted:
Tue Oct 21, 2003 1:32 pm |
|
I am looking for information on how to add an icon to the address bar of my site.
(the little image that sits to the left of the URL on some websites)
I believe that this is the code
Code:<LINK REL="SHORTCUT ICON"
<ahref="http://yoururl.com/youricon.ico">
|
I just do not know what file to put it in.
I tried the /includes/meta.php file, but this does not seem to be correct.
Thanx in advance. |
|
|
|
 |
Raven
Site Admin/Owner

Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Tue Oct 21, 2003 5:51 pm |
|
Here is something I picked up along the way. Don't know who to give the credit to. It's not anything proprietary so it's public domain anyway. If you use method two, which you are, try placing it in the header.php file or the includes/my_header.php file.
Quote: | ============================================================
Script: Adding An Icon With Your URL - Two Methods
Functions: Whenever anyone bookmarks your site, an icon
will subsequently show up on their Favorites
list. When your site is visited, the icon
will also show in the URL box of the browser.
Browsers: IE5 and Later (ignored by other browsers)
Author: etLux - after Microsoft
============================================================
===========
Method One
===========
Select any standard Windows icon file. The .ico file *must*
be in standard Windows icon file format, or it will be
ignored.
Rename the icon file *exactly* to: favicon.ico -- all
lowercase. No deviation from this is allowed.
Place the favicon.ico file in the 'root' directory on your
web server (where your main index page is).
Whenever your site is bookmarked, the icon will subsequently
show up on the visitor's Favorites list. When they visit
your site, the icon will also show in the URL window of the
browser.
That's all there is to it -- it's automatically picked up by
IE5 and later browsers.
===========
Method Two
===========
Insert the following LINK tag in the <head>...</head> of
your pages.
<LINK REL="SHORTCUT ICON" HREF="http://www.mydomain.com/myicon.ico">
Change the path and icon filename to correspond to the
location of the icon file on your site. The icon graphic
filename should be lowercase, no more than eight characters,
and the extension must be .ico.
As above, the file *must* be in standard Windows icon file
format or it will be ignored.
When you use this method as opposed to Method One above, the
LINK REL code should appear on any page that might be
bookmarked.
Don't forget to confirm that the icon file is actually where
you say it is in the LINK REL path!
==================================
More Information - Creating Icons
==================================
The following is an exact quote from Microsoft®:
"For Internet Explorer 5, the required size of a shortcut
icon is 16x16 pixels. To create the icon, use an icon
editor, such as the one included in Microsoft® Visual
Studio® or one of the many other icon editors available.
Regardless of the program you use, make sure you set the
editor to create an icon that is 16x16 pixels. Otherwise,
the icon will be ignored by Internet Explorer."
================
Troubleshooting
================
We've noticed occasionally quirky behavior with this IE5
feature on several systems.
In many cases the icon will not appear on your machine until
*after* you perform the following steps:
- close *all* programs but the browser
- navigate to a neutral site, off your own url
- remove any and all bookmarks (favorites) to your
site that you may currently have
- clear the History and the Cache of the browser
- reboot, clear the Recycle Bin
- reboot again, bookmark your site
- reboot [sigh] again...
============================================================ |
|
|
|
|
 |
Stylee

|
Posted:
Tue Oct 21, 2003 9:29 pm |
|
Thank you very much!  |
|
|
|
 |
sqzdog
Involved


Joined: Sep 22, 2003
Posts: 252
|
Posted:
Wed Oct 22, 2003 8:23 pm |
|
Hey, this was a great idea! Thanks so much! |
|
|
|
 |
blith
Client

Joined: Jul 18, 2003
Posts: 977
|
Posted:
Thu Oct 23, 2003 1:54 pm |
|
Raven I added the code exactly as you have it except for changing it my stuff ofcourse and I received the followingCode:Parse error: parse error in /home/gamers/public_html/includes/my_header.php on line 23
| can you help me out with this? thanks |
|
|
|
 |
Raven

|
Posted:
Thu Oct 23, 2003 1:58 pm |
|
This is NOT my code. I just responded to the original post. This line of code should not produce any errors though, if that's what you usedCode:<LINK REL="SHORTCUT ICON" HREF="http://www.mydomain.com/myicon.ico">
|
|
|
|
|
 |
blith

|
Posted:
Thu Oct 23, 2003 2:01 pm |
|
right not your code... I added this in the includes/my_header.php before the closing. The only thing different is that mine is named favicon.ico Is this a problem? |
|
|
|
 |
Raven

|
Posted:
Thu Oct 23, 2003 2:05 pm |
|
That is correct. If you are sending it as PHP code, then remember you have to echo it. |
|
|
|
 |
blith

|
Posted:
Thu Oct 23, 2003 2:07 pm |
|
thank you Raven. I found my problem my .ico file was not really an .ico file. It was a .jpg file masquerading... as one  |
|
|
|
 |
Stylee

|
Posted:
Thu Oct 23, 2003 2:43 pm |
|
Raven wrote: | That is correct. If you are sending it as PHP code, then remember you have to echo it. |
lol, ok, I got mine working with the provided code on the 1st try...YAY!
But now I read something about Echoing....do I need to do that, and if so, what should I add to the code. |
|
|
|
 |
TheosEleos
Life Cycles Becoming CPU Cycles

Joined: Sep 18, 2003
Posts: 960
Location: Missouri
|
Posted:
Tue Nov 11, 2003 1:21 am |
|
Or you could just put the file 'favicon.ico' file in your theme/images directory as this code from header.php says it will look for it.
Code:if (file_exists("themes/$ThemeSel/images/favicon.ico")) {
echo "<link REL=\"shortcut icon\" HREF=\"themes/$ThemeSel/images/favicon.ico\" TYPE=\"image/x-icon\">\n";
|
|
_________________ Only registered users can see links on this board! Get registered or login! |
|
 |
 |
|