118 Posts
webchun
7 years ago
Topic

Hello guys, I'd like to embed seblod user avatar in my mod_login template override, so when users logged in, they will see their photo in the login module. Any idea how can I do that?

Get a Book for SEBLOD
118 Posts
webchun
7 years ago
1
Level 1

ok I ended up by accessing the db directly :

$db = JFactory::getDBO();
$query = $db->getQuery(true);
$query->
	select('avatar')->
	from('#__cck_store_item_users')->
	where('id='.(int)$user->id);
$db->setQuery($query) ;
$avatar = $db->loadResult();

but this gives me the full path to the uploaded file : images/users/xxx/image_name.jpg 

How can I get the thumbnail path? ( eg. images/users/xxx/_thumbx/image_name.jpg )

118 Posts
webchun
7 years ago
0
Level 2

Ok found it by myself

// get user avatar
$db 	= JFactory::getDBO();
$query 	= $db->getQuery(true);
$query->
	select('avatar')->
	from('#__cck_store_item_users')->
	where('id='.(int)$user->id);
$db->setQuery($query) ;
$avatar = $db->loadResult();
$path 	= pathinfo($avatar);
$thumb 	= $path ['dirname'].DIRECTORY_SEPARATOR.'_thumb3'.DIRECTORY_SEPARATOR.$path ['basename'];
Get a Book for SEBLOD