Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff
Author Message
Stylee
New Member
New Member



Joined: Aug 15, 2003
Posts: 18

PostPosted: Tue Oct 21, 2003 1:32 pm Reply with quote

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.
 
View user's profile Send private message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Tue Oct 21, 2003 5:51 pm Reply with quote

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...

============================================================
 
View user's profile Send private message
Stylee







PostPosted: Tue Oct 21, 2003 9:29 pm Reply with quote

Thank you very much! Very Happy
 
sqzdog
Involved
Involved



Joined: Sep 22, 2003
Posts: 252

PostPosted: Wed Oct 22, 2003 8:23 pm Reply with quote

Hey, this was a great idea! Thanks so much!
 
View user's profile Send private message Send e-mail
blith
Client



Joined: Jul 18, 2003
Posts: 977

PostPosted: Thu Oct 23, 2003 1:54 pm Reply with quote

Raven I added the code exactly as you have it except for changing it my stuff ofcourse and I received the following
Code:
Parse error: parse error in /home/gamers/public_html/includes/my_header.php on line 23
can you help me out with this? thanks
 
View user's profile Send private message Visit poster's website
Raven







PostPosted: Thu Oct 23, 2003 1:58 pm Reply with quote

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 used
Code:
<LINK REL="SHORTCUT ICON" HREF="http://www.mydomain.com/myicon.ico"> 
 
blith







PostPosted: Thu Oct 23, 2003 2:01 pm Reply with quote

right not your code... Very Happy 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







PostPosted: Thu Oct 23, 2003 2:05 pm Reply with quote

That is correct. If you are sending it as PHP code, then remember you have to echo it.
 
blith







PostPosted: Thu Oct 23, 2003 2:07 pm Reply with quote

thank you Raven. I found my problem Embarassed my .ico file was not really an .ico file. It was a .jpg file masquerading... as one Embarassed
 
Stylee







PostPosted: Thu Oct 23, 2003 2:43 pm Reply with quote

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

PostPosted: Tue Nov 11, 2003 1:21 am Reply with quote

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";

_________________
http://jamesdibben.com 
View user's profile Send private message Visit poster's website AIM Address ICQ Number
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©