Favicon.ico

Anything that you think should be in Cacti.

Moderators: Developers, Moderators

Post Reply
Kedar

Favicon.ico

Post by Kedar »

Reguest for little but useful addon.
Swen

Post by Swen »

Just dump a favicon.ico into the webroot and you should be good to go.

- Swen
le roumain
Posts: 2
Joined: Wed Nov 10, 2004 7:48 am

Post by le roumain »

Hello,

i've made a little favicon for cacti :D
Attachments
Clipboard02.jpg
Clipboard02.jpg (1.17 KiB) Viewed 29518 times
favicon.zip
(796 Bytes) Downloaded 976 times
User avatar
crazee_canuck
Posts: 13
Joined: Tue Nov 09, 2004 5:28 am
Location: Eastpointe, MI

Post by crazee_canuck »

Very nice...saved me the trouble. :)
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Dump where?
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Guest

Post by Guest »

TheWitness wrote:Dump where?

If using Apache and DocumentRoot is set to /var/www, you can put the favicon there and it'll be used by cacti (assuming cacti is accessible from http://site/cacti). Only problem with that is, ALL sites will be using the Cacti icon (assuming they don't have their own <link>'s inside).

My preferred method would be to edit the php files in Cacti, adding a <link> to the favicon.ico file. I put mine in include, since that's where main.css lives as well.

You'd want to add

Code: Select all

<link href="include/favicon.ico" rel="image/x-icon">
<link rel="shortcut icon" href="include/favicon.ico" type="image/x-icon">
to the files:
include/auth.php
include/top_graph_header.php
include/top_header.php


Just add those lines just below the <link> for main.css and you'll be set. :)

Add the following to lib/graph_export.php around line 410:

Code: Select all

<link href="favicon.ico" rel="image/x-icon">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
Also add the following line

Code: Select all

copy("$cacti_root_path/include/favicon.ico", "$cacti_export_path/favicon.ico");
to lib/graph_export.php near line 275. You will probably have to copy the favicon.ico file to your exported folder manually (or delete $export_path/main.css). I'd just say copy the darn thing. :P
User avatar
crazee_canuck
Posts: 13
Joined: Tue Nov 09, 2004 5:28 am
Location: Eastpointe, MI

Post by crazee_canuck »

/me was the guest above :P
Attachments
After the edits, you should see something like this
After the edits, you should see something like this
favicon.png (2.32 KiB) Viewed 29484 times
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

I have applied the code, and it doesn't work in IE and is buggy in mozilla. When using the link references, not placing the icon in the root of the web.

What format is the Icon in?
If it can't be consistent, I don't know about implementing it.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Rony,

I simply droped into the cacti directory and it worked for me (iE6). However, firefox did not.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
crazee_canuck
Posts: 13
Joined: Tue Nov 09, 2004 5:28 am
Location: Eastpointe, MI

Post by crazee_canuck »

rony wrote: What format is the Icon in?

Code: Select all

# file favicon.ico 
favicon.ico: ms-windows icon resource - 1 icon
The icon is shown by IE *ONLY* when bookmarked. Mozilla 1.6 (at least), Netscape 7.x, Safari, Firefox, Konqueror and Opera display the favicon when you go to the site. IE is the odd one of the bunch.

I also missed (at least) one file in the list above. You'd also want to add those lins to auth_login.php at around line 97 (just beneath <title>).

So all the files to be edited should consist of:
auth_login.php
include/auth.php
include/top_graph_header.php
include/top_header.php
lib/graph_export.php


For more information about favicon.ico please see http://www.thesitewizard.com/archive/favicon.shtml.
Attachments
In order:
<br />Firefox 1.0 
<br />Opera 7.54
<br />Mozilla 1.8
<br />IE 6SP2
<br />
<br />(IE again being the odd one of the bunch....had to briefly give that server a IPv4 address since IE can't handle the IPv6 notation..I hate IE but I know we have to support it).
In order:
Firefox 1.0
Opera 7.54
Mozilla 1.8
IE 6SP2

(IE again being the odd one of the bunch....had to briefly give that server a IPv4 address since IE can't handle the IPv6 notation..I hate IE but I know we have to support it).
favicon-moz-ff-op-ie.png (142.28 KiB) Viewed 29451 times
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

*shrug*

I had issues with IE, Firefox and Safari, I will try again tonight. If it works for the most part, I will commit it to CVS. :)

Also, don't know about including it in graph_export.php, I will have to look to make sure that the icon gets copied on export.

Also, I'm no expert on which browsers it works with and not. ;) Just did about 5 minutes of research, and that is why I had a question about the icon format.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
User avatar
crazee_canuck
Posts: 13
Joined: Tue Nov 09, 2004 5:28 am
Location: Eastpointe, MI

Post by crazee_canuck »

rony wrote: Just did about 5 minutes of research, and that is why I had a question about the icon format.
Hehe...same here with that original post as "Guest," I didn't test all of the other browsers until the question was raised.

As for the copying of the icon, I think this'll take care of that:

Code: Select all

copy("$cacti_root_path/include/favicon.ico", "$cacti_export_path/favicon.ico"); 
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

I don't know if having the favicon is that important, concerning what most people use the export function todo. That is my only reasoning for not thinking we need to have it copy over. :)
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
User avatar
crazee_canuck
Posts: 13
Joined: Tue Nov 09, 2004 5:28 am
Location: Eastpointe, MI

Post by crazee_canuck »

Nah, I didn't even expect this to be anything worthy of going into CVS to begin with. :D
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Both Larry and I like it.. :)

And I have been working on those files anyways... :)
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest