Advertisement:

Author Topic: How to change themes client side?  (Read 786 times)

Sophia_OS

  • Full Member
  • ***
  • Posts: 146
How to change themes client side?
« on: July 25, 2018, 03:01:16 am »
hey,
i wanna give the option for users to change themes,
for that we have to add a (theme_name) field in oc_t_user table and store the theme name for each user.
and put the selector in header for users. like if there is 3 themes, the selector shows 3 themes over there for users to select one.
please help me to do this
thanks

Sophia_OS

  • Full Member
  • ***
  • Posts: 146
Re: How to change themes client side?
« Reply #1 on: July 29, 2018, 11:33:52 pm »
No help?

Aficionado

  • issues
  • Hero Member
  • *
  • Posts: 6240
  • Hardliner
Re: How to change themes client side?
« Reply #2 on: July 30, 2018, 01:47:13 am »
No help?

Nop, just your shameless bump.

Sophia_OS

  • Full Member
  • ***
  • Posts: 146
Re: How to change themes client side?
« Reply #3 on: July 30, 2018, 10:35:13 am »
No help?

Nop, just your shameless bump.

I don't know who made you "hero member" with this attitude!

Sophia_OS

  • Full Member
  • ***
  • Posts: 146
Re: How to change themes client side?
« Reply #4 on: August 06, 2018, 12:53:04 am »
Is there a client side theme switcher in other cms?

Aficionado

  • issues
  • Hero Member
  • *
  • Posts: 6240
  • Hardliner
Re: How to change themes client side?
« Reply #5 on: August 06, 2018, 01:50:00 am »

I don't know who made you "hero member" with this attitude!

You can always report any user that is violating the rules or for any other reason. There is a Report To Moderator link. Use it, and please leave personal comments out of here.

As for me, i got no special treat (aka nobody "made" me anything) and i have no affiliation of any kind with Osclass.


Sophia_OS

  • Full Member
  • ***
  • Posts: 146
Re: How to change themes client side?
« Reply #6 on: August 06, 2018, 08:12:19 am »

I don't know who made you "hero member" with this attitude!

You can always report any user that is violating the rules or for any other reason. There is a Report To Moderator link. Use it, and please leave personal comments out of here.

As for me, i got no special treat (aka nobody "made" me anything) and i have no affiliation of any kind with Osclass.

You are not helping,
Can i ask you not to leave comments in my topics?

patrickFromCroatia

  • Sr. Member
  • ****
  • Posts: 473
Re: How to change themes client side?
« Reply #7 on: August 06, 2018, 08:56:57 pm »
And how is all this shi*talk related to the question?

About that, you would probably need a plugin which will use DAO to create table and insert into it. When you have that you need to make a form with a list of themes. When the form gets submitted it will save theme name and user id to your table. Then you use WebThemes class and before_html hook to change theme.

Regards.

Sophia_OS

  • Full Member
  • ***
  • Posts: 146
Re: How to change themes client side?
« Reply #8 on: August 08, 2018, 08:49:09 pm »
And how is all this shi*talk related to the question?

About that, you would probably need a plugin which will use DAO to create table and insert into it. When you have that you need to make a form with a list of themes. When the form gets submitted it will save theme name and user id to your table. Then you use WebThemes class and before_html hook to change theme.

Regards.

Would you please help us practically?

patrickFromCroatia

  • Sr. Member
  • ****
  • Posts: 473
Re: How to change themes client side?
« Reply #9 on: August 08, 2018, 11:07:34 pm »
I'm busy currently, but I will think of making a plugin with this functionality. I will provide more information tomorrow (I hope).

Regards.

Sophia_OS

  • Full Member
  • ***
  • Posts: 146
Re: How to change themes client side?
« Reply #10 on: August 10, 2018, 08:42:05 pm »
I'm busy currently, but I will think of making a plugin with this functionality. I will provide more information tomorrow (I hope).

Regards.

Thank you very much

Sophia_OS

  • Full Member
  • ***
  • Posts: 146
Re: How to change themes client side?
« Reply #11 on: August 23, 2018, 10:42:10 pm »
I'm busy currently, but I will think of making a plugin with this functionality. I will provide more information tomorrow (I hope).

Regards.

Did you make plugin for this?

patrickFromCroatia

  • Sr. Member
  • ****
  • Posts: 473
Re: How to change themes client side?
« Reply #12 on: August 23, 2018, 10:44:06 pm »
I totally forgot about this, sorry. I will try to make it this week. ;)

Regards.

patrickFromCroatia

  • Sr. Member
  • ****
  • Posts: 473
Re: How to change themes client side?
« Reply #13 on: August 24, 2018, 12:33:37 am »
UPDATED

I have made a huge progress, check the demo site: https://demo.zagorski-oglasnik.com/osclass/
However, there's a big problem. The plugin doesn't work for some themes. I have tested Violet, Veronika, Gum, Osclass Wizards, Bender, Modern, Benny, India Classifieds and only Violet, Veronika and Modern worked.

Using the other themes gave me errors - themename_add_body_class is not defined. I have no idea what to do about that so I will create a thread in the Development section to see if someone wants to help.


The plugin is attached below, depending on your themes, it may work great. Please firstly test it on a local server, don't use it on a live website as it may crash it if themes are not supported.

Use <?php themechooser_form(); ?> to show a selector for themes.

EDIT: Try the new version in the attachment, I didn't test it a lot, but it seems the main issue is fixed.

Regards.
« Last Edit: September 19, 2018, 10:50:55 pm by patrickFromCroatia »

patrickFromCroatia

  • Sr. Member
  • ****
  • Posts: 473
Re: How to change themes client side?
« Reply #14 on: September 16, 2018, 02:58:57 pm »
I have made a huge progress, check the demo site: https://demo.zagorski-oglasnik.com/osclass/
However, there's a big problem. The plugin doesn't work for some themes. I have tested Violet, Veronika, Gum, Osclass Wizards, Bender, Modern, Benny, India Classifieds and only Violet, Veronika and Modern worked.

Using the other themes gave me errors - themename_add_body_class is not defined. I have no idea what to do about that so I will create a thread in the Development section to see if someone wants to help.

The plugin is attached below, depending on your themes, it may work great. Please firstly test it on a local server, don't use it on a live website as it may crash it if themes are not supported.

Use <?php themechooser_form(); ?> to show a selector for themes.

Regards.

It would be nice if someone would even respond, considering I put an effort into this... And I found a solution to the issue with themes not supported. There's no interest there so this, when fixed, will probably become a premium plugin.

Regards.