Login     Sign up
How I can change "username" to "full name"
Pramod Indunith (@pramod)
Join date: Dec 1st 2010
Community posts: 6
View Profile
Send Message

Hi,

Friends, I'm new to Jcow. I need to replace the username of users to their full name.

Ex 1 -
"Up coming birthdays

  • lgs123 - 12/18
  • mahasona - 12/23"

But their real names are,
"lgs123 - Lakshika Gayal
mahasona - Yohan Uthpala"

Ex 2 -
And when users be friends, the dashboard shows like this -
"Pramod Indunith be a friend of dave153."
I want to do it "Pramod Indunith be a friend of Dave"

So that's the problem. Can you help me ?

172 months ago
Jcow Master (@falcone)
Join date: Sep 2nd 2010
Community posts: 917
View Profile
Send Message

users birthday

file: includes\libs\dashboard.module.php

function friends_birthday
change line
[code]
$content .= '<li>'.url('u/'.$user['username'],$user['username']).' - <strong>'.$user['birthmonth'].'/'.$user['birthday'].'</strong></li>';
[/code]
to
[code]
$content .= '<li>'.url('u/'.$user['username'],$user['fullname']).' - <strong>'.$user['birthmonth'].'/'.$user['birthday'].'</strong></li>';
[/code]

friends.

file includes\libs\friends.module.php
function approve
change line
[code]
stream_publish(
t(
'became a friend of {1}',
url('u/'.$user['username'],$user['fullname'],'','',1)
)
);
[/code]
in
[code]
stream_publish(
t(
'became a friend of {1}',
url('u/'.$user['username'],$user['username'],'','',1)
)
);
[/code]

172 months ago
Pramod Indunith (@pramod)
Join date: Dec 1st 2010
Community posts: 6
View Profile
Send Message

Thanks falcone. You are a GOD!!!

Also can u tell me how to change the "username" in Browse category names to their full name?

172 months ago
Jcow Master (@falcone)
Join date: Sep 2nd 2010
Community posts: 917
View Profile
Send Message

file includes\libs\browse.module.php

function index
change line
[code]
section_content('<li><span>'.url('u/'.$member['username'],$member['username']).'</span><br />
[/code]
in
[code]
section_content('<li><span>'.url('u/'.$member['username'],$member['fullname']).'</span><br />
[/code]

172 months ago
Thakim (@thakim83)
Join date: Oct 8th 2010
Community posts: 87
View Profile
Send Message

Cheers Master Falcone!
And how to you edit for stream comment?

172 months ago
Faizan (@faizi)
Join date: Nov 28th 2010
Community posts: 20
View Profile
Send Message

yes great code. but one thing. how to change the username to fullname while we click on "friends" on the top.
Thnks

172 months ago
Pramod Indunith (@pramod)
Join date: Dec 1st 2010
Community posts: 6
View Profile
Send Message

Hmmm... that works. but there is an error. You can see it below. How can i show the first name of the users in Browse ? The names are binded now together. See below picture.

[img]http://lh5.ggpht.com/_fTa2rhh5Kjc/TPcH-CvJD1I/AAAAAAAAAaI/C_a5azaZC_E/errir.jpg[/img]
[url]http://lh5.ggpht.com/_fTa2rhh5Kjc/TPcH-CvJD1I/AAAAAAAAAaI/C_a5azaZC_E/errir.jpg[/url]

172 months ago
Faizan (@faizi)
Join date: Nov 28th 2010
Community posts: 20
View Profile
Send Message

it looks great.

172 months ago
putribetha (@putribetha)
Join date: Sep 17th 2010
Community posts: 34
View Profile
Send Message

wow is good idea...tanks master

172 months ago
arizon efendi (@arizon)
Join date: Aug 26th 2010
Community posts: 145
View Profile
Send Message

you must edit browse.module.php

[code]
section_content('<ul class="small_avatars">');
[/code]

replace wiht this one
[code]
section_content('<ul class="gallery">');
[/code]

172 months ago
sinici (@sinici)
Join date: Nov 26th 2010
Community posts: 24
View Profile
Send Message

[quote=arizon]you must edit browse.module.php

[code]
section_content('<ul class="small_avatars">');
[/code]

replace wiht this one
[code]
section_content('<ul class="gallery">');
[/code] [/quote]

thanks brother....
how to change username to the fullname in the comments????plese..help me..

172 months ago