Ejemplo n.º 1
0
 public function show($id = 0)
 {
     if (!($id && ($article_info = render_cell('site_cache_cell', 'article', $id)))) {
         return redirect_message(array('articles'), array('_flash_message' => '找不到該筆資料。'));
     }
     $article = $article_info['article'];
     $tags = $article_info['tags'];
     $others = $article_info['others'];
     $user = $article_info['user'];
     $sources = $article_info['sources'];
     $this->set_title($article['title'] . ' - ' . Cfg::setting('site', 'site', 'title'))->add_hidden(array('id' => 'id', 'value' => $article['id']))->add_meta(array('name' => 'keywords', 'content' => $article['title'] . ',' . implode(',', Cfg::setting('site', 'site', 'keywords'))))->add_meta(array('name' => 'description', 'content' => $article['mini_content']['150']))->add_meta(array('property' => 'og:title', 'content' => $article['title'] . ' - ' . Cfg::setting('site', 'site', 'title')))->add_meta(array('property' => 'og:description', 'content' => $article['mini_content']['300']))->add_meta(array('property' => 'og:image', 'tag' => 'larger', 'content' => $img = $article['cover_url']['1200x630c'], 'alt' => $article['title'] . ' - ' . Cfg::setting('site', 'site', 'title')))->add_meta(array('property' => 'og:image:type', 'tag' => 'larger', 'content' => 'image/' . pathinfo($img, PATHINFO_EXTENSION)))->add_meta(array('property' => 'og:image:width', 'tag' => 'larger', 'content' => '1200'))->add_meta(array('property' => 'og:image:height', 'tag' => 'larger', 'content' => '630'))->add_meta(array('property' => 'article:modified_time', 'content' => $article['updated_at']['c']))->add_meta(array('property' => 'article:published_time', 'content' => $article['created_at']['c']))->add_param('tags', $tags);
     if (($tags = column_array($tags, 'name')) || ($tags = Cfg::setting('site', 'site', 'keywords'))) {
         foreach ($tags as $i => $tag) {
             if (!$i) {
                 $this->add_meta(array('property' => 'article:section', 'content' => $tag))->add_meta(array('property' => 'article:tag', 'content' => $tag));
             } else {
                 $this->add_meta(array('property' => 'article:tag', 'content' => $tag));
             }
         }
     }
     if ($others) {
         foreach ($others as $other) {
             $this->add_meta(array('property' => 'og:see_also', 'content' => base_url('article', $other['site_show_page_last_uri'])));
         }
     }
     $this->add_css(resource_url('resource', 'css', 'fancyBox_v2.1.5', 'my.css'))->add_js(resource_url('resource', 'javascript', 'fancyBox_v2.1.5', 'my.js'))->load_view(array('article' => $article, 'sources' => $sources, 'user' => $user));
 }
Ejemplo n.º 2
0
 public function get_weathers()
 {
     if (!$this->is_ajax(false)) {
         return show_error("It's not Ajax request!<br/>Please confirm your program again.");
     }
     $north_east = $this->input_post('NorthEast');
     $south_west = $this->input_post('SouthWest');
     if (!(isset($north_east['latitude']) && isset($south_west['latitude']) && isset($north_east['longitude']) && isset($south_west['longitude']))) {
         return $this->output_json(array('status' => true, 'weathers' => array()));
     }
     $weathers = array_filter(array_map(function ($weather) {
         $info = render_cell('weather_cell', 'icon', $weather);
         return $info ? array('id' => $weather->id, 'lat' => $weather->latitude, 'lng' => $weather->longitude, 'title' => $weather->title, 'temp' => $info['temperature'], 'icon' => $info['icon']) : array();
     }, Weather::find('all', array('conditions' => array('latitude < ? AND latitude > ? AND longitude < ? AND longitude > ?', $north_east['latitude'], $south_west['latitude'], $north_east['longitude'], $south_west['longitude'])))));
     return $this->output_json(array('status' => true, 'weathers' => $weathers));
 }
Ejemplo n.º 3
0
        echo base_url('admin', 'banners', $banner->id);
        ?>
' data-method='delete' class='icon-bin destroy'></a>
            </td>
            <td data-title='排序' width='50' class='sort'>
              <a href='<?php 
        echo base_url('admin', 'banners', $banner->id, 'sort', 'up');
        ?>
' data-method='post' class='icon-triangle-up'></a>
              <a href='<?php 
        echo base_url('admin', 'banners', $banner->id, 'sort', 'down');
        ?>
' data-method='post' class='icon-triangle-down'></a>
            </td>
          </tr>
  <?php 
    }
} else {
    ?>
        <tr><td colspan>目前沒有任何資料。</td></tr>
<?php 
}
?>
    </tbody>
  </table>

<?php 
echo render_cell('admin_frame_cell', 'pagination', $pagination);
?>

Ejemplo n.º 4
0
              <a href='<?php 
        echo base_url('admin', 'proposes', 'check', $propose->id);
        ?>
'><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="26" height="28" viewBox="0 0 26 28"><path fill="#444444" d="M22 14.531v4.969q0 1.859-1.32 3.18t-3.18 1.32h-13q-1.859 0-3.18-1.32t-1.32-3.18v-13q0-1.859 1.32-3.18t3.18-1.32h13q0.984 0 1.828 0.391 0.234 0.109 0.281 0.359 0.047 0.266-0.141 0.453l-0.766 0.766q-0.156 0.156-0.359 0.156-0.047 0-0.141-0.031-0.359-0.094-0.703-0.094h-13q-1.031 0-1.766 0.734t-0.734 1.766v13q0 1.031 0.734 1.766t1.766 0.734h13q1.031 0 1.766-0.734t0.734-1.766v-3.969q0-0.203 0.141-0.344l1-1q0.156-0.156 0.359-0.156 0.094 0 0.187 0.047 0.313 0.125 0.313 0.453zM25.609 6.891l-12.719 12.719q-0.375 0.375-0.891 0.375t-0.891-0.375l-6.719-6.719q-0.375-0.375-0.375-0.891t0.375-0.891l1.719-1.719q0.375-0.375 0.891-0.375t0.891 0.375l4.109 4.109 10.109-10.109q0.375-0.375 0.891-0.375t0.891 0.375l1.719 1.719q0.375 0.375 0.375 0.891t-0.375 0.891z"></path></svg></a>
              /
              <a href='<?php 
        echo base_url('admin', 'proposes', 'destroy', $propose->id);
        ?>
'><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32" viewBox="0 0 32 32"><path fill="#444444" d="M4 10v20c0 1.1 0.9 2 2 2h18c1.1 0 2-0.9 2-2v-20h-22zM10 28h-2v-14h2v14zM14 28h-2v-14h2v14zM18 28h-2v-14h2v14zM22 28h-2v-14h2v14z"></path><path fill="#444444" d="M26.5 4h-6.5v-2.5c0-0.825-0.675-1.5-1.5-1.5h-7c-0.825 0-1.5 0.675-1.5 1.5v2.5h-6.5c-0.825 0-1.5 0.675-1.5 1.5v2.5h26v-2.5c0-0.825-0.675-1.5-1.5-1.5zM18 4h-6v-1.975h6v1.975z"></path></svg></a>
            </td>
          </tr>
  <?php 
    }
} else {
    ?>
        <tr><td colspan='7'>目前沒有任何資料。</td></tr>
  <?php 
}
?>
    <tbody>
  </table>

<?php 
echo $pagination;
?>

</div>

<?php 
echo render_cell('admin_frame_cell', 'footer');
Ejemplo n.º 5
0
    ?>
'>
          </a>

          <figcaption>
            <a href='<?php 
    echo base_url('work', $work->site_show_page_last_uri());
    ?>
'><?php 
    echo $work->title;
    ?>
</a>
            <p><?php 
    echo $work->content;
    ?>
</p>
          </figcaption>
        </figure>
<?php 
}
echo render_cell('site_frame_cell', 'pagination', $pagination);
?>
    </div>
  </article>
  
  <aside>
<?php 
echo render_cell('site_work_asides_cell', 'tags');
?>
  </aside>
</div>
Ejemplo n.º 6
0
<?php

echo render_cell('site_frame_cell', 'header');
?>

<div id='container'>
  <div class="map">
    <i></i><i></i><i></i><i></i>
    <div id='map'></div>
    <div class='loading_data'>資料讀取中...</div>
  </div>
</div>

<?php 
echo render_cell('site_frame_cell', 'footer');
Ejemplo n.º 7
0
      <div><span>張貼者:</span><a href='<?php 
echo $user['facebook_link'];
?>
' target='_blank'><?php 
echo $user['name'];
?>
</a>於<time datetime='<?php 
echo $article['created_at']['Y-m-d H:i:s'];
?>
'><?php 
echo $article['created_at']['Y-m-d H:i:s'];
?>
</time>發佈。</div>
      <div>瀏覽人數:<?php 
echo $article['pv'];
?>
 人</div>
    </footer>
  </article>
  
  <section>
<?php 
echo render_cell('site_article_asides_cell', 'tags');
echo render_cell('site_article_asides_cell', 'hots');
echo render_cell('site_article_asides_cell', 'news');
?>
  </section>

</div>

Ejemplo n.º 8
0
' data-time='<?php 
        echo $article->created_at ? $article->created_at->format('Y-m-d H:i:s') : date('Y-m-d H:i:s');
        ?>
'><?php 
        echo $article->created_at ? $article->created_at->format('Y-m-d H:i:s') : date('Y-m-d H:i:s');
        ?>
</time></div></div>
        </article>        
<?php 
    }
} else {
    ?>
      <div>目前尚未有相關文章。</div>
<?php 
}
echo render_cell('site_frame_cell', 'pagination', $pagination);
?>
  </section>
  
  <section>
<?php 
echo render_cell('site_article_asides_cell', 'tags');
echo render_cell('site_article_asides_cell', 'hots');
echo render_cell('site_article_asides_cell', 'news');
echo render_cell('site_frame_cell', 'pagination', $pagination);
?>
  </section>

</div>