当前位置: 首页>>代码示例>>PHP>>正文


PHP Media::getMedia方法代码示例

本文整理汇总了PHP中Media::getMedia方法的典型用法代码示例。如果您正苦于以下问题:PHP Media::getMedia方法的具体用法?PHP Media::getMedia怎么用?PHP Media::getMedia使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Media的用法示例。


在下文中一共展示了Media::getMedia方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: switch

                             break;
                     }
                 }
                 break;
         }
     }
     break;
 case 'media':
     Manager::LoadExtension('Media', $ClassConstructor);
     $Smarty->translate('Media');
     switch ($_REQUEST['subcategory']) {
         case 'videos':
             $TypeID = Media::getMediaTypeByName($_REQUEST['subcategory']);
             $Data = Media::getMediaRecord($_REQUEST['lastcategory'], $TypeID);
             $Smarty->assign('MediaData', $Data);
             $Smarty->assign('MediaVideos', Media::getMedia(1));
             Page::GeneratePage($Smarty, 'media', null, $Smarty->variable('Media_Videos'), 'pages/media_videos');
             break;
         case 'screenshots':
             break;
         case 'music':
             break;
         case 'wallpapers':
             break;
         default:
             $Smarty->assign('MediaData', Media::getAll());
             Page::GeneratePage($Smarty, 'media', null, $Smarty->variable('Menu_Media'), 'pages/media_index');
             break;
     }
     break;
 case 'shop':
开发者ID:Expecto,项目名称:FreedomCore,代码行数:31,代码来源:pager.php

示例2: Posts

try {
    $auth->authenticate();
    require_once 'Comment.php';
    require_once 'Media.php';
    require_once 'Posts.php';
    require_once 'Profile.php';
    require_once 'Skillet.php';
    require_once 'Utils.php';
    if (isset($_GET["get"]) && $_GET["get"] == "posts") {
        $posts = new Posts($auth);
        $posts->getPosts();
        print $posts->printOutput();
    } else {
        if (isset($_GET["get"]) && $_GET["get"] == "media") {
            $media = new Media($auth);
            $media->getMedia();
            print $media->printOutput();
        } else {
            if (isset($_POST['changepass'])) {
                $auth->changePassword();
                print $auth->printOutput();
            } else {
                if (isset($_POST["comment"])) {
                    $posts = new Posts($auth);
                    $posts->post();
                    print $posts->printOutput();
                } else {
                    if (isset($_POST["deleteid"])) {
                        $utils = new Utils($auth);
                        if (isset($_POST["deleteid"]) && $_POST["deleteid"] != "" && is_numeric($_POST["deleteid"])) {
                            $id = $_POST["deleteid"];
开发者ID:grldchz,项目名称:grldservice,代码行数:31,代码来源:service.php

示例3:

				} else {
					$sp_feeds = $skin->parseTag('feed_logo_exist', 'feed_logo_nonexistence', $sp_feeds);
				}
				
				$s_feedrecent = '';
				$src_feedrecent = $skin->cutSkinTag('feedrecent');
				$src_feedrecent_rep = $skin->cutSkinTag('feedrecent_rep');
				$s_feedrecent_rep = '';

					if ($recents = FeedItem::getRecentFeedItemsByFeed($feed['id'], $skinConfig->feedListRecentFeedList)) {
						$sp_feedrecent_rep = '';
						foreach($recents as $recent) {
							$link_url = $config->addressType == 'id' ? $service['path'].'/go/'.$recent['id'] : $service['path'].'/go/'.$recent['permalink'];
							
							$recent['thumbnail'] = '';
							if($media = Media::getMedia($recent['thumbnailId'])) {
								$recent['thumbnail'] = $media['thumbnail'];	
							}

							$src_thumbnail = $skin->cutSkinTag('cond_thumbnail', $src_feedrecent_rep);
							$thumbnailFile =  $event->on('Text.postThumbnail', Media::getMediaFile($recent['thumbnail']));
		
							if(!empty($thumbnailFile)) {
								$s_thumbnail = (!Validator::is_empty($thumbnailFile)) ? $skin->parseTag('feeds_recent_thumbnail', $thumbnailFile, $src_thumbnail) : '';
								$s_feedrecent_rep = $skin->dressOn('cond_thumbnail', $src_thumbnail, $s_thumbnail, $src_feedrecent_rep);	
								$s_feedrecent_rep = $skin->parseTag('feeds_recent_thumbnail_exist', 'post_thumbnail_exist', $s_feedrecent_rep);
							} else {
								$s_feedrecent_rep = $skin->dressOn('cond_thumbnail', $src_thumbnail, '', $src_feedrecent_rep);
								$s_feedrecent_rep = $skin->parseTag('feeds_recent_thumbnail_exist', 'post_thumbnail_nonexistence', $s_feedrecent_rep);
							}
							
开发者ID:ncloud,项目名称:bloglounge,代码行数:30,代码来源:feedlist.php

示例4: getPlayerArrayDataBP

 private static function getPlayerArrayDataBP($gameId, $playerArray, $getItems = true, $getAttributes = true, $getNotes = true)
 {
     //preload data into memory for quick re-use
     $mediaA = Media::getMedia($gameId)->data;
     $mediaMap = array();
     $numMedia = count($mediaA);
     for ($i = 0; $i < $numMedia; $i++) {
         $mediaMap[$mediaA[$i]->media_id] = $mediaA[$i];
     }
     if ($getItems) {
         $itemsMap = array();
         $itemsA = Module::queryArray("SELECT * FROM items WHERE game_id = '{$gameId}' AND (is_attribute = '0' OR is_attribute = '')");
         $numItems = count($itemsA);
         for ($i = 0; $i < $numItems; $i++) {
             $itemsA[$i]->media_url = $mediaMap[$itemsA[$i]->media_id]->url;
             $itemsA[$i]->media_thumb_url = $mediaMap[$itemsA[$i]->media_id]->thumb_url;
             $itemsA[$i]->icon_url = $mediaMap[$itemsA[$i]->icon_media_id]->url;
             $itemsA[$i]->icon_thumb_url = $mediaMap[$itemsA[$i]->icon_media_id]->thumb_url;
             $itemsMap[$itemsA[$i]->item_id] = $itemsA[$i];
         }
     }
     if ($getAttributes) {
         $attributesMap = array();
         $attributesA = Module::queryArray("SELECT * FROM items WHERE game_id = '{$gameId}' AND is_attribute = '1'");
         $numAttributes = count($attributesA);
         for ($i = 0; $i < $numAttributes; $i++) {
             $attributesA[$i]->media_url = $mediaMap[$attributesA[$i]->media_id]->url;
             $attributesA[$i]->media_thumb_url = $mediaMap[$attributesA[$i]->media_id]->thumb_url;
             $attributesA[$i]->icon_url = $mediaMap[$attributesA[$i]->icon_media_id]->url;
             $attributesA[$i]->icon_thumb_url = $mediaMap[$attributesA[$i]->icon_media_id]->thumb_url;
             $attributesMap[$attributesA[$i]->media_id] = $attributesA[$i];
         }
     }
     if ($getNotes) {
         $gameTagsMap = array();
         $gameTagsA = Module::queryArray("SELECT * FROM game_tags WHERE game_id = '{$gameId}'");
         $numGameTags = count($gameTagsA);
         for ($i = 0; $i < $numGameTags; $i++) {
             $gameTagsMap[$gameTagsA[$i]->tag_id] = $gameTagsA[$i];
         }
     }
     $backpacks = array();
     $numPlayers = count($playerArray);
     for ($i = 0; $i < $numPlayers; $i++) {
         $backpack = new stdClass();
         $backpack->owner = Module::queryObject("SELECT player_id, user_name, display_name, group_name, media_id FROM players WHERE player_id = '{$playerArray[$i]}'");
         if (!$backpack->owner) {
             continue;
         }
         $playerPic = Media::getMediaObject('player', $backpack->owner->media_id)->data;
         $backpack->owner->player_pic_url = $playerPic->url;
         $backpack->owner->player_pic_thumb_url = $playerPic->thumb_url;
         $media->thumb_file_path = substr($media->file_path, 0, strrpos($media->file_path, '.')) . '_128' . substr($media->file_path, strrpos($media->file_path, '.'));
         $media->url_path = Config::gamedataWWWPath . "/";
         if ($getItems || $getAttributes) {
             if ($getItems) {
                 $backpack->items = array();
             }
             if ($getAttributes) {
                 $backpack->attributes = array();
             }
             $playerItemData = Module::queryArray("SELECT item_id, qty FROM player_items WHERE game_id = '{$gameId}' AND player_id = '{$playerArray[$i]}'");
             $numItems = count($playerItemData);
             for ($j = 0; $j < $numItems; $j++) {
                 if ($getItems && isset($itemsMap[$playerItemData[$j]->item_id])) {
                     $item = clone $itemsMap[$playerItemData[$j]->item_id];
                     $item->qty = $playerItemData[$j]->qty;
                     $backpack->items[] = $item;
                 } else {
                     if ($getAttributes && isset($attributesMap[$playerItemData[$j]->item_id])) {
                         $attribute = clone $attributesMap[$playerItemData[$j]->item_id];
                         $attribute->qty = $playerItemData[$j]->qty;
                         $backpack->attributes[] = $attribute;
                     }
                 }
             }
         }
         if ($getNotes) {
             $rawNotes = Module::query("SELECT * FROM notes WHERE owner_id = '{$playerArray[$i]}' AND game_id = '{$gameId}' AND parent_note_id = 0 ORDER BY sort_index ASC");
             $backpack->notes = array();
             while ($note = mysql_fetch_object($rawNotes)) {
                 $note->username = $backpack->owner->user_name;
                 if ($backpack->owner->display_name && $backpack->owner->display_name != "") {
                     $note->username = $backpack->owner->display_name;
                 }
                 $rawContent = Module::query("SELECT * FROM note_content WHERE note_id = '{$note->note_id}'");
                 $note->contents = array();
                 while ($content = mysql_fetch_object($rawContent)) {
                     $content->media_url = $mediaMap[$content->media_id]->url;
                     $content->media_thumb_url = $mediaMap[$content->media_id]->thumb_url;
                     $note->contents[] = $content;
                 }
                 $note->likes = Notes::getNoteLikes($note->note_id);
                 $note->player_liked = Notes::playerLiked($playerId, $note->note_id);
                 $result = Module::query("SELECT * FROM note_tags WHERE note_id = '{$note->note_id}'");
                 $note->tags = array();
                 while ($tag = mysql_fetch_object($result)) {
                     $note->tags[] = $gameTagsMap[$tag->tag_id];
                 }
                 $note->dropped = 0;
//.........这里部分代码省略.........
开发者ID:kimblemj,项目名称:server,代码行数:101,代码来源:players.php

示例5:

	}
	$skin->dress('focus', $s_focuses);
	$skin->replace('focuslist_url', $servicePath.'/focus/');

	// 인기글
	$src_booms = $skin->cutSkinTag('boom');

	$result = FeedItem::getTopFeedItemsByLastest($skinConfig->boomList,$config->rankBy);
	if(count($result) > 0) {	

		$s_booms_rep = '';
		$src_booms_rep = $skin->cutSkinTag('boom_rep');

		foreach($result as $item) {		
			$item['thumbnail'] = '';
			if($media = Media::getMedia($item['thumbnailId'])) {
				$item['thumbnail'] = $media['thumbnail'];	
			}
			$src_thumbnail = $skin->cutSkinTag('cond_boom_thumbnail');
			$thumbnailFile = Media::getMediaFile($item['thumbnail']);

			if(!empty($thumbnailFile)) {
				$s_thumbnail = (!Validator::is_empty($thumbnailFile)) ? $skin->parseTag('boom_thumbnail', $thumbnailFile, $src_thumbnail) : '';
				$sp_booms = $skin->dressOn('cond_boom_thumbnail', $src_thumbnail, $s_thumbnail, $src_booms_rep);		
				$sp_booms = $skin->parseTag('boom_thumbnail_exist', 'boom_thumbnail_exist', $sp_booms);
			} else {
				$sp_booms = $skin->dressOn('cond_boom_thumbnail', $src_thumbnail, '', $src_booms_rep);
				$sp_booms = $skin->parseTag('boom_thumbnail_exist', 'boom_thumbnail_nonexistence', $sp_booms);
			}

			$link_url = $config->addressType == 'id' ? $service['path'].'/go/'.$item['id'] : $service['path'].'/go/'.$item['permalink'];
开发者ID:ncloud,项目名称:bloglounge,代码行数:31,代码来源:skin.begin.php

示例6: if

		
		if(isset($linker_feed['xmlURL']) && !empty($linker_feed['xmlURL'])) {
			if($linker_feed['xmlType'] == 'rss') { // rss
				$src_rss = $skin->cutSkinTag('rss');	
					$s_rss = $skin->parseTag('rss_url', $linker_feed['xmlURL'], $src_rss);
				$skin->dress('rss', $s_rss);
			} else if($linker_feed['xmlType'] == 'atom') { // atom
				$src_atom = $skin->cutSkinTag('atom');	
					$s_atom = $skin->parseTag('atom_url', $linker_feed['xmlURL'], $src_atom);
				$skin->dress('atom', $s_atom);
			}
		}

		$linker_post['thumbnail'] = '';

		if($media = Media::getMedia($linker_post['thumbnailId'])) {
			$linker_post['thumbnail'] = $media['thumbnail'];	
		}

		$thumbnailFile = '';

		$src_thumbnail = $skin->cutSkinTag('cond_thumbnail');
		if ((substr($linker_post['thumbnail'], 0, 7) != 'http://')) {
			if (!is_file(ROOT . '/cache/thumbnail/' . $linker_post['thumbnail'])) { 
				$thumbnailFile = '';
			} else {
				$thumbnailFile = str_replace('/cache/thumbnail//', '/cache/thumbnail/', $service['path']. '/cache/thumbnail/'.$linker_post['thumbnail']);			
			}
		}

		if(!empty($thumbnailFile)) {
开发者ID:ncloud,项目名称:bloglounge,代码行数:30,代码来源:linker.php

示例7: Media

<?php

require_once 'models/Http.php';
require_once 'models/Media.php';
require_once 'models/User.php';
require_once 'views/MediaPage.php';
require_once 'views/Standard.php';
$media = new Media();
$media_id = Http::get('id');
$comments = $media->getComments($media_id, 0, 50);
$media_tags = $media->getAllTags($media_id);
$media_data = $media->getMedia($media_id);
$statistics = $media->getMediaStatistics($media_id);
$user = User::getUser(User::getCurrentLogin());
$user_affiliation = $media->getUserVotes($media_id, $user['user_ID']);
$media_code = MediaPage::render($media_data, $media_tags, $comments);
$from = $media_data['from_id'];
$to = $media_data['to_id'];
$control_code = MediaPage::renderControls($media_data['media_ID'], $user_affiliation, $statistics, $from, $to);
$error_code = MediaPage::renderWarning(Http::get('reason'));
echo Standard::render($control_code . $error_code, $media_code, User::generateLoginState());
开发者ID:BourgondAries,项目名称:e622,代码行数:21,代码来源:media.php

示例8: getAll

 public static function getAll()
 {
     return ['videos' => Media::getMedia(1), 'screenshots' => Media::getMedia(2), 'music' => Media::getMedia(3), 'wallpapers' => Media::getMedia(4)];
 }
开发者ID:Expecto,项目名称:FreedomCore,代码行数:4,代码来源:Media.FreedomCore.php

示例9: getIssueFocus


//.........这里部分代码省略.........
<?php
		// 포커스

		if($config['useFocus']) {
			$focusFeedItems = FeedItem::getRecentFocusFeedItems($config['focusCount']);
?>
				<li id="_issueFocus_focus_menu" class="selected _issueFocus_menu" onclick="goto('<?php echo $service['path'];?>/focus'); return false;" onmouseover="issueFocusMouseOverMenu('_issueFocus_focus');">포커스</li>
<?php
		}
		
		// 이슈태그

		$index = 0;
		foreach($issueTags as $key=>$tag) {
			list($issueTags[$key]['feedItems'], $totalFeedItemCount) = FeedItem::getFeedItems('tag', $tag['name'], null, 1, $config['issueFeedCount']);
			$index++;
?>	
			<li id="_issueFocus_<?php echo $index;?>_menu" class="<?php echo (!$config['useFocus']&&($index==1))?'selected ':'';?>_issueFocus_menu" onclick="goto('<?php echo $service['path'];?>/search/tag/<?php echo rawurlencode($tag['name']);?>'); return false;" onmouseover="issueFocusMouseOverMenu('_issueFocus_<?php echo $index;?>');" title="클릭하시면 태그검색이 가능합니다."><?php echo $tag['name'];?></li>
<?php
		}
?>
			</ul>

			<div class="clear"></div>
<?php
		// 포커스 내용
		if($config['useFocus']) {
?>
			<ul id="_issueFocus_focus_item" class="item _issueFocus_item viewed">
<?php
	if(count($focusFeedItems)>0) {
		foreach($focusFeedItems as $feedItem) {
			$thumbnailFile = '';
			if($media = Media::getMedia($feedItem['thumbnailId'])) {
				$thumbnailFile = Media::getMediaFile($media['thumbnail']);
			}

			$link_url = $config->addressType == 'id' ? $service['path'].'/go/'.$feedItem['id'] : $service['path'].'/go/'.$feedItem['permalink'];

?>
			<li>
<?php
			if(!empty($thumbnailFile)) {
?>
				<div class="thumbnail">
					<img src="<?php echo $thumbnailFile;?>" alt="미리보기" />
				</div>
<?php
			}
?>
				<div class="data <?php echo empty($thumbnailFile)?'data2':'';?>">
					<h3><a href="<?php echo $link_url;?>" target="_blank"><?php echo UTF8::lessenAsByte(func::stripHTML($feedItem['title']),$config['issueTitleLength']);?></a></h3>
					<div class="desc">
						<?php echo UTF8::lessenAsByte(func::htmltrim(func::stripHTML($feedItem['description'])),$config['issueDescLength']);?>
					</div>
				</div>

				<div class="clear"></div>
			</li>
<?php
		}
	} else {
?>
			<li class="empty">포커스로 지정된 글이 없습니다.</li>
<?php
	}
开发者ID:ncloud,项目名称:bloglounge,代码行数:67,代码来源:index.php

示例10:

				$category = $event->on('Data.category', $category);
				
				$sp_categories = $skin->parseTag('category_name', $event->on('Text.categoryName', UTF8::lessenAsByte($category['name'], $skinConfig->categoryListNameLength)), $src_category_rep);

				$s_categoryrecent = '';
				$src_categoryrecent = $skin->cutSkinTag('categoryrecent');
				$src_categoryrecent_rep = $skin->cutSkinTag('categoryrecent_rep');
				$s_categoryrecent_rep = '';

					if ($category['posts']) {	
						$sp_categoryrecent_rep = '';
						foreach($category['posts'] as $post) {
							$link_url = $config->addressType == 'id' ? $service['path'].'/go/'.$post['id'] : $service['path'].'/go/'.$post['permalink'];

							$post['thumbnail'] = '';
							if($media = Media::getMedia($post['thumbnailId'])) {
								$post['thumbnail'] = $media['thumbnail'];	
							}
							$src_thumbnail = $skin->cutSkinTag('cond_thumbnail', $src_category_rep);
							$thumbnailFile =  $event->on('Text.postThumbnail', Media::getMediaFile($post['thumbnail']));
		
							if(!empty($thumbnailFile)) {
								$s_thumbnail = (!Validator::is_empty($thumbnailFile)) ? $skin->parseTag('categories_recent_thumbnail', $thumbnailFile, $src_thumbnail) : '';
								$s_categoryrecent_rep = $skin->dressOn('cond_thumbnail', $src_thumbnail, $s_thumbnail, $src_categoryrecent_rep);	
								$s_categoryrecent_rep = $skin->parseTag('categories_recent_thumbnail_exist', 'post_thumbnail_exist', $s_categoryrecent_rep);
							} else {
								$s_categoryrecent_rep = $skin->dressOn('cond_thumbnail', $src_thumbnail, '', $src_categoryrecent_rep);
								$s_categoryrecent_rep = $skin->parseTag('categories_recent_thumbnail_exist', 'post_thumbnail_nonexistence', $s_categoryrecent_rep);
							}
							
							$s_categoryrecent_rep = $skin->parseTag('categories_recent_url', $post['permalink'], $s_categoryrecent_rep);
开发者ID:ncloud,项目名称:bloglounge,代码行数:31,代码来源:categorylist.php

示例11: getMagazineFocus


//.........这里部分代码省略.........

		ob_start();
?>
		<div class="magazineFocusWrap">
			<table class="magazineFocusTable" cellpadding="0" cellspacing="0">
				<tr>
					<td class="leftTab">
						<ul>
<?php
			$index = 0;
			foreach($issueTags as $key=>$tag) {
				list($issueTags[$key]['feedItems'], $totalFeedItemCount) = FeedItem::getFeedItems('tag', $tag['name'], null, 1, $config['issueFeedCount']);
				$index++;
?>
							<li id="_magazineFocus_<?php echo $index;?>_menu" class="<?php echo ($index==1)?'first selected ':'';?>_magazineFocus_menu" onclick="goto('<?php echo $service['path'];?>/search/tag/<?php echo rawurlencode($tag['name']);?>'); return false;" onmouseover="magazineFocusMouseOverMenu('_magazineFocus_<?php echo $index;?>');" title="클릭하시면 태그검색이 가능합니다."><span><?php echo UTF8::lessen($tag['name'],10);?></span></li>
<?php
		}
?>							<li class="dummy"></li>
						</ul>
					</td>
					<td class="mainData">
<?php
	// 이슈태그 내용
	$index = 0;
	foreach($issueTags as $tag) {
		$index ++;
?>
						<ul id="_magazineFocus_<?php echo $index;?>_item" class="item _magazineFocus_item<?php echo ($index==1)?' viewed':'';?>">
<?php
	if(count($tag['feedItems'])>0) {
			$feedItem = current($tag['feedItems']);

			$thumbnailFile = '';
			if($media = Media::getMedia($feedItem['thumbnailId'])) {
				$thumbnailFile = Media::getMediaFile($media['thumbnail']);
			}			
			
			$link_url = $config->addressType == 'id' ? $service['path'].'/go/'.$feedItem['id'] : $service['path'].'/go/'.$feedItem['permalink'];

?>
							<li>
<?php
			if(!empty($thumbnailFile)) {
?>
								<div class="thumbnail">
									<img src="<?php echo $thumbnailFile;?>" alt="미리보기" />
								</div>
<?php
			}
?>
								<div class="data <?php echo empty($thumbnailFile)?'data2':'';?>">
									<h3><a href="<?php echo $link_url;?>" target="_blank"><?php echo UTF8::lessenAsByte(func::stripHTML($feedItem['title']),60);?></a></h3>
									<div class="permalink">
										<a href="<?php echo $feedItem['permalink'];?>" target="_blank"><?php echo $feedItem['permalink'];?></a>
									</div>
									<div class="desc">
										<?php echo UTF8::lessenAsByte(func::stripHTML($feedItem['description']),140);?>
									</div>
								</div>

								<div class="clear"></div>
							</li>
<?php
			if(count($tag['feedItems'])>1) {
					for($i=1;$i<count($tag['feedItems']);$i++) {
						$tagItem = $tag['feedItems'][$i];
开发者ID:ncloud,项目名称:bloglounge,代码行数:67,代码来源:index.php

示例12: exportFunction_iframe

	function exportFunction_iframe($params, $exportConfig) {
		global $export, $service, $config, $event;
		
		$page = isset($params['get']['page'])?$params['get']['page']:1;
		if($page <= 0) $page = 1;

		$thumbnail = isset($exportConfig) && isset($exportConfig['thumbnail']) ?  Validator::getBool($exportConfig['thumbnail']) : true;
		$pageCount = isset($exportConfig) && isset($exportConfig['count']) ?  $exportConfig['count'] : 10;
		$newWindow = isset($exportConfig) && isset($exportConfig['popup']) ?  Validator::getBool($exportConfig['popup']) : true;
		$categoryView = isset($exportConfig) && isset($exportConfig['category_view']) ?  Validator::getBool($exportConfig['category_view']) : false;
		$focusView = isset($exportConfig) && isset($exportConfig['focus_view']) ?  ($exportConfig['focus_view'] == 'focus' ? true : false) : false;
		
		if($focusView) {
			list($posts, $totalFeedItems) = FeedItem::getFeedItems('focus', 'y', '', $page, $pageCount);
		} else {
			if($categoryView) {
				$categoryValue = isset($exportConfig) && isset($exportConfig['category']) ?  $exportConfig['category'] : '';
				list($posts, $totalFeedItems) = FeedItem::getFeedItems('category', $categoryValue, '', $page, $pageCount);
			} else {
				list($posts, $totalFeedItems) = FeedItem::getFeedItems('', '', '', $page, $pageCount);
			}
		}
		$paging = Func::makePaging($page, $pageCount, $totalFeedItems);

		requireComponent('LZ.PHP.Media');

		ob_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ko">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title><?php echo $config->title;?></title>
<link rel="stylesheet" media="screen" type="text/css" href="<?php echo $export->exportURL;?>/style.css" />
<link rel="shortcut icon" href="<?php echo $service['path'];?>/images/favicon.ico" />
</head>
<body>
	<div id="export_iframe_wrap">
		<ul>
<?php
		foreach($posts as $post) {	
			$post['thumbnail'] = '';
			if($media = Media::getMedia($post['thumbnailId'])) {
				$post['thumbnail'] = $media['thumbnail'];	
			}
			$thumbnailFile =  $event->on('Text.postThumbnail', Media::getMediaFile($post['thumbnail']));

			$post['description'] = func::stripHTML($post['description'].'>');
			if (substr($post['description'], -1) == '>') $post['description'] = substr($post['description'], 0, strlen($post['description']) - 1);
			$post_description = UTF8::lessenAsByte(func::htmltrim($post['description']), 300);
			if (strlen($post_description) == 0) $post_description = '<span class="empty">'._t('(글의 앞부분이 이미지 혹은 HTML 태그만으로 되어있습니다)').'</span>';					

			$post_description = $event->on('Text.postDescription', $post_description);

?>
			<li class="<?php echo empty($thumbnailFile)||!$thumbnail?'thumbnail_nonexistence':'';?>">
<?php
		if($thumbnail) {

			$link_url = $config->addressType == 'id' ? $service['path'].'/go/'.$post['id'] : $service['path'].'/go/'.$post['permalink'];

			if(!empty($post['thumbnail'])) {
?>
				<div class="thumbnail">
					<a href="<?php echo $link_url;?>" target="<?php echo $newWindow?'_blank':'_parent';?>"><img src="<?php echo $thumbnailFile;?>" alt="thumnail" /></a>
				</div>
<?php
			}
		}
?>
				<div class="data">
					<h3><a href="<?php echo $link_url;?>" target="<?php echo $newWindow?'_blank':'_parent';?>"><?php echo UTF8::clear($event->on('Text.postTitle', func::stripHTML($post['title'])));?></a></h3>
					<p><?php echo $post_description;?></p>
				</div>
				<div class="clear"></div>
			</li>
<?php
		}
?>
		</ul>

		<div class="paging">
			<?php echo func::printPaging($paging);?>
		</div>

	</div>
</body>
</html>
<?php
		$content = ob_get_contents();
		ob_end_clean();

		return $content;
	}
开发者ID:ncloud,项目名称:bloglounge,代码行数:94,代码来源:index.php

示例13: printCategoryFocusView

function printCategoryFocusView($categories, $index, $config) {
	global $service, $event;
	$pluginURL = $event->pluginURL;

	if($index < 0 || $index >= count($categories)) {
		return false;
	}
	$category = $categories[$index];
	$result = '';

	$entries = FeedItem::getRecentFeedItemsByCategory($category['id'], $config['categoryFeedCount']+1);
?>
	<div class="title">
		<h3><a href="<?php echo $service['path'];?>/category/<?php echo func::encode($category['name']);?>"><?php echo $category['name'];?></a></h3>
		<div class="more">
			<a href="<?php echo $service['path'];?>/category/<?php echo func::encode($category['name']);?>"><img src="<?php echo $pluginURL;?>/images/bt_more.gif" alt="<?php echo _t('더보기');?>" /></a>
		</div>
		<div class="clear"></div>
	</div>
	<ul>
<?php
		if(count($entries)>0) {
			$entry = $entries[0];
?>
		<li class="detail">
<?php
		$thumbnailFile = '';
		if($media = Media::getMedia($entry['thumbnailId'])) {
			$thumbnailFile = Media::getMediaFile($media['thumbnail']);
		}
		
		$link_url = $config->addressType == 'id' ? $service['path'].'/go/'.$entry['id'] : $service['path'].'/go/'.$entry['permalink'];

		if(!empty($thumbnailFile)) {
?>
			<div class="thumbnail">
				<img src="<?php echo $thumbnailFile;?>" alt="<?php echo _t('미리보기 이미지');?>" />
			</div>
			<div class="data">
				<h3><a href="<?php echo $link_url;?>" target="_blank"><?php echo UTF8::lessenAsByte(func::stripHTML($entry['title']),$config['categoryTitleLength']);?></a></h3>
				<div class="desc">
					<?php echo UTF8::lessenAsByte(func::stripHTML($entry['description']),$config['categoryDescLength']);?>
				</div>
			</div>
<?php
		} else {
?>
			<div class="data data_full">
				<h3><a href="<?php echo $link_url;?>" target="_blank"><?php echo UTF8::lessenAsByte(func::stripHTML($entry['title']),$config['categoryTitleLength']);?></a></h3>
				<div class="desc">
					<?php echo UTF8::lessenAsByte(func::stripHTML($entry['description']),$config['categoryDescLength']);?>
				</div>
			</div>
<?php
		}
?>
			<div class="clear"></div>
		</li>
<?php
		}
		for($i=1;$i<count($entries);$i++) {
			$entry = $entries[$i];
			$link_url = $config->addressType == 'id' ? $service['path'].'/go/'.$entry['id'] : $service['path'].'/go/'.$entry['permalink'];

?>
		<li class="list"><a href="<?php echo $link_url;?>" target="_blank"><?php echo UTF8::lessenAsByte(func::stripHTML($entry['title']),$config['categoryTitleLength']);?></a></li>
<?php
		}
?>
	</ul>
<?php
	return $result;
}
开发者ID:ncloud,项目名称:bloglounge,代码行数:73,代码来源:index.php


注:本文中的Media::getMedia方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。