×
Kunena 5.2 Beta 1 Released (24 Sep 2020)

The Kunena team is thrilled to announce the first public beta release of Kunena 5.2, a native Joomla extension for Joomla 3.9. This is a development release and should be only be used for testing; this version is not recommended for live websites at this stage.

The purpose of this release is to encourage testing by downloading, installing and identifying any problems or shortcomings that people may discover. K 5.2.0 B1 is stable and we are aware that people will discover defects. We encourage you to use the forum to report defects, as soon as they are discovered, so that the development team can work through the problems before the release of K 5.1 as a stable product. Reporting defects does not mean that the problems can or will be fixed. The Kunena team is looking forward to hearing your feedback on how well we have achieved our design goals.

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

More
5 years 3 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 3 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 3 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 3 months ago - 5 years 3 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 3 months ago by Armor.

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

More
5 years 3 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.257 seconds