本文整理汇总了PHP中func::array_trim方法的典型用法代码示例。如果您正苦于以下问题:PHP func::array_trim方法的具体用法?PHP func::array_trim怎么用?PHP func::array_trim使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类func
的用法示例。
在下文中一共展示了func::array_trim方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: boom
$skin->replace('boomup_count', $linker_post['boomUp']);
$skin->replace('boomdown_count', $linker_post['boomDown']);
$skin->replace('boomup_onclick', 'javascript: boom(\''.$linker_post['id'].'\',\'up\');');
$skin->replace('boomdown_onclick', 'javascript: boom(\''.$linker_post['id'].'\',\'down\');');
$skin->replace('boomup_id', 'boomUp'.$linker_post['id']);
$skin->replace('boomdown_id', 'boomDown'.$linker_post['id']);
$boomedUp = Boom::isBoomedUp($linker_post['id']);
$boomedDown = Boom::isBoomedDown($linker_post['id']);
$skin->replace('boomup_class', (($boomedUp)?'isBoomedUp':'isntBoomedUp'));
$skin->replace('boomdown_class', (($boomedDown)?'isBoomedDown':'isntBoomedDown'));
$tags = $event->on('Data.linker.tags', func::array_trim(explode(',', $linker_post['tags'])));
if (count($tags) > 1) {
$s_tags = '';
$src_tags = $skin->cutSkinTag('tags_rep');
foreach ($tags as $tag) {
if ($tag == $category) continue;
$sp_tags = $skin->replace('tag_link', htmlspecialchars($service['path'].'/?tag='.urlencode(trim($tag))), $src_tags);
$sp_tags = $skin->replace('tag_name', UTF8::clear($tag), $sp_tags);
$s_tags .= $sp_tags;
$sp_tags = '';
}
$skin->dress('tags_rep', $src_tags, $s_tags);
} else {
}
}
?>
示例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
$userid = $session['id'];
$ip = $_SERVER['REMOTE_ADDR'];
if (isLoggedIn()) {
$boomedUp = Boom::isBoomedUp($post['id'], 'userid', $userid);
$boomedDown = Boom::isBoomedDown($post['id'], 'userid', $userid);
} else {
$boomedUp = Boom::isBoomedUp($post['id'], 'ip', $ip);
$boomedDown = Boom::isBoomedDown($post['id'], 'ip', $ip);
}
$sp_post = $skin->parseTag('boomup_class', (($boomedUp)?'isBoomedUp':'isntBoomedUp'), $sp_post);
$sp_post = $skin->parseTag('boomdown_class', (($boomedDown)?'isBoomedDown':'isntBoomedDown'), $sp_post);
$tags = $event->on('Data.postTags', func::array_trim(explode(',', $post['tags'])));
if (count($tags) > 1) {
$s_tags = '';
$src_tags = $skin->cutSkinTag('tags_rep');
foreach ($tags as $tag) {
if ($tag == $post_category) continue;
$sp_tags = $skin->parseTag('tag_link', htmlspecialchars($service['path'].'/?tag='.urlencode(trim($tag))), $src_tags);
$sp_tags = $skin->parseTag('tag_name', UTF8::clear(trim($tag)), $sp_tags);
$s_tags .= $sp_tags;
$sp_tags = '';
}
$sp_post = $skin->dressOn('tags_rep', $src_tags, $s_tags, $sp_post);
$sp_post = str_replace('<s_tags>', '', $sp_post);
$sp_post = str_replace('</s_tags>', '', $sp_post);
} else {
if ($skin->doesScopeExists('tags'))
示例4:
<?php
define('ROOT', '../../..');
include ROOT . '/lib/includeForAdmin.php';
requireMembership();
// 글수정
$msg = '';
if (isset($_POST['id']) || !empty($_POST['id']) || (isset($_POST['id']) && preg_match("/^[0-9]+$/", $_POST['id']))) {
$feedItem = FeedItem::getAll($_POST['id']);
if (FeedItem::editWithArray($_POST['id'], array("title"=>$_POST['title'], "focus"=>((isset($_POST['isFocus']) && $is_admin) ? 'y' : 'n'), "author"=>$_POST['author'], "permalink"=>$_POST['permalink'], "tags"=>$_POST['tags'],"autoUpdate"=>(isset($_POST['autoUpdate']) ? 'y' : 'n'), "visibility"=>(isset($_POST['visibility']) ? $_POST['visibility'] : NULL), "allowRedistribute"=>(isset($_POST['allowRedistribute']) ? 'y' : 'n')))) {
if($_POST['tags'] != $feedItem['tags']) {
$tags = func::array_trim(explode(',', $_POST['tags']));
$oldTags = func::array_trim(explode(',', $feedItem['tags']));
Tag::buildTagIndex($_POST['id'], $tags, $oldTags);
Category::buildCategoryRelations($_POST['id'], $tags, $oldTags);
}
if(isset($_POST['category'])) {
Category::setItemCategory($_POST['id'], $_POST['category']);
Category::rebuildCount($_POST['category']);
Category::rebuildCount($feedItem['category']);