1

Socialengine プラットフォーム用に提供されているペット プラグインに (表示に関連する) 大幅な変更を加えました。ディスカッション エリアの投稿にコメントを追加する必要があります。私はこれを達成しようとしてきましたが、これまでのところこのアイテムがあります:

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

これはページ上でも実行されません (表示が壊れ、データが出力されません)。アイテムから必要なデータを取得し、engine4_core_comments に格納されたコメントを作成する際に petid、topicid、および userid を使用するボックスが表示されることを期待していました。ページにある種のコメント機能を追加する必要があるだけです。このタイプの機能の経験があれば、何でも構いません。

ここに完全な view.tpl ページがあります:

<?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]\n' + body + '[/blockquote]\n\n';
    $("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; ?>

ありがとう!

4

1 に答える 1

1

SocialEngine の最近のバージョンではComment、レイアウト マネージャーで利用できるウィジェットがあります。それを使ってみることができます。

于 2012-08-19T19:59:59.990 に答える