×
Kunena 5.2.1 Addons released (Yesterday)

The Kunena team has announce the arrival of Addons (modules and plugins made by Kunena team) in version 5.2.1 which is now available for download. This version addresses most of the issues that were discovered since the release of Kunena 5.2.3. Download the Kunena Addons

Question How to disable the automatic avatars size change and link to the original file

More
5 years 9 months ago #1 by Armor
Hi ;) (sorry for my language)
I looked a little on forum but I have not found a solution.
I want to use animated gifs as avatars and I do not want to Kunena reworked it to me.
On my forum I use a gallery avatars, I would like to receive the address directly into the selected avatar and permanently disable the automatic avatars size change in avatars/resized (This creates unnecessary files).

I use J!3.4 & K4.0

Please Log in or Create an account to join the conversation.

More
5 years 8 months ago #2 by Armor
:( Can anyone help me ?
Can someone point me though precisely which functions are of this, and where find it ?
I do not want to "look in the dark" :laugh:
Author Kunena surely knows it ;)

Please Log in or Create an account to join the conversation.

More
5 years 8 months ago #3 by 810
you can use antimated gifs <90px.

"and I do not want to Kunena reworked it to me." ?

Please Log in or Create an account to join the conversation.

More
5 years 8 months ago - 5 years 8 months ago #4 by Armor
Hi :)
I do not want to be limited ;)
I have animated gifs smaller and larger, for example
/media/kunena/avatars/gallery/Uzytkownicy/caage1.gif
I know that the script creates
/media/kunena/avatars/resized/size200/gallery/Uzytkownicy/caage1.gif
but also
/media/kunena/avatars/resized/size36/gallery/Uzytkownicy/caage1.gif
Where is the function of copying and changing ?
If I do not get help I'll be looking for "/resized/" in PHP but I'd have to get all files on disk. I thought, here I get such information.

"and I do not want to Kunena reworked it to me." ? >>

I want to use CSS for resize images, not PHP code ;)
Attachments:
Last edit: 5 years 8 months ago by Armor.

Please Log in or Create an account to join the conversation.

More
5 years 8 months ago #5 by Armor
Okay, I worked it out myself :)

I found 2 files
administrator\components\com_kunena\install\plugins\plg_kunena_kunena\avatar.php
plugins\kunena\kunena\avatar.php

I changed
	protected function _getURL($user, $sizex, $sizey)
 
	{
 
		$user = KunenaFactory::getUser($user);
 
		$avatar = $user->avatar;
 
		$config = KunenaFactory::getConfig();
 
 
 
		$path = KPATH_MEDIA ."/avatars";
 
		if ( !is_file("{$path}/{$avatar}")) {
 
			// If avatar does not exist use default image
 
			if ($sizex <= 90) $avatar = 's_nophoto.jpg';
 
			else $avatar = 'nophoto.jpg';
 
		}
 
		$dir = dirname($avatar);
 
		$file = basename($avatar);
 
		if ($sizex == $sizey) {
 
			$resized = "resized/size{$sizex}/{$dir}";
 
		} else {
 
			$resized = "resized/size{$sizex}x{$sizey}/{$dir}";
 
		}
 
		if ( !is_file( "{$path}/{$resized}/{$file}" ) ) {
 
			require_once(KPATH_SITE.'/lib/kunena.image.class.php');
 
			CKunenaImageHelper::version("{$path}/{$avatar}", "{$path}/{$resized}", $file, $sizex, $sizey, intval($config->avatarquality));
 
		}
 
		return KURL_MEDIA . "avatars/{$resized}/{$file}";
 
	}

for this
	protected function _getURL($user, $sizex, $sizey)
 
	{
 
		$user = KunenaFactory::getUser($user);
 
		$avatar = $user->avatar;
 
		$config = KunenaFactory::getConfig();
 
 
		$path = KPATH_MEDIA ."/avatars";
 
		if ( !is_file("{$path}/{$avatar}")) {
 
				$avatar = 'nophoto.jpg';
		}
 
		$dir = dirname($avatar);
 
		$file = basename($avatar);
 
		if ( !is_file( "{$path}/{$dir}/{$file}" ) ) {
 
			$path = KPATH_MEDIA ."/avatars";
			$file = 'nophoto.jpg';
			return KURL_MEDIA . "{$path}/{$file}";	
 
		}
 
		return KURL_MEDIA . "avatars/{$dir}/{$file}";
 
	}

I do not know if this is good, but it works.
I use only gallery ;)

Please Log in or Create an account to join the conversation.

  • Not Allowed: to create new topic.
  • Not Allowed: to reply.
  • Not Allowed: to edit your message.
Time to create page: 0.326 seconds