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

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

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

по поводу user_messages_view.tpl

Discussion in 'Хаки - Haks' started by FANG, Jun 19, 2010.

  1. FANG Thread starter User


    Offline
    Message Count:
    69
    Likes Received:
    1
    Добрых времени суток

    народ подскажите как сделать в сообщениях, когда уже вошел в сообщение и читаешь его, там идет "Имя Фамилия" Фотография, а под ней я хочу сделать картинку "На сайте" но чтоб показывало тогда когда пользователь на сайте, а когда его не было чтоб исчезала картинка

    вот мой код

    PHP:
    {include file='header.tpl'}

    {* 
    $Iduser_messages_view.tpl 8 $ *}

    <
    table class='tabs' cellpadding='0' cellspacing='0'>
    <
    tr>
    <
    td class='tab0'>&nbsp;</td>
    <
    td class='tab{if $b == 0}1{else}2{/if}' NOWRAP><a href='user_messages.php'>{lang_print id=780}</a></td>
    <
    td class='tab'>&nbsp;</td>
    <
    td class='tab{if $b == 0}2{else}1{/if}' NOWRAP><a href='user_messages_outbox.php'>{lang_print id=781}</a></td>
    <
    td class='tab3'>&nbsp;</td>
    </
    tr>
    </
    table>

    <
    img src='./images/icons/messages48.gif' border='0' class='icon_big' />
    <
    div class='page_header'>{$pmconvo_info.pmconvo_subject}</div>
    {
    capture assign='collaborators'}{section name=coll_loop loop=$collaborators}<a href='{$url->url_create("profile", $collaborators[coll_loop]->user_info.user_username)}'>{$collaborators[coll_loop]->user_displayname}</a>{if $smarty.section.coll_loop.last != TRUE}, {/if}{/section}{/capture}
    <
    div>{lang_sprintf id=801 1=$collaborators}</div>
    <
    br />
    <
    br />


    {* 
    JAVASCRIPT FOR AUTOGROWING TEXTAREA *}
    {
    literal}
    <
    script type="text/javascript">
    <!--
      
    window.addEvent('domready', function() { textarea_autogrow('reply_body'); });
    //-->
    </script>
    {/literal}


    {* LOOP THROUGH MESSAGES IN THREAD *}
    <table cellpadding='0' cellspacing='0' width='100%'>
    {section name=pm_loop loop=$pms}
      <tr>
      <td class='messages_view1' width='1'>
        <a href='{$url->url_create('profile',$pms[pm_loop].author->user_info.user_username)}'><img class='photo' src='{$pms[pm_loop].author->user_photo('./images/nophoto.gif', TRUE)}' width='60' height='60' border='0'></a>
        {if $smarty.section.pm_loop.last}<a name='bottom'></a>{/if}
      </td>
      <td class='messages_authorbox' nowrap='nowrap'>
        <div class='messages_author'><a href='{$url->url_create('profile',$pms[pm_loop].author->user_info.user_username)}'>{$pms[pm_loop].author->user_displayname|truncate:20:"...":true}</a></div>
        <div class='messages_date'>{$datetime->cdate("`$setting.setting_timeformat` `$setting.setting_dateformat`", $datetime->timezone($pms[pm_loop].pm_date, $global_timezone))}</div>
      </td>
      <td class='messages_view2'>{$pms[pm_loop].pm_body|choptext:75:"<br>"}</td>
      </tr>
      <tr><td colspan='3'>&nbsp;</td></tr>
    {/section}

    {* DISPLAY REPLY TO ALL BOX *}
    <tr>
    <td colspan='2'>&nbsp;</td>
    <td class='messages_view2_bottom'>
      <a name='reply'></a>
      <div id='reply_error' style='display: none;'>{lang_print id=796}</div>
      <form action='user_messages_view.php#bottom' method='POST' onSubmit="{literal}if(this.reply.value.replace(/ /g, '') == '') { $('reply_error').style.display='block'; return false; } else { return true; }{/literal}">
      {if $collaborators|@count == 1}{lang_print id=802}{else}{lang_print id=803}{/if}<br>
      <textarea name='reply' id='reply_body' rows='3' cols='60' style='margin-bottom: 5px; width: 100%;'></textarea>
      <br>
      <input type='submit' class='button' value='{lang_print id=791}'>

      {* SHOW BACK TO INBOX *}
      {if $b == 0}
        <input type='button' class='button' value='{lang_print id=805}' onClick="window.location.href='user_messages.php';">
      {* SHOW BACK TO OUTBOX *}
      {else}
        <input type='button' class='button' value='{lang_print id=806}' onClick="window.location.href='user_messages_outbox.php';">
      {/if}

      <input type='hidden' name='task' value='reply'>
      <input type='hidden' name='pmconvo_id' value='{$pmconvo_info.pmconvo_id}'>
      </form>

      <div style='padding-top: 15px;'><a href='user_messages_view.php?pmconvo_id={$pmconvo_info.pmconvo_id}&task=delete'>{lang_print id=1181}</a></div>

    </td>
    </tr>

    </table>



    {include file='footer.tpl'}
    я добавил вот эту строку

    PHP:
    {if $pms[pm_loop].pm_user->is_online == 1}<img src='./images/icons/online.gif' border='0' class='icon'>{/if}
    но она не работает в чем может проблема, подскажите кто знает буду благодарен.
  2. Gooos абырвалГ


    Offline
    • Admin
    Message Count:
    2,435
    Likes Received:
    645
    My version of SE:
    3.20
  3. FANG Thread starter User


    Offline
    Message Count:
    69
    Likes Received:
    1
    Gooos, та тема про другой раздел идет речь о другом тпл файле, там по другому идут рассклад кода

    посмотри и подскажи если не составит проблемы, буду благодарен за помощь.
  4. djpower User


    Offline
    Message Count:
    93
    Likes Received:
    8
  5. moldwest Novice member


    Offline
    Message Count:
    1
    Likes Received:
    0
    Vot otvet

    Beri eto i stavi pod stroku gde ./images/icons/online16.gif

    vot eto

    <center> {if $is_online == 1}
    <table cellpadding='0' cellspacing='0'>
    <tr>
    <td valign='top'><img src='./images/icons/online16.gif' border='0' class='icon'></td>
    <td>{lang_sprintf id=845 1=$owner->user_displayname_short}</td>
    </tr>
    </table>

    a tam popravish!:)

    a tochnee.. eto zdesi


    {include file='header.tpl'}

    {* $Id: user_messages_view.tpl 8 $ *}

    <table class='tabs' cellpadding='0' cellspacing='0'>
    <tr>
    <td class='tab0'>&nbsp;</td>
    <td class='tab{if $b == 0}1{else}2{/if}' NOWRAP><a href='user_messages.php'>{lang_print id=780}</a></td>
    <td class='tab'>&nbsp;</td>
    <td class='tab{if $b == 0}2{else}1{/if}' NOWRAP><a href='user_messages_outbox.php'>{lang_print id=781}</a></td>
    <td class='tab3'>&nbsp;</td>
    </tr>
    </table>

    <img src='./images/icons/messages48.gif' border='0' class='icon_big' />
    <div class='page_header'>{$pmconvo_info.pmconvo_subject}</div>
    {capture assign='collaborators'}{section name=coll_loop loop=$collaborators}<a href='{$url->url_create("profile", $collaborators[coll_loop]->user_info.user_username)}'>{$collaborators[coll_loop]->user_displayname}</a>{if $smarty.section.coll_loop.last != TRUE}, {/if}{/section}{/capture}
    <div>{lang_sprintf id=801 1=$collaborators}</div>
    <br />
    <br />


    {* JAVASCRIPT FOR AUTOGROWING TEXTAREA *}
    {literal}
    <script type="text/javascript">
    <!--
    window.addEvent('domready', function() { textarea_autogrow('reply_body'); });
    //-->
    </script>
    {/literal}


    {* LOOP THROUGH MESSAGES IN THREAD *}
    <table cellpadding='0' cellspacing='0' width='100%'>
    {section name=pm_loop loop=$pms}
    <tr>
    <td class='messages_view1' width='1'>
    <a href='{$url->url_create('profile',$pms[pm_loop].author->user_info.user_username)}'><img class='photo' src='{$pms[pm_loop].author->user_photo('./images/nophoto.gif', TRUE)}' width='60' height='60' border='0'></a>
    <br>
    <center> {if $is_online == 1}
    <table cellpadding='0' cellspacing='0'>
    <tr>
    <td valign='top'><img src='./images/icons/online16.gif' border='0' class='icon'></td>
    <td>{lang_sprintf id=845 1=$owner->user_displayname_short}</td>
    </tr>
    </table>

    {if $smarty.section.pm_loop.last}<a name='bottom'></a>{/if}
    </td>
    <td class='messages_authorbox' nowrap='nowrap'>
    <div class='messages_author'><a href='{$url->url_create('profile',$pms[pm_loop].author->user_info.user_username)}'>{$pms[pm_loop].author->user_displayname|truncate:20:"...":true}</a></div>
    <div class='messages_date'>{$datetime->cdate("`$setting.setting_timeformat` `$setting.setting_dateformat`", $datetime->timezone($pms[pm_loop].pm_date, $global_timezone))}</div>
    </td>
    <td class='messages_view2'>{$pms[pm_loop].pm_body|choptext:75:"<br>"}</td>
    </tr>
    <tr><td colspan='3'>&nbsp;</td></tr>
    {/section}

    {* DISPLAY REPLY TO ALL BOX *}
    <tr>
    <td colspan='2'>&nbsp;</td>
    <td class='messages_view2_bottom'>
    <a name='reply'></a>
    <div id='reply_error' style='display: none;'>{lang_print id=796}</div>
    <form action='user_messages_view.php#bottom' method='POST' onSubmit="{literal}if(this.reply.value.replace(/ /g, '') == '') { $('reply_error').style.display='block'; return false; } else { return true; }{/literal}">
    {if $collaborators|@count == 1}{lang_print id=802}{else}{lang_print id=803}{/if}<br>
    <textarea name='reply' id='reply_body' rows='3' cols='60' style='margin-bottom: 5px; width: 100%;'></textarea>
    <br>
    <input type='submit' class='button' value='{lang_print id=791}'>

    {* SHOW BACK TO INBOX *}
    {if $b == 0}
    <input type='button' class='button' value='{lang_print id=805}' onClick="window.location.href='user_messages.php';">
    {* SHOW BACK TO OUTBOX *}
    {else}
    <input type='button' class='button' value='{lang_print id=806}' onClick="window.location.href='user_messages_outbox.php';">
    {/if}

    <input type='hidden' name='task' value='reply'>
    <input type='hidden' name='pmconvo_id' value='{$pmconvo_info.pmconvo_id}'>
    </form>

    <div style='padding-top: 15px;'><a href='user_messages_view.php?pmconvo_id={$pmconvo_info.pmconvo_id}&task=delete'>{lang_print id=1181}</a></div>

    </td>
    </tr>

    </table>



    {include file='footer.tpl'}
  6. Gooos абырвалГ


    Offline
    • Admin
    Message Count:
    2,435
    Likes Received:
    645
    My version of SE:
    3.20
    Не проверял, но по крайней мере ошибка уже есть, надо добавить {/if} :
    PHP:
    <br>
    <
    center> {if $is_online == 1}
    <
    table cellpadding='0' cellspacing='0'>
    <
    tr>
    <
    td valign='top'><img src='./images/icons/online16.gif' border='0' class='icon'></td>
    <
    td>{lang_sprintf id=845 1=$owner->user_displayname_short}</td>
    </
    tr>
    </
    table>
    {/if}
    и не понятно зачем дублировать имя юзера {lang_sprintf id=845 1=$owner->user_displayname_short}, там и так имя рядом написано.
    Проще {lang_print id=929}

Share This Page

All rights reserved SocEngine.ru ©