Forums / Cotonti / Extensions / [REQ] Color Changer

barkerb23
#1 2011-02-21 14:38
can someone make a plugin of admin tool, user tool or something so users can change the colors of the themes by their self or make a theme and use it on their profile and only their profile. so they chan change the normal like the text, link, background (etc.) color? technically making their own custom css and using it on their profile? for a certian ranked users?
GHengeveld
#2 2011-02-21 18:29
This can be done ofcourse, but you should be very aware of security issues. I suggest you don't allow direct access to CSS (and defenitely not TPL files). The easiest solution would be to use extrafields for the user profile, in which only very specific preferences (such as background color or text color) can be changed. These fields can be used in TPL files to override default values. So it doesn't require a plugin.
Kort
#3 2011-02-21 18:41
Codename PSP
SED.by - создание сайтов, разработка плагинов и тем для Котонти
Kingsley
#4 2011-02-21 20:05
# Kort : Codename PSP

lol
barkerb23
#5 2011-02-22 05:32
what will i be putting in the extra feilds?
GHengeveld
#6 2011-02-22 06:39
Color codes for example. Say you have an extrafield for page background color named 'bgcolor', and you put a color code such as #FF0000 in it. Then in your TPL files you can use something like:
<body style="background-color:{PHP.usr.profile.user_bgcolor}">
This will make the background color for page body red (#FF0000).

Best is to check if the user has actually set an alternative value, like this:


<body<!-- IF {PHP.usr.profile.user_bgcolor} --> style="background-color:{PHP.usr.profile.user_bgcolor}"<!-- ENDIF -->>
barkerb23
#7 2011-02-23 00:27
# Koradhil : Best is to check if the user has actually set an alternative value, like this:

<body<!-- IF {PHP.usr.profile.user_bgcolor} --> style="background-color:{PHP.usr.profile.user_bgcolor}"<!-- ENDIF -->>
sorry man im a n00b. how can a user set an alternative feild? because when i do "show in user profile" i click yes and nothing
GHengeveld
#8 2011-02-23 01:15
admin.php?m=users&s=extrafields

Name: bgcolor
Type: input

The rest can stay empty.
barkerb23
#9 2011-02-23 09:28
1,) what tpl do i put it in?

Added 50 seconds later:

Best is to check if the user has actually set an alternative value, like this:


<body<!-- IF {PHP.usr.profile.user_bgcolor} --> style="background-color:{PHP.usr.profile.user_bgcolor}"<!-- ENDIF -->>



what?
RaisenBran
#10 2011-02-23 11:05
You can make mutliple css's for one skin, I am currently doing that :D But what your doing can overwrite it.