Advertisement:

Permission to choose own theme?

Aloittaja jnix, huhtikuu 17, 2007, 08:02:34 AP

« edellinen - seuraava »

jnix

My overall setting is for users NOT to be able to select their own theme. But I'd like global moderators to be able to - to test out new themes really. I tried selecting a different theme in their profile, but it has no effect (presumably due to the overall setting..) - but this does work for admin (ie by changing the theme in the admin profile I can use a different one).

Is there any way to allow global moderators to choose their own theme, but no-one else?

Thanks in advance

Sarge

In your forum, what permissions do global moderators (and of course admins) have that no-one else has?


    Please do not PM me with support requests unless I invite you to.

http://www.zeriyt.com/   ~   http://www.galeriashqiptare.net/


Lainaa
<H> I had zero posts when I started posting

jnix

Several eg they can modify/remove any post. And there are a couple of boards that only they can see. I presume pretty standard mod type settings.

SleePy

Do you have it enabled so users can change their theme?
Admin -> Themes and Layout
Allow members to select their own themes.
Allow members to select the "Default" theme.

are checked?
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Sarge

Lainaus käyttäjältä: SleePy - huhtikuu 17, 2007, 09:04:20 IP
Do you have it enabled so users can change their theme?
Admin -> Themes and Layout
Allow members to select their own themes.
Allow members to select the "Default" theme.

are checked?

SleePy, the whole point is to allow only global moderators, not regular members, to change their theme.

I figured out a way to do that, but I need to know the name of a permission that is (normally) only assigned to global moderators. Can you help with that?

    Please do not PM me with support requests unless I invite you to.

http://www.zeriyt.com/   ~   http://www.galeriashqiptare.net/


Lainaa
<H> I had zero posts when I started posting

metallica48423

Sarge, theres a couple things you could do, just as suggestions:

1.) Create a custom permission -- this would be the most customizable route

2.) Do a check on the membergroup ID -- This would be customizable, but not easily or without further code modification.

3.) One permission that mods usually always have is 'Moderate board'

With the gumption, you could package this up and make it a mod :P 

Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

LainaaMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

Sarge

Lainaus käyttäjältä: metallica48423 - huhtikuu 18, 2007, 02:49:01 AP
Sarge, theres a couple things you could do, just as suggestions:

1.) Create a custom permission -- this would be the most customizable route

2.) Do a check on the membergroup ID -- This would be customizable, but not easily or without further code modification.

3.) One permission that mods usually always have is 'Moderate board'

With the gumption, you could package this up and make it a mod :P 



I'm trying to code the second way right now.

It seems that the first way might be implemented in the next SMF version. Here's a comment in Profile.template.php:


// Are they allowed to change their theme? // !!! Change to permission?


Anyway, I'll try to make a permission and release a mod. ;)

    Please do not PM me with support requests unless I invite you to.

http://www.zeriyt.com/   ~   http://www.galeriashqiptare.net/


Lainaa
<H> I had zero posts when I started posting

metallica48423

#7
IF it helps any :P

2 is the Membergroup ID of Global Moderators

if (in_array($user_info['groups'], 2) {
code here
}


I THINK (i'm not sure) that this check is done with if $context['user']['is_admin'] if the option is not on, i am not sure, i'd have to look sometime tomorrow... so it'd be matter of checking if they're an admin || if they're a global mod?

Just my random thoughts, i'll have a look at the code if you can't figure it out :)
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

LainaaMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

Sarge

Thanks, I think I have figured it out already. Although I think it's in_array(2, $user_info['groups']) -- not the other way round :P

    Please do not PM me with support requests unless I invite you to.

http://www.zeriyt.com/   ~   http://www.galeriashqiptare.net/


Lainaa
<H> I had zero posts when I started posting

metallica48423

i thought that looked funny -- i did a search for $user_info

You are correct, it is before :P
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

LainaaMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

Sarge

#10
I coded the changes and made a mod package. See attached. You can install it through Package Manager.

This mod allows all members of the membergroup with ID = 2 (global moderators by default) to change their theme.

Tested in a SMF 1.1.2 installation, but could work in other SMF versions too.

P.S. Fixed mod ID (it was set as another mod of mine).

    Please do not PM me with support requests unless I invite you to.

http://www.zeriyt.com/   ~   http://www.galeriashqiptare.net/


Lainaa
<H> I had zero posts when I started posting

Sarge

#11
I just submitted the mod:
http://custom.simplemachines.org/mods/index.php?mod=769

P.S. I intend to make the mod even better by creating a permission for it.

    Please do not PM me with support requests unless I invite you to.

http://www.zeriyt.com/   ~   http://www.galeriashqiptare.net/


Lainaa
<H> I had zero posts when I started posting

jnix

Thanks all - especially Sarge for the mod. Works fine for me - exactly what I wanted. Now means I can get feedback on any theme changes from global mods before unleashing them on all users.

Makes sense to me to make it a permission - is it worth me making a feature request for this?




metallica48423

I think it would be best and make a mod request for it -- unless Sarge is going to change his to add permissions as an option :P

I suspect, along with Sarge, that this may already be planned for 2.0, due to the comment.  Only time will tell
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

LainaaMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

Sarge

Lainaus käyttäjältä: jnix - huhtikuu 18, 2007, 04:39:58 AP
Makes sense to me to make it a permission - is it worth me making a feature request for this?

Although there's a hint for it in the source files, by all means do request this feature -- if you don't request it, then I will.

There's no harm in poking the devs now and then, is there? :P

Lainaus käyttäjältä: metallica48423 - huhtikuu 18, 2007, 04:43:40 AP
I think it would be best and make a mod request for it -- unless Sarge is going to change his to add permissions as an option :P

Unless? I'm already rewriting this mod to use permissions instead. This way, the admin can set the option for whatever membergroup he/she wishes.

Stay tuned. ;)

    Please do not PM me with support requests unless I invite you to.

http://www.zeriyt.com/   ~   http://www.galeriashqiptare.net/


Lainaa
<H> I had zero posts when I started posting

metallica48423

the Unless was more of a 'not sure whether or not you were planning to do so but strongly suspected so' unless :P

I think it'd be a fairly useful mod, however :P

Will definitely check it out when the permissioned version becomes available
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

LainaaMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

KGIII

Check ID on re-write. (Almost done being swamped.) :D (It is set as the shared forum mod in your package that you have here.)

My PC Support Forum
Please ask in-thread before PMing
                   SMF Help
                   Visit My Blog

How can we improve the support process?:
http://www.simplemachines.org/community/index.php?topic=163533.0

SMF vs. Godzilla? Who do you think will win?

jnix

Lainaus käyttäjältä: Sarge - huhtikuu 18, 2007, 04:49:27 AP
Although there's a hint for it in the source files, by all means do request this feature -- if you don't request it, then I will.

Ok, have made a feature request.

Thanks again for your help

Sarge

Lainaus käyttäjältä: metallica48423 - huhtikuu 18, 2007, 04:52:39 AP
Will definitely check it out when the permissioned version becomes available

How long are you going to stay online tonight? ;)

Lainaus käyttäjältä: KGIII - huhtikuu 18, 2007, 04:59:47 AP
Check ID on re-write. (Almost done being swamped.) :D (It is set as the shared forum mod in your package that you have here.)

Fixed. Thanks!

    Please do not PM me with support requests unless I invite you to.

http://www.zeriyt.com/   ~   http://www.galeriashqiptare.net/


Lainaa
<H> I had zero posts when I started posting

KGIII

You MAY have issues with it at the mod site - if you've already uploaded it for approval. Let one of us know if you do and we can get it deleted it and you can upload a new one if required. (I say this 'cause, well, I have had to have one deleted though they may have fixed that issue now.)

My PC Support Forum
Please ask in-thread before PMing
                   SMF Help
                   Visit My Blog

How can we improve the support process?:
http://www.simplemachines.org/community/index.php?topic=163533.0

SMF vs. Godzilla? Who do you think will win?

Advertisement: