XenForo Plugin: XenFans Favicon

Floris

I'm just me :) Hi.
Staff member
Joined
Jan 1, 2001
Messages
60,096
Version 1.0.0, build 2, for XenForo 1.5.13

I've only tested this on omgboards.com right now. I was following a discussion on xenforo.com and thought: "Since I don't want to manually edit the template, and rather insert my own and have some control over it, let's see if I can make this into a plugin".

The benefit is that I can turn on/off the plugin easily, the ?v= at the end, and the URL updates as I update the board settings (say, change http to https, or omgboards.com to www.omgboards.com, etc.
Another benefit is that this then applies to all styles, and I don't have to worry about upgrading.
And finally, a benefit is that you can edit the xenfans_favicon template to make personal changes, expand on this, or customize it to your site.

What this plugin does is add one of the following before </head> in the PAGE_CONTAINER, by using the hook to insert the xenfans_favicon template.

Once installed you can go to /admin.php?options/list/xenfans_favicon and set a preference.
Screen Shot 2017-03-20 at 00.21.56.png

Which for example will output as such on our board:

Screen Shot 2017-03-19 at 20.35.52.png

Changing to the middle option will keep the full url, but remove the ?v=x at the end.
The value changes, if it doesn't. Just save a template or style element and it updates.
Changing it to the first one will not include the full board url by force, nor the ?v=x part.
The third option is selected by default. Assuming you wish to force refresh of a new favicon and give the browser the full url. Regardless of where you are on the board.
Changing the path from empty to something, expects it to be a directory starting with a slash, not ending with one.
So if you have example.com/banana/files/img/favicon.ico,
Then set path to: /banana/files/img

The version value is 1 by default, if you leave it at 1, it will use the style's last modified date instead. If you rather have ?v=2 or ?v=3 .. and manually set it, increment the number of the version field higher than 1. Like.. 2 or 3.

Installation instructions are per usual for XenForo plugins. Upload the content of the upload folder to your board, merging with existing folders. Then import the .xml from the admin panel > install a plugin. And you're done.

Known issues: This doesn't hook into the style of XenForo, so the default favicon is probably still listed somewhere and might be pointed to twice, however, since this is at the end of the <head> tag, it should take precedence.

Disclaimer: I don't have a XenForo license, can I download this, use it, or distribute it? No. What if I do have a license? If you have a valid license for XenForo, you are free to use this plugin for your board. Regardless of XenForo license status, can I share this plugin with others? No.
 

Attachments

  • xenfans_favicon_v100b2.zip
    2.9 KB · Views: 5
Last edited:
Top