Welcome to OMG boards community!
Community of friends where we talk about daily life, offtopic stuff, and what keeps us busy.

You are currently viewing our community forums as a guest user. Sign up or
Having an account grants you additional privileges, such as creating and participating in discussions.

XenForo Plugin: XenFans Favicon

Discussion in 'Forum Software Discussions' started by Floris, Mar 19, 2017.

  1. Floris

    Floris I'm just me :) Hi. Staff Member

    Threads:
    10,168
    Messages:
    35,360
    Likes Gained:
    388
    Trophy Points:
    605
    Gender:
    Male
    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.
     

    Attached Files:

    Last edited: Mar 21, 2017
  2. Mikey

    Mikey :mikey: Staff Member

    Threads:
    766
    Messages:
    12,328
    Likes Gained:
    681
    Trophy Points:
    505
    Gender:
    Male
    thumbsup, great job!
     
  3. Creaky

    Creaky OMG Member

    Threads:
    4
    Messages:
    48
    Likes Gained:
    8
    Trophy Points:
    60
    Gender:
    Male
    Looks good, will try this out.
     
    • Like Like x 1
  4. Smokey

    Smokey OMG Member

    Threads:
    1
    Messages:
    15
    Likes Gained:
    1
    Trophy Points:
    60
    Gender:
    Male
    Fantastic! Just what I needed! Thanks @Floris! :)
     
  5. OP
    Floris

    Floris I'm just me :) Hi. Staff Member

    Threads:
    10,168
    Messages:
    35,360
    Likes Gained:
    388
    Trophy Points:
    605
    Gender:
    Male
    Thanks, glad it is of help.
     

Share This Page