doulai2025 2012-08-18 03:17
浏览 19

如何将评论添加到以前没有可用的Socialengine页面?

I've made some substantial mods (related to display) to the pets plugin offered for the Socialengine platform, and need comments added to the posts in the discussions area. I've been trying to accomplish this and thus far have this item:

 <a name="comments"></a>
<?php echo $this->action("list", "comment", "core", array("type"=>$object->getType(),"id"=>$object->getIdentity())) ?> 

Which won't even run on the page (breaks the display and outputs no data). I was hoping that would display a box that would grab the needed data from the item and use the petid, topicid, and userid in creating a comment stored in engine4_core_comments. Just need to get some kind of commenting functionality going on the page, anything will do really if you have experience with this type of functionality.

Here is the full view.tpl page:

<?php
/**    

* Radcodes - SocialEngine Module
 *
 * @category   Application_Extensions
 * @package    Pet
 * @copyright  Copyright (c) 2009-2010 Radcodes LLC (http://www.radcodes.com)
 * @license    http://www.radcodes.com/license/
 * @version    $Id$
 * @author     Vincent Van <vincent@radcodes.com>
 */
?>

<h2>
  <?php echo $this->translate("%s &#187; Discussions", $this->pet->__toString())?>
</h2>



<h3>
  <?php echo $this->topic->getTitle() ?>
</h3>

<?php $this->placeholder('pettopicnavi')->captureStart(); ?>
<div class="pet_discussions_thread_options">
  <?php echo $this->htmlLink(array('route' => 'pet_extended', 'controller' => 'topic', 'action' => 'index', 'pet_id' => $this->pet->getIdentity()), $this->translate('Back to Topics'), array(
    'class' => 'buttonlink icon_back'
  )) ?>
  <?php if( $this->form ): ?>
    <?php echo $this->htmlLink($this->url(array()) . '#reply', $this->translate('Post Reply'), array(
      'class' => 'buttonlink icon_pet_post_reply'
    )) ?>
  <?php endif; ?>
  <?php if( $this->can_edit): ?>
    <?php if( !$this->topic->sticky ): ?>
      <?php echo $this->htmlLink(array('action' => 'sticky', 'sticky' => '1', 'reset' => false), $this->translate('Make Sticky'), array(
        'class' => 'buttonlink icon_pet_post_stick'
      )) ?>
    <?php else: ?>
      <?php echo $this->htmlLink(array('action' => 'sticky', 'sticky' => '0', 'reset' => false), $this->translate('Remove Sticky'), array(
        'class' => 'buttonlink icon_pet_post_unstick'
      )) ?>
    <?php endif; ?>
    <?php if( !$this->topic->closed ): ?>
      <?php echo $this->htmlLink(array('action' => 'close', 'close' => '1', 'reset' => false), $this->translate('Close'), array(
        'class' => 'buttonlink icon_pet_post_close'
      )) ?>
    <?php else: ?>
      <?php echo $this->htmlLink(array('action' => 'close', 'close' => '0', 'reset' => false), $this->translate('Open'), array(
        'class' => 'buttonlink icon_pet_post_open'
      )) ?>
    <?php endif; ?>
    <?php echo $this->htmlLink(array('action' => 'rename', 'reset' => false), $this->translate('Rename'), array(
      'class' => 'buttonlink smoothbox icon_pet_post_rename'
    )) ?>
    <?php echo $this->htmlLink(array('action' => 'delete', 'reset' => false), $this->translate('Delete'), array(
      'class' => 'buttonlink smoothbox icon_pet_post_delete'
    )) ?>
  <?php elseif( !$this->can_edit): ?>
    <?php if( $this->topic->closed ): ?>
      <div class="pet_discussions_thread_options_closed">
        <?php echo $this->translate('This topic has been closed.')?>
      </div>
    <?php endif; ?>
  <?php endif; ?>
</div>
<?php $this->placeholder('pettopicnavi')->captureEnd(); ?>



<?php echo $this->placeholder('pettopicnavi') ?>
<?php echo $this->paginationControl(null, null, null, array(
  'params' => array(
    'post_id' => null // Remove post id
  )
)) ?>


<script type="text/javascript">
  var quotePost = function(user, href, body)
  {
    $("body").value = '[blockquote]' + '[b][url=' + href + ']' + user + '[/url] said:[/b]
' + body + '[/blockquote]

';
    $("body").focus();
    $("body").scrollTo(0, $("body").getScrollSize().y);
  }
</script>



<ul class='pet_discussions_thread'>
  <?php foreach( $this->paginator as $post ): ?>
  <li>
    <div class="pet_discussions_thread_photo">
      <?php
        $user = $this->item('user', $post->user_id);
        echo $this->htmlLink($user->getHref(), $user->getTitle());
        echo $this->htmlLink($user->getHref(), $this->itemPhoto($user, 'thumb.icon'));
      ?>
    </div>
    <div class="pet_discussions_thread_info">
      <div class="pet_discussions_thread_details">
        <div class="pet_discussions_thread_details_options">
          <?php if( $this->form ): ?>
            <?php echo $this->htmlLink('javascript:void(0);', $this->translate('Quote'), array(
              'class' => 'buttonlink icon_pet_post_quote',
              'onclick' => 'quotePost("'.$this->escape($user->getTitle()).'", "'.$this->escape($user->getHref()).'", "'.$this->string()->escapeJavascript($post->body).'");'
            )) ?>
          <?php endif; ?>
          <?php if( $post->user_id == $this->viewer()->getIdentity() || $this->pet->getOwner()->getIdentity() == $this->viewer()->getIdentity() ): ?>
            <?php echo $this->htmlLink(array('route' => 'pet_extended', 'controller' => 'post', 'action' => 'edit', 'post_id' => $post->getIdentity(), 'format' => 'smoothbox'), $this->translate('Edit'), array(
              'class' => 'buttonlink smoothbox icon_pet_post_edit'
            )) ?>
            <?php echo $this->htmlLink(array('route' => 'pet_extended', 'controller' => 'post', 'action' => 'delete', 'post_id' => $post->getIdentity(), 'format' => 'smoothbox'), $this->translate('Delete'), array(
              'class' => 'buttonlink smoothbox icon_pet_post_delete'
            )) ?>
          <?php endif; ?>
        </div>
        <div class="pet_discussions_thread_details_date">
          <?php echo $this->timestamp(strtotime($post->creation_date)) ?>
        </div>
      </div>
      <div class="pet_discussions_thread_body">
        <?php echo nl2br($this->BBCode($post->body)) ?>
      </div>
    </div>
  </li>
  <?php endforeach; ?>




<?php if($this->paginator->getCurrentItemCount() > 4): ?>

  <?php echo $this->paginationControl(null, null, null, array(
    'params' => array(
      'post_id' => null // Remove post id
    )
  )) ?>
  <br />
  <?php echo $this->placeholder('pettopicnavi') ?>

<?php endif; ?>
<br />

<?php if( $this->form ): ?>
  <a name="reply" />
  <?php echo $this->form->setAttrib('id', 'pet_topic_reply')->render($this) ?>
<?php endif; ?>

Thanks!

  • 写回答

1条回答 默认 最新

  • duananyu9231 2012-08-19 19:59
    关注

    In recent version of SocialEngine there is a Comment widget available in layout manager. You can try using that.

    评论

报告相同问题?

悬赏问题

  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 Revit2020下载问题
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大
  • ¥15 单片机无法进入HAL_TIM_PWM_PulseFinishedCallback回调函数
  • ¥15 Oracle中如何从clob类型截取特定字符串后面的字符
  • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
  • ¥15 如何在炒股软件中,爬到我想看的日k线
  • ¥15 seatunnel 怎么配置Elasticsearch