Posts

Showing posts from May, 2013

Joomla - Get user id

To get user id in joomla use, $user =& JFactory::getUser(); $userId = $user->get( 'id' ); You can also get User details like, $user =& JFactory::getUser(); $userId = $user->username;   // Returns username $userId = $user->name;         // Returns real name $userId = $user->id;             // Returns id

FTP- 503 user cannot login home directory inaccessible - Godaddy

If you find this error in FTP. Please first check whether you have provided correct host name. Sometimes the host name might be in IP address . In that case try with this,   ftp.YourDomain.com

Smarty - How to check smarty Version

In template file you have to give, {$smarty.version} Output: Smarty-3.1.8

Javascript - To get URLs in JS

This function is used to get values from URL. function getUrlVars() {     var vars = {};     var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {         vars[key] = value;     });     return vars; } Eg: URL: http://www.xyz.com?type=test Output:   test So that we can check through Javascript, var type = getUrlVars()["type"]; if(type == "test") { alert(" I am here"); }