451
Mods & Plugins (Requests & Discussions) / Re: Search the [MOD] Min. width/height/size for uploaded images
« on: March 15, 2005, 01:18:57 PM »
Check Minimum für Upload
This mod will add a minimum width/height and size requirements for new uploaded images.
Affected files:
admin/settings.php
includes/upload.php
lang/<yourlangauge>/admin.php
lang/<yourlangauge>/main.php
Installataion
Step 1
Open admin/settings.php
Find:
Replace with:
Step 2
Open includes/upload.php
Find:
Add below:
Step 2.1
Find:
Add below:
Step 2.2
Find:
Add below:
Step 2.3
Find:
Add above:
Step 2.4
Find:
Add above:
Step 3
Open lang/<yourlangauge>/admin.php
Find:
Add above:
Step 4
Open lang/<yourlangauge>/main.php
At the end, above closing ?> add this:
Step 5
Download this database updater
Unpack it and upload to your 4images root diretory.
Execute it by typing in your browser http://<yoursiteaddress>/path/to/4images/install_min_upload.php and follow the instructions.
After all this done, u should see new settings under "Upload settings" section in ACP->Settings.
P.S. your 4images administrator will not be affected by any of the upload restrictions! Test it as a regular member or as a guest.
V@no... I Hope, everything is ok so....
This mod will add a minimum width/height and size requirements for new uploaded images.
Affected files:
admin/settings.php
includes/upload.php
lang/<yourlangauge>/admin.php
lang/<yourlangauge>/main.php
Installataion
Step 1
Open admin/settings.php
Find:
Code: [Select]
show_setting_row("max_thumb_width");
show_setting_row("max_thumb_height");
show_setting_row("max_thumb_size");
show_setting_row("max_image_width");
show_setting_row("max_image_height");
show_setting_row("max_media_size");
Replace with:
Code: [Select]
show_setting_row("max_thumb_width");
show_setting_row("max_thumb_height");
show_setting_row("max_thumb_size");
show_setting_row("min_thumb_width");
show_setting_row("min_thumb_height");
show_setting_row("min_thumb_size");
show_setting_row("max_image_width");
show_setting_row("max_image_height");
show_setting_row("max_media_size");
show_setting_row("min_image_width");
show_setting_row("min_image_height");
show_setting_row("min_media_size");
Step 2
Open includes/upload.php
Find:
Code: [Select]
var $max_size = array();
Add below:
Code: [Select]
var $min_width = array();
var $min_height = array();
var $min_size = array();
Step 2.1
Find:
Code: [Select]
$this->max_size['media'] = $config['max_media_size'] * 1024;
Add below:
Code: [Select]
$this->min_width['thumb'] = $config['min_thumb_width'];
$this->min_width['media'] = $config['min_image_width'];
$this->min_height['thumb'] = $config['min_thumb_height'];
$this->min_height['media'] = $config['min_image_height'];
$this->min_size['thumb'] = $config['min_thumb_size'] * 1024;
$this->min_size['media'] = $config['min_media_size'] * 1024;
Step 2.2
Find:
Code: [Select]
if ($this->image_size[1] > $this->max_height[$this->image_type]) {
$ok = 0;
$this->set_error($this->lang['invalid_image_height']);
}
Add below:
Code: [Select]
if ($this->image_size[0] < $this->min_width[$this->image_type]) {
$ok = 0;
$this->set_error($this->lang['invalid_image_width_min']);
}
if ($this->image_size[1] < $this->min_height[$this->image_type]) {
$ok = 0;
$this->set_error($this->lang['invalid_image_height_min']);
}
Step 2.3
Find:
Code: [Select]
function save_file() {
Add above:
Code: [Select]
function check_min_filesize() {
if ($this->HTTP_POST_FILES[$this->field_name]['size'] < $this-
>min_size[$this->image_type]) {
return false;
}
else {
return true;
}
}
Step 2.4
Find:
Code: [Select]
if (eregi("image", $this->HTTP_POST_FILES[$this-
>field_name]['type'])) {
Add above:
Code: [Select]
if (!$this->check_min_filesize()) {
$this->set_error($this->lang['invalid_file_size_min']);
$ok = 0;
}
Step 3
Open lang/<yourlangauge>/admin.php
Find:
Code: [Select]
$auto_thumbnail_resize_type_optionlist = array(
Add above:
Code: [Select]
$setting['min_thumb_width'] = "Min. width of thumbnail in pixel";
$setting['min_thumb_height'] = "Min. heigth of thumbnail in pixel";
$setting['min_thumb_size'] = "Min. thumbnail size in KB";
$setting['min_image_width'] = "Min. image width in pixel";
$setting['min_image_height'] = "Min. image heigth in pixel";
$setting['min_media_size'] = "Min. image size in KB";
Step 4
Open lang/<yourlangauge>/main.php
At the end, above closing ?> add this:
Code: [Select]
$lang['min_filesize'] = "Min. File Size: ";
$lang['min_imagewidth'] = "Min. Image Width: ";
$lang['min_imageheight'] = "Min. Image Height: ";
$lang['invalid_image_width_min'] = "Image width invalid";
$lang['invalid_image_height_min'] = "Image heigth invalid";
$lang['invalid_file_size_min'] = "Image size invalid";
Step 5
Download this database updater
Unpack it and upload to your 4images root diretory.
Execute it by typing in your browser http://<yoursiteaddress>/path/to/4images/install_min_upload.php and follow the instructions.
After all this done, u should see new settings under "Upload settings" section in ACP->Settings.
P.S. your 4images administrator will not be affected by any of the upload restrictions! Test it as a regular member or as a guest.
V@no... I Hope, everything is ok so....