本文整理汇总了PHP中UTF8::lessenAsEm方法的典型用法代码示例。如果您正苦于以下问题:PHP UTF8::lessenAsEm方法的具体用法?PHP UTF8::lessenAsEm怎么用?PHP UTF8::lessenAsEm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UTF8
的用法示例。
在下文中一共展示了UTF8::lessenAsEm方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: RefererURLBeautifier_handler
function RefererURLBeautifier_handler($target, $mother)
{
$keyword = false;
if (preg_match('/\\W(q|query|k|keyword|search|stext|nlia|aqa|wd)(?:=|%3D)([^&]+)/i', $mother['url'], $matches)) {
$keyword = urldecode(rawurldecode($matches[2]));
} else {
if (strpos($mother['host'], 'images.google.') !== false && preg_match('/%3Fsearch%3D([^&]+)/i', $mother['url'], $matches)) {
$keyword = urldecode(rawurldecode($matches[1]));
} else {
if (strpos($mother['host'], 'yahoo.') !== false && preg_match('/\\Wp=([^&]+)/i', $mother['url'], $matches)) {
$keyword = urldecode(rawurldecode($matches[1]));
} else {
if (preg_match('@/search/(?:\\w+/)*([^/?]+)@i', $mother['url'], $matches)) {
$keyword = urldecode(rawurldecode($matches[1]));
}
}
}
}
if (!UTF8::validate($keyword)) {
$keyword = UTF8::correct(UTF8::bring($keyword));
}
$keyword = UTF16UrlDecode($keyword);
$url = rawurldecode(substr($mother['url'], 7));
if (!UTF8::validate($url)) {
$url = UTF8::correct(UTF8::bring($url));
}
//return '<img src="http://'.$mother['host'].'/favicon.ico" width="16" height="16" alt="Favicon" onerror="this.parentNode.removeChild(this)" style="vertical-align: middle"/> ' . (($keyword) ? '<span style="font-weight: bold; color: #594">['.htmlspecialchars($keyword).']</span> ' . UTF8::lessenAsEm($url, 65 - UTF8::lengthAsEm($keyword)) : UTF8::lessenAsEm($url, 65));
return $keyword ? '<span style="font-weight: bold; color: #594">[' . htmlspecialchars($keyword) . ']</span> ' . htmlspecialchars(UTF8::lessenAsEm($url, 70 - UTF8::lengthAsEm($keyword))) : htmlspecialchars(UTF8::lessenAsEm($url, 70));
}
示例2: ViewCounterList
function ViewCounterList($target)
{
global $database, $blogid, $blogURL, $skinSetting;
$result = POD::queryAll("SELECT b.id, b.title, a.readcounts FROM {$database['prefix']}EntryReadCount a INNER JOIN {$database['prefix']}Entries b ON a.blogid = b.blogid AND a.id = b.id WHERE a.blogid={$blogid} AND b.visibility >= 2 AND b.draft = 0 AND b.category >=0 ORDER BY a.readcounts DESC LIMIT 0,5");
$target = "<ul>";
foreach ((array) $result as $row) {
$articleid = $row['id'];
$articletitle = htmlspecialchars(UTF8::lessenAsEm($row['title'], $skinSetting['recentEntryLength']));
$readcounts = $row['readcounts'];
$rsurl = "{$blogURL}/{$articleid}";
$target .= "<li><a href=\"{$rsurl}\">{$articletitle}</a> <span class=\"cnt\">({$readcounts})</span></li>\n";
}
$target .= "</ul>";
return $target;
}
示例3: PN_BlogStatisticsProcess
function PN_BlogStatisticsProcess($target)
{
global $blogid, $pluginURL, $defaultURL, $blog;
if (doesHaveOwnership()) {
include_once 'lib/open-flash-chart.php';
$grpStyle = $_GET['grpStyle'];
$grpData = explode("|", $_GET['grpData']);
$grpTotal = $_GET['grpTotal'];
$grpYear = $_GET['grpYear'];
$grpTypeName = $_GET['grpTypeName'];
$grpLinkType = $_GET['grpLinkType'];
$grpXLabelType = isset($_GET['grpXLabelType']) ? $_GET['grpXLabelType'] : 0;
$grpLabel = explode("|", $_GET['grpLabel']);
$grpSubTitle = array();
$grpLabelTemp = array();
if (!empty($_GET['grpData'])) {
if ($grpTypeName == "category") {
for ($i = 0; $i < count($grpLabel); $i++) {
$grpSubTitle[] = rawurlencode($grpLabel[$i] == 0 ? _t('분류없음') : htmlspecialchars(UTF8::lessenAsEm(getCategoryNameById($blogid, $grpLabel[$i]), 15)));
}
} else {
if ($grpTypeName == "hits" || $grpTypeName == "cmmax" || $grpTypeName == "tbmax" || $grpTypeName == "tagmax") {
for ($i = 0; $i < count($grpLabel); $i++) {
$grpSubTitle[] = rawurlencode(htmlspecialchars(UTF8::lessenAsEm(str_replace(",", "-", getEntryTitleById($blogid, $grpLabel[$i])), 25)));
}
} else {
if ($grpTypeName == "commenter" || $grpTypeName == "tag") {
for ($i = 0; $i < count($grpLabel); $i++) {
$grpSubTitle[] = htmlspecialchars(UTF8::lessenAsEm($grpLabel[$i], 15));
$grpLabelTemp[] = htmlspecialchars(UTF8::lessenAsEm($grpLabel[$i], 6, ''));
}
$grpLabel = $grpLabelTemp;
} else {
if ($grpTypeName == "time") {
for ($i = 0; $i < count($grpLabel); $i++) {
$grpSubTitle[] = rawurlencode($grpLabel[$i] . "시");
}
} else {
if ($grpTypeName == "refer") {
for ($i = 0; $i < count($grpLabel); $i++) {
$tmpHost = explode('.', $grpLabel[$i]);
$tmpHostCnt = count($tmpHost) - 1;
$tmpDomain = (strlen($tmpHost[$tmpHostCnt]) < 3 ? $tmpHost[$tmpHostCnt - 2] . '.' : '') . $tmpHost[$tmpHostCnt - 1] . '.' . $tmpHost[$tmpHostCnt];
$cutDomain = explode('.', $tmpDomain);
$grpSubTitle[] = htmlspecialchars($grpLabel[$i]);
$grpLabelTemp[] = htmlspecialchars(UTF8::lessenAsEm($cutDomain[0], 6, ''));
}
$grpLabel = $grpLabelTemp;
} else {
if ($grpTypeName == "referkey") {
for ($i = 0; $i < count($grpLabel); $i++) {
$tmpLabel = explode('(', $grpLabel[$i]);
$grpSubTitle[] = htmlspecialchars(UTF8::lessenAsEm($grpLabel[$i], 15));
$grpLabelTemp[] = htmlspecialchars(UTF8::lessenAsEm($tmpLabel[0], 6, ''));
}
$grpLabel = $grpLabelTemp;
}
}
}
}
}
}
$g = new graph();
$g->bg_colour = '#FFFFFF';
if ($grpStyle == "pie") {
$grpClickLink = "";
$grpPercent = array();
$grpLink = array();
for ($i = 0; $i < count($grpData); $i++) {
$grpPercent[] = round($grpData[$i] / $grpTotal * 100, 0);
}
if ($grpLinkType == "archiveYear") {
for ($i = 0; $i < count($grpLabel); $i++) {
$permalink = $defaultURL . "/archive/" . substr($grpLabel[$i], 0, 4);
$grpLink[] = "javascript:window.open('{$permalink}');void(0)";
}
$grpClickLink = "<br>click on the pie.";
} else {
if ($grpLinkType == "archiveMonth" && $grpYear != "9999") {
for ($i = 0; $i < count($grpLabel); $i++) {
$cutMonth = str_replace("월", "", $grpLabel[$i]);
$tmpMonth = strlen($cutMonth) == 1 ? "0" . $cutMonth : $cutMonth;
$permalink = $defaultURL . "/archive/" . $grpYear . $tmpMonth;
$grpLink[] = "javascript:window.open('{$permalink}');void(0)";
}
$grpClickLink = "<br>click on the pie.";
} else {
if ($grpLinkType == "category") {
for ($i = 0; $i < count($grpLabel); $i++) {
$permalink = $defaultURL . "/category/" . getCategoryLabelById($blogid, $grpLabel[$i]);
$grpLink[] = "javascript:window.open('{$permalink}');void(0)";
}
$grpClickLink = "<br>click on the pie.";
} else {
if ($grpLinkType == "entry") {
for ($i = 0; $i < count($grpLabel); $i++) {
$permalink = $defaultURL . ($blog['useSlogan'] ? "/entry/" . getEntrySloganById($blogid, $grpLabel[$i]) : "/" . $grpLabel[$i]);
$grpLink[] = "javascript:window.open('{$permalink}');void(0)";
}
$grpClickLink = "<br>click on the pie.";
//.........这里部分代码省略.........
示例4: printIphoneLinksView
function printIphoneLinksView($links)
{
global $blogURL, $skinSetting, $suri, $pathURL;
if (rtrim($suri['url'], '/') == $pathURL) {
$home = true;
} else {
$home = false;
}
foreach ($links as $link) {
if (!doesHaveOwnership() && $link['visibility'] == 0 || !doesHaveMembership() && $link['visibility'] < 2) {
continue;
}
$linkView .= '<li><a href="' . htmlspecialchars($link['url']) . '" class="link" target="_blank">' . htmlspecialchars(UTF8::lessenAsEm($link['name'], $skinSetting['linkLength'])) . '</a></li>' . CRLF;
}
return $linkView;
}
示例5: if
<div class="ftitle<?php if(!$noVerifier) {?> noftool<?php } ?>">
<a href="<?php echo $service['path'];?>/admin/blog/list?read=<?php echo $feed['id'];?>"><?php echo UTF8::lessenAsEm(stripcslashes($feed['title']), 25);?></a> <?php echo ($isNew?' <img src="'.$service['path'].'/images/admin/icon_new.gif" alt="new" align="absmiddle"/>':'');?>
</div>
<div class="clear"></div>
<?php
$content = ob_get_contents();
ob_end_clean();
array_push($data['datas'], array('class'=>'bloglist_title','data'=> $content ));
// 블로그 최근업데이트
ob_start();
if(!empty($lastPost)) {
?>
<a href="<?php echo $service['path'];?>/admin/blog/entrylist/?read=<?php echo $lastPost['id'];?>"><?php echo UTF8::lessenAsEm(stripcslashes(func::stripHTML($lastPost['title'])),20);?></a> <span class="date"> : <?php echo date('y.m.d H:i:s', $feed['lastUpdate']);?> (<?php echo $stringDate;?>) </span>
<?php
} else {
?>
<span class="empty"><?php echo _t('수집된 글이 없습니다.');?></span>
<?php
}
$content = ob_get_contents();
ob_end_clean();
array_push($data['datas'], array('class'=>'bloglist_update','data'=> $content ));
// 블로그 등록 글 수
array_push($data['datas'], array('class'=>'bloglist_count','data'=> '<a href="'.$service['path'].'/admin/blog/entrylist/?type=blogURL&keyword='.rawurlencode($feed['blogURL']).'" title="'._t('전체보기').'">'.$feed['feedCount'].'</a>' ));
示例6: define
<?php
/// Copyright (c) 2004-2011, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
define('__TEXTCUBE_IPHONE__', true);
require ROOT . '/library/preprocessor.php';
requireView('iphoneView');
if (empty($suri['id'])) {
printIphoneHtmlHeader();
?>
<ul id="home" title="<?php
echo htmlspecialchars(UTF8::lessenAsEm($blog['title'], 30));
?>
" selected="true">
<?php
$blogAuthor = User::getBlogOwnerName($blogid);
$blogLogo = !empty($blog['logo']) ? printIphoneImageResizer($blogid, $blog['logo'], 80) : "{$service['path']}/resources/style/iphone/image/textcube_logo.png";
$itemsView = '<li class="blog_info">' . CRLF;
$itemsView .= ' <div class="logo"><img src="' . $blogLogo . '" /></div>' . CRLF;
$itemsView .= ' <div class="blog_container">' . CRLF;
$itemsView .= ' <span class="title">' . htmlspecialchars($blog['title']) . '</span>' . CRLF;
$itemsView .= ' <span class="author">by ' . $blogAuthor . '</span>' . CRLF;
$itemsView .= ' <span class="description">' . htmlspecialchars($blog['description']) . '</span>' . CRLF;
$itemsView .= ' </div>' . CRLF;
$itemsView .= '</li>' . CRLF;
print $itemsView;
?>
<li><a href="<?php
echo $blogURL;
示例7: longURLtoShort
function longURLtoShort($url,$checkURL=55,$leftURL=39,$rightURL=8) {
//$checkURL = 55; // 체크할 URL 길이
//$leftURL = 39; // '...'의 왼쪽에 나타낼 URL 길이
//$rightURL = 8; // '...'의 오른쪽에 나타낼 URL의 길이
$link = $url;
$full_url = str_replace(array(' ', '\'', '`', '"'), array('%20', '', '', ''), $url);
$url = "http://".htmlspecialchars($url);
$url = strtolower(str_replace("http://http://","http://",$url));
$templink = strip_tags($link);
$templink = "http://".htmlspecialchars($templink);
$templink = strtolower(str_replace("http://http://","http://",$templink));
if (strpos($url, 'www.') === 0)
$full_url = 'http://'.$full_url;
else if (strpos($url, 'ftp.') === 0)
$full_url = 'ftp://'.$full_url;
else if (!preg_match('#^([a-z0-9]{3,6})://#', $url, $bah))
$full_url = 'http://'.$full_url;
$link = ($templink == '' || $templink == $url) ? ((strlen($url) > $checkURL) ? UTF8::lessenAsEm($url, $leftURL, '').' … '.substr(rawurlencode($url), ($rightURL*-1)) : stripslashes($link)) : stripslashes($link);
return $link;
}
示例8: getNoticePage
//.........这里部分代码省略.........
$headers = array(array('title'=>_t('선택'),'class'=>'entrylist_select','width'=>'50px'),
array('title'=>_t('날짜'),'class'=>'entrylist_date','width'=>'100px'),
array('title'=>_t('제목'),'class'=>'entrylist_title','width'=>'790px'),
array('title'=>_t('실행'),'class'=>'entrylist_execute','width'=>'auto'));
$datas = array();
if(count($posts)>0) {
foreach($posts as $post) {
$data = array();
$date = Func::dateToString($post['written']);
$feedvisibility = Feed::get($post['feed'], 'visibility');
$data['id'] = 'list_item_'.$post['id'];
$data['class'] = ($post['visibility']=='n'?'list_item_hide':'').($post['id']==$read?' list_item_select':'');
$data['datas'] = array();
// 글 선택
array_push($data['datas'], array('class'=>'noticelist_select','data'=> '<input type="checkbox" class="postid" value="'.$post['id'].'" />' ));
// 글 등록날짜
ob_start();
?>
<?php echo date('y.m.d H:i:s', $post['written']);?><br />
<span class="date_text">(<?php echo $date;?>)</span>
<?php
$content = ob_get_contents();
ob_end_clean();
array_push($data['datas'], array('class'=>'noticelist_date','data'=> $content ));
// 글 제목
ob_start();
?>
<?php
$desc = UTF8::lessenAsEm(str_replace(' ','',func::stripHTML($post['description'])),82);
if(empty($desc)) {
$desc = '<span class="empty">'._t('내용이 비어있거나 HTML로만 작성되어 있습니다.').'</span>';
}
$isNew = Func::isNew($post['written'],1);
?>
<div class="title"><?php echo UTF8::lessenAsEm(stripcslashes(func::stripHTML($post['title'])), 60);?> <?php echo ($isNew?' <img src="'.$service['path'].'/images/admin/icon_new.gif" alt="new" align="absmiddle" class="new" />':'');?></div>
<?php echo $desc?>
<?php
$content = ob_get_contents();
ob_end_clean();
array_push($data['datas'], array('class'=>'noticelist_title','data'=> $content ));
// 글 실행
ob_start();
?>
<a href="#" class="microbutton alertbutton" onclick="deleteItem(<?php echo $post['id'];?>); return false;"><span><?php echo _t('삭제');?></span></a>
<?php
$content = ob_get_contents();
ob_end_clean();
array_push($data['datas'], array('class'=>'noticelist_execute','data'=> $content ));
array_push($datas, $data);
}
} else {
array_push( $datas, array( 'class'=>"list_empty", 'datas'=>array(array('data'=>empty($keyword)?_t('공지사항이 없습니다.'):_t('검색된 공지사항이 없습니다.')) )) );
}
ob_start();
?>
<div class="select">
<a href="#" onclick="toggleCheckAll('postid'); return false;"><img src="<?php echo $service['path'];?>/images/admin/bt_arrow.gif" /></a>
</div>
<div class="action">
<strong><a href="#" onclick="deleteAllItem('postid'); return false;"><?php echo _t('삭제');?></a></strong>
</div>
<div class="clear"></div>
<?php
$footers = ob_get_contents();
ob_end_clean();
echo makeTableBox('noticelist', $headers, $datas, $footers);
?>
</div>
<div class="wrap">
<br />
<div class="paging">
<?php echo func::printPaging($paging, $params);?>
</div>
</div>
<?php
$input .= ob_get_contents();
ob_end_clean();
}
return $input;
}
示例9: echo
?>
<div class="data<?php echo !empty($thumbnailFile)?'':' no_thumbnail_data';?>">
<div class="title"><a href="<?php echo $service['path'];?>/admin/blog/entrylist?read=<?php echo $post['id'];?>"><?php echo UTF8::lessenAsEm(stripcslashes(func::stripHTML($post['title'])), 36);?></a><?php echo ($isNew?'<img src="'.$service['path'].'/images/admin/icon_new.gif" alt="new" align="absmiddle" class="new" />':'');?></div>
<a href="<?php echo $service['path'];?>/admin/blog/entrylist?read=<?php echo $post['id'];?>"><?php echo $desc?></a>
</div>
<div class="clear"></div>
<?php
$content = ob_get_contents();
ob_end_clean();
array_push($data['datas'], array('class'=>'entrylist_title','data'=> $content ));
// 글 블로그
ob_start();
?>
<a href="<?php echo $service['path'];?>/admin/blog/list?read=<?php echo $post['feed'];?>" title="<?php echo _f('\'%1\' 정보보기', stripcslashes(Feed::get($post['feed'], 'title')));?>"><?php echo UTF8::lessenAsEm(stripcslashes(Feed::get($post['feed'], 'title')), 30);?></a> <?php echo $feedvisibility=='n'?'<span class="hide">'._t('(비공개)').'</span>':'';?>
<?php
$content = ob_get_contents();
ob_end_clean();
array_push($data['datas'], array('class'=>'entrylist_blog','data'=> $content ));
// 글 랭크
$rank = Boom::getRank($post['id']);
array_push($data['datas'], array('class'=>'entrylist_rank','data'=> '<span class="rank'.$rank.'">'.$rank.'</span>' ));
// 글 읽은 수
array_push($data['datas'], array('class'=>'entrylist_hit','data'=> $post['click']));
// 글 실행