Help
Discuss or request ArrowChat modifications
User avatar
chattasubito
Customer
 
Posts: 11
Joined: 25 Apr 2010, 03:12

 

by chattasubito 27 Apr 2010, 02:09

Hi, in the past days I've already little modded my copy of Arrowchat to better fit the needs of my community and now I have only 1 mod left which I really need but I'm having some problems to make it work...

What I need is a mod to show the names of the users in the list in different colors according to their sex (let's say for example, pink color for women, blue for men). I modified my getFriendsList() function adding a new "gender" field which I already have in my user's table:

Code: Select all
..... ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_NAME." username, ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_NAME." gender, .......


This "gender" field returns "1" if the user is a man, "2" if a woman.

Now my question is: using this modified getFriendsList() function, how to modify the arrowchat_core.js (and relative template's style.css) to show the username in blue color if "gender = 1" and pink if "gender = 2"?

Any help would be very appreciated, thank you!
User avatar
Jason
Customer
 
Posts: 2356
Joined: 12 Dec 2009, 16:06

 

by Jason 27 Apr 2010, 11:38

You'll need to edit receive_buddylist like so:

Code: Select all
            $buddyList[] = array('g' => $chat['gender'], 'id' => $chat['userid'], 'n' => $chat['username'], 's' => $chat['status'], 'm' => $chat['message'], 'a' => $avatar, 'l' => $link);


Then in arrowchat_core.js you'll need to just add a style if it is male or a different style for female. So in the function Va(b) you'll need to do this.

I didn't test this or anything so it may not be 100% correct, but something like this (f.g is your gender variable)..

Code: Select all
if(f.g==1){a("#arrowchat_user_"+f.id).css("color","#FFF")}else if(f.g==2){a("#arrowchat_user_"+f.id).css("color","#000")}


You could also do .addClass("classname") and then add a male and female style to the css file.
User avatar
FBorcherds
Customer
 
Posts: 7
Joined: 12 Oct 2012, 01:22

 

by FBorcherds 13 Oct 2012, 00:53

Hi. Which file do I edit to get the different genders show up differently in Skadate?

Help will be much appriciated
User avatar
Staff Bot
ArrowChat Team
 
Posts: 8996
Joined: 07 Nov 2012, 13:41

 

by Staff Bot 16 Dec 2014, 00:26

[b]This thread has been locked because the last post is greater than six months old. There is a good chance that the information in this thread is outdated. Please open a new topic if you wish to discuss this further.[/b]