Skip to content

Instantly share code, notes, and snippets.

@cyberalien
Last active December 24, 2018 15:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cyberalien/b3295a0392d92ce159f59da6e138f858 to your computer and use it in GitHub Desktop.
Save cyberalien/b3295a0392d92ce159f59da6e138f858 to your computer and use it in GitHub Desktop.
/* Include Iconify code */
$iconifyConfigFile = __DIR__ . '/addons/Iconify/Iconify/config.php';
if (@file_exists($iconifyConfigFile))
{
require($iconifyConfigFile);
}
/* End of Iconify code */
@cyberalien
Copy link
Author

cyberalien commented Dec 24, 2018

Iconify Integration add-on creates new XenForo template engine tags. Because of that add-on must always be available as if it was part of XenForo core. That means add-on should run even when event listeners are disabled and add-ons are being installed/uninstalled or XenForo might throw errors.

Because of that add-on installation requires adding code to src/config.php that will make sure XenForo template engine always has Iconify tags available, so templates are always displayed properly.

If your src/config.php is writable, add-on will add all necessary code on installation, so you do not need to do anything. Add-on will also remove that code when its uninstalled. How to know if src/config.php is writable? Try to install add-on, it will show error if file is not writable.

If your src/config.php is not writable by PHP, you need to add code yourself.

How to add code to src/config.php:

  • Above this comment you can see code. Click "Raw" button to see code without line numbers.
  • Select all code (Ctrl+A on Windows, Cmd+A on Mac) and copy it (Ctrl+C on Windows, Cmd+C on Mac).
  • Open src/config.php in any text editor, move cursor to end of file and paste code (Ctrl+V on Windows, Cmd+V on Mac).

If you are uninstalling Iconify Integration add-on, make sure you uninstall all add-ons and styles that depend on it first. Then you can uninstall Iconify Integration add-on and after that you can remove code from src/config.php.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment