コード例 #1
0
ファイル: util.php プロジェクト: uzura8/flockbird
 public static function get_timeline_images($type, $foreign_id, $timeline_id = null, $access_from = null, $is_detail = false)
 {
     // defaults
     $images = array();
     $images['file_cate'] = 'ai';
     $images['size'] = 'N_M';
     $images['column_count'] = 3;
     switch ($type) {
         case \Config::get('timeline.types.album_image_profile'):
             $images['list'] = array();
             if ($list = \Album\Model_AlbumImage::check_authority($foreign_id)) {
                 $images['list'][] = $list;
                 $images['column_count'] = 2;
             }
             break;
         case \Config::get('timeline.types.profile_image'):
             $images['list'] = array();
             if ($list = \Model_File::find($foreign_id)) {
                 $images['list'][] = $list;
                 $images['file_cate'] = 'm';
                 $images['size'] = 'LL';
                 $images['column_count'] = 2;
             }
             break;
         case \Config::get('timeline.types.note'):
             list($images['list'], $images['count_all']) = \Note\Model_NoteAlbumImage::get_album_image4note_id($foreign_id, $is_detail ? 0 : \Config::get('timeline.articles.thumbnail.limit.default'), array('id' => 'asc'), true);
             $images['parent_page_uri'] = 'note/' . $foreign_id;
             break;
         case \Config::get('timeline.types.thread'):
             list($images['list'], $images['count_all']) = \Thread\Model_ThreadImage::get4thread_id($foreign_id, 3, true);
             $images['file_cate'] = 't';
             $images['size'] = 'M';
             $images['column_count'] = 3;
             $images['parent_page_uri'] = 'thread/' . $foreign_id;
             break;
         case \Config::get('timeline.types.album'):
         case \Config::get('timeline.types.album_image'):
             $images['list'] = array();
             $images['count'] = 0;
             if ($album_image_ids = Model_TimelineChildData::get_foreign_ids4timeline_id($timeline_id)) {
                 list($images['list'], $images['count']) = \Album\Model_AlbumImage::get_list_and_count(array('where' => \Site_Model::get_where_public_flag4access_from($access_from, array(array('id', 'in', $album_image_ids))), $is_detail ? 0 : 'limit' => \Config::get('timeline.articles.thumbnail.limit.default'), 'order_by' => array('created_at' => 'asc')));
             }
             $images['count_all'] = \Album\Model_AlbumImage::get_list_count(array('where' => \Site_Model::get_where_public_flag4access_from($access_from, array(array('album_id', $foreign_id)))));
             $images['parent_page_uri'] = 'album/' . $foreign_id;
             break;
         case \Config::get('timeline.types.album_image_timeline'):
             list($images['list'], $images['count']) = \Album\Model_AlbumImage::get_list_and_count(array('where' => \Site_Model::get_where_public_flag4access_from($access_from, array(array('id', 'in', Model_TimelineChildData::get_foreign_ids4timeline_id($timeline_id)))), $is_detail ? 0 : 'limit' => \Config::get('timeline.articles.thumbnail.limit.album_image_timeline'), 'order_by' => array('created_at' => 'asc')));
             $images['count_all'] = $images['count'];
             $images['parent_page_uri'] = 'timeline/' . $timeline_id;
             break;
         default:
             break;
     }
     return $images;
 }
コード例 #2
0
ファイル: list.php プロジェクト: uzura8/flockbird
            ?>
			<div class="date_box">
				<small><?php 
            echo site_get_time($album->created_at);
            ?>
</small>
<?php 
            $is_mycontents = Auth::check() && $u->id == $album->member_id;
            echo render('_parts/public_flag_selecter', array('model' => 'album', 'id' => $album->id, 'public_flag' => $album->public_flag, 'is_mycontents' => $is_mycontents, 'view_icon_only' => true, 'disabled_to_update' => $disable_to_update, 'have_children_public_flag' => true, 'child_model' => 'album_image'));
            ?>
			</div><!-- date_box -->
<?php 
        } else {
            echo render('_parts/member_contents_box', array('member' => $album->member, 'id' => $album->id, 'public_flag' => $album->public_flag, 'public_flag_view_icon_only' => true, 'public_flag_disabled_to_update' => $disable_to_update, 'have_children_public_flag' => true, 'model' => 'album', 'date' => array('datetime' => $album->created_at), 'child_model' => 'album_image'));
        }
        $album_image_count = \Album\Model_AlbumImage::get_list_count(array('where' => \Site_Model::get_where_public_flag4access_from($access_from, array(array('album_id', $album->id)))));
        ?>
			<div class="article">
				<div class="body"><?php 
        echo convert_body($album->body, array('nl2br' => false, 'truncate_width' => conf('articles.trim_width.body', 'album')));
        ?>
</div>
				<small><?php 
        echo render('_parts/image_count_link', array('count' => $album_image_count, 'uri' => 'album/slide/' . $album->id . '#slidetop'));
        ?>
</small>
			</div><!-- article -->
<?php 
        $dropdown_btn_group_attr = array('id' => 'btn_dropdown_' . $album->id, 'class' => array('dropdown', 'boxBtn'));
        $get_uri = sprintf('album/api/menu/%d.html', $album->id);
        $dropdown_btn_attr = array('class' => 'js-dropdown_content_menu', 'data-uri' => sprintf('album/api/menu/%d.html', $album->id), 'data-member_id' => $album->member_id, 'data-menu' => '#menu_' . $album->id, 'data-loaded' => 0);