Hi,
How to I get information on the Current Logged in User, such as username, id, etc.
Rgds
Chris
Hi,
How to I get information on the Current Logged in User, such as username, id, etc.
Rgds
Chris
Hello,
You can use the code below.
PHP Code:global $current_user;
echo $current_user->id;
echo $current_user->user_name;
Last edited by AlexAv; 2010-02-24 at 11:51 AM.
Letrium ltd. - Only high quality service
http://letrium.com
hi,
you can get by global variables
global $current_user;
Best Regards
---------------------------------------
Jaydeepsinh Sagar
hi.
sorry i just submit reply(lately).
it's duplicate the answer of AlexAv.
Best Regards
---------------------------------------
Jaydeepsinh Sagar
Thanks thats perfect.
Rgds
Chris
i can get the id of current logged on just wif the code above?
i tried but nth is displaying
How can i get the current user_id in java-script; i have write some java-script condition code lke
if(document.getElementById('assigned_user_id').val ue == '{{$current_id}}') { }
Here '{{$current_id}}') is not working
While assigning the accounts to other user it will alert the javascript message. if assignuser_id = curretnuser_if then return false else it will dispaly the alert message.
I am writing logic_hook for this my javascript code as follows
function check_save() {
if(document.getElementById('assigned_user_id').val ue == '{{$current_id}}') {
document.getElementById('warning').innerHTML = 'Error: Explanation of error';
$j("#warning").fadeIn("slow");
setTimeout('$j("#warning").fadeOut("slow");',20000 );
return false;
}else {
return false;
}
}
Here {{$current_id}} is not working
Please show me all hook file code.
Letrium ltd. - Only high quality service
http://letrium.com
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks