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

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

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

не отображаются комментарии

Discussion in 'Прочая Поддержка - Help Requests' started by GodPloutos, Aug 27, 2011.

  1. GodPloutos Thread starter <b>Мошенник</b>


    Offline
    Message Count:
    34
    Likes Received:
    0
    пишет число комментов, но самих комментов не видно. в ленте активности они отображаются
  2. Gooos абырвалГ


    Offline
    • Admin
    Message Count:
    2,435
    Likes Received:
    645
    My version of SE:
    3.20
    попробую догадаться где комментов не видно...
    думаю...
    ... в профиле?
    Угадал?
  3. GodPloutos Thread starter <b>Мошенник</b>


    Offline
    Message Count:
    34
    Likes Received:
    0
    нигде не видно, ни в профиле, ни в видео ни в фотках, файлы перезаливать пробовал не помогло
  4. Gooos абырвалГ


    Offline
    • Admin
    Message Count:
    2,435
    Likes Received:
    645
    My version of SE:
    3.20
    Пустой разговор. Это как - у меня кот заболел, что мне делать?
    Ты хоть какой шаблон укажи, что за хостинг, какие изменения в шаблонах, скрипте делались - чем больше исходных данных тем более вероятна помощь.
  5. ruffer Famous member


    Offline
    • Знаменитый
    Message Count:
    393
    Likes Received:
    56
    My version of SE:
    3.20
    это все равно что тыкнуть пальцем в небо......
  6. GodPloutos Thread starter <b>Мошенник</b>


    Offline
    Message Count:
    34
    Likes Received:
    0
    Ок. Предоставляю максимум информации.
    и так

    версия : Релиз SE.RU 3.3 FREE версии на стандартном шаблоне. Шаблон переделан но никакие файлы кроме стилей и шапки не затрагивались. в шапке ява скрипты не трогал.

    Выделенный сервер, с последним пхп и апач, для корректной работы сборки вручную заменялись некоторые функции (например ereg, eregi_replace ) и так далее.

    При добавлении комментария к видео и фото, не видно что коммент добавился (комментариев 0) после обновления видим 1 коммент, в ленте активности сам коммент есть. тоесть получается что запись комментв в базу идет, но отображение нет.

    и так предоставляю файлы отвечающие за вывод комментов и сами файлы

    1. album_file.tpl

    Code:
    {include file='header.tpl'}
    
    {* $Id: album_file.tpl 2 2009-01-10 20:53:09Z john $ *}
    
    {* SET PAGE WIDTH *}
    {assign var='page_width' value=$owner->level_info.level_album_width}
    {assign var='menu_width' value=$page_width+32}
    
    <div style='width: {$menu_width}px; margin-left: auto; margin-right: auto;'>
    
    <div class='page_header'>
      {lang_sprintf id=1000141 1=$url->url_create('profile', $owner->user_info.user_username) 2=$owner->user_displayname 3=$url->url_create('albums', $owner->user_info.user_username)}
      » <a href='{$url->url_create('album', $owner->user_info.user_username, $album_info.album_id)}'>{$album_info.album_title}</a>
    </div>
    
    
    {* SET MEDIA PATH *}
    {assign var='media_dir' value=$url->url_userdir($owner->user_info.user_id)}
    {assign var='media_path' value="`$media_dir``$media_info.media_id`.`$media_info.media_ext`"}
    
    
    {* DISPLAY IMAGE *}
    {if $media_info.media_ext == "jpg" ||
        $media_info.media_ext == "jpeg" ||
        $media_info.media_ext == "gif" ||
        $media_info.media_ext == "png" ||
        $media_info.media_ext == "bmp"}
      {assign var='file_src' value="<img src='`$media_path`' id='media_photo' border='0'>"}
      {assign var='is_image' value=true}
    
    {* DISPLAY AUDIO *}
    {elseif $media_info.media_ext == "mp3" ||
            $media_info.media_ext == "mp4" ||
            $media_info.media_ext == "wav"}
      {capture assign='media_download'}[ <a href='{$media_path}'>{lang_print id=1000142}</a> ]{/capture}
      {assign var='file_src' value="<a href='`$media_path`'><img src='./images/icons/album_audio_big.gif' border='0'></a>"}
      {assign var='is_image' value=false}
    
    {* DISPLAY WINDOWS VIDEO *}
    {elseif $media_info.media_ext == "mpeg" ||
    	$media_info.media_ext == "mpg" ||
    	$media_info.media_ext == "mpa" ||
    	$media_info.media_ext == "avi" ||
    	$media_info.media_ext == "ram" ||
    	$media_info.media_ext == "rm"}
      {capture assign='media_download'}[ <a href='{$media_path}'>{lang_print id=1000143}</a> ]{/capture}
      {assign var='file_src' value="
        <object id='video'
          classid='CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6'
          type='application/x-oleobject'>
          <param name='url' value='`$media_path`'>
          <param name='sendplaystatechangeevents' value='True'>
          <param name='autostart' value='true'>
          <param name='autosize' value='true'>
          <param name='uimode' value='mini'>
          <param name='playcount' value='9999'>
        </OBJECT>
      "}
      {assign var='is_image' value=false}
    
    {* DISPLAY QUICKTIME FILE *}
    {elseif $media_info.media_ext == "mov" ||
    	$media_info.media_ext == "moov" ||
    	$media_info.media_ext == "movie" ||
    	$media_info.media_ext == "qtm" ||
    	$media_info.media_ext == "qt"}
      {capture assign='media_download'}[ <a href='{$media_path}'>{lang_print id=1000143}</a> ]{/capture}
      {assign var='file_src' value="
        <embed src='`$media_path`' controller='true' autosize='1' scale='1' width='550' height='350'>
      "}
      {assign var='is_image' value=false}
    
    {* EMBED FLASH FILE *}
    {elseif $media_info.media_ext == "swf"}
      {assign var='file_src' value="
    	<object width='350' height='250' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0' id='myMovieName'>
    	  <param name=movie value=$media_path>
    	  <param name=wmode value=transparent>
    	  <param name=quality value=high>
    	  <param name=bgcolor value=#FFFFFF>
    	  <embed src=$media_path quality=high bgcolor=#FFFFFF width='350' height='250' name='myMovieName' align='' type='application/x-shockwave-flash' wmode='transparent' pluginspage='http://www.macromedia.com/go/getflashplayer'>
    	  </embed>
    	</object>
      "}
      {assign var='is_image' value=false}
    
    {* DISPLAY UNKNOWN FILETYPE *}
    {else}
      {capture assign='media_download'}[ <a href='{$media_path}'>{lang_print id=1000144}</a> ]{/capture}
      {assign var='file_src' value="<a href='`$media_path`'><img src='./images/icons/file_big.gif' border='0'></a>"}
      {assign var='is_image' value=false}
    {/if}
    
    
    {* ASSIGN INDICES *}
    {assign var="current_index" value=$media_info.media_id|array_search:$media_keys}
    {capture assign="previous_index"}{if $current_index == 0}{math equation="x-1" x=$media|@count}{else}{math equation="x-1" x=$current_index}{/if}{/capture}
    {capture assign="next_index"}{if $current_index+1 == $media|@count}0{else}{math equation="x+1" x=$current_index}{/if}{/capture}
    {capture assign="current_num"}{math equation="x+1" x=$current_index}{/capture}
    
    
    <br>
    
    {* SHOW PAGE NAVIGATION *}
    <div style='margin-bottom: 6px;'>
      <table cellpadding='0' cellspacing='0' width='100%'>
      <tr>
      <td>
        {lang_sprintf id=1000145 1=$current_num 2=$media|@count 3=$url->url_create('album', $owner->user_info.user_username, $album_info.album_id) 4=$album_info.album_title}
      </td>
      <td style='text-align: right;'>
        <a href='{$url->url_create('album_file', $owner->user_info.user_username, $album_info.album_id, $media_keys.$previous_index)}'>{lang_print id=1000146}</a>
        &nbsp;&nbsp;&nbsp;
        <a href='{$url->url_create('album_file', $owner->user_info.user_username, $album_info.album_id, $media_keys.$next_index)}'>{lang_print id=1000147}</a>
      </td>
      </tr>
      </table>
    </div>
    
    {* SHOW IMAGE *}
    
    <div class='media'>
      <table cellpadding='0' cellspacing='0' align='center'>
      <tr>
      <td style='text-align: center;'>
    
    {* gooos title photo *}
        <div style='width: 100%'>
          {if $media_info.media_title != ""}
          <div class='page_header'>{$media_info.media_title}</div>{/if}
          {if $media_info.media_desc != ""}
          <div>{$media_info.media_desc}<br /><br /></div>{/if}
        </div>
    {* /gooos title photo *}
    
        {* CREATE WRAPPER DIV *}
        <div id='media_photo_div' class='media_photo_div' style='{if $is_image}width:{$media_info.media_width}px;height:{$media_info.media_height}px;{/if}'>
    
          {* DISPLAY FILE/IMAGE *}
          {$file_src}
    
        </div>
    
        {* SHOW MEDIA DOWNLOAD LINK FOR NON-IMAGES *}
        {if $media_download != ""}
          <div style='font-weight: bold; margin-left: auto; margin-right: auto;'>{$media_download}</div>
        {/if}
    
        {* SHOW DIV WITH TITLE, DESC, TAGS, ETC *}
        <div class='album_media_caption' style='width: {if $media_info.media_width > 300}{$media_info.media_width}{else}300{/if}px;'>
          <!--{if $media_info.media_title != ""}<div class='album_media_title'>{$media_info.media_title}</div>{/if}
          {if $media_info.media_desc != ""}<div>{$media_info.media_desc}</div>{/if}-->
          <div id='media_tags' style='display: none; margin-top: 10px;'>{lang_print id=1000162}</div>
          {if $is_image && $allowed_to_tag}
            <a href='javascript:void(0);' onClick="SocialEngine.MediaTag.addTag();">{lang_print id=1000163}</a>
          {/if}
          <div class='album_media_date'>
            {lang_print id=1000126} {assign var="uploaddate" value=$datetime->time_since($media_info.media_date)}{lang_sprintf id=$uploaddate[0] 1=$uploaddate[1]}
            -
            <a href="javascript:TB_show('{lang_print id=1000164}', '#TB_inline?height=400&width=400&inlineId=sharethis', '', '../images/trans.gif');">{lang_print id=1000164}</a>
            -
            <a href="javascript:TB_show('{lang_print id=1000148}', 'user_report.php?return_url={$url->url_current()}&TB_iframe=true&height=300&width=450', '', './images/trans.gif');">{lang_print id=1000148}</a>
          </div>
        </div>
      </td>
      </tr>
      </table>
    </div>
    
    {* DIV FOR SHARE THIS WINDOW *}
    <div style='display: none;' id='sharethis'>
      <div style='margin: 10px 0px 10px 0px;'>{lang_print id=1000165}</div>
      <div style='margin: 10px 0px 10px 0px; font-weight: bold;'>{lang_print id=1000166}</div>
      <textarea readonly='readonly' onClick='this.select()' class='text' rows='2' cols='30' style='width: 95%; font-size: 7pt;'>{$url->url_base}{$media_path|replace:"./":""}</textarea>
      <div style='margin: 10px 0px 10px 0px; font-weight: bold;'>{lang_print id=1000167}</div>
      <textarea readonly='readonly' onClick='this.select()' class='text' rows='2' cols='30' style='width: 95%; font-size: 7pt;'><a href='{$url->url_base}{$media_path|replace:"./":""}'><img src='{$url->url_base}{$media_path|replace:"./":""}' border='0'></a></textarea>
      <div style='margin: 10px 0px 10px 0px; font-weight: bold;'>{lang_print id=1000168}</div>
      <textarea readonly='readonly' onClick='this.select()' class='text' rows='2' cols='30' style='width: 95%; font-size: 7pt;'><a href='{$url->url_base}{$media_path|replace:"./":""}'>{if $media_info.media_title != ""}{$media_info.media_title}{else}{lang_print id=589}{/if}</a></textarea>
      <div style='margin: 10px 0px 10px 0px; font-weight: bold;'>{lang_print id=1000169}</div>
      <textarea readonly='readonly' onClick='this.select()' class='text' rows='2' cols='30' style='width: 95%; font-size: 7pt;'>[url={$url->url_base}{$media_path|replace:"./":""}][img]{$url->url_base}{$media_path|replace:"./":""}[/img][/url]</textarea>
      <div style='margin-top: 10px;'>
        <input type='button' class='button' value='{lang_print id=1000170}' onClick='parent.TB_remove();'>
      </div>
    </div>
    
    {* TAGGING *}
    {lang_javascript ids=39,1212,1213,1214,1215,1228}
    
    <script type="text/javascript">
    
      SocialEngine.MediaTag = new SocialEngineAPI.Tags({ldelim}
          'canTag' : {if $allowed_to_tag}true{else}false{/if},
    
          'type' : '',
          'media_id' : {$media_info.media_id},
          'media_dir' : '{$media_dir}'
    
        {rdelim});
    
        SocialEngine.RegisterModule(SocialEngine.MediaTag);
    
        {section name=tag_loop loop=$tags}
          insertTag('{$tags[tag_loop].mediatag_id}', '{if $tags[tag_loop].tagged_user->user_exists}{$url->url_create("profile", $tags[tag_loop].tagged_user->user_info.user_username)}{/if}', '{if $tags[tag_loop].tag_user->user_exists}{$tags[tag_loop].tagged_user->user_displayname}{else}{$tags[tag_loop].mediatag_text}{/if}', '{$tags[tag_loop].mediatag_x}', '{$tags[tag_loop].mediatag_y}', '{$tags[tag_loop].mediatag_width}', '{$tags[tag_loop].mediatag_height}', '{$tags[tag_loop].tagged_user->user_info.user_username}')
        {/section}
    
        // Backwards
        function insertTag(tag_id, tag_link, tag_text, tag_x, tag_y, tag_width, tag_height, tagged_user)
        {ldelim}
          SocialEngine.MediaTag.insertTag(tag_id, tag_link, tag_text, tag_x, tag_y, tag_width, tag_height, tagged_user);
        {rdelim}
    
      </script>
    
    
    </div>
    
    
    {* SHOW FILES IN THIS ALBUM *}
    <table cellpadding='0' cellspacing='0' align='center' style='margin-top: 20px;'>
    <tr>
    <td><a href='javascript:void(0);' onClick='moveLeft();this.blur()'><img src='./images/icons/media_moveleft.gif' border='0' onMouseOver="this.src='./images/icons/media_moveleft2.gif';" onMouseOut="this.src='./images/icons/media_moveleft.gif';"></a></td>
    <td>
    
      <div id='album_carousel' style='width: 750px; margin: 0px 5px 0px 5px; text-align: center; overflow: hidden;'>
    
        <table cellpadding='0' cellspacing='0'>
        <tr>
        <td id='thumb-2' style='padding: 0px 5px 0px 5px;'><img src='./images/media_placeholder.gif' border='0' width='70'></td>
        <td id='thumb-1' style='padding: 0px 5px 0px 5px;'><img src='./images/media_placeholder.gif' border='0' width='70'></td>
        <td id='thumb0' style='padding: 0px 5px 0px 5px;'><img src='./images/media_placeholder.gif' border='0' width='70'></td>
        {foreach name=media_loop from=$media key=k item=v}
    
          {* IF IMAGE, GET THUMBNAIL *}
          {if $v.media_ext == "jpeg" || $v.media_ext == "jpg" || $v.media_ext == "gif" || $v.media_ext == "png" || $v.media_ext == "bmp"}
            {assign var='file_dir' value=$url->url_userdir($v.album_user_id)}
            {assign var='file_src' value="`$file_dir``$v.media_id`_thumb.jpg"}
          {* SET THUMB PATH FOR AUDIO *}
          {elseif $v.media_ext == "mp3" || $v.media_ext == "mp4" || $v.media_ext == "wav"}
            {assign var='file_src' value='./images/icons/audio_big.gif'}
          {* SET THUMB PATH FOR VIDEO *}
          {elseif $v.media_ext == "mpeg" || $v.media_ext == "mpg" || $v.media_ext == "mpa" || $v.media_ext == "avi" || $v.media_ext == "swf" || $v.media_ext == "mov" || $v.media_ext == "ram" || $v.media_ext == "rm"}
            {assign var='file_src' value='./images/icons/video_big.gif'}
          {* SET THUMB PATH FOR UNKNOWN *}
          {else}
            {assign var='file_src' value='./images/icons/file_big.gif'}
          {/if}
    
          {* SHOW THUMBNAILS *}
          <td id='thumb{$smarty.foreach.media_loop.iteration}' class='carousel_item{if $v.media_id == $media_info.media_id}_active{/if}'><a href='{$url->url_create('album_file', $owner->user_info.user_username, $album_info.album_id, $v.media_id)}'><img src='{$file_src}' border='0' width='{$misc->photo_size($file_src,'70','70','w')}' onClick='this.blur()'></a></td>
    
        {/foreach}
        {* border hack *}
        <td id='thumb{math equation="x+1" x=$media|@count}' style='padding: 0px 5px 0px 5px;'><img src='./images/media_placeholder.gif' border='0' width='70'></td>
        <td id='thumb{math equation="x+2" x=$media|@count}' style='padding: 0px 5px 0px 5px;'><img src='./images/media_placeholder.gif' border='0' width='70'></td>
        <td id='thumb{math equation="x+3" x=$media|@count}' style='padding: 0px 5px 0px 5px;'><img src='./images/media_placeholder.gif' border='0' width='70'></td>
        {* end border hack *}
        </tr>
        </table>
    
      </div>
    
    </td>
    <td><a href='javascript:void(0);' onClick='moveRight();this.blur()'><img src='./images/icons/media_moveright.gif' border='0' onMouseOver="this.src='./images/icons/media_moveright2.gif';" onMouseOut="this.src='./images/icons/media_moveright.gif';"></a></td>
    </tr>
    </table>
    
    
    <div style='width: {$menu_width}px; margin-left: auto; margin-right: auto;'>
    
    
    {* JAVASCRIPT FOR CAROUSEL *}
    {literal}
    <script type='text/javascript'>
    <!--
    
      var visiblePhotos = 7;
      var current_id = 0;
      var myFx;
    
      window.addEvent('domready', function() {
        myFx = new Fx.Scroll('album_carousel');
        current_id = parseInt({/literal}{math equation="x-2" x=$current_index}{literal});
        var position = $('thumb'+current_id).getPosition($('album_carousel'));
        myFx.set(position.x, position.y);
      });
    
    
      function moveLeft() {
        if($('thumb'+(current_id-1))) {
          myFx.toElement('thumb'+(current_id-1));
          myFx.toLeft();
          current_id = parseInt(current_id-1);
        }
      }
    
      function moveRight() {
        if($('thumb'+(current_id+visiblePhotos))) {
          myFx.toElement('thumb'+(current_id+1));
          myFx.toRight();
          current_id = parseInt(current_id+1);
        }
      }
    
    //-->
    </script>
    {/literal}
    
    <br>
    
    
    {* DISPLAY POST COMMENT BOX *}
    <div style='margin-left: auto; margin-right: auto;'>
    
      {* COMMENTS *}
    
      <div id="media_{$media_info.media_id}_postcomment"></div>
    
      <div id="media_{$media_info.media_id}_comments" style='margin-left: auto; margin-right: auto;'></div>
    
      {lang_javascript ids=39,155,175,182,183,184,185,187,784,787,829,830,831,832,833,834,835,854,856,891,1025,1026,1032,1034,1071}
    
      <script type="text/javascript">
    
        SocialEngine.MediaComments = new SocialEngineAPI.Comments({ldelim}
          'canComment' : {if $allowed_to_comment}true{else}false{/if},
          'commentHTML' : '{$setting.setting_comment_html|replace:",":", "}',
          'commentCode' : {if $setting.setting_comment_code}true{else}false{/if},
    
          'type' : 'media',
          'typeIdentifier' : 'media_id',
          'typeID' : {$media_info.media_id},
    
          'typeTab' : 'media',
          'typeCol' : 'media',
          'typeTabParent' : 'albums',
          'typeColParent' : 'album',
          'typeChild' : true,
    
          'initialTotal' : {$total_comments|default:0}
        {rdelim});
    
        SocialEngine.RegisterModule(SocialEngine.MediaComments);
    
        // Backwards
        function addComment(is_error, comment_body, comment_date)
        {ldelim}
          SocialEngine.MediaComments.addComment(is_error, comment_body, comment_date);
        {rdelim}
    
        function getComments(direction)
        {ldelim}
          SocialEngine.MediaComments.getComments(direction);
        {rdelim}
    
      </script>
    
    </div>
    
    
    
    
    </div>
    
    
    
    {include file='footer.tpl'}
  7. GodPloutos Thread starter <b>Мошенник</b>


    Offline
    Message Count:
    34
    Likes Received:
    0
    2. video.tpl
    Code:
    {include file='header.tpl'}
    
    {* $Id: video.tpl 91 2009-03-10 11:09:00Z szerrade $ *}
    
    <div class='page_header'>
      {capture assign="owner_url"}{$url->url_create('profile', $owner->user_info.user_username)}&v=video{/capture}
      {lang_sprintf id=5500076 1=$owner_url 2=$owner->user_displayname}
    </div>
    
    
    {* LEFT COLUMN - VIDEO PLAYER AND COMMENTS *}
    <table cellpadding='0' cellspacing='0' border='0' style='margin-top: 10px;' width='100%'>
    <tr>
    <td valign='top' align='left'>
    
      {* VIDEO HEADER - TITLE AND TEXT *}
      <div style='padding:2px;border:1px solid #c0c0c0;'>
        <div class='videoHeader' style='width:{$setting.setting_video_width}px'>
          <div class='inner' style='cursor:default'>
            <h1>{$video_info.video_title}</h1>
            <h2 id='short_desc'>{$video_info.video_desc|truncate:100:"...":true}{if $video_info.video_desc|count_characters:true > 100} (<a href='javascript:void(0);' onClick="$('short_desc').style.display = 'none'; $('long_desc').style.display = 'block';">{lang_print id=5500101}</a>){/if}</h2>
            {if $video_info.video_desc|count_characters:true > 100}
              <h2 id='long_desc' style='display:none'>{$video_info.video_desc|nl2br} (<a href='javascript:void(0);' onClick="$('short_desc').style.display = 'block'; $('long_desc').style.display = 'none';">{lang_print id=5500027}</a>)</h2>
            {/if}
          </div>
        </div>
    
        {* LOAD FLASH PLAYER *}
        <script type="text/javascript" src="./include/flow_player/js/flashembed.min.js"></script>
        {if $video_info.video_type == 1}
    
    <object width="{$setting.setting_video_width}" height="{$setting.setting_video_height}"><param name="wmode" value="transparent"></param><param name="movie" value="http://www.youtube.com/v/{$video_info.video_youtube_code}&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed wmode="transparent" src="http://www.youtube.com/v/{$video_info.video_youtube_code}&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="{$setting.setting_video_width}" height="{$setting.setting_video_height}"></embed></object>
    
        {/if}
        {if $video_info.video_type == 0}
        {literal}
        <script type='text/javascript'>
        <!--
          flashembed("sevideo_player",
              {
                src:'./include/flow_player/FlowPlayerDark.swf',
                width: {/literal}{$setting.setting_video_width}{literal},
                height: {/literal}{$setting.setting_video_height}{literal},
                wmode: 'transparent'
              },
              {config: {
                autoPlay: false,
                autoBuffering: true,
                controlBarBackgroundColor:'0x000000',
                initialScale: 'scale',
                videoFile: './../../{/literal}{$video_info.video_dir}{$video_info.video_id}.flv{literal}'
              }}
          );
        //-->
        </script>
        {/literal}
        {/if}
        {* DISPLAY FLASH PLAYER *}
        <div id='sevideo_player'></div>
      </div>
    
    
      {* SHOW VIDEO DETAILS *}
      <div class='videoInfo' style='width:{$setting.setting_video_width}px'>
    
        <div id='tab'>
    
          {* SHOW RATING (NOT ALLOWED TO RATE) *}
          {if !$allowed_to_rate}
    	<div id='video_rating' style='float: left;'>
              {section name=full_loop start=0 loop=$video_info.video_rating_full}
    	    <img src='./images/icons/video_rating_full.gif' border='0'>
    	  {/section}
    	  {if $video_info.video_rating_part}<img src='./images/icons/video_rating_part.gif' border='0'>{/if}
              {section name=none_loop start=0 loop=$video_info.video_rating_none}
    	    <img src='./images/icons/video_rating_none.gif' border='0'>
    	  {/section}
    	</div>
    
          {* SHOW RATING (ALLOWED TO RATE) *}
          {else}
    	<div id='video_rating' onmouseout='rating_out()' style='float: left;'>
    	  {assign var="rating" value="0"}
              {section name=full_loop start=0 loop=$video_info.video_rating_full}
    	    {assign var="rating" value=$rating+1}
    	    <img src='./images/icons/video_rating_full.gif' border='0' onmouseover="rating_over({$rating});" onclick="rate({$rating});" id='rate_{$rating}' style='cursor:pointer;'>
    	  {/section}
    	  {if $video_info.video_rating_part}
    	    {assign var="rating" value=$rating+1}
    	    <img src='./images/icons/video_rating_part.gif' border='0' onmouseover="rating_over({$rating});" onclick="rate({$rating});" id='rate_{$rating}' style='cursor:pointer;'>
              {/if}
              {section name=none_loop start=0 loop=$video_info.video_rating_none}
    	    {assign var="rating" value=$rating+1}
    	    <img src='./images/icons/video_rating_none.gif' border='0' onmouseover="rating_over({$rating});" onclick="rate({$rating});" id='rate_{$rating}' style='cursor:pointer;'>
    	  {/section}
    	</div>
    
    	{* RATING JAVASCRIPT *}
    	{literal}
    	<script type='text/javascript'>
    	<!--
    
    	  preload_full = new Image();
    	  preload_full.src = "./images/icons/video_rating_full.gif";
    	  preload_partial = new Image();
    	  preload_partial.src = "./images/icons/video_rating_part.gif";
    	  preload_empty = new Image();
    	  preload_empty.src = "./images/icons/video_rating_none.gif";
    
    	  function rating_over(rating) {
    	    for(var x=1; x<=5; x++) {
    	      if(x <= rating) {
    	        $('rate_'+x).src = preload_full.src;
    	      } else {
    	        $('rate_'+x).src = preload_empty.src;
    	      }
    	    }
    	  }
    
    	  function rating_out() {
    	    for(var x=1; x<=5; x++) {
    	      if(x <= {/literal}{$video_info.video_rating_full}{literal}) {
    	        $('rate_'+x).src = preload_full.src;
    	      } else if({/literal}{$video_info.video_rating_part}{literal} != 0 && x == {/literal}{math equation='x+1' x=$video_info.video_rating_full}{literal}) {
    	        $('rate_'+x).src = preload_partial.src;
    	      } else {
    	        $('rate_'+x).src = preload_empty.src;
    	      }
    	    }
    	  }
    
    	  function rate(rating) {
    	    $('video_rating').onmouseout = null;
    	    var request = new Request.JSON({
    	      'url' : 'video.php',
    	      'method' : 'post',
    	      'secure' : false,
    	      'data' : {
    	        'task'  : 'rate_do',
    	        'user'  : '{/literal}{$owner->user_info.user_username}{literal}',
    	        'video_id'  : '{/literal}{$video_info.video_id}{literal}',
    		'rating' : rating
    	      },
    	      'onComplete' : function(responseObject, responseText)
    	      {
    	        rating_result(responseObject);
    	      }
    	    });
    	    request.send();
    	  }
    
    	  function rating_result(rating) {
    	    $('rating_total').innerHTML = rating.rating_total;
    	    for(var x=1; x<=5; x++) {
    	      if(x <= rating.rating_full) {
    	        $('rate_'+x).src = preload_full.src;
    	        if(!rating.allowed_to_rate) { $('rate_'+x).onmouseover = null; $('rate_'+x).onclick = null; }
    	      } else if(rating.rating_part != 0 && x == rating.rating_full+1) {
    	        $('rate_'+x).src = preload_partial.src;
    	        if(!rating.allowed_to_rate) { $('rate_'+x).onmouseover = null; $('rate_'+x).onclick = null; }
    	      } else {
    	        $('rate_'+x).src = preload_empty.src;
    	        if(!rating.allowed_to_rate) { $('rate_'+x).onmouseover = null; $('rate_'+x).onclick = null; }
    	      }
    	    }
    	    if(!rating.allowed_to_rate) { $('video_rating').onmouseout = null; }
    	  }
    
    	//-->
    	</script>
    	{/literal}
    
          {/if}
    
          {* SHOW STATS *}
          <div style='float: left; padding-left: 15px; padding-top: 5px;'>
    	{assign var="uploaddate" value=$datetime->time_since($video_info.video_datecreated)}
    	{capture assign="uploaded"}{lang_sprintf id=$uploaddate[0] 1=$uploaddate[1]}{/capture}
    	{lang_sprintf id=5500024 1=$uploaded}
          </div>
          <div style='float: left; padding-left: 15px; padding-top: 5px;'>{lang_sprintf id=5500037 1=$video_info.video_rating_total}</div>
          <div style='float: left; padding-left: 15px; padding-top: 5px;'>{lang_sprintf id=5500038 1=$video_info.video_views}</div>
          <div style='float: left; padding-left: 15px; padding-top: 5px;'><a href="javascript:TB_show('{lang_print id=5500147}', 'user_report.php?return_url=video.php?video_id={$video_info.video_id}&TB_iframe=true&height=300&width=450', '', './images/trans.gif');">{lang_print id=5500147}</a></div>
          <div style='clear: both; height: 0px;'></div>
    
        </div>
    
      </div>
    
      <br>
    
      {* COMMENTS *}
    
      <div id="video_{$video_info.video_id}_postcomment"></div>
    
      <div id="video_{$video_info.video_id}_comments" style='margin-left: auto; margin-right: auto;'></div>
    
      {lang_javascript ids=39,155,175,182,183,184,185,187,784,787,829,830,831,832,833,834,835,854,856,891,1025,1026,1032,1034,1071}
    
      <script type="text/javascript">
    
        SocialEngine.VideoComments = new SocialEngineAPI.Comments({ldelim}
          'canComment' : {if $allowed_to_comment}true{else}false{/if},
          'commentHTML' : '{$setting.setting_comment_html|replace:",":", "}',
          'commentCode' : {if $setting.setting_comment_code}true{else}false{/if},
    
          'type' : 'video',
          'typeIdentifier' : 'video_id',
          'typeID' : {$video_info.video_id},
    
          'typeTab' : 'videos',
          'typeCol' : 'video',
    
          'initialTotal' : {$total_comments|default:0}
        {rdelim});
    
        SocialEngine.RegisterModule(SocialEngine.VideoComments);
    
        // Backwards
        function addComment(is_error, comment_body, comment_date)
        {ldelim}
          SocialEngine.VideoComments.addComment(is_error, comment_body, comment_date);
        {rdelim}
    
        function getComments(direction)
        {ldelim}
          SocialEngine.VideoComments.getComments(direction);
        {rdelim}
    
      </script>
    
    
    {* RIGHT COLUMN - USER'S OTHER VIDEOS *}
    </td>
    <td valign='top' align='left' width='100%'>
    
      <div id='videoTabFrame'>
    
        <div class='header'>{lang_sprintf id=5500022 1=$owner->user_displayname_short} ({$total_videos})</div>
        <div class='video_box' style='margin-bottom: 10px; padding-bottom: 10px; height: 395px; overflow: auto;'>
    
          {* LOOP THROUGH USER VIDEOS *}
          {section name=video_loop loop=$videos}
    
            {* ENSURE VIDEO TITLE ISN'T BLANK *}
            {if $videos[video_loop].video_title == ""}{capture assign="video_title"}{lang_print id=589}{/capture}{else}{assign var="video_title" value=$videos[video_loop].video_title}{/if}
    
    	<div class='video_row' style='{if $smarty.section.video_loop.first}padding-top: 0px; border-top: none;{/if}'>
    	  <table cellpadding='0' cellspacing='0'>
    	  <tr>
    	  <td style='vertical-align: top;' width='1'>
                <div class='video_row_nowplaying{if $videos[video_loop].video_id == $video_info.video_id}2{/if}'{if $videos[video_loop].video_id != $video_info.video_id}onMouseOver="this.className='video_row_nowplaying2'" onMouseOut="this.className='video_row_nowplaying'"{/if}><a href='{$url->url_create("video", $owner->user_info.user_username, $videos[video_loop].video_id)}'><img src='{if $videos[video_loop].video_thumb}{$videos[video_loop].video_dir}{$videos[video_loop].video_id}_thumb.jpg{else}./images/video_placeholder.gif{/if}' border='0' width='{$setting.setting_video_thumb_width}' height='{$setting.setting_video_thumb_height}'></a></div>
    	  </td>
    	  <td style='vertical-align: top; padding-left: 7px;'>
                <div class='video_row_title'><a href='{$url->url_create("video", $owner->user_info.user_username, $videos[video_loop].video_id)}'>{$video_title|truncate:45:'...':true}</a></div>
                <div class='video_row_info'>
    {if $videos[video_loop].video_type==0}{$videos[video_loop].video_duration_in_min} - {/if}{lang_sprintf id=5500023 1=$videos[video_loop].total_comments} - {lang_sprintf id=5500070 1=$videos[video_loop].video_views}</div>
                <div>
                  {section name=full_loop start=0 loop=$videos[video_loop].video_rating_full}
    	        <img src='./images/icons/video_rating_full_small.gif' border='0'>
    	      {/section}
    	      {if $videos[video_loop].video_rating_part}<img src='./images/icons/video_rating_part_small.gif' border='0'>{/if}
                  {section name=none_loop start=0 loop=$videos[video_loop].video_rating_none}
    	        <img src='./images/icons/video_rating_none_small.gif' border='0'>
    	      {/section}
                </div>
    	  </td>
    	  </tr>
    	  </table>
    	</div>
          {/section}
    
        </div>
    
      </div>
    
    
    </td>
    </tr>
    </table>
    
    
    
    
    {include file='footer.tpl'}
  8. GodPloutos Thread starter <b>Мошенник</b>


    Offline
    Message Count:
    34
    Likes Received:
    0
    3. class_comments.php
    Code:
    <?php
    
    /* $Id: class_comment.php 161 2009-04-28 21:14:59Z john $ */
    
    //  THIS CLASS CONTAINS COMMENT-RELATED METHODS
    //  IT IS USED FOR ALL COMMENTING (INCLUDING PLUGINS)
    //  METHODS IN THIS CLASS:
    //    se_comment()
    //    comment_total()
    //    comment_list()
    //    comment_post()
    //    comment_edit()
    //    comment_delete()
    //    comment_delete_selected()
    
    
    
    
    
    class se_comment
    {
    	// INITIALIZE VARIABLES
    	var $is_error;			// DETERMINES WHETHER THERE IS AN ERROR OR NOT
    
    	var $comment_type;		          // CONTAINS THE PREFIX CORRESPONDING TO THE COMMENT TYPE (EX: PROFILE FOR SE_PROFILECOMMENTS)
    	var $comment_identifier;	      // CONTAINS THE IDENTIFYING COLUMN IN THE TABLE (EX: USER_ID FOR SE_PROFILECOMMENTS)
    	var $comment_identifying_value;	// CONTAINS THE VALUE TO MATCH TO THE IDENTIFIER
    	var $comment_parent_type;	      // CONTAINS THE PREFIX CORRESPONDING TO THE COMMENT'S PARENT TYPE (EX: USERS FOR SE_USERS, MUSIC FOR SE_MUSIC)
    	var $comment_parent_identifier;	// CONTAINS THE IDENTIFYING COLUMN IN THE COMMENT'S PARENT'S TABLE (EX: USER FOR SE_USERS, MUSIC FOR SE_MUSIC)
    
    
    
    
    
    
    
    
    	// THIS METHOD SETS INITIAL VARS
    	// INPUT: $type REPRESENTING THE PREFIX CORRESPONDING TO THE COMMENT TYPE
    	//	  $identifier REPRESENTING THE IDENTIFYING COLUMN IN THE TABLE
    	// OUTPUT:
    
    	function se_comment($type, $identifier, $identifying_value, $parent_type=NULL, $parent_identifier=NULL)
      {
    	  $this->comment_type = $type;
    	  $this->comment_identifier = $identifier;
    	  $this->comment_identifying_value = $identifying_value;
    
    	  $this->comment_parent_type = $parent_type;
    	  $this->comment_parent_identifier = $parent_identifier;
    	}
    
      // END se_comment() METHOD
    
    
    
    
    
    
    
    
    	// THIS METHOD RETURNS THE TOTAL NUMBER OF COMMENTS
    	// INPUT:
    	// OUTPUT: AN INTEGER REPRESENTING THE NUMBER OF COMMENTS
    
    	function comment_total()
      {
    	  global $database;
    
        // New handling. On failure, will use old handling
        if( $this->comment_parent_type && $this->comment_parent_identifier )
        {
          $comment_query = "SELECT `{$this->comment_parent_identifier}_totalcomments` AS total_comments FROM `se_{$this->comment_parent_type}` WHERE `{$this->comment_parent_identifier}_id`='{$this->comment_identifying_value}' LIMIT 1";
          $resource = $database->database_query($comment_query);
    
          if( $resource )
          {
            $result = $database->database_fetch_assoc($resource);
            return (int) $result['total_comments'];
          }
        }
    
        // Old handling
    	  $comment_query = "SELECT `{$this->comment_type}comment_id` FROM `se_{$this->comment_type}comments` WHERE `{$this->comment_type}comment_{$this->comment_identifier}`='{$this->comment_identifying_value}'";
    	  $resource = $database->database_query($comment_query);
    
        if( !$resource ) return FALSE;
    
    	  return (int) $database->database_num_rows($resource);
    	}
    
      // END comment_total() METHOD
    
    
    
    
    
    
    
    
    	// THIS METHOD RETURNS AN ARRAY CONTAINING COMMENT INFO
    	// INPUT: $start REPRESENTING THE COMMENT TO START WITH
    	//	  $limit REPRESENTING THE NUMBER OF COMMENTS TO RETURN
    	// OUTPUT: AN ARRAY OF COMMENTS
    
    	function comment_list($start, $limit)
      {
    	  global $database, $setting, $user;
    
    	  $comment_array = Array();
    	  $comment_query = "
          SELECT
    				`se_{$this->comment_type}comments`.*,
    				se_users.user_id,
    				se_users.user_username,
    				se_users.user_fname,
    				se_users.user_lname,
    				se_users.user_photo,
    			CASE
    			  WHEN ((se_users.user_privacy & @SE_PRIVACY_REGISTERED) AND '{$user->user_exists}'<>0)
    			    THEN FALSE
    			  WHEN ((se_users.user_privacy & @SE_PRIVACY_ANONYMOUS) AND '{$user->user_exists}'=0)
    			    THEN FALSE
    			  WHEN ((se_users.user_privacy & @SE_PRIVACY_SELF) AND se_users.user_id='{$user->user_info['user_id']}')
    			    THEN FALSE
    			  WHEN ((se_users.user_privacy & @SE_PRIVACY_FRIEND) AND (SELECT TRUE FROM se_friends WHERE friend_user_id1=se_users.user_id AND friend_user_id2='{$user->user_info['user_id']}' AND friend_status='1' LIMIT 1))
    			    THEN FALSE
    			  WHEN ((se_users.user_privacy & @SE_PRIVACY_SUBNET) AND se_users.user_subnet_id='{$user->user_info['user_subnet_id']}')
    			    THEN FALSE
    			  WHEN ((se_users.user_privacy & @SE_PRIVACY_FRIEND2) AND se_users.user_subnet_id='{$user->user_info['user_subnet_id']}' AND (SELECT TRUE FROM se_friends AS friends_primary LEFT JOIN se_friends AS friends_secondary ON friends_primary.friend_user_id2=friends_secondary.friend_user_id1 WHERE friends_primary.friend_user_id1=se_users.user_id AND friends_secondary.friend_user_id2='{$user->user_info['user_id']}' LIMIT 1))
    			    THEN FALSE
    			  ELSE TRUE
    			END
    			AS is_profile_private
    			FROM
    				`se_{$this->comment_type}comments`
    			LEFT JOIN
    				se_users
    			ON
    				`se_{$this->comment_type}comments`.`{$this->comment_type}comment_authoruser_id`=se_users.user_id
    			WHERE
    				`{$this->comment_type}comment_{$this->comment_identifier}`='{$this->comment_identifying_value}'
    			ORDER BY
            `{$this->comment_type}comment_id` DESC
    			LIMIT
            {$start}, {$limit}
        ";
    
    	  $comments = $database->database_query($comment_query);
    	  while($comment_info = $database->database_fetch_assoc($comments))
        {
    	    // CREATE AN OBJECT FOR AUTHOR
    	    $author = new se_user();
    	    if( $comment_info['user_id'] != $comment_info[$this->comment_type.'comment_authoruser_id'] )
          {
    	      $author->user_exists = FALSE;
    	    }
          else
          {
    	      $author->user_exists = TRUE;
    	      $author->user_info['user_id'] = $comment_info['user_id'];
    	      $author->user_info['user_username'] = $comment_info['user_username'];
    	      $author->user_info['user_fname'] = $comment_info['user_fname'];
    	      $author->user_info['user_lname'] = $comment_info['user_lname'];
    	      $author->user_info['user_photo'] = $comment_info['user_photo'];
    	      $author->user_displayname();
    	    }
    
    	    // СМАЙЛЫ //
              $asconf['smiles'] = "bad,biggrin,blum,blush,cray,crazy,dance,diablo,dirol,
              drinks,fool,good,kiss_mini,man_in_love,music,
              nea,pardon,rofl,rolleyes,sad,scratch_one-s_head,
              shok,shout,smile,unknw,wacko2,wink,yahoo,angel";
              $find = array();
              $replace = array();
    
                // ЗАМЕНА СМАЙЛОВ //
              $smilies_arr = explode(",", $asconf['smiles']);
              $r_comment = ' '.$comment_info[$this->comment_type.'comment_body'];
              foreach($smilies_arr as $smile)
       {
              $smile = trim($smile);
              $find = ':'.$smile.':';
              $replace = '<img alt="'.$smile.'" src="./templates/images/smiles/'.$smile.'.gif" border=0>';
              $r_comment = ereg_replace("$find", "$replace", $r_comment);
      }
    
            // SET COMMENT ARRAY
            $comment_array[] = Array(
            'comment_id' => $comment_info[$this->comment_type.'comment_id'],
            'comment_authoruser_id' =>$comment_info[$this->comment_type.'comment_authoruser_id'],
            'comment_author' => $author,
            'comment_date' => $comment_info[$this->comment_type.'comment_date'],
            'comment_body' => $r_comment,
            'comment_author_private' => $comment_info['is_profile_private']
          );
    	  }
    
    	  return $comment_array;
    	}
    
      // END comment_list() METHOD
    
    
    
    
    
    
    
    
    	// THIS METHOD POSTS A COMMENT
    	// INPUT: $comment_body REPRESENTING THE COMMENT BODY BEING POSTED
    	//	  $comment_secure REPRESENTING THE SECURITY CODE VALUE (IF APPLICABLE)
    	//	  $object_title (OPTIONAL) REPRESENTING THE COMMENTED OBJECT'S TITLE
    	//	  $object_owner (OPTIONAL) REPRESENTING THE OWNER OF THE OBJECT (ex 'user')
    	//	  $object_owner_id (OPTIONAL) REPRESENTING THE OWNER OF THE OBJECT'S ID
    	//	  $object_privacy (OPTIONAL) REPRESENTING THE PRIVACY OF THE OBJECT
    	// OUTPUT: AN ARRAY CONTAINING ALL THE SAVED COMMENT DATA
    
    	function comment_post($comment_body, $comment_secure, $object_title = "", $object_owner = "", $object_owner_id = 0, $object_privacy = "")
      {
    	  global $database, $user, $owner, $setting, $actions, $notify, $url;
    
    	  $comment_id = 0;
    	  $comment_date = time();
    
    	  // RETRIEVE AND CHECK SECURITY CODE IF NECESSARY
    	  if( $setting['setting_comment_code'] )
        {
    	    // NOW IN HEADER
          //session_start();
    	    $code = $_SESSION['code'];
    	    if($code == "") { $code = randomcode(); }
    	    if($comment_secure != $code) { $this->is_error = 1; }
    	  }
    
    	  // MAKE SURE COMMENT BODY IS NOT EMPTY - ADD BREAKS AND CENSOR
    	  $comment_body = cleanHTML(censor($comment_body), $setting['setting_comment_html'], Array("style"));
    	  $comment_body = preg_replace('/(\r\n?)/', "\n", $comment_body);
    	  $comment_body = str_replace("\n", "<br>", $comment_body);
    	  $comment_body = preg_replace('/(<br>){3,}/is', '<br><br>', $comment_body);
    	  $comment_body = str_replace("'", "\'", $comment_body);
    	  if( !trim($comment_body) )
        {
          $this->is_error = 1;
          $comment_body = "";
        }
    
    	  // ADD COMMENT IF NO ERROR
    	  if( !$this->is_error )
        {
    	    $resource = $database->database_query("
            INSERT INTO `se_{$this->comment_type}comments` (
              `{$this->comment_type}comment_{$this->comment_identifier}`,
              `{$this->comment_type}comment_authoruser_id`,
              `{$this->comment_type}comment_date`,
              `{$this->comment_type}comment_body`
            ) VALUES (
              '{$this->comment_identifying_value}',
              '{$user->user_info['user_id']}',
              '{$comment_date}',
              '{$comment_body}'
            )
          ");
    
          $comment_id = $database->database_insert_id();
          // New handling - total cached in parent table
          if( $resource && $this->comment_parent_type && $this->comment_parent_identifier )
          {
            $database->database_query("
              UPDATE
                `se_{$this->comment_parent_type}`
              SET
                `{$this->comment_parent_identifier}_totalcomments`=`{$this->comment_parent_identifier}_totalcomments`+1
              WHERE
                `{$this->comment_identifier}`='{$this->comment_identifying_value}'
              LIMIT
                1
            ");
          }
    
    	    // INSERT ACTION IF USER EXISTS
    	    if( $user->user_exists )
          {
    	      $commenter = $user->user_displayname;
    	      $comment_body_encoded = strip_tags($comment_body);
    
    	      if( strlen($comment_body_encoded) > 250 ) $comment_body_encoded = substr($comment_body_encoded, 0, 247)."...";
    
            $comment_body_encoded = str_replace(Array("<br>", "<br />"), " ", $comment_body_encoded);
    
    	      $actions->actions_add($user, $this->comment_type."comment", Array(
              $user->user_info['user_username'],
              $user->user_displayname,
              $owner->user_info['user_username'],
              $owner->user_displayname,
              $comment_body_encoded,
              $this->comment_identifying_value,
              $object_title,
              $object_owner_id
            ), Array(), 0, false, $object_owner, $object_owner_id, $object_privacy);
    	    }
          else
          {
    	      SE_Language::_preload(835);
    	      SE_Language::load();
    	      $commenter = SE_Language::_get(835);
    	    }
    
    	    // SEND PROFILE COMMENT NOTIFICATION IF COMMENTER IS NOT OWNER
    	    if( $owner->user_info['user_id'] != $user->user_info['user_id'] )
          {
    	      $notifytype = $notify->notify_add(
              $owner->user_info['user_id'],
              $this->comment_type."comment",
              $this->comment_identifying_value,
              Array(
                $owner->user_info['user_username'],
                $this->comment_identifying_value,
                $object_owner_id
              ),
              Array($object_title)
            );
    	      $object_url = $url->url_base.vsprintf($notifytype['notifytype_url'], Array($owner->user_info['user_username'], $this->comment_identifying_value));
    	      $owner->user_settings();
    	      if( $owner->usersetting_info['usersetting_notify_'.$this->comment_type.'comment'] )
            {
              send_systememail($this->comment_type."comment", $owner->user_info['user_email'], Array($owner->user_displayname, $commenter, "<a href=\"$object_url\">$object_url</a>"));
            }
    	    }
    	  }
    
    	  return Array(
          'comment_id' => $comment_id,
          'comment_body' => $comment_body,
          'comment_date' => $comment_date
        );
    	}
    
      // END comment_post() METHOD
    
    
    
    
    
    
    
    
    	// THIS METHOD EDITS A COMMENT
    	// INPUT: $comment_id REPRESENTING THE ID FOR THE COMMENT BEING EDITED
    	//	  $comment_body REPRESENTING THE COMMENT BODY BEING EDITED
    	// OUTPUT:
    
    	function comment_edit($comment_id, $comment_body)
      {
    	  global $database, $user, $setting;
    
    	  // MAKE SURE COMMENT BODY IS NOT EMPTY - ADD BREAKS AND CENSOR
    	  $comment_body = str_replace("\r\n", "<br>", cleanHTML(censor($comment_body), $setting['setting_comment_html']));
    	  $comment_body = preg_replace('/(<br>){3,}/is', '<br><br>', $comment_body);
    	  $comment_body = str_replace("'", "\'", $comment_body);
    
    	  // EDIT COMMENT IF NO ERROR
    	  if( trim($comment_body) )
        {
    	    $database->database_query("
            UPDATE
              `se_{$this->comment_type}comments`
            SET
              `{$this->comment_type}comment_body`='{$comment_body}'
            WHERE
              `{$this->comment_type}comment_{$this->comment_identifier}`='{$this->comment_identifying_value}' &&
              `{$this->comment_type}comment_id`='{$comment_id}' &&
              `{$this->comment_type}comment_authoruser_id`='{$user->user_info['user_id']}'
            LIMIT
              1
          ");
    	  }
    	}
    
      // END comment_edit() METHOD
    
    
    
    
    
    
    
    
    	// THIS METHOD DELETES A SINGLE COMMENT
    	// INPUT: $comment_id REPRESENTING THE ID OF THE COMMENT TO DELETE
    	// OUTPUT:
    
    	function comment_delete($comment_id)
      {
    	  global $database;
    
    	  $resource = $database->database_query("
          DELETE FROM
            `se_{$this->comment_type}comments`
          WHERE
            `{$this->comment_type}comment_{$this->comment_identifier}`='{$this->comment_identifying_value}' &&
            `{$this->comment_type}comment_id`='{$comment_id}'
          LIMIT
            1
        ");
    
        // New handling - total cached in parent table
        if( $this->comment_parent_type && $this->comment_parent_identifier && $resource && $database->database_affected_rows($resource) )
        {
          $database->database_query("
            UPDATE
              `se_{$this->comment_parent_type}`
            SET
              `{$this->comment_parent_identifier}_totalcomments`=`{$this->comment_parent_identifier}_totalcomments`-1
            WHERE
              `{$this->comment_identifier}`='{$this->comment_identifying_value}'
            LIMIT
              1
          ");
        }
    	}
    
      // END comment_delete() METHOD
    
    
    
    
    
    
    
    
    	// THIS METHOD DELETES MANY COMMENTS BASED ON WHAT HAS BEEN POSTED
    	// INPUT: $start REPRESENTING THE COMMENT TO START WITH
    	//	  $limit REPRESENTING THE NUMBER OF COMMENTS TO RETURN
    	// OUTPUT:
    
    	function comment_delete_selected($start, $limit)
      {
    	  global $database;
    
    	  $comments = $database->database_query("
          SELECT
            `se_{$this->comment_type}comments`.`{$this->comment_type}comment_id`
          FROM
            `se_{$this->comment_type}comments`
          WHERE
            `{$this->comment_type}comment_{$this->comment_identifier}`='{$this->comment_identifying_value}'
          ORDER BY
            `{$this->comment_type}comment_id` DESC
          LIMIT
            {$start}, {$limit}
        ");
    
        $delete_ids = array();
    	  while( $comment_info = $database->database_fetch_assoc($comments) )
        {
    	    $var = "comment_".$comment_info[$this->comment_type.'comment_id'];
    
    	    if( isset($_POST[$var]) && is_numeric($_POST[$var]) )
          {
            $delete_ids[] = $comment_info[$this->comment_type.'comment_id'];
    	    }
    	  }
    
        if( !empty($delete_ids) )
        {
          $database->database_query("
            DELETE FROM
              `se_{$this->comment_type}comments`
            WHERE
              `{$this->comment_type}comment_id` IN('".join("', '", $delete_ids)."')
          ");
        }
    	}
    
      // END comment_delete_selected() METHOD
    }
    
    ?>
  9. GodPloutos Thread starter <b>Мошенник</b>


    Offline
    Message Count:
    34
    Likes Received:
    0
    Изза ограничения на размер поста пришлось разбивать потом только сообразил что можно залить. прошу простить. помоему все что нужно было выложил. Заранее благодарю за помощь

    Attached Files:

  10. Gooos абырвалГ


    Offline
    • Admin
    Message Count:
    2,435
    Likes Received:
    645
    My version of SE:
    3.20
    Файлы в архиве не имеют отличий от файлов сборки.
    За комментарии отвечает ещё include/js/core_min.js
    В файлах шаблона что менялось?
    До правки шаблона работало всё?

Share This Page

All rights reserved SocEngine.ru ©