[ABD] Avatar auto resize (0.0.4b)

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
User avatar
nims
Registered User
Posts: 310
Joined: Sun Aug 13, 2006 12:29 pm
Contact:

Re: [Beta] Avatar auto resize (0.0.4b)

Post by nims »

I am also looking for auto resize MOD for avatars. Can anyone confirm if it works with 3.0.6 prosilver.
Outsource content writing - Freelance Content Writers
*** Everything related to kids - Kids ***
SEO- search engine optimisation melbourne
User avatar
nims
Registered User
Posts: 310
Joined: Sun Aug 13, 2006 12:29 pm
Contact:

Re: [Beta] Avatar auto resize (0.0.4b)

Post by nims »

is this MOD being developed further ?
Outsource content writing - Freelance Content Writers
*** Everything related to kids - Kids ***
SEO- search engine optimisation melbourne
Lamer4o
Registered User
Posts: 98
Joined: Tue Dec 22, 2009 9:29 pm

Re: [Beta] Avatar auto resize (0.0.4b)

Post by Lamer4o »

nims wrote:I am also looking for auto resize MOD for avatars. Can anyone confirm if it works with 3.0.6 prosilver.
I'm w8 for the same thing :}
User avatar
keith10456
Registered User
Posts: 2315
Joined: Thu Feb 24, 2005 6:55 pm
Contact:

Re: [Beta] Avatar auto resize (0.0.4b)

Post by keith10456 »

Lamer4o wrote:
nims wrote:I am also looking for auto resize MOD for avatars. Can anyone confirm if it works with 3.0.6 prosilver.
I'm w8 for the same thing :}
It works with 3.0.6.

I suspect the mod writer didn't add anything else to the mod because "it works" as is ;)
Jamiee™
Registered User
Posts: 24
Joined: Tue Dec 15, 2009 11:33 am

Re: [Beta] Avatar auto resize (0.0.4b)

Post by Jamiee™ »

I get this error when trying to access the ACP board:
Parse error: syntax error, unexpected T_DOUBLE_ARROW, expecting ')' in /home/sites/**********.org/public_html/includes/acp/acp_board.php on line 130
and this is line 130:
'AVATAR_MAX_FILESIZE' => ($config['avatar_auto_resize'] && request_var('mode', '')=='avatar') ? '' : $config['avatar_filesize'], => array('lang' => 'validate' => 'int:0', 'type' => 'text:4:10', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']),
Any help?
User avatar
keith10456
Registered User
Posts: 2315
Joined: Thu Feb 24, 2005 6:55 pm
Contact:

Re: [Beta] Avatar auto resize (0.0.4b)

Post by keith10456 »

Jamiee™ wrote:I get this error when trying to access the ACP board:
Parse error: syntax error, unexpected T_DOUBLE_ARROW, expecting ')' in /home/sites/**********.org/public_html/includes/acp/acp_board.php on line 130
and this is line 130:
'AVATAR_MAX_FILESIZE' => ($config['avatar_auto_resize'] && request_var('mode', '')=='avatar') ? '' : $config['avatar_filesize'], => array('lang' => 'validate' => 'int:0', 'type' => 'text:4:10', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']),
Any help?

Double-check your file edits :idea:
Lamer4o
Registered User
Posts: 98
Joined: Tue Dec 22, 2009 9:29 pm

Re: [Beta] Avatar auto resize (0.0.4b)

Post by Lamer4o »

When this mod will be available to install whit Automod ?
kevin90
Registered User
Posts: 11
Joined: Mon Feb 08, 2010 3:40 pm

Re: [Beta] Avatar auto resize (0.0.4b)

Post by kevin90 »

i 've installed success but got a problem
i used localhost,when i changing avatar images then error : Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 7680 bytes) in C:\AppServ\www\a\includes\dv_functions_image.php on line 293
although i configed memory_limit = 16M
healthinfo
Registered User
Posts: 20
Joined: Sun Jan 24, 2010 7:49 pm

Re: [Beta] Avatar auto resize (0.0.4b)

Post by healthinfo »

I also get this error...any ideas (I use 3.0.6)? I already checked my edits 3 times.

Code: Select all

[phpBB Debug] PHP Notice: in file /adm/index.php on line 150: Cannot modify header information - headers already sent by (output started at /language/en/acp/board.php:1)
[phpBB Debug] PHP Notice: in file /adm/index.php on line 152: Cannot modify header information - headers already sent by (output started at /language/en/acp/board.php:1)
[phpBB Debug] PHP Notice: in file /adm/index.php on line 153: Cannot modify header information - headers already sent by (output started at /language/en/acp/board.php:1)
[phpBB Debug] PHP Notice: in file /adm/index.php on line 154: Cannot modify header information - headers already sent by (output started at /language/en/acp/board.php:1)
Health Forum A source for health related information.
kevin90
Registered User
Posts: 11
Joined: Mon Feb 08, 2010 3:40 pm

Re: [Beta] Avatar auto resize (0.0.4b)

Post by kevin90 »

healthinfo wrote:I also get this error...any ideas (I use 3.0.6)? I already checked my edits 3 times.

Code: Select all

[phpBB Debug] PHP Notice: in file /adm/index.php on line 150: Cannot modify header information - headers already sent by (output started at /language/en/acp/board.php:1)
[phpBB Debug] PHP Notice: in file /adm/index.php on line 152: Cannot modify header information - headers already sent by (output started at /language/en/acp/board.php:1)
[phpBB Debug] PHP Notice: in file /adm/index.php on line 153: Cannot modify header information - headers already sent by (output started at /language/en/acp/board.php:1)
[phpBB Debug] PHP Notice: in file /adm/index.php on line 154: Cannot modify header information - headers already sent by (output started at /language/en/acp/board.php:1)
check the file following board.php :)
shadyshane
Registered User
Posts: 10
Joined: Tue Aug 11, 2009 7:21 am

Re: [Beta] Avatar auto resize (0.0.4b)

Post by shadyshane »

tested on phpbb3 3.0.6 on localhost... OK!

Changed: Avatar size limit: Config in ACP

Will update if I found any problem

Code: Select all

###############################################################
## MOD Title:	Avatar auto resize
## MOD Author:	doviet < dev@doviet.net > (Do Viet)
## MOD Description: This MOD resizes automatically user's avatar when it reaches the limit of max width, max height or max filesize
## MOD Version: 0.0.4b
##
## phpBB Version: 3.0.1
## Supported languages: English, Vietnamese, French.
## Supported templates: prosilver (and other templates based on prosilver, such as Glacier, Worldsilver, proIce...), subsilver2 (and other templates based on subsilver2, such as fisubsilver2, Tranquility, Darkness...).
## 
## Installation Level: Easy
## Installation Time: ~15 Minutes
##
## Files to edit:
##		includes/functions_upload.php
##		includes/acp/acp_board.php
##		includes/acp/acp_groups.php
##		includes/acp/acp_users.php
##		includes/ucp/ucp_groups.php
##		includes/ucp/ucp_profile.php
##		language/en/acp/board.php
##		language/vi/acp/board.php [for vietnamese language pack of nedka]
##		language/fr/acp/board.php [for français_strict language pack]
##		styles/prosilver/template/ucp_avatar_options.html
##		styles/subsilver2/template/ucp_profile_avatar.html
## Included Files:
##		includes/dv_functions_image.php
##
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
###############################################################
##	MOD History:
##
##	2008-04-26 - Version 0.0.1a
##		- First alpha version
##		- Resize avatars uploaded by users
##		- Supported image formats:
##			JPEG
##			GIF (non-transparent, static)
##			PNG (non-transparent)
##		- Supported language: english
##
##	2008-05-05 - Version 0.0.2b
##		- Fixed the problem of resizing attachment images
##		- Added supported image formats:
##			GIF transparent
##			PNG 24-bit transparent
##		- Added supported languages: vietnamese, french
##		- Added MOD instruction for subsilver2 style
##		- Added MOD description for supported templates
##
##	2008-06-13 - Version 0.0.3b
##		- Fixed the problem of "Undefined index: avatar_auto_resize" in ACP
##
##	2008-06-29 - Version 0.0.4b
##		- Resize JPEG images by filesize limit
##		- Resize users' avatar uploaded by admins
##		- Resize groups' avatar uploaded by admins or users
###############################################################
## Author Notes:
## - Requirement: GD library installed.
## - Tip: Using Notepad++ or Macromedia Dreamweaver will simplify your code research!
###############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
###############################################################

#
#-----[ UPLOAD ]------------------------------------------
#
includes/dv_functions_image.php to includes/

#
#-----[ SQL ]---------------------------------------------
#
INSERT INTO `phpbb_config`(`config_name`, `config_value`, `is_dynamic`) VALUES ('avatar_auto_resize', 0, 1);

#
#-----[ OPEN ]------------------------------------------
#
includes/functions_upload.php

#
#-----[ FIND ]------------------------------------------
#
if (!defined('IN_PHPBB'))
{
	exit;
}

#
#-----[ AFTER, ADD ]------------------------------------------
#
require($phpbb_root_path . 'includes/dv_functions_image.' . $phpEx);

#
#-----[ FIND ]------------------------------------------
#
	function move_file($destination, $overwrite = false, $skip_image_check = false, $chmod = 0666)
	{
		global $user, $phpbb_root_path;

#
#-----[ FIND INLINE ]------------------------------------------
#
		global $user, $phpbb_root_path

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
, $config

#
#-----[ FIND ]------------------------------------------
#
				// Make sure the dimensions match a valid image
				if (empty($this->width) || empty($this->height))
				{
					$this->error[] = $user->lang['ATTACHED_IMAGE_NOT_IMAGE'];
				}

#
#-----[ AFTER, ADD ]------------------------------------------ 
#
				else if($config['avatar_auto_resize']
				&& (request_var('mode', '')=='avatar'
				|| (request_var('i', '')=='groups' && request_var('mode', '')=='manage')
				|| request_var('i', '')=='users'))
				{
					$img = new Image($this->destination_file);
					$img->set_max_width($config['avatar_max_width']);
					$img->set_max_height($config['avatar_max_height']);
					$img->set_max_filesize($config['avatar_filesize']);
					if($img->resize())
					{
						$img_infos = getimagesize($this->destination_file);
						$this->width = $img_infos[0];
						$this->height = $img_infos[1];
					}
				}

#
#-----[ FIND ]------------------------------------------
#
		$this->additional_checks();

#
#-----[ BEFORE, ADD ]------------------------------------------
#
		if(!$config['avatar_auto_resize']
		|| request_var('mode', '')!='avatar'
		|| (request_var('i', '')!='groups' && request_var('mode', '')=='manage')
		|| request_var('i', '')!='users')

#
#-----[ FIND ]------------------------------------------
#
	function fileupload($error_prefix = '', $allowed_extensions = false, $max_filesize = false, $min_width = false, $min_height = false, $max_width = false, $max_height = false)
	{

#
#-----[ AFTER, ADD ]------------------------------------------
#
		global $config;
		if($config['avatar_auto_resize']
		&& (request_var('mode', '')=='avatar'
		|| (request_var('mode', '')=='manage' && request_var('i', '')=='groups')
		|| request_var('i', '')=='users'))
		$max_filesize = $config['avatar_filesize'];

#
#-----[ OPEN ]------------------------------------------
#
includes/acp/acp_board.php

#
#-----[ FIND ]------------------------------------------
#
						'avatar_max'			=> array('lang' => 'MAX_AVATAR_SIZE',		'validate' => 'int:0',	'type' => 'dimension:3:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
						'avatar_auto_resize'	=> array('lang' => 'AVATAR_AUTO_RESIZE',	'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),

#
#-----[ OPEN ]------------------------------------------
#
includes/acp/acp_groups.php

#
#-----[ FIND ]------------------------------------------
#
							'AVATAR_MAX_FILESIZE'	=> $config['avatar_filesize'],
	
# 
#-----[ REPLACE WITH ]------------------------------------------ 
#
							'AVATAR_MAX_FILESIZE'	=> ($config['avatar_auto_resize'] && request_var('mode', '')=='avatar') ? '' : $config['avatar_filesize'],

#
#-----[ OPEN ]------------------------------------------
#
includes/acp/acp_users.php

#
#-----[ FIND ]------------------------------------------
#
					'AVATAR_MAX_FILESIZE'	=> $config['avatar_filesize'],
	
# 
#-----[ REPLACE WITH ]------------------------------------------ 
#
					'AVATAR_MAX_FILESIZE'	=> ($config['avatar_auto_resize'] && request_var('mode', '')=='avatar') ? '' : $config['avatar_filesize'],

#
#-----[ OPEN ]------------------------------------------
#
includes/ucp/ucp_groups.php

#
#-----[ FIND ]------------------------------------------
#
							'AVATAR_MAX_FILESIZE'	=> $config['avatar_filesize'],
	
# 
#-----[ REPLACE WITH ]------------------------------------------ 
#
							'AVATAR_MAX_FILESIZE'	=> ($config['avatar_auto_resize'] && request_var('mode', '')=='avatar') ? '' : $config['avatar_filesize'],

#
#-----[ OPEN ]------------------------------------------
#
includes/ucp/ucp_profile.php

#
#-----[ FIND ]------------------------------------------
#
					'AVATAR_SIZE'	=> $config['avatar_filesize'],
	
# 
#-----[ REPLACE WITH ]------------------------------------------ 
#
					'AVATAR_SIZE'	=> ($config['avatar_auto_resize'] && request_var('mode', '')=='avatar') ? '' : $config['avatar_filesize'],

#
#-----[ FIND ]------------------------------------------
#
					'S_FORM_ENCTYPE'	=> ($can_upload) ? ' enctype="multipart/form-data"' : '',
	
# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
					'S_AVATAR_AUTO_RESIZE'	=> $config['avatar_auto_resize'] ? true : false,

#
#-----[ OPEN ]------------------------------------------
#
language/en/acp/board.php

#
#-----[ FIND ]------------------------------------------
#
	'MIN_AVATAR_SIZE'				=> 'Minimum avatar dimensions',
	'MIN_AVATAR_SIZE_EXPLAIN'		=> 'Width x Height in pixels.',

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
	'AVATAR_AUTO_RESIZE'			=> 'Avatar auto resize',
	'AVATAR_AUTO_RESIZE_EXPLAIN'	=> 'Resize automatically user\'s avatar when it reaches the limit of max width, max height and max filesize.',

#
#-----[ OPEN ]------------------------------------------
#
language/vi/acp/board.php [for vietnamese users only]

#
#-----[ FIND ]------------------------------------------
#
	'MIN_AVATAR_SIZE'				=> 'Kích thước hình đại diện tối thiểu cho phép',
	'MIN_AVATAR_SIZE_EXPLAIN'		=> 'Chiều rộng x chiều cao với đơn vị tính Pixel.',

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
	'AVATAR_AUTO_RESIZE'			=> 'Tự động điều chỉnh kích thước ảnh đại diện',
	'AVATAR_AUTO_RESIZE_EXPLAIN'	=> 'Điều chỉnh lại ảnh đại diện theo giới hạn tối đa về kích thước và dung lượng cho phép.',

#
#-----[ OPEN ]------------------------------------------
#
language/fr/acp/board.php [for french users only]

#
#-----[ FIND ]------------------------------------------
#
	'MIN_AVATAR_SIZE'				=> 'Dimensions minimales des avatars',
	'MIN_AVATAR_SIZE_EXPLAIN'		=> 'Largeur x hauteur en pixels.',

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
	'AVATAR_AUTO_RESIZE'			=> 'Redimensionnement automatique de l\'avatar automatiquement',
	'AVATAR_AUTO_RESIZE_EXPLAIN'	=> 'Redimensionner automatiquement l\'avatar de l\'utilisateur quand sa taille ou son poids dépassent la limite.',

#
#-----[ OPEN ]------------------------------------------
#
styles/prosilver/template/ucp_avatar_options.html

#
#-----[ FIND ]------------------------------------------
#
		<dt><label>{L_CURRENT_IMAGE}:</label><br /><span>{L_AVATAR_EXPLAIN}</span></dt>

#
#-----[ REPLACE WITH ]------------------------------------------
#
		<dt>
			<label>{L_CURRENT_IMAGE}:</label>
			<!-- IF not S_AVATAR_AUTO_RESIZE -->
			<br />
			<span>{L_AVATAR_EXPLAIN}</span>
			<!-- ENDIF -->
		</dt>

#
#-----[ OPEN ]------------------------------------------
#
styles/subsilver2/template/ucp_profile_avatar.html

#
#-----[ FIND ]------------------------------------------
#
	<td class="row1" width="35%"><b class="genmed">{L_CURRENT_IMAGE}: </b><br /><span class="gensmall">{L_AVATAR_EXPLAIN}</span></td>

#
#-----[ REPLACE WITH ]------------------------------------------
#
	<td class="row1" width="35%"><b class="genmed">{L_CURRENT_IMAGE}: </b>
	<!-- IF not S_AVATAR_AUTO_RESIZE -->
	<br /><span class="gensmall">{L_AVATAR_EXPLAIN}</span>
	<!-- ENDIF --></td>

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
#
# EoM 
Bonky
Registered User
Posts: 8
Joined: Thu Feb 25, 2010 3:07 am

Re: [Beta] Avatar auto resize (0.0.4b)

Post by Bonky »

Is that a working version above? I'd really like to install this mod.

And 'healthinfo' what text editor are you using for your mods? Sounds like you're using one that saves the file with a BOM, like notepad.
User avatar
archivar
Registered User
Posts: 216
Joined: Sun Sep 13, 2009 1:00 pm
Location: Deutschland

Re: [Beta] Avatar auto resize (0.0.4b)

Post by archivar »

Hello doviet,
Thank you for this great mod.
The installation has worked perfectly for me right away. :D
Best regards, Archivar
Sorry for my English Google Translation.
StoarceCreierul
Registered User
Posts: 50
Joined: Sat Mar 27, 2010 1:47 pm
Contact:

Re: [Beta] Avatar auto resize (0.0.4b)

Post by StoarceCreierul »

The mod works great only for my (founder) account.

The other users, including unchanged "admin" (also founder) get the dimension limit error.
Using phpBB 3.0.7-PL1, prosilver based theme with corectly modified

Code: Select all

ucp_avatar_options.html
Switching between themes (with the mentioned file edited) doesn't solve this.
Stoarce Creierul - a splendid example of PhpBB and WordPress integration done with the WP-United MOD.
User avatar
keith10456
Registered User
Posts: 2315
Joined: Thu Feb 24, 2005 6:55 pm
Contact:

Re: [Beta] Avatar auto resize (0.0.4b)

Post by keith10456 »

StoarceCreierul wrote:The mod works great only for my (founder) account.

The other users, including unchanged "admin" (also founder) get the dimension limit error.
Using phpBB 3.0.7-PL1, prosilver based theme with corectly modified

Code: Select all

ucp_avatar_options.html
Switching between themes (with the mentioned file edited) doesn't solve this.
Double... triple check your file edits.

This works fine on my 3.0.7-PL1 site.
Locked

Return to “[3.0.x] Abandoned MODs”