Foren / Cotonti / Core Labs / Archive / Custom HTML for users/groups

Kilandor
#1 30. Dezember 2008, 17:20
Ok, well I think this is all to common of a requested, or core hacked feature. I don't see any reason we shouldn't just, add a couple new super simple configs.

The ability to configure custom colors for groups. Though I would preferr rather than just custom colors, the abillity for the admin to just enter HTML then they can choose size differences or whatever they want.

All we have to do is add the config rows into the group, edit area (ex. admin.php?m=users&n=edit&g=5) add new option for the HTML. This can be used straight up in sed_build_group(sms) and sed_build_user, for sed_build_user I would just propose adding a 3 optional var, (that wont' break plugins etc) that adds the main group, which eliminates the need for any extra sql query. So there is no extra overhead of any sorts.
Trustmaster
#2 3. April 2009, 23:08
Can you show example implementation of this (the code I mean)?
May the Source be with you!
pieter
#3 4. April 2009, 00:03
I think it should not be in admin-area / database, but in CSS.
Because a lot of sites uses multiple skins.

And some colors for one skin, are maybe not visible in the other skin.
Can't we use CSS for this?
... can we help you ...
Mynt
#4 18. August 2009, 07:57
@pieter,

This would I hope be handled through css in some aspect, however the admin would be able to set the css values. I guess the best way you could do it is a variable system. Set the variables up in the admin section, and have CSS call on the id_ of them?

@Trustmaster,

Here is a few code ways of doing it. In the admin panel, create a new field for each usergroup, name it something such as "usergroup_colors". Have a master field, which would be the default. So "usergroup_colors_default" and all other fields would be named "usergroup_colors_($usergroupname)"

In a post, you could then call on it with if/else commands.

if (user = usergroup) {
document.getElementById("[b]usernamecolor[/b]").style.selector =[b]hexvalue from admin panel[/b]
}
else
{
}

Of course the above is not actual viable working code. It was merely something to show, how you can do it.. in a way I suppose. This could actually be a very easy task, but you just have to add in everything to support it.
"I only sleep when I know I won't miss a thing."
GHengeveld
#5 18. August 2009, 16:41
I don't really get the point of this. Can't you just use this:
<span class="{USER_MAINGRP}">{USER_NAME}</span>
and in the CSS add a class for each maingroup? You could even use XTemplate IF/ELSE system with USER_LEVEL. We already have everything you need to implement this.

In general, I hate such fancy usernames, its a design killer. They should shoot everyone who even thinks of it. A fontsize+1 is okay, but colors...
Mynt
#6 18. August 2009, 17:39
# Koradhil : I don't really get the point of this. Can't you just use this:
<span class="{USER_MAINGRP}">{USER_NAME}</span>
and in the CSS add a class for each maingroup? You could even use XTemplate IF/ELSE system with USER_LEVEL. We already have everything you need to implement this.

In general, I hate such fancy usernames, its a design killer. They should shoot everyone who even thinks of it. A fontsize+1 is okay, but colors...

@Koradhil,
What your describing is essentially core hacking by modifying the original file. I think it was more of talking about implimenting code to make it happen if the user wanted it. The idea behind usercolors makes it easier to understand. A good example would be if I wrote an article, and someone read it, unless that article states my flag of being a member, they don't know that an administrator, or developer wrote it. I am not talking about a design theory of changing the color from Black to Pink, but maybe a contrasting color which can be defined by the admin to match and aid in the color of the sites scheme.
"I only sleep when I know I won't miss a thing."
Kilandor
#7 18. August 2009, 18:37
Yea i've kept forgetting about this feature and have yet to implement something for it (oops).

CSS could be used to a point. And with sed_url I think that could be used for per_user basis, maybe with some tweaking or something it could be refined more. I'll come up with something no worries, i'll make a ticket for it so I don't keep forgetting.
esclkm
#8 18. August 2009, 21:39
Agree with Koradhil/
littledev.ru - мой маленький зарождающийся блог о котонти.
снижение стоимости программирования и снижение стоимости производства разные вещи. Первое можно скорее сравнить с раздачей работникам дешевых инструментов, чем со снижением зарплаты
GHengeveld
#9 19. August 2009, 02:42
Still, we already have it. If you want it to be a user option, add an extra field for it. The admin will likely have FTP access so he can set the styles (color) in CSS. Finally you can use XTemplate IF/ELSE to show the color/style or not, depending on the extrafield setting. You see, it's all very well possible using just normal Cotonti features. There is no need to bloat the core with features like this.
Kilandor
#10 19. August 2009, 03:43
No you cannot fully do this in all area's just with core features.
esclkm
#11 19. August 2009, 04:06
Why not?
littledev.ru - мой маленький зарождающийся блог о котонти.
снижение стоимости программирования и снижение стоимости производства разные вещи. Первое можно скорее сравнить с раздачей работникам дешевых инструментов, чем со снижением зарплаты
Mynt
#12 19. August 2009, 06:50
# esclkm : Why not?

Core hacking is needed for the following areas:
-Any Plugin that calls a username
-When users are linked via [uid]
-When an article is being viewed
-Downloads that are posted
"I only sleep when I know I won't miss a thing."