示例#1
0
 public function find()
 {
     if (!$this->uri->segment(3)) {
         show_404(current_url(), FALSE);
     } else {
         if ($this->data['Treasure'] = $this->treasure_model->get_by('md5', $this->uri->segment(3))) {
             if (isFound($this->data['Treasure']->id, $this->session->userdata('id'))) {
                 $found = TRUE;
             } else {
                 $found = FALSE;
                 if (isLoggedIn()) {
                     if (!isBanned($this->session->userdata('id'))) {
                         if (!isAdmin()) {
                             $this->mytreasure_model->insert(array('pirate' => $this->session->userdata('id'), 'treasure' => $this->data['Treasure']->id, 'time' => time()));
                         }
                     }
                 }
             }
             $this->data['found'] = $found;
             $this->template->write_view('content', 'views/treasure/find', $this->data);
             $this->template->render();
         } else {
             show_404(current_url(), FALSE);
         }
     }
 }
示例#2
0
<br />
                    <?php 
        if (isFound($Treasure->id, $me->id)) {
            ?>
                        <em><?php 
            echo $Treasure->location;
            ?>
</em>
                    <?php 
        }
        ?>
                </span>
            </td>
            <td>
                <?php 
        if (isFound($Treasure->id, $me->id)) {
            ?>
                    <span class="label label-success">Found</span>
                <?php 
        } else {
            ?>
                    <span class="label">Not Found</span> <a data-toggle="modal" id="Click<?php 
            echo $Treasure->id;
            ?>
" data-id="<?php 
            echo $Treasure->id;
            ?>
" class="btn btn-info btn-mini">Clue</a>
                    <script type="text/javascript">
                        $('#Click<?php 
            echo $Treasure->id;