RolandTi / collections

Collections is a theme for Zenphoto CMS. Responsive layout and pictures. Dark and light alternative.
GNU General Public License v3.0
11 stars 2 forks source link

Can't switch bright/dark mode #3

Closed stalkerGH closed 1 year ago

stalkerGH commented 1 year ago

What is going on: When I click on "sun" symbol in bottom bar, nothing change. Expected behaviour: Switch between dark and normal mode.

ZenPhoto 1.6 Collections 1.1

RolandTi commented 1 year ago

This is odd because it's working on the demo gallery. Can you check the JavaScript console in your browser when you click on it ?

stalkerGH commented 1 year ago

Thanks for reply. I was surprised too because your website is switching the modes as expected. I opened JS console with my webpage, clicked on bulb but see no errors. I hope I use the console properly...

RolandTi commented 1 year ago

Erase the collection folder with the new version (https://github.com/RolandTi/collections/releases/tag/v.1.2). Which browser are you using ? I've been trying with Firefox (109), Opera (95), Safari (16).

Is your gallery available for public so I can check ?

stalkerGH commented 1 year ago

Thank you for fixing the thumbnails' centering!

Yes, my gallery is public, you can find it here: https://dodoprint.pl/portfolio/

Unfortunately I can't simply overwrite all files from 1.2 to 1.1 because small improvements which I've done (mostly hacked links which didn't work as expected, contact form bypass, footer etc.). These changes have been made because I had problems with ZenPhoto plugins and your theme (which is really great!). I checked updated files between 1.1 and 1.2 and can't see any significant changes in "lightbulb" code section.

I'm using Vivaldi browser (5.7) on Kubuntu 22.04 but can also cross-check in Firefox 110.0, also in Windows 10.

RolandTi commented 1 year ago

Hello ! I've been looking to your portfolio, if you look at the source code of your page, you'll see that Zenphoto stop rendering HTML in the middle of your footer menu. I don't know the reason, maybe a plugin related thing ? This is why the switcher doesn't work. The javascript is not printed. I guess you don't see the admin bar neither.

Maybe take a look to /zp-core/admin-logs.php

At this point, I can't say if it's a theme related bug or Zenphoto bug. You can switch to a Zenphoto default theme to see if it's working. If not you should ask for help on the Zenphoto Github.

But I'm almost sure the solution is in the error logs.

stalkerGH commented 1 year ago

You're right, there is something in the debug log:

TYPEERROR: call_user_func(): Argument #1 ($callback) must be a valid callback, function "printLanguageSelector" not found or invalid function name in /home/HIDDEN/portfolio/themes/collections/_footer.php on line 48

So it is the problem with language selector. I don't need this function so I commented it out:

<li>
<?php /* @call_user_func('printLanguageSelector');  */ ?>
</li>

And switching light modes magically started working. Administrator menu also appeared in top right corner (I didn't knew it should be visible).

So, thank you once again for help and great theme. I like it for simplicity and clear look. Keep developing it :)

RolandTi commented 1 year ago

You're welcome ! And if you want to hide the admin bar you can active the show_not_logged-in plugin (but secret albums will be hidden)