1. Мы продолжаем публиковать интересные статьи на тему SocialEngine 4. Одна из статей посвящена правильному выбору сервера для вашей социальной сети, а другая содержит советы по увеличению производительности платформы. Также мы добавили большую статью о пользовательских уровнях. Ознакомиться со статьями вы можете в разделе Вопросы и Ответы SocialEngine 4.
  2. Вам кажется, что ваша версия SocialEngine 4, работает медленно?

    Голосуйте. Пишите свою версию системы, железо на чем работает и количество пользователей. Будем увеличивать производительность :-) Подробнее

  3. В связи с участившимися случаями попыток продажи пользователями форума различных "сборок" коммерческих социальных платформ, обычно основанных на SocialEngine 3, вводится новое правило для форума. Запрещается создание тем или размещение в уже созданных предложений о продаже или размещение ссылок на сайты, где происходит продажа "сборок". Пользователи, которые продолжат свою коммерческую деятельность в данном направлении, будут заблокированы. Подробнее.

Avatar size on upload

Discussion in 'Прочая Поддержка - Help Requests' started by abatu, Apr 5, 2012.

  1. abatu Thread starter User


    Offline
    Message Count:
    87
    Likes Received:
    4
    Hi,Please any one knows how to set max and min width/height of avatar photo on upload?
    So if User tried to upload any photo bigger or smaller than max or min allowed (width/height)..so display error!
    Thank you
  2. Sn+ User


    Offline
    • Знаменитый
    Message Count:
    377
    Likes Received:
    76
    My version of SE:
    3.20
    My version of phpFox:
    3.0.0
    you mean plugin avatar or just want to resize avatars size ? i didnt get you at all sorry )
  3. abatu Thread starter User


    Offline
    Message Count:
    87
    Likes Received:
    4
    Thank you for replay....
    all what i want: to prevent user to upload photo with width < 193 px and height < 290px.
    thank you
  4. Sn+ User


    Offline
    • Знаменитый
    Message Count:
    377
    Likes Received:
    76
    My version of SE:
    3.20
    My version of phpFox:
    3.0.0
    so just have a change in css file seek it for the script photo size and rechange how you want thats all !
  5. abatu Thread starter User


    Offline
    Message Count:
    87
    Likes Received:
    4
    No....in css will not give you the exact effect..cuz it will not resize it well.
    We need to get image size on upload in php and if it dosen't equal our rules (width and height) then reject it and display error.....
    I tried to play with the php file from ajax avatar as it has this option, But i couldn't figure out how to do it for normal uploading...
    please if any one can help..i will be so grateful .
  6. Gooos абырвалГ


    Offline
    • Admin
    Message Count:
    2,435
    Likes Received:
    645
    My version of SE:
    3.20
    avatar.jpg
    nadri likes this.
  7. abatu Thread starter User


    Offline
    Message Count:
    87
    Likes Received:
    4
    Gooos...i know...but this is max-width and max-height....
    I need min-width and min-height...
    Now you can try..user even can upload 16px icon as avatar!!!!
  8. abatu Thread starter User


    Offline
    Message Count:
    87
    Likes Received:
    4
    I SOLVED IT...here is how to do it:
    In class_upload.php
    1-Find (// OUTPUT: BOOLEAN INDICATING WHETHER UPLOAD SUCCEEDED OR FAILED)
    2-Find
    Code:
    function upload_photo($photo_dest, $file_maxwidth = "", $file_maxheight = "")
    replace with
    function upload_photo($photo_dest, $file_maxwidth = "", $file_maxheight = "",$file_minheight = "290",$file_minwidth = "193" )
    3-Find
    Code:
    // SET MAX WIDTH AND HEIGHT
     
          if( !$file_maxwidth  ) $file_maxwidth  = $this->file_maxwidth ;
     
          if( !$file_maxheight ) $file_maxheight = $this->file_maxheight;
    Add after it
    if( !$file_minheight  ) $file_minheight  = $this->file_minheight ;
     
          if( !$file_minwidth ) $file_minwidth = $this->file_minwidth;
    4-Finally Find
    Code:
    // RESIZE IMAGE AND PUT IN USER DIRECTORY
     
    Add before it
    if( $width < $file_minwidth)
    {die('The width must be min 193px.');}
    if( $height < $file_minheight)
    {die('The height must be min 290px.');}
    DONE
    berdyev likes this.
  9. Sn+ User


    Offline
    • Знаменитый
    Message Count:
    377
    Likes Received:
    76
    My version of SE:
    3.20
    My version of phpFox:
    3.0.0
    Hm thats perfect does it work well ?
  10. berdyev Famous member


    Offline
    • Знаменитый
    Message Count:
    339
    Likes Received:
    104
    My version of SE:
    3.15
    My version of phpFox:
    3.0.1
    My version of Oxwall:
    1.3.0
    Thank you for sharing abatu

Share This Page

All rights reserved SocEngine.ru ©