本文整理汇总了PHP中func::htmltrim方法的典型用法代码示例。如果您正苦于以下问题:PHP func::htmltrim方法的具体用法?PHP func::htmltrim怎么用?PHP func::htmltrim使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类func
的用法示例。
在下文中一共展示了func::htmltrim方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: htmlspecialchars
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);
$sp_booms = $skin->parseTag('boom_description', UTF8::clear(UTF8::lessenAsByte(func::htmltrim(func::stripHTML($item['description'])),$skinConfig->boomDescLength)), $sp_booms);
$sp_booms = $skin->parseTag('boom_author', UTF8::clear($item['author']), $sp_booms);
$sp_booms = $skin->parseTag('boom_date', (Validator::is_digit($item['written']) ? date('Y-m-d', $item['written']) : $item['written']), $sp_booms);
$s_booms_rep .= $sp_booms;
$sp_booms = '';
}
$s_booms = $skin->dressOn('boom_rep', $src_booms_rep, $s_booms_rep, $src_booms);
} else {
$s_booms = '';
}
$skin->dress('boom', $s_booms);
// ** 태그 클라우드
$skin->dress('tagcloud', SkinElement::getTagCloud($skinConfig->tagCloudOrder, $skinConfig->tagCloudLimit));
示例2: saveFeedItem
//.........这里部分代码省略.........
}
if ($filtered) return false;
}
if (preg_match('/\((.[^\)]+)\)$/Ui', trim($item['author']), $_matches)) $item['author'] = $_matches[1];
$item['author']=$db->escape($db->lessen(UTF8::correct($item['author'])));
$item['permalink']=$db->escape($db->lessen(UTF8::correct($item['permalink'])));
$item['description']=$db->escape($db->lessen(UTF8::correct(trim($item['description'])),65535));
$enclosures = array();
foreach($item['enclosures'] as $en) {
array_push($enclosures, $en['url']);
}
$enclosureString=$db->escape($db->lessen(UTF8::correct(implode('|',$enclosures))));
$deadLine=0;
$feedLife = Settings::get('archivePeriod');
if ($feedLife > 0) $deadLine=gmmktime()-($feedLife*86400);
requireComponent('Bloglounge.Data.FeedItems');
$oldTags = null;
$id = FeedItem::getIdByURL($item['permalink']);
if($id === false && isset($item['guid'])) {
$item['guid']=$db->escape($db->lessen(UTF8::correct($item['guid'])));
$id = FeedItem::getIdByURL($item['guid']);
}
$item['author'] = Feed::getAuthor($item, $feedId, $id);
$item['title'] = Feed::getTitle($item, $feedId, $id);
$affected = 0;
$isRebuildData = false;
$summarySave = Settings::get('summarySave');
$description = $item['description'];
if(Validator::getBool($summarySave)) { // summarySave
$description = func::stripHTML($item['description'].'>');
if (substr($description, -1) == '>') $description = substr($description, 0, strlen($description) - 1);
$description = $db->lessen(func::htmltrim($description), 1000, '');
}
if (preg_match("/^[0-9]+$/",$id)) {
$baseItem = FeedItem::getFeedItem($id);
// $baseItem['title']=$db->escape(UTF8::correct($baseItem['title']));
// $baseItem['description']=$db->escape(UTF8::correct(trim($baseItem['description'])));
if(($baseItem['title']!=$item['title'])) {
$isRebuildData = true;
$tags = FeedItem::get($id, 'tags');
requireComponent('LZ.PHP.Media');
Media::delete($id);
$oldTags = func::array_trim(explode(',', $tags));
$db->execute("UPDATE {$database['prefix']}FeedItems SET author = '{$item['author']}', title = '{$item['title']}', description = '{$description}', tags = '$tagString', enclosure = '$enclosureString', written = {$item['written']} WHERE id = $id");
}
} else {
if ($item['written']==0)
$item['written']=gmmktime();
if ($item['written']>$deadLine) {
$db->execute("INSERT INTO {$database['prefix']}FeedItems (feed, author, permalink, title, description, tags, enclosure, written, feedVisibility) VALUES ($feedId, '{$item['author']}', '{$item['permalink']}', '{$item['title']}', '{$description}', '$tagString', '$enclosureString', {$item['written']},'{$feedVisibility}')");
$id =$db->insertId();
$db->execute('UPDATE '.$database['prefix'].'Feeds SET feedCount=feedCount+1 WHERE id="'.$feedId.'"');
if (isset($this)) $this->updated++;
}
$isRebuildData = true;
}
if(Validator::getBool(Settings::get('saveImages'))) {
if($description = FeedItem::saveImages($feedId, $id, $item)) {
$db->execute("UPDATE {$database['prefix']}FeedItems SET description = '{$description}' WHERE id = $id");
}
}
$item = $event->on('Add.updateFeedItem', array($feedId, $id, $item));
if(count($item)==3) $item = $item[2];
$result = false;
if($isRebuildData) {
requireComponent('Bloglounge.Data.Groups');
GroupCategory::buildGroupCategory($id, $feedId, $item['tags']);
Tag::buildTagIndex($id, $item['tags'], $oldTags);
Category::buildCategoryRelations($id, $item['tags'], $oldTags);
$isSaveThumbnail = FeedItem::cacheThumbnail($id, $item);
// 썸네일 저장 이벤트
$event->on('Add.thumbnailSave',array($item, $feedId, $id, $isSaveThumbnail));
$result = true;
}
return $result;
}
示例3: htmlspecialchars
$sp_posts = $skin->parseTag('post_link_target', (Validator::getBool($config->directView)?'_self':'_blank'), $sp_posts);
$sp_posts = $skin->parseTag('post_permalink', htmlspecialchars($item['permalink']), $sp_posts);
$sp_posts = $skin->parseTag('post_visibility', (($item['visibility'] == 'n' || $item['feedVisibility'] == 'n') ? 'hidden' : 'visible' ), $sp_posts);
$sp_posts = $skin->parseTag('post_title', UTF8::clear($event->on('Text.postTitle', UTF8::lessen(func::stripHTML($item['title']), $skinConfig->postTitleLength))), $sp_posts);
$sp_posts = $skin->parseTag('post_author', UTF8::clear($event->on('Text.postAuthor',$item['author'])), $sp_posts);
list($post_category) = explode(',', UTF8::clear($item['tags']), 2);
$sp_posts = $skin->parseTag('post_category', $post_category, $sp_posts);
$sp_posts = $skin->parseTag('post_date', $event->on('Text.postDate',(Validator::is_digit($item['written']) ? date('Y-m-d h:i a', $item['written']) : $item['written'])), $sp_posts);
$sp_posts = $skin->parseTag('post_view', $item['click'], $sp_posts);
$post_description = func::stripHTML($item['description'].'>');
if (substr($post_description, -1) == '>') $post_description = substr($post_description, 0, strlen($post_description) - 1);
$post_description = UTF8::lessenAsByte(func::htmltrim($post_description), $skinConfig->postDescLength);
if (strlen($post_description) == 0) $post_description = '<span class="empty">'._t('(글의 앞부분이 이미지 혹은 HTML 태그만으로 되어있습니다)').'</span>';
$post_description = $event->on('Text.postDescription', $post_description);
if(!empty($searchKeyword) && in_array($searchType,array('title','description','title+description'))) {
$keyword_pattern = "/([^<]*)".str_replace("\0","\\0",preg_quote($searchKeyword,"/"))."([^>]*)/i";
$post_description = preg_replace($keyword_pattern, "\\1<span class=\"point\">" . $searchKeyword . "</span>\\2", $post_description);
}
$sp_posts = $skin->parseTag('post_description_slashed', addslashes($post_description), $sp_posts);
$sp_posts = $skin->parseTag('post_description', $post_description, $sp_posts);
$post_description = str_replace('/cache/images/',$service['path'] . '/cache/images/', $item['description']);
$sp_posts = $skin->parseTag('post_description_original', $post_description, $sp_posts);
示例4: getIssueFocus
//.........这里部分代码省略.........
?>
</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
}
?>
</ul>
<?php
}
// 이슈태그 내용
$index = 0;
foreach($issueTags as $tag) {
$index ++;
?>
<ul id="_issueFocus_<?php echo $index;?>_item" class="item _issueFocus_item<?php echo (!$config['useFocus']&&($index==1))?' viewed':'';?>">
<?php
if(count($tag['feedItems'])>0) {
foreach($tag['feedItems'] as $feedItem) {
$thumbnailFile = '';
if($media = Media::getMedia($feedItem['thumbnailId'])) {
$thumbnailFile = Media::getMediaFile($media['thumbnail']);
}
示例5: 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;
}