We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Locked Topic
[ ! ] Custom style usernames based on group permission
Topic Started: Jun 6 2015, 05:00 PM (655 Views)
Revillution.com
Who ate all the pecan sandies?
[ *  * ]
Board Address: http://s15.zetaboards.com/revillution/index/
Board Software: (ZetaBoards or zIFBoards) ZetaBoards
Description: Individual Username markup based on group permissions.
Allows permitted groups to change the foreground, background,border colors & stylings of their username as well as use CSS if they have the know-how. I assume this can be done via custom profile fields but there needs to be a way to either hide the fields if the user doesn't have permission to edit them or prevent their choices from being displayed across the board if they do not have access/permission to use the feature.

Here's 2 codes that accomplish something similar to what I want but would like them combined and with group permissions as I stated:

Code that will show the styling across the entire board:
Code:
 
<!-- User Colors Across board -->
<style type="text/css">
/* CSS FOR NAME COLORS */
.ant {color: #0000FF!important; background-color:#000000; border: 2px solid #0397fe; font-weight: bold;}
.nikki {color: #7329ab!important; background-color:#0a0a0a!important; border: 2px solid #7329ab; font-weight: bold;}
</style>
<script type="text/javascript">
//C.U.A.B
//By Choco
function colorUser(uN,u,uNa) {
$("a[href*=/profile/"+uN+"/]").not("[img]").each(function() {
a=this;a.className=(u.match(/\./))?u.split(".")[1]:a.className;
a.style.color=(!(u.match(/\./)))?u:a.style.color;
a.innerHTML=(uNa)?uNa:a.innerHTML;
});
}

colorUser("3374576",".ant","");
colorUser("3374579",".nikki","");
</script>


Code that uses custom profile fields and can be edited by user but doesn't support highlight/background color, border color or style:
Code by Ferby:

Code:
 
<script type="text/javascript">
// <![CDATA[
$(".c_user .user_profile").each(function() {
var username = {
//
enable_font:true,
font:"Username Font:",
//
enable_color:true,
color:"Username Colour:",
//
enable_glow:true,
glow:"Username Glow:",
glow_amount:5,
//
enable_icon:true,
icon:"Username Icon:",
icon_type:1,
}
// Editing below is not required
var css="",thisIs,image;
if(username.enable_font == true) var font = $(this).find("dt:contains("+username.font+") + dd").text();
if(username.enable_color == true) var color = $(this).find("dt:contains("+username.color+") + dd").text();
if(username.enable_glow == true) var glow = $(this).find("dt:contains("+username.glow+") + dd").text();
if(username.enable_icon == true) var icon = $(this).find("dt:contains("+username.icon+") + dd").text();
//
thisIs = $(this).parent().parent().prev().find(".c_username a:first").text();
$(this).parent().parent().prev().find(".c_username a:first").html("<span>"+thisIs+"</span>");
//
if(username.enable_color == true && color !== undefined) css = css+"color:"+color+";";
if(username.enable_font == true && font !== undefined) css = css+"font-family:"+font+";";
if(username.enable_glow ==true && glow !== undefined) css = css+"text-shadow:0px 0px "+username.glow_amount+"px "+glow+";";
if(username.enable_icon == true && icon !== undefined) {
if(username.icon_type == 1) {
$(this).parent().parent().prev().find(".c_username a:first span").append(" <img src='"+icon+"' alt='Username Image' style='max-height:20px' />");
}
else if(username.icon_type == 2) {
$(this).parent().parent().prev().find(".c_username a:first span").prepend("<img src='"+icon+"' alt='Username Image' style='max-height:20px' /> ");
}
else if(username.icon_type == 3) {
$(this).parent().parent().prev().find(".c_username a:first span").append(" <img src='"+icon+"' alt='Username Image' style='max-height:20px' />");
$(this).parent().parent().prev().find(".c_username a:first span").prepend("<img src='"+icon+"' alt='Username Image' style='max-height:20px' /> ");
}
}
$(this).parent().parent().prev().find(".c_username a:first span").attr("style",css);
console.log(css);
$(this).find("dt:contains("+username.font+") + dd, dt:contains("+username.font+")").hide();
$(this).find("dt:contains("+username.color+") + dd, dt:contains("+username.color+")").hide();
$(this).find("dt:contains("+username.glow+") + dd, dt:contains("+username.glow+")").hide();
$(this).find("dt:contains("+username.icon+") + dd, dt:contains("+username.icon+")").hide();
if($(this).find("dd").length == 0) $(this).hide();
});
// ]]>
</script>


If anyone can assist with getting these done, that would be great! :)
Edited by Revillution.com, Jun 6 2015, 11:08 PM.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
So, you're basically looking for this code, only for usernames instead of posts?
Offline Profile Goto Top
 
Revillution.com
Who ate all the pecan sandies?
[ *  * ]
Cory
Jun 12 2015, 10:57 PM
So, you're basically looking for this code, only for usernames instead of posts?
Yes, but also include border & background coloring and have it set based on group permissions so only selected groups can use it.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Not really practical for styling usernames across the board since the information is always stored in the users profile and it would require way too much AJAX to grab that information for every user. It is practical to only apply this option to usernames in topics though, since the mini profile that stores this information is attached to each post a user creates in a topic.
Offline Profile Goto Top
 
Revillution.com
Who ate all the pecan sandies?
[ *  * ]
The first code i've posted basically displays it wherever the username is a link so logged in as, last post, topic starter, in posts, memberlist & things like active topic list. Would that be possible?
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
So, you don't mind it being a manual process for the administrator, as opposed to a manual process for the user?
Offline Profile Goto Top
 
Revillution.com
Who ate all the pecan sandies?
[ *  * ]
I want the users in a permitted group to be able to change their name styling at will. The first code I posted is a manual process via admin. If this code can be modified to include border color, style & highlight/background color and have it set so it's got a permission set so only specified groups can use it, that'd be good:
User styling v3.1 by Ferby

Edit: I realize this code is the same as the 2nd code that I posted in this topic. here is a demo of ferby's code


Edited by Revillution.com, Jul 3 2015, 10:34 PM.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
To affect all areas of the board like you are wanting, the code can be made where the administrator has to manually style usernames via the Board Template. Due to AJAX restrictions, the members will have no control over their username style, only users with access to the Board Template.
Offline Profile Goto Top
 
Revillution.com
Who ate all the pecan sandies?
[ *  * ]
So to style their own usernames, where would it be able to show up? Just in posts? or is there other areas it would work just not as many?
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Posts is really just about it.
Offline Profile Goto Top
 
Moonface
Member Avatar


This request has gone a lengthy period of time without any new activity, therefore it is being marked as expired. This means that the request was typically too time-consuming or irritating for coders (who provide this service voluntarily in their free time) to complete.

Thank you.
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Closed Requests · Next Topic »
Locked Topic