Author Topic: Image size for different category  (Read 4365 times)

0 Members and 1 Guest are viewing this topic.

Offline casper01

  • Newbie
  • *
  • Posts: 22
    • View Profile
Image size for different category
« on: July 10, 2008, 11:55:45 PM »

Hello,
I have two main categories of images (photos and postcards), each holding images with a fixed width & height (eg. category #1 holds 1024x864 images, category and #2 contains 640x480 images.

When visitors upload their images in one of these categories, I'd like to set the max size for each category (from admin panel) #1 to 1024x864, and #2 to 640x480.

I hope you understan what I want to do

   

Offline SAD

  • Newbie
  • *
  • Posts: 23
    • View Profile
    • Туристические ФотоАльбомы
Re: Image size for different category
« Reply #1 on: November 12, 2009, 11:14:57 PM »
Давно не заходил в гости, но появилась необходимость в новой галерее.
Так и не нашел ответа на вопрос об отдельных настройках размеров картинок для разных категорий.
Есть в планах релизовать?
Sergey


Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Image size for different category
« Reply #2 on: November 13, 2009, 12:50:36 AM »
The most simple solution is "hard code" the new settings in member.php.

Find:
include(ROOT_PATH.'includes/page_header.php');

Insert above:
if (in_array($cat_id, array(1,23,4,5,10)))
{
  
$config['max_image_width'] = 800//image width
  
$config['max_image_height'] = 800//image height
  
$config['max_media_size'] = 1000//max media filesize in kb

  
$config['max_thumb_width'] = 100//thumbnail width
  
$config['max_thumb_height'] = 100//thumbnail height
  
$config['max_thumb_size'] = 50//max thumbnail filesize in kb
}


numbers in first line "1,23,4,5,10" are comma separated category IDs;
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline SAD

  • Newbie
  • *
  • Posts: 23
    • View Profile
    • Туристические ФотоАльбомы
Re: Image size for different category
« Reply #3 on: November 13, 2009, 10:17:25 AM »
Спасибо.
Я примерно так и сделал.
Но это не совсем удобно.
Будет ли вынесено в админку в след. версии?
Sergey


 

Post your comments here