Seite 2 von 2

Verfasst: 16.11.2005 13:52
von Markus67
Hi ...

verlinke mal bitte die usercp_avatar.php und die usercp_register.php als txt-Datei.
KB:datei

Markus

Verfasst: 17.11.2005 16:55
von AftermathT

Verfasst: 25.11.2005 11:46
von Markus67
Hi ...

Vor den Änderungen bitte eine Sicherungskopie der Datei erstellen.

suche in der usercp_avatar.php

Code: Alles auswählen

function user_avatar_gallery($mode, &$error, &$error_msg, $avatar_filename)
{
	global $board_config;

	$avatar_filename = str_replace(array('../', '..\\', './', '.\\'), '', $avatar_filename);
	if ($avatar_filename{0} == '/' || $avatar_filename{0} == "\\")


	{
		return '';
	}

	if ( file_exists(@phpbb_realpath($board_config['avatar_gallery_path'] . '/' . $avatar_filename)) && ($mode == 'editprofile') )
	{
		$return = ", user_avatar = '" . str_replace("\'", "''", $avatar_filename) . "', user_avatar_type = " . USER_AVATAR_GALLERY;
	}
	else
	{
		$return = '';
	}
	return $return;
}
ersetze mit:

Code: Alles auswählen

function user_avatar_gallery($mode, &$error, &$error_msg, $avatar_filename, $avatar_category)
{
	global $board_config;

	$avatar_filename = phpbb_ltrim(basename($avatar_filename), "'");
	$avatar_category = phpbb_ltrim(basename($avatar_category), "'");
	
	if(!preg_match('/(\.gif$|\.png$|\.jpg|\.jpeg)$/is', $avatar_filename))
	{
		return '';
	}

	if ($avatar_filename == "" || $avatar_category == "")
	{
		return '';
	} 

	if ( file_exists(@phpbb_realpath($board_config['avatar_gallery_path'] . '/' . $avatar_category . '/' . $avatar_filename)) && ($mode == 'editprofile') )
	{
		$return = ", user_avatar = '" . str_replace("\'", "''", $avatar_category . '/' . $avatar_filename) . "', user_avatar_type = " . USER_AVATAR_GALLERY;
	}
	else
	{
		$return = '';
	}
	return $return;
}
suche:

Code: Alles auswählen

$ini_val = ( @phpversion() >= '4.0.0' ) ? 'ini_get' : 'get_cfg_var';
danach einfügen:

Code: Alles auswählen

	$width = $height = 0;
	$type = '';
suche:

Code: Alles auswählen

			list($width, $height) = @getimagesize($tmp_filename);
ersetze mit:

Code: Alles auswählen

			list($width, $height, $type) = @getimagesize($tmp_filename);
suche:

Code: Alles auswählen

		list($width, $height) = @getimagesize($avatar_filename);
	}

	if ( !($imgtype = check_image_type($avatar_filetype, $error, $error_msg)) )
	{
		return;
	}

	if ( $width > 0 && $height > 0 && $width <= $board_config['avatar_max_width'] && $height <= $board_config['avatar_max_height'] )
	{
		$new_filename = uniqid(rand()) . $imgtype;

		if ( $mode == 'editprofile' && $current_type == USER_AVATAR_UPLOAD && $current_avatar != '' )
		{
			if ( file_exists(@phpbb_realpath('./' . $board_config['avatar_path'] . '/' . $current_avatar)) )
			{
				@unlink('./' . $board_config['avatar_path'] . '/' . $current_avatar);
			}
		}

		if( $avatar_mode == 'remote' )
ersetze mit:

Code: Alles auswählen

		list($width, $height, $type) = @getimagesize($avatar_filename);
	}

	if ( !($imgtype = check_image_type($avatar_filetype, $error, $error_msg)) )
	{
		return;
	}

	switch ($type)
	{
		// GIF
		case 1:
			if ($imgtype != '.gif')
			{
				@unlink($tmp_filename);
				message_die(GENERAL_ERROR, 'Unable to upload file', '', __LINE__, __FILE__);
			}
		break;

		// JPG, JPC, JP2, JPX, JB2
		case 2:
		case 9:
		case 10:
		case 11:
		case 12:
			if ($imgtype != '.jpg' && $imgtype != '.jpeg')
			{
				@unlink($tmp_filename);
				message_die(GENERAL_ERROR, 'Unable to upload file', '', __LINE__, __FILE__);
			}
		break;

		// PNG
		case 3:
			if ($imgtype != '.png')
			{
				@unlink($tmp_filename);
				message_die(GENERAL_ERROR, 'Unable to upload file', '', __LINE__, __FILE__);
			}
		break;

		default:
			@unlink($tmp_filename);
			message_die(GENERAL_ERROR, 'Unable to upload file', '', __LINE__, __FILE__);
	}

	if ( $width > 0 && $height > 0 && $width <= $board_config['avatar_max_width'] && $height <= $board_config['avatar_max_height'] )
	{
		$new_filename = uniqid(rand()) . $imgtype;

		if ( $mode == 'editprofile' && $current_type == USER_AVATAR_UPLOAD && $current_avatar != '' )
		{
			user_avatar_delete($current_type, $current_avatar);



		}

		if( $avatar_mode == 'remote' )
suche:

Code: Alles auswählen

				"AVATAR_IMAGE" => $board_config['avatar_gallery_path'] . '/' . $avatar_images[$category][$i][$j], 
ersetze mit:

Code: Alles auswählen

				"AVATAR_IMAGE" => $board_config['avatar_gallery_path'] . '/' . $category . '/' . $avatar_images[$category][$i][$j], 
suche:

Code: Alles auswählen

	$s_hidden_vars = '<input type="hidden" name="sid" value="' . $session_id . '" /><input type="hidden" name="agreed" value="true" />';
ersetze mit:

Code: Alles auswählen

	$s_hidden_vars = '<input type="hidden" name="sid" value="' . $session_id . '" /><input type="hidden" name="agreed" value="true" /><input type="hidden" name="avatarcatname" value="' . $category . '" />';
Und danach musst du noch diese Änderungen hier machen ... dann sollte es wieder klappen :wink:
http://www.phpbb.com/phpBB/viewtopic.ph ... 24#1834524

Markus

Verfasst: 25.11.2005 14:35
von AftermathT
Das hat aber keine Auswirkungen auf die installierten Mods?

Grüßle aus dem viel zu schneeigen Schwabenland :wink:

Verfasst: 25.11.2005 15:45
von Markus67
AftermathT hat geschrieben:Das hat aber keine Auswirkungen auf die installierten Mods?

Grüßle aus dem viel zu schneeigen Schwabenland :wink:
nein .. das kannst du bedenkenlos so machen :wink:

Markus

Verfasst: 26.11.2005 00:32
von AftermathT
Also ich habe die von dir genannten Änderungen ohne Probleme durchführen können, nur meine common.php sieht anderst aus, als vogegeben :(

http://aftermatht.af.funpic.de/phpbb/common.txt

Ich hab mich auch noch mal versichert wegen den Versionen, das ist definitv die neueste 2.0.18, sagt das Forum selber und auch der "Update Checker"

Verfasst: 26.11.2005 10:57
von Markus67
Hi ...

ausser dem Intor % Portal MOD konnte ich da jetzt keinen anderen MOD entdecken.

Nimm dir einfach eine 2.0.18 common.php und modifiziere die wieder mit dem Teil für den Intro & Portal MOD

suche:

Code: Alles auswählen

if (file_exists('install') || file_exists('contrib'))
davor einfügen:

Code: Alles auswählen

// Intro + Portal MOD START
$sql = "SELECT * FROM " . INTROPORTALMOD_TABLE;
if( ($result = $db->sql_query($sql)) )
while ( $row = $db->sql_fetchrow($result) )
{
	$introportalmod_config[$row['config_name']] = $row['config_value'];
}
// Intro + Portal MOD END
Markus

Verfasst: 27.11.2005 10:36
von AftermathT
Das ist wahnsinn... *sing*

es geht wieder alles :-)

Danke vielmals für den Support ;-)

MfG Thomas

Verfasst: 05.12.2006 12:53
von [MSD] Pitti
ich habe das phpBB 2.0.21 am laufen
bin sehr stolz das ich alle PHPKit Daten übernehmen konnte

nur habe ich ein Problem mit den Avataren
mir scheint das da Optionen fehlen oder ?

[ externes Bild ]

Ich habe in der Board Konfiguration alles gesetzt das es da sein müßte.
Die Ordner für Avatare sind vorhanden und mit CHMOD 777 versehen.

Auf der Admin-Index Seite steht aber dann:
Größe des Avatarordners: Nicht verfügbar
Wer kann mir nen Tip geben ?