Example #1
0
 public function history()
 {
     $this->set_title('Note History');
     if ($this->params()->id) {
         $this->notes = NoteVersion::where("note_id = ?", (int) $this->params()->id)->order("id DESC")->paginate($this->page_number(), 25);
     } elseif ($this->params()->post_id) {
         $this->notes = NoteVersion::where("post_id = ?", (int) $this->params()->post_id)->order("id DESC")->paginate($this->page_number(), 50);
     } elseif ($this->params()->user_id) {
         $this->notes = NoteVersion::where("user_id = ?", (int) $this->params()->user_id)->order("id DESC")->paginate($this->page_number(), 50);
     } else {
         $this->notes = NoteVersion::order("id DESC")->paginate($this->page_number(), 25);
     }
     $this->respond_to_list("notes");
 }
Example #2
0
        ?>
%</td>
          <td><?php 
        echo round(100 * Post::where("user_id = ? and status = 'active' and score < -1", $user->id)->count() / $user->post_count());
        ?>
%</td>
        <?php 
    } else {
        ?>
          <td></td>
          <td></td>
        <?php 
    }
    ?>
        <td><?php 
    echo $this->linkTo(NoteVersion::where('user_id = ' . $user->id)->count(), ['note#history', 'user_id' => $user->id]);
    ?>
</td>
        <td><?php 
    echo $user->pretty_level();
    ?>
</td>
        <td><span title="<?php 
    echo $user->created_at;
    ?>
"><?php 
    echo $this->t(['time.x_ago', 't' => $this->timeAgoInWords($user->created_at)]);
    ?>
</span></td>
      </tr>
    <?php 
Example #3
0
      <td><strong><?php 
echo $this->t('user_tag_edits');
?>
</strong></td>
      <td><?php 
echo $this->linkTo(History::where(['user_id' => $this->user->id, 'group_by_table' => 'posts'])->count(), array('history#index', 'search' => 'type:post user:'******'user_note_edits');
?>
</strong></td>
      <td><?php 
echo $this->linkTo(NoteVersion::where(['user_id' => $this->user->id])->count(), array('note#history', 'user_id' => $this->user->id));
?>
</td>
    </tr>
    <tr>
      <td><strong><?php 
echo $this->t('user_wiki_edits');
?>
</strong></td>
      <td><?php 
echo $this->linkTo(WikiPageVersion::where(['user_id' => $this->user->id])->count(), array('wiki#recent_changes', 'user_id' => $this->user->id));
?>
</td>
    </tr>
    <tr>
      <td><strong><?php 
Example #4
0
      <td>0<?php 
//echo link_to History.count(:all, :conditions => "user_id = #{@user.id}"), :controller => "history", :action => "index", :search => "user:#{@user.name}"
?>
</td>
    </tr>
    <tr>
      <td><strong>Tag Edits</strong></td>
      <td>0<?php 
//echo link_to History.count(:all, :conditions => "user_id = #{@user.id} AND group_by_table = 'posts'"), :controller => "history", :action => "post", :search => "user:#{@user.name}"
?>
</td>
    </tr>
    <tr>
      <td><strong>Note Edits</strong></td>
      <td><?php 
echo link_to(NoteVersion::count(array('conditions' => "user_id = {$user->id}"), array('note#history', 'user_id' => $user->id)));
?>
</td>
    </tr>
    <tr>
      <td><strong>Wiki Edits</strong></td>
      <td>0<?php 
//echo link_to WikiPageVersion.count(:all, :conditions => "user_id = #{@user.id}"), :controller => "wiki", :action => "recent_changes", :user_id => @user.id
?>
</td>
    </tr>
    <tr>
      <td><strong>Forum Posts</strong></td>
      <td>0<?php 
//echo ForumPost.count(:all, :conditions => "creator_id = #{@user.id}")
?>