Ejemplo n.º 1
0
 public function test()
 {
     echo get_userdir(2);
     echo '<br>';
     echo get_asset_userdir(2);
 }
Ejemplo n.º 2
0
echo $pos;
?>
"> -->
		<div class="photo-pos"><em><?php 
echo $pos + 1;
?>
</em>/<em><?php 
echo count($list);
?>
</em></div>
	</div>
	<?php 
foreach ($list as $key => $value) {
    ?>
		<img class="large-img" src="<?php 
    echo get_asset_userdir($photo['uid']) . 'thumbnail_500/' . $value['filename'] . '_500.jpg';
    ?>
" data-id="<?php 
    echo $value['id'];
    ?>
" data-key="<?php 
    echo $key;
    ?>
" style="display:none;">
	<?php 
}
?>
	<?php 
include VIEWPATH . "inc/footer.php";
?>
	<script>
Ejemplo n.º 3
0
?>
	<div class="title">
		随便看看
	</div>
	<div class="album-list">
		<?php 
foreach ($list as $key => $value) {
    ?>
			<div class="album-item">
				<div class="center-block">
					<a href="<?php 
    echo site_url('photo/detail/' . $value['id']);
    ?>
">
						<img src="<?php 
    echo get_asset_userdir($value['uid']) . $value['filename'] . '.jpg';
    ?>
" class="album_img">
					</a>	
				</div>
				<div class="center block">
					来自:<?php 
    echo $value['user']['nickname'];
    ?>
				</div>
			</div>
		<?php 
}
?>
	</div>
	<?php 
Ejemplo n.º 4
0
			img.className = 'album-detail-img';
			a.appendChild(img);
			img.onload = function(){
				$(a).appendTo('.image-list');
				var x = _getMinKey(flow_config.cArr);
				img.style.width = flow_config.itemWidth - flow_config.mh + 'px';
				img.style.top = flow_config.cArr[x] + flow_config.mw + 'px';
				img.style.left = flow_config.itemWidth * x + 'px';
				img.style.opacity = 1;
				img.classList.add('animated');
				img.classList.add('fadeInUp');
				flow_config.cArr[x] = flow_config.cArr[x] + img.offsetHeight + flow_config.mw;
				create_dom(res);
			};
			img.src = '<?php 
echo get_asset_userdir($value['uid']);
?>
/thumbnail_500/'+row['filename']+'_500.jpg';
		}

		function load_more(cArr)
		{
			var $load = $('<div class="waterfall-loadmore waterfall-more">点击加载更多</div>');
			var height = _getMaxValue(cArr);
			$load.css({
					position : 'absolute',
					top : height
				});
			$load.on('click' , function(){
				var page = 1;
				this.parentNode.removeChild(this);
Ejemplo n.º 5
0
 /**
  * 我的相册
  */
 public function my_albums()
 {
     $user = $this->session->user;
     $where = array('uid' => $user['id']);
     $count = $this->albums->count($where);
     // 设置分页
     $get = $this->input->get();
     $page = isset($get['page']) ? $get['page'] : 0;
     $this->load->library('pagination');
     $this->config->load('pagination', TRUE);
     $config = $this->config->item('pagination');
     $config['total_rows'] = $count;
     $this->pagination->initialize($config);
     $limit = $config['per_page'];
     $offset = $page * $limit;
     $result = $this->albums->get($where, $limit, $offset);
     $ajax_res = array();
     foreach ($result as $key => $value) {
         if ($value['cover_img'] == '') {
             $where = array('aid' => $value['id']);
             $img = $this->photos->get_one($where);
             if ($img) {
                 $result[$key]['cover_img'] = get_asset_userdir($user['id']) . 'thumbnail_500/' . $img['filename'] . '_500.jpg';
             } else {
                 $result[$key]['cover_img'] = ASSET_PATH . 'images/' . 'none.jpg';
             }
         }
         if ($this->input->is_ajax_request()) {
             $ajax_res[] = '<div class="album-item">' . '<div class="center-block">' . '<a href="' . site_url('album/detail/' . $value['id']) . '">' . '<img src="' . $result[$key]['cover_img'] . '" class="album_img">' . '</a>' . '</div>' . '<div class="center-block">' . $value['name'] . '</div>' . '</div>';
         }
     }
     if ($this->input->is_ajax_request()) {
         $data = array('code' => 200, 'result' => $ajax_res);
         echo json_encode($data);
         return;
     }
     //显示默认相册
     $where = array('aid' => 0);
     $cover_img = $this->photos->get_one($where);
     if ($cover_img) {
         $result[] = array('id' => 0, 'uid' => $user['id'], 'name' => '默认相册', 'status' => 1, 'cover_img' => get_asset_userdir($user['id']) . 'thumbnail_500/' . $cover_img['filename'] . '_500.jpg');
     }
     $data = array('list' => $result);
     $this->load->view('album/my_albums', $data);
 }