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

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

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

Возраст (дата рождения)

Discussion in 'Прочая Поддержка - Help Requests' started by lem1x, Dec 20, 2010.

  1. lem1x Thread starter Active member


    Offline
    Message Count:
    166
    Likes Received:
    68
    Была тут раньше тема про вывод возраст в профиле с учетом склонения возраста (20 лет 21 год 22 года)
    Но кто-то безжалостно её уничтожил - хотя совершенно не понятно зачем.
    В общем кто успел реализовать поделитесь.
  2. SummerResident User


    Offline
    Message Count:
    241
    Likes Received:
    4
    Тоже интересно.
  3. nadri Administrator


    Offline
    • Admin
    • Знаменитый
    Message Count:
    1,257
    Likes Received:
    392
    My version of SE:
    4.6.0
    1. Make file with name age_case.tpl and put inside code below:

    Code:
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) <= 4} (izvadi cuclu iz usta) {/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) >= 5 and $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) <=20} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} godina) {/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) == 21} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} godina){/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) >= 22 and $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) <=24} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} godine) {/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) >= 25 and $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) <=30} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} godina) {/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) == 31} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} godina){/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) >= 32 and $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) <=34} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} godine) {/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) >= 35 and $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) <=40} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} godina) {/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) == 41} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} godina){/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) >= 42 and $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) <=44} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} godine) {/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) >= 45 and $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) <=50} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} godina) {/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) == 51} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} godina){/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) >= 52 and $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) <=54} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} godine) {/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) >= 55 and $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) <=60} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} godina) {/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) == 61} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} godina){/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) >= 62 and $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) <=64} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} godine) {/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) >= 65 and $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) <=70} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} godina) {/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) == 71} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} godina){/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) >= 72 and $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) <=74} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} godine) {/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) >= 75 and $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) <=80} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} godina) {/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) == 81} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} godina){/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) >= 82 and $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) <=84} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} godine) {/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) >= 85 and $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) <=90} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} godina) {/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) == 91} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} godina){/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) >= 92 and $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) <=94} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} godine) {/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) >= 95 and $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) <=100} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} godina) {/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) >= 101} (Pamtite Prvi Svetski Rat?) {/if}
    
    Instalation:

    2. Upload new file age_case.tpl in folder /templates/

    3. In file profile.tpl find:


    ({lang_sprintf id=852 1=$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)})

    and change to:

    {include file='age_case.tpl'}

    4. NOTICE: change your language variabile in age_case.tpl file to your own language.
  4. lem1x Thread starter Active member


    Offline
    Message Count:
    166
    Likes Received:
    68
    Кому нужно - вот русский язык
    Code:
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) <= 4} (вынь сиську изо рта) {/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) >= 5 and $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) <=20} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} лет) {/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) == 21} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} год){/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) >= 22 and $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) <=24} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} года) {/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) >= 25 and $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) <=30} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} лет) {/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) == 31} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} год){/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) >= 32 and $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) <=34} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} года) {/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) >= 35 and $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) <=40} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} лет) {/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) == 41} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} год){/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) >= 42 and $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) <=44} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} года) {/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) >= 45 and $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) <=50} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} лет) {/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) == 51} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} год){/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) >= 52 and $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) <=54} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} года) {/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) >= 55 and $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) <=60} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} лет) {/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) == 61} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} год){/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) >= 62 and $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) <=64} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} года) {/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) >= 65 and $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) <=70} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} лет) {/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) == 71} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} год){/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) >= 72 and $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) <=74} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} года) {/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) >= 75 and $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) <=80} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} лет) {/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) == 81} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} год){/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) >= 82 and $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) <=84} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} года) {/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) >= 85 and $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) <=90} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} лет) {/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) == 91} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} год){/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) >= 92 and $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) <=94} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} года) {/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) >= 95 and $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) <=100} ({$datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value)} лет) {/if}
    {if $datetime->age($cats[cat_loop].subcats[subcat_loop].fields[field_loop].field_value) >= 101} (Вы и Ленина видели?) {/if}
    Nadri tnx!
  5. SummerResident User


    Offline
    Message Count:
    241
    Likes Received:
    4
    У меня этого там ваще нет о_О

    Зато есть
    — изменил эту строку, заработало.
    Версия 3.20
  6. lem1x Thread starter Active member


    Offline
    Message Count:
    166
    Likes Received:
    68
    SummerResident,
    Всё правильно.Просто код, который указал Nadri походу для 2-й ветки!
  7. Ren_hi User


    Offline
    Message Count:
    13
    Likes Received:
    0
    А кто знает, как это вставить в quick informer? Там тоже есть вывод возраста.
  8. Plushkin User


    Offline
    Message Count:
    67
    Likes Received:
    0
    А для версии 3.3 она же) 3.18 как сделать)
  9. nadri Administrator


    Offline
    • Admin
    • Знаменитый
    Message Count:
    1,257
    Likes Received:
    392
    My version of SE:
    4.6.0
    There is no existed version 3.3......latest version is 3.20
    I noticed that ( wrong copy/paste)- and I corrected my first post, now everything is OK

Share This Page

All rights reserved SocEngine.ru ©