Author Topic: Search the [MOD] Min. width/height/size for uploaded images  (Read 5077 times)

0 Members and 1 Guest are viewing this topic.

Offline baseline

  • Newbie
  • *
  • Posts: 21
    • View Profile
Search the [MOD] Min. width/height/size for uploaded images
« on: March 15, 2005, 12:57:47 PM »
Hallo,

suche das [MOD] Min. width/height/size! Auf der site von v@no finde ich nur den database-installer, hat jemand noch die beschreibung. Leider ist sie nach dem hack verloren gegangen.

viele grüße

sascha

Offline TIMT

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
Re: Search the [MOD] Min. width/height/size for uploaded images
« Reply #1 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:
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....
« Last Edit: March 15, 2005, 01:23:40 PM by TIMT »

Offline baseline

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Search the [MOD] Min. width/height/size for uploaded images
« Reply #2 on: March 15, 2005, 01:38:10 PM »
Vielen Dank! Thank you!

Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: Search the [MOD] Min. width/height/size for uploaded images
« Reply #3 on: January 10, 2007, 06:44:20 PM »
The database updater you can find here:
http://www.4homepages.de/forum/index.php?topic=7325.0

Und jetzt bitte schliessen... *g*

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: Search the [MOD] Min. width/height/size for uploaded images
« Reply #4 on: January 10, 2007, 11:09:07 PM »
@ Acidgod
... wo kramst du denn überall rum ( März 15, 2005 )... ;)
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...