本文整理汇总了PHP中Media::getMediaFile方法的典型用法代码示例。如果您正苦于以下问题:PHP Media::getMediaFile方法的具体用法?PHP Media::getMediaFile怎么用?PHP Media::getMediaFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Media
的用法示例。
在下文中一共展示了Media::getMediaFile方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: set
public static function set($autoattendant)
{
$xml = FreeSwitch::setSection('autoattendant', $autoattendant['auto_attendant_id']);
if (empty($autoattendant['registry']['mediafile_id']) or !class_exists('Media')) {
$type = 'tty';
} else {
$type = $autoattendant['registry']['type'];
}
switch ($type) {
case 'audio':
$xml->setAttributeValue('', 'greet-long', Media::getMediaFile($autoattendant['registry']['mediafile_id']));
$xml->setAttributeValue('', 'greet-short', Media::getMediaFile($autoattendant['registry']['mediafile_id']));
break;
default:
if (empty($autoattendant['registry']['tts_string'])) {
$tts_string = 'Thank you for calling, your call is important to us.';
} else {
$tts_string = $autoattendant['registry']['tts_string'];
}
$tts_string = 'say:' . preg_replace('/[^A-Za-z0-9.,!? ]/', '', $tts_string);
$xml->setAttributeValue('', 'tts-engine', 'flite');
$xml->setAttributeValue('', 'tts-voice', 'kal');
$xml->setAttributeValue('', 'greet-long', $tts_string);
$xml->setAttributeValue('', 'greet-short', $tts_string);
}
if (!empty($autoattendant['extension_context_id'])) {
$xml->setAttributeValue('', 'digit-len', $autoattendant['extension_digits']);
}
$xml->setAttributeValue('', 'timeout', $autoattendant['timeout'] * 1000);
$xml->setAttributeValue('', 'inter-digit-timeout', $autoattendant['digit_timeout'] * 1000);
if (!empty($autoattendant['registry']['max-failures'])) {
$xml->setAttributeValue('', 'max-failures', $autoattendant['registry']['max-failures']);
} else {
$xml->setAttributeValue('', 'max-failures', '3');
}
$xml->deleteChildren();
if (!empty($autoattendant['extension_context_id'])) {
$xml->update(sprintf('/entry[@action="menu-exec-app"][@name="catch_all"][@digits="\\/^([0-9]{%s})$\\/"][@param="execute_extension $1 XML context_%s"]', $autoattendant['extension_digits'], $autoattendant['extension_context_id']));
}
foreach ($autoattendant['keys'] as $key) {
if (!isset($key['digits'])) {
continue;
}
if (!($transferString = fs::getTransferToNumber($key['number_id']))) {
continue;
}
$xml->update(sprintf('/entry[@action="menu-exec-app"][@digits="%s"][@param="transfer %s"]', $key['digits'], $transferString));
}
}
示例2: date
$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);
}
$s_feedrecent_rep = $skin->parseTag('feeds_recent_url', $recent['permalink'], $s_feedrecent_rep);
$s_feedrecent_rep = $skin->parseTag('feeds_recent_linkurl', $link_url, $s_feedrecent_rep);
$s_feedrecent_rep = $skin->parseTag('feeds_recent_title', $recent['title'], $s_feedrecent_rep);
$s_feedrecent_rep = $skin->parseTag('feeds_recent_date', date('Y-m-d H:i',$recent['written']), $s_feedrecent_rep);
$sp_feedrecent_rep .= $s_feedrecent_rep;
示例3: getIssueFocus
//.........这里部分代码省略.........
// 포커스
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
}
?>
示例4: htmlspecialchars
// 인기글
$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'];
$sp_booms = $skin->parseTag('boom_url', htmlspecialchars($item['permalink']), $sp_booms);
$sp_booms = $skin->parseTag('boom_link_url', $link_url , $sp_booms);
$sp_booms = $skin->parseTag('boom_title', UTF8::clear(UTF8::lessenAsByte(func::stripHTML($item['title']), $skinConfig->boomTitleLength)), $sp_booms);
示例5: blast
/**
*
* blast
* <user>@<domain> <sound_file> [<cid_num>] [<cid_name>]
* voicemail_inject is used to add an arbitrary sound file to a users voicemail mailbox.
*/
public function blast()
{
$account_id = users::getAttr('account_id');
$domain = VoicemailManager::getDomain($account_id);
$this->view->mailboxes = VoicemailManager::getAllMailboxes();
if ($this->input->post()) {
if ($this->input->post('file_id') == 0) {
message::set('Select a file to to use in the voicemail message');
} else {
foreach ($this->input->post('blast') as $mailbox) {
echo VoicemailManager::blast($mailbox, $domain, Media::getMediaFile($this->input->post('file_id')));
}
}
}
}
示例6: 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];
示例7: array
array_push($data['datas'], array('id'=>'entryCategory'.$post['id'],'class'=>'entrylist_category','data'=> $content ));
// 글 제목
ob_start();
?>
<div class="focus">
<?php if($is_admin) { echo '<a href="#" onclick="setFocus(\'' . $post['id'] . '\'); return false;">'; } ?><img id="focusImage<?php echo $post['id'];?>" src="<?php echo $service['path'];?>/images/admin/bt_focus_<?php echo $post['focus']=='y'?'on':'off';?>.png" alt="focus" align="absmiddle" <?php echo $is_admin?'':'title="'._t('포커스기능은 관리자만 사용하실 수 있습니다.').'"';?>/><?php if($is_admin) { echo '</a>'; }?>
</div>
<?php
if(!empty($post['thumbnailId'])) {
if($media = Media::getMedia($post['thumbnailId'])) {
$post['thumbnail'] = $media['thumbnail'];
}
$thumbnailFile = Media::getMediaFile($post['thumbnail']);
if(!empty($thumbnailFile)) {
?>
<div class="thumbnail">
<img src="<?php echo $thumbnailFile;?>"/>
</div>
<?php
}
}
$desc = UTF8::lessenAsEm(str_replace(' ','',func::stripHTML($post['description'])),42);
if(empty($desc)) {
$desc = '<span class="empty">'._t('내용이 비어있거나 HTML로만 작성되어 있습니다.').'</span>';
}
$isNew = Func::isNew($post['written'],1);
示例8: 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;
}
示例9: 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;
}