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

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

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

Avatar size on upload

En tråd i 'Прочая Поддержка - Help Requests' startet av abatu, 5 Apr 2012.

  1. abatu Trådstarter User


    Оффлайн
    Antall innlegg:
    87
    Antall likte mottatt:
    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


    Оффлайн
    • Знаменитый
    Antall innlegg:
    377
    Antall likte mottatt:
    76
    Версия SocialEngine:
    3.20
    Версия phpFox:
    3.0.0
    you mean plugin avatar or just want to resize avatars size ? i didnt get you at all sorry )
  3. abatu Trådstarter User


    Оффлайн
    Antall innlegg:
    87
    Antall likte mottatt:
    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


    Оффлайн
    • Знаменитый
    Antall innlegg:
    377
    Antall likte mottatt:
    76
    Версия SocialEngine:
    3.20
    Версия 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 Trådstarter User


    Оффлайн
    Antall innlegg:
    87
    Antall likte mottatt:
    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 абырвалГ


    Оффлайн
    • Admin
    Antall innlegg:
    2.435
    Antall likte mottatt:
    645
    Версия SocialEngine:
    3.20
    avatar.jpg
    nadri liker dette.
  7. abatu Trådstarter User


    Оффлайн
    Antall innlegg:
    87
    Antall likte mottatt:
    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 Trådstarter User


    Оффлайн
    Antall innlegg:
    87
    Antall likte mottatt:
    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
    Kode:
    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
    Kode:
    // 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
    Kode:
    // 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 liker dette.
  9. Sn+ User


    Оффлайн
    • Знаменитый
    Antall innlegg:
    377
    Antall likte mottatt:
    76
    Версия SocialEngine:
    3.20
    Версия phpFox:
    3.0.0
    Hm thats perfect does it work well ?
  10. berdyev Famous member


    Оффлайн
    • Знаменитый
    Antall innlegg:
    339
    Antall likte mottatt:
    104
    Версия SocialEngine:
    3.15
    Версия phpFox:
    3.0.1
    Версия Oxwall:
    1.3.0
    Thank you for sharing abatu

Del denne siden

All rights reserved SocEngine.ru ©