sixem / ivfi-php

IVFi is a directory indexer that aims to make it easy to browse and explore web-accessible directories.
https://git.five.sh/ivfi/
Other
108 stars 18 forks source link

Setting custom themes #18

Closed justin-peacock closed 3 years ago

justin-peacock commented 3 years ago

Thanks for the script, it's awesome.

The only thing I'm having an issue with is setting custom themes. I have the following set in .indexer.config.php

<?php
return array(
    'style' => array(
        'themes' => array(
            'path' => 'indexer/css/themes',
            'default' => 'bliss',
        ),
        'compact' => true
    ),
    'debug' => true
);

In the console I'm seeing the following:

style: {…}
​​
compact: true
​​
themes: {…}
​​​
path: "/indexer/css/themes/"
​​​
pool: (4) […]
​​​​
0: "default"
​​​​
1: "bliss"
​​​​
2: "photon"
​​​​
3: "pelagic"
​​​​
length: 4
​​​​
<prototype>: Array []
​​​
set: "default"

Within the head it's only outputting the main style.css though.

Any help would be great!

sixem commented 3 years ago

You may have to set the theme yourself in the settings menu (top right corner).

The thing is, the active theme is stored as a cookie, and that default value in the cookie will be whatever is in the config at the time of the first page load, if nothing is set, then the default theme will be used. Updating the config after the cookie has been created won't change the set theme for the clients which already have an active cookie. I guess you can also just clear the cookie and reload the page, that should fix it too.

It's sort of hard to explain it but I think this is the issue you're having? If not, let me know and I'll try to help you.

justin-peacock commented 3 years ago

Oh wow, hah! I did not even see that down arrow in the top right. Handy!

Thanks for the help, this has me on the right path.