Pagina 1 di 1

Default Random 'No Avatar'

Inviato: marzo 12, 2011, 5:48 pm
da Darkman
Modification name: Default Random 'No Avatar'
Author: Boardtalk.net
Modification description: Random Avatars are displayed by default for users who have not selected an Avatar. Pack includes 17 ‘No Avatar’ images.

Contrib contains a sports set of avatars should you prefer a different set.

Many thanks to KillBill. for the assistance in making this modification.
Modification version: 1.0.4a
Tested on phpBB version: 3.0.8

download
http://www.phpbb.com/community/viewtopi ... &t=2123484

File copy

Copy: root/images/avatars/random/*.*
To: images/avatars/random/*.*

Open: includes/functions_display.php
Find:

Codice: Seleziona tutto

		return '';
	}
Replace with

Codice: Seleziona tutto

		$random_avatar = $phpbb_root_path . 'images/avatars/random/no_avatar' . mt_rand(1, 17) . '.gif';

		if (file_exists($random_avatar))
		{
			if (!$avatar_width && !$avatar_height)
			{
				if (list($width, $height) = @getimagesize($random_avatar))
				{
					$avatar_width  = $width;
					$avatar_height = $height;
				} 
				else
				{
					$avatar_width = $avatar_height = 100;
				}
			}

			return '<img src="' . $random_avatar . '" width="' . $avatar_width . '" height="' . $avatar_height . '" title="' . ((!empty($user->lang['RANDOM_AVATAR'])) ? $user->lang['RANDOM_AVATAR'] : 'RANDOM_AVATAR') . '" alt="' . ((!empty($user->lang['RANDOM_AVATAR'])) ? $user->lang['RANDOM_AVATAR'] : 'RANDOM_AVATAR') . '"/>';
		}
		else
		{
			return '';
		}
	}
Open: language/en/common.php

Find

Codice: Seleziona tutto

	'READING_FORUM'				=> 'Viewing topics in %s',
Add before

Codice: Seleziona tutto

	'RANDOM_AVATAR'				=> 'Random avatar',
Nella lingua it:

Codice: Seleziona tutto

	'RANDOM_AVATAR'				=> 'Avatar casuale',
Bella modifica rilasciata sul .com

In pratica mettere avatars casuali a chi non ce li ha rendendo molto simpatico l'aspetto degli argomenti.
Il pack comprende 17 gif ma ne aggiungerà altre.

si riprende amici e vai

Re: Default Random 'No Avatar'

Inviato: maggio 5, 2011, 7:02 pm
da Augusta
la sto vedendo all'opera, almeno credo, qui sul tuo forum visto che non ho ancora inserito l'avatar... (troppo grande, debbo ridimensionarlo, lo farò dopo...) e debbo dire che gli animaletti proposti sono davvero uno spasso! simpaticissimi! :lol:

Re: Default Random 'No Avatar'

Inviato: maggio 5, 2011, 7:08 pm
da Darkman
Augusta ha scritto:la sto vedendo all'opera, almeno credo, qui sul tuo forum visto che non ho ancora inserito l'avatar... (troppo grande, debbo ridimensionarlo, lo farò dopo...) e debbo dire che gli animaletti proposti sono davvero uno spasso! simpaticissimi! :lol:

vero cara amica, sono un pochino indietro qui indaffarato, come sai nelle traduzioni.

Re: Default Random 'No Avatar'

Inviato: ottobre 29, 2011, 10:57 am
da Darkman
Per integrare nella mchat
RMcGirr83 ha scritto:You can have the Random Avatar mod incorporated into the mchat mod. You MUST have the random avatar mod installed on your forum for this to work.

Open

mchat.php

[install]Find This may be a partial find and not the whole line

Codice: Seleziona tutto

$mchat_avatar =
[/install]
[install]Replace with Replace the preceding lines with the following

Codice: Seleziona tutto

				$random_avatar = $phpbb_root_path . 'images/avatars/random/no_avatar' . mt_rand(1, 17) . '.gif';
				$mchat_avatar = $row['user_avatar'] ? get_user_avatar($row['user_avatar'], $row['user_avatar_type'], ($row['user_avatar_width'] > $row['user_avatar_height']) ? 40 : (40 / $row['user_avatar_height']) * $row['user_avatar_width'], ($row['user_avatar_height'] > $row['user_avatar_width']) ? 40 : (40 / $row['user_avatar_width']) * $row['user_avatar_height']) : '<img src="' . $random_avatar . '" width="40" height="40" alt="Random Avatar" />';
[/install]
[install]Find This may be a partial find and not the whole line

Codice: Seleziona tutto

$mchat_avatar =
[/install]
[install]Replace with Replace the preceding lines with the following

Codice: Seleziona tutto

$random_avatar = $phpbb_root_path . 'images/avatars/random/no_avatar' . mt_rand(1, 17) . '.gif';
			$mchat_avatar = $row['user_avatar'] ? get_user_avatar($row['user_avatar'], $row['user_avatar_type'], ($row['user_avatar_width'] > $row['user_avatar_height']) ? 40 : (40 / $row['user_avatar_height']) * $row['user_avatar_width'], ($row['user_avatar_height'] > $row['user_avatar_width']) ? 40 : (40 / $row['user_avatar_width']) * $row['user_avatar_height']) : '<img src="' . $random_avatar . '" width="40" height="40" alt="Random Avatar" />';
[/install]
[install]Find This may be a partial find and not the whole line

Codice: Seleziona tutto

$mchat_avatar =
[/install]
[install]Replace with Replace the preceding lines with the following

Codice: Seleziona tutto

$random_avatar = $phpbb_root_path . 'images/avatars/random/no_avatar' . mt_rand(1, 17) . '.gif';
		$mchat_avatar = $row['user_avatar'] ? get_user_avatar($row['user_avatar'], $row['user_avatar_type'], ($row['user_avatar_width'] > $row['user_avatar_height']) ? 40 : (40 / $row['user_avatar_height']) * $row['user_avatar_width'], ($row['user_avatar_height'] > $row['user_avatar_width']) ? 40 : (40 / $row['user_avatar_width']) * $row['user_avatar_height']) : '<img src="' . $random_avatar . '" width="40" height="40" alt="Random Avatar" />';
[/install]
[install]Find This may be a partial find and not the whole line

Codice: Seleziona tutto

$mchat_avatar =
[/install]

[install]Replace with Replace the preceding lines with the following

Codice: Seleziona tutto

				$random_avatar = $phpbb_root_path . 'images/avatars/random/no_avatar' . mt_rand(1, 17) . '.gif';
				// END random avatar
				$mchat_avatar = $row['user_avatar'] ? get_user_avatar($row['user_avatar'], $row['user_avatar_type'], ($row['user_avatar_width'] > $row['user_avatar_height']) ? 40 : (40 / $row['user_avatar_height']) * $row['user_avatar_width'], ($row['user_avatar_height'] > $row['user_avatar_width']) ? 40 : (40 / $row['user_avatar_width']) * $row['user_avatar_height']) : '<img src="' . $random_avatar . '" width="40" height="40" alt="Random Avatar" />';
[/install]

Few notes
  • the finds above are not complete finds. When you find the code given, you need to replace the entire line with the "replace with"
  • the random avatar mod comes with 17 avatars, if you have more avatars you want to use then upload them into the random avatar directory and change the number 17 within the mt_rand function