Exemplo n.º 1
0
 function run()
 {
     if (!$this->slug) {
         return __('render commnet form failed,slug should be set');
     }
     $formId = 'comment' . md5(uniqid(microtime()));
     $infoMessage = "info" . md5($formId);
     if (is_ajax()) {
         $body = trim($_POST['Comment']['body']);
         $messge = Classes::comment($this->slug, $body, $this->display);
         echo "##ajax-form-alert##:" . $messge;
         exit;
     }
     echo $this->render('@app/modules/comment/widget/views/form', array('top' => $this->top, 'slug' => $this->slug, 'infoMessage' => $infoMessage, 'formId' => $formId));
 }
Exemplo n.º 2
0
<?php

use app\modules\comment\Classes;
use app\modules\member\Auth;
?>
<div class="<?php 
echo $formId;
?>
">
	<?php 
foreach ($rows->models as $model) {
    ?>
		 
		<p><?php 
    echo Classes::get_body($model['body_id']);
    ?>
</p>
    	<div>
    		<span class="label">
    		<?php 
    $o = Auth::get_member($model['mid']);
    echo $o->name;
    ?>
    		</span>
        
        	<div class="pull-right"> 
		         <span class="badge badge-success"><?php 
    echo __('commented');
    ?>
: <?php 
    echo date('Y-m-d H:i', $model['created']);
Exemplo n.º 3
0
 function run()
 {
     $this->formId = 'pagination.' . $this->formId;
     $rows = DB::pagination('comment', array('where' => array('slug_id' => Classes::one($this->slug), 'display' => $this->display), 'orderBy' => 'sort desc,id desc'), 'comment/ajax/index');
     echo $this->render('@app/modules/comment/widget/views/pagination', array('rows' => $rows, 'formId' => $this->formId));
 }