本文整理汇总了PHP中URL::encode方法的典型用法代码示例。如果您正苦于以下问题:PHP URL::encode方法的具体用法?PHP URL::encode怎么用?PHP URL::encode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类URL
的用法示例。
在下文中一共展示了URL::encode方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test3
public function test3()
{
$URL = new URL("http://abc.com/目录1/目录2/index.php?cat=科技&rate= 非常好");
$URL->encode();
$newUrl = $URL->build();
echo $newUrl;
//http://abc.com/%E7_%AE%E5%BD_1/%E7_%AE%E5%BD_2/index.php?cat=%E7%A7_%E6__&rate=+%E9__%E5%B8%B8%E5%A5%BD
}
示例2: KeywordUI_bindTag
function KeywordUI_bindTag($target, $mother)
{
global $blogURL, $pluginURL, $configVal;
requireModel('blog.keyword');
$blogid = getBlogId();
if (isset($mother) && isset($target)) {
$tagsWithKeywords = array();
$keywordNames = getKeywordNames($blogid);
foreach ($target as $tag => $tagLink) {
if (in_array($tag, $keywordNames) == true) {
$tagsWithKeywords[$tag] = $tagLink . "<a href=\"#\" class=\"key1\" onclick=\"openKeyword('{$blogURL}/keylog/" . URL::encode($tag) . "'); return false\"><img src=\"" . $pluginURL . "/images/flag_green.gif\" alt=\"Keyword " . $tag . "\"/></a>";
} else {
$tagsWithKeywords[$tag] = $tagLink;
}
}
$target = $tagsWithKeywords;
}
return $target;
}
示例3: KeywordUI_bindTag
function KeywordUI_bindTag($target, $mother)
{
$context = Model_Context::getInstance();
importlib('model.blog.keyword');
$blogid = getBlogId();
$blogURL = $context->getProperty("uri.blog");
$pluginURL = $context->getProperty("plugin.uri");
if (isset($mother) && isset($target)) {
$tagsWithKeywords = array();
$keywordNames = getKeywordNames($blogid);
foreach ($target as $tag => $tagLink) {
if (in_array($tag, $keywordNames) == true) {
$tagsWithKeywords[$tag] = $tagLink . "<a href=\"#\" class=\"key1\" onclick=\"openKeyword('{$blogURL}/keylog/" . URL::encode($tag) . "'); return false\"><img src=\"" . $pluginURL . "/images/flag_green.gif\" alt=\"Keyword " . $tag . "\"/></a>";
} else {
$tagsWithKeywords[$tag] = $tagLink;
}
}
$target = $tagsWithKeywords;
}
return $target;
}
示例4: dress
<?php
/// Copyright (c) 2004-2016, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
if (!empty($listView)) {
dress('list', $listView, $view);
} else {
if (isset($list) && isset($skin)) {
$listView = $skin->list;
$itemsView = '';
foreach ($list['items'] as $item) {
$author = User::getName($item['userid']);
$itemsView .= str_replace(array('[##_list_rep_regdate_##]', '[##_list_rep_name_##]', '[##_list_rep_author_##]', '[##_list_rep_link_##]', '[##_list_rep_title_##]', '[##_list_rep_rp_cnt_##]'), array(fireEvent('ViewListDate', Timestamp::formatDate($item['published']), $item['published']), fireEvent('ViewListName', htmlspecialchars($author)), fireEvent('ViewListName', htmlspecialchars($author)), (!empty($skinSetting['showListWithTotalEntries']) ? "#entry_" . $item['id'] : $context->getProperty('uri.blog') . "/" . ($context->getProperty('blog.useSloganOnPost') ? 'entry/' . URL::encode($item['slogan'], $service['useEncodedURL']) : $item['id'])) . (isset($list['category']) ? '?category=' . $list['category'] : ''), fireEvent('ViewListTitle', htmlspecialchars($item['title'])), $item['comments'] > 0 ? "{$item['comments']}" : ''), $skin->listItem);
}
dress('list_rep', $itemsView, $listView);
dress('list_conform', fireEvent('ViewListHeadTitle', htmlspecialchars($list['title'])), $listView);
dress('list_count', isset($list['count']) ? $list['count'] : '0', $listView);
dress('list_rss_url', $context->getProperty('uri.default') . '/rss/' . $listFeedURL, $listView);
dress('list_atom_url', $context->getProperty('uri.default') . '/atom/' . $listFeedURL, $listView);
$listView = fireEvent('ViewList', $listView, $list);
if (empty($entries)) {
$listView = $listView . CRLF . '[##_paging_list_##]';
}
dress('list', $listView, $view);
if (isset($cache)) {
$cache->contents = $listView;
$cache->dbContents = $paging;
$cache->update();
}
}
示例5: encode_url
function encode_url($url)
{
depricated_warning();
return URL::encode($url);
}
示例6: pretty_dress
function pretty_dress($view)
{
global $blogid, $blog, $database, $service, $stats, $skinSetting;
/* local static */
global $pd_category, $pd_categoryXhtml, $pd_archive, $pd_calendar, $pd_tags, $pd_notices, $pd_recentEntry;
global $pd_recentComment, $pd_recentTrackback, $pd_link, $pd_authorList;
if (isset($_REQUEST['safe'])) {
// safe mode
return '<div class="sidebar-element-safebox">…</div>';
}
if (isset($_REQUEST['tag'])) {
// safe mode
return '<div class="sidebar-element-safebox"><p>' . nl2br(htmlspecialchars($view, ENT_QUOTES)) . '</p></div>';
}
$writer = POD::queryCell("SELECT name FROM {$database['prefix']}Users WHERE userid = " . User::getBlogOwner($blogid));
$pageTitle = _t('페이지 제목');
dress('page_title', htmlspecialchars($pageTitle), $view);
dress('blogger', htmlspecialchars($writer), $view);
dress('title', htmlspecialchars($context->getProperty('blog.title')), $view);
dress('desc', htmlspecialchars($context->getProperty('blog.description')), $view);
if (!empty($context->getProperty('blog.logo'))) {
dress('image', "{$context->getProperty('service.path')}/attach/{$blogid}/{$context->getProperty('blog.logo')}", $view);
} else {
dress('image', "{$context->getProperty('service.path')}/resources/image/spacer.gif", $view);
}
dress('blog_link', "{$context->getProperty}('uri.blog')/", $view);
dress('keylog_link', "{$context->getProperty}('uri.blog')/keylog", $view);
dress('localog_link', "{$context->getProperty}('uri.blog')/location", $view);
dress('taglog_link', "{$context->getProperty}('uri.blog')/tag", $view);
dress('guestbook_link', "{$context->getProperty}('uri.blog')/guestbook", $view);
list($view, $searchView) = Skin::cutSkinTag($view, 'search');
dress('search_name', 'search', $searchView);
dress('search_text', isset($search) ? htmlspecialchars($search) : '', $searchView);
dress('search_onclick_submit', 'searchBlog()', $searchView);
dress('search', '<form id="TTSearchForm" action="' . $context->getProperty('uri.blog') . '/search/" method="get" onsubmit="return searchBlog()">' . $searchView . '</form>', $view);
dress('category', $pd_category, $view);
dress('category_list', $pd_categoryXhtml, $view);
dress('count_total', $stats['total'], $view);
dress('count_today', $stats['today'], $view);
dress('count_yesterday', $stats['yesterday'], $view);
list($view, $archiveView) = Skin::cutSkinTag($view, 'archive_rep');
dress('archive_rep', getArchivesView($pd_archive, $archiveView), $view);
dress('calendar', $pd_calendar, $view);
list($view, $randomView) = Skin::cutSkinTag($view, 'random_tags');
dress('random_tags', getRandomTagsView($pd_tags, $randomView), $view);
list($view, $recentNoticeItem) = Skin::cutSkinTag($view, 'rct_notice_rep');
list($view, $noticeView) = Skin::cutSkinTag($view, 'rct_notice');
$notices = $pd_notices;
if (sizeof($notices) == 0) {
$notices = array(array('title' => _t('공지 제목'), 'id' => -1));
}
if (sizeof($notices) > 0) {
$itemsView = '';
foreach ($notices as $notice) {
$itemView = $recentNoticeItem;
dress('notice_rep_title', htmlspecialchars(fireEvent('ViewNoticeTitle', Utils_Unicode::lessenAsEm($notice['title'], $skinSetting['recentNoticeLength']), $notice['id'])), $itemView);
dress('notice_rep_link', "{$context->getProperty}('uri.blog')/notice/" . ($blog['useSloganOnPost'] ? URL::encode($notice['slogan'], $itemView) : $notice['id']), $itemView);
$itemsView .= $itemView;
}
dress('rct_notice_rep', $itemsView, $noticeView);
dress('rct_notice', $noticeView, $view);
}
list($view, $authorList) = Skin::cutSkinTag($view, 'author_rep');
dress('author_rep', getAuthorListView($pd_authorList, $authorList), $view);
list($view, $recentEntry) = Skin::cutSkinTag($view, 'rctps_rep');
dress('rctps_rep', getRecentEntriesView($pd_recentEntry, $recentEntry), $view);
list($view, $recentComments) = Skin::cutSkinTag($view, 'rctrp_rep');
dress('rctrp_rep', getRecentCommentsView($pd_recentComment, $recentComments), $view);
list($view, $recentTrackback) = Skin::cutSkinTag($view, 'rcttb_rep');
dress('rcttb_rep', getRecentTrackbacksView($pd_recentTrackback, $recentTrackback), $view);
list($view, $s_link_rep) = Skin::cutSkinTag($view, 'link_rep');
dress('link_rep', getLinksView($pd_link, $s_link_rep), $view);
dress('rss_url', "{$context->getProperty}('uri.blog')/rss", $view);
dress('owner_url', "{$context->getProperty}('uri.blog')/owner", $view);
dress('textcube_name', TEXTCUBE_NAME, $view);
dress('textcube_version', TEXTCUBE_VERSION, $view);
$tagSearches = array('@<a @i', '@</a *>@i', '@ id *= *".*"@isU', '@ onkey(down|up|press) *="@i', '@ on(click|load|unload) *="@i', '@<input +@i', '@<script.*</script *>@siU', '@<form @siU', '@</form>@siU');
$tagReplaces = array('<span ', '</span>', '', ' onnothing="', ' onnothing="', '<input disabled="disabled" ', '', '<div ', '</div>');
$view = preg_replace($tagSearches, $tagReplaces, $view);
return correctSidebarImage($view);
}
示例7: MT_Cover_getRecentEntries
function MT_Cover_getRecentEntries($parameters)
{
global $skin;
$context = Model_Context::getInstance();
$data = $context->getProperty('plugin.config');
importlib("model.blog.entry");
importlib("model.blog.tag");
$data['coverMode'] = !isset($data['coverMode']) ? 1 : $data['coverMode'];
if (Utils_Misc::isMetaBlog() != true) {
$data['coverMode'] = 1;
}
$data['screenshot'] = !isset($data['screenshot']) ? 1 : $data['screenshot'];
$data['screenshotSize'] = !isset($data['screenshotSize']) ? 90 : $data['screenshotSize'];
$data['paging'] = !isset($data['paging']) ? '2' : $data['paging'];
$data['contentLength'] = !isset($data['contentLength']) ? 250 : $data['contentLength'];
if (isset($parameters['preview'])) {
// preview mode
$retval = '표지에 최신 글 목록을 추가합니다.';
return htmlspecialchars($retval);
}
$entryLength = isset($parameters['entryLength']) ? $parameters['entryLength'] : 10;
if (!is_dir(__TEXTCUBE_CACHE_DIR__ . "/thumbnail")) {
@mkdir(__TEXTCUBE_CACHE_DIR__ . "/thumbnail");
@chmod(__TEXTCUBE_CACHE_DIR__ . "/thumbnail", 0777);
}
if (!is_dir(__TEXTCUBE_CACHE_DIR__ . "/thumbnail/" . $context->getProperty('blog.id'))) {
@mkdir(__TEXTCUBE_CACHE_DIR__ . "/thumbnail/" . $context->getProperty('blog.id'));
@chmod(__TEXTCUBE_CACHE_DIR__ . "/thumbnail/" . $context->getProperty('blog.id'), 0777);
}
if (!is_dir(__TEXTCUBE_CACHE_DIR__ . "/thumbnail/" . $context->getProperty('blog.id') . "/coverPostThumbnail/")) {
@mkdir(__TEXTCUBE_CACHE_DIR__ . "/thumbnail/" . $context->getProperty('blog.id') . "/coverPostThumbnail/");
@chmod(__TEXTCUBE_CACHE_DIR__ . "/thumbnail/" . $context->getProperty('blog.id') . "/coverPostThumbnail/", 0777);
}
$page = $data['paging'] == '1' && !empty($_GET['page']) ? intval($_GET['page']) : 1;
$cache = new PageCache();
$cache->name = 'MT_Cover_RecentPS';
if ($cache->load()) {
//If successful loads
$cache->contents = unserialize($cache->contents);
// If coverpage is single mode OR coverpage is coverblog and cache is not expired, return cache contents.
if (($data['coverMode'] == 1 || $data['coverMode'] == 2) && array_key_exists($page, $cache->contents) && Timestamp::getUNIXtime() - $cache->dbContents < 300) {
return $cache->contents[$page];
}
}
$pool = DBModel::getInstance();
$pool->reset("BlogSettings");
$pool->setQualifier("name", "eq", 'visibility', true);
$pool->setQualifier("value", "<", 2);
$privateBlogId = $pool->getCell("blogid");
$pool->reset("Entries");
$pool->join("Categories", "left", array(array("e.blogid", "eq", "c.blogid"), array("e.category", "eq", "c.id")));
$pool->setQualifier("e.draft", "eq", 0);
$pool->setQualifier("e.category", "beq", 0);
if ($privateBlogId) {
$pool->setQualifier("e.blogid", "hasnoneof", $privateBlogId);
}
if (Utils_Misc::isMetaBlog() == true && doesHaveOwnership() && $context->getProperty('service.type', 'single') != 'single') {
$pool->setQualifier("e.visibility", ">", 1);
$pool->setQualifierSet(array("c.visibility", ">", 1), "OR", array("e.category", "eq", 0));
} else {
if (!doesHaveOwnership()) {
$pool->setQualifier("e.visibility", ">", 1);
$pool->setQualifierSet(array("c.visibility", ">", 1), "OR", array("e.category", "eq", 0));
}
}
if ($data['coverMode'] != 2) {
$pool->setQualifier("e.blogid", "eq", $context->getProperty("blog.id"));
}
list($entries, $paging) = Paging::fetch($pool, $page, $entryLength);
$html = '';
foreach ((array) $entries as $entry) {
$tagLabelView = "";
$blogid = $data['coverMode'] == 2 ? $entry['blogid'] : $context->getProperty('blog.id');
$entryTags = getTags($blogid, $entry['id']);
$defaultURL = getDefaultURL($blogid);
if (sizeof($entryTags) > 0) {
$tags = array();
foreach ($entryTags as $entryTag) {
$tags[$entryTag['name']] = "<a href=\"{$defaultURL}/tag/" . (Setting::getBlogSettingGlobal('useSloganOnTag', true) ? URL::encode($entryTag['name'], $service['useEncodedURL']) : $entryTag['id']) . '">' . htmlspecialchars($entryTag['name']) . '</a>';
}
$tagLabelView = "<div class=\"post_tags\"><span>TAG : </span>" . implode(",\r\n", array_values($tags)) . "</div>";
}
if (empty($entry['category'])) {
$entry['label'] = _text('분류없음');
$entry['link'] = "{$defaultURL}/category";
} else {
$entry['link'] = "{$defaultURL}/category/" . (Setting::getBlogSettingGlobal('useSloganOnCategory', true) ? URL::encode($entry['label'], $service['useEncodedURL']) : $entry['category']);
}
$permalink = "{$defaultURL}/" . (Setting::getBlogSettingGlobal('useSloganOnPost', true) ? "entry/" . URL::encode($entry['slogan'], $context->getProperty('service.useEncodedURL', false)) : $entry['id']);
$html .= '<div class="coverpost">' . CRLF;
if ($imageName = MT_Cover_getAttachmentExtract($entry['content'])) {
if (($tempImageSrc = MT_Cover_getImageResizer($blogid, $imageName, $data['screenshotSize'])) && $data['screenshot'] == 1) {
$html .= '<div class="img_preview"><a href="' . $permalink . '"><img src="' . $tempImageSrc . '" alt="" /></a></div>' . CRLF;
}
}
$html .= ' <div class="content_box">';
$html .= ' <h2><a href="' . $permalink . '">' . htmlspecialchars($entry['title']) . '</a></h2>' . CRLF;
$html .= ' <div class="post_info">' . CRLF;
$html .= ' <span class="category"><a href="' . htmlspecialchars($entry['link']) . '">' . htmlspecialchars($entry['label']) . '</a></span>' . CRLF;
$html .= ' <span class="date">' . Timestamp::format5($entry['published']) . '</span>' . CRLF;
//.........这里部分代码省略.........
示例8: array
require ROOT . '/library/preprocessor.php';
$param = array();
if (isset($_REQUEST['trashType'])) {
array_push($param, 'trashType=' . URL::encode($_REQUEST['trashType'], $service['useEncodedURL']));
}
if (isset($_REQUEST['category'])) {
array_push($param, 'category=' . URL::encode($_REQUEST['category'], $service['useEncodedURL']));
}
if (isset($_REQUEST['name'])) {
array_push($param, 'name=' . URL::encode($_REQUEST['name'], $service['useEncodedURL']));
}
if (isset($_REQUEST['ip'])) {
array_push($param, 'ip=' . URL::encode($_REQUEST['ip']));
}
if (isset($_REQUEST['withSearch'])) {
array_push($param, 'withSearch=' . URL::encode($_REQUEST['withSearch'], $service['useEncodedURL']));
}
if (isset($_REQUEST['search'])) {
array_push($param, 'search=' . URL::encode($_REQUEST['search'], $service['useEncodedURL']));
}
$paramStr = implode('&', $param);
if (strlen($paramStr) > 0) {
$paramStr = '?' . $paramStr;
}
$location = $context->getProperty('uri.blog') . 'owner/center';
if (empty($_REQUEST['trashType']) || $_REQUEST['trashType'] == "comment") {
$location = 'trash/comment';
} else {
$location = 'trash/trackback';
}
header("Location: {$location}{$paramStr}");
示例9: getPagingView
function getPagingView(&$paging, &$template, &$itemTemplate, $useCache = false, $mode = 'href')
{
if ($paging === false || empty($paging['page'])) {
$paging['url'] = NULL;
$paging['onclick'] = NULL;
$paging['prefix'] = NULL;
$paging['postfix'] = NULL;
$paging['total'] = NULL;
$paging['pages'] = 1;
$paging['page'] = 1;
$paging['next'] = NULL;
}
$url = URL::encode($paging['url']);
$prefix = $paging['prefix'];
$postfix = isset($paging['postfix']) ? $paging['postfix'] : '';
ob_start();
if (isset($paging['first'])) {
$itemView = "{$itemTemplate} <span class=\"interword\">...</span> ";
Misc::dress('paging_rep_link_num', '<span>1</span>', $itemView, $useCache);
Misc::dress('paging_rep_link', ($mode == 'href' ? "href='" : "href='#' onclick='") . "{$url}{$prefix}{$paging['first']}{$postfix}'", $itemView, $useCache);
print $itemView;
} else {
if ($paging['page'] > 5) {
$itemView = "{$itemTemplate} <span class=\"interword\">...</span> ";
Misc::dress('paging_rep_link_num', '<span>1</span>', $itemView, $useCache);
Misc::dress('paging_rep_link', ($mode == 'href' ? "href='" : "href='#' onclick='") . "{$url}{$prefix}1{$postfix}'", $itemView, $useCache);
print $itemView;
}
}
if (isset($paging['before'])) {
$page = $paging['page'] - count($paging['before']);
} else {
$page = $paging['page'] < 5 ? 1 : $paging['page'] - 4;
}
if (isset($paging['before'])) {
foreach ($paging['before'] as $value) {
$itemView = $itemTemplate;
Misc::dress('paging_rep_link_num', "<span>{$page}</span>", $itemView, $useCache);
Misc::dress('paging_rep_link', ($mode == 'href' ? "href='" : "href='#' onclick='") . "{$url}{$prefix}{$value}{$postfix}'", $itemView, $useCache);
print $itemView;
$page++;
}
} else {
for ($i = 0; $i < 4 && $page < $paging['page']; $i++) {
$itemView = $itemTemplate;
Misc::dress('paging_rep_link_num', "<span>{$page}</span>", $itemView, $useCache);
Misc::dress('paging_rep_link', ($mode == 'href' ? "href='" : "href='#' onclick='") . "{$url}{$prefix}{$page}{$postfix}'", $itemView, $useCache);
print $itemView;
$page++;
}
}
if ($page == $paging['page'] && $page <= $paging['pages']) {
$itemView = $itemTemplate;
Misc::dress('paging_rep_link_num', "<span class=\"selected\" >{$page}</span>", $itemView, $useCache);
Misc::dress('paging_rep_link', '', $itemView, $useCache);
print $itemView;
$page++;
}
if (isset($paging['before'])) {
foreach ($paging['after'] as $value) {
$itemView = $itemTemplate;
Misc::dress('paging_rep_link_num', "<span>{$page}</span>", $itemView, $useCache);
Misc::dress('paging_rep_link', ($mode == 'href' ? "href='" : "href='#' onclick='") . "{$url}{$prefix}{$value}{$postfix}'", $itemView, $useCache);
print $itemView;
$page++;
}
} else {
for ($i = 0; $i < 4 && $page <= $paging['pages']; $i++) {
$itemView = $itemTemplate;
Misc::dress('paging_rep_link_num', "<span>{$page}</span>", $itemView, $useCache);
Misc::dress('paging_rep_link', ($mode == 'href' ? "href='" : "href='#' onclick='") . "{$url}{$prefix}{$page}{$postfix}'", $itemView, $useCache);
print $itemView;
$page++;
}
}
if (isset($paging['last'])) {
$itemView = " <span class=\"interword\">...</span> {$itemTemplate}";
Misc::dress('paging_rep_link_num', "<span>{$paging['pages']}</span>", $itemView, $useCache);
Misc::dress('paging_rep_link', ($mode == 'href' ? "href='" : "href='#' onclick='") . "{$url}{$prefix}{$paging['last']}{$postfix}'", $itemView, $useCache);
print $itemView;
} else {
if ($paging['pages'] - $paging['page'] > 4) {
$itemView = " <span class=\"interword\">...</span> {$itemTemplate}";
Misc::dress('paging_rep_link_num', "<span>{$paging['pages']}</span>", $itemView, $useCache);
Misc::dress('paging_rep_link', ($mode == 'href' ? "href='" : "href='#' onclick='") . "{$url}{$prefix}{$paging['pages']}{$postfix}'", $itemView, $useCache);
print $itemView;
}
}
$itemsView = ob_get_contents();
ob_end_clean();
$view = $template;
Misc::dress('prev_page', isset($paging['prev']) ? ($mode == 'href' ? "href=\"" : "href=\"#\" onclick=\"") . "{$url}{$prefix}{$paging['prev']}{$postfix}\" rel=\"prev\"" : '', $view, $useCache);
Misc::dress('prev_page_title', isset($paging['prev_title']) ? $paging['prev_title'] : '', $view, $useCache);
Misc::dress('paging_rep', $itemsView, $view, $useCache);
Misc::dress('next_page', isset($paging['next']) ? ($mode == 'href' ? "href=\"" : "href=\"#\" onclick=\"") . "{$url}{$prefix}{$paging['next']}{$postfix}\" rel=\"next\"" : '', $view, $useCache);
Misc::dress('next_page_title', isset($paging['next_title']) ? $paging['next'] : '', $view, $useCache);
Misc::dress('no_more_prev', isset($paging['prev']) ? '' : 'no-more-prev', $view, $useCache);
Misc::dress('no_more_next', isset($paging['next']) ? '' : 'no-more-next', $view, $useCache);
return $view;
}
示例10: array
if (isset($_POST['page'])) {
$_GET['page'] = $_POST['page'];
}
if (!empty($_POST['mode']) && $_POST['mode'] == 'fb') {
$IV = array('GET' => array('page' => array('int', 1, 'default' => 1), 'category' => array('int', 0, 'mandatory' => false)), 'POST' => array('mode' => array(array('fb')), 'partial' => array('bool', 'default' => false), 's_home_title' => array('string', 'default' => ''), 's_name' => array('string', 'default' => ''), 's_no' => array('int'), 'url' => array('string', 'default' => ''), 's_url' => array('string', 'default' => ''), 's_post_title' => array('string', 'default' => ''), 'r1_no' => array('int'), 'r1_name' => array('string', 'default' => ''), 'r1_rno' => array('int'), 'r1_homepage' => array('string', 'default' => ''), 'r1_regdate' => array('timestamp'), 'r1_body' => array('string'), 'r1_url' => array('string', 'default' => ''), 'r2_no' => array('int'), 'r2_name' => array('string', 'default' => ''), 'r2_rno' => array('int'), 'r2_homepage' => array('string', 'default' => ''), 'r2_regdate' => array('timestamp'), 'r2_body' => array('string'), 'r2_url' => array('string', 'default' => '')));
} else {
$IV = array('GET' => array('page' => array('int', 1, 'default' => 1), 'mode' => array(array('mobile', 'desktop', 'tablet'), 'mandatory' => false), 'category' => array('int', 0, 'mandatory' => false)));
}
require ROOT . '/library/preprocessor.php';
// Redirect for ipod touch / iPhone
$browserUtil = Utils_Browser::getInstance();
if (Setting::getBlogSettingGlobal('useiPhoneUI', true) && $browserUtil->isMobile() == true && (!isset($_GET['mode']) || $_GET['mode'] != 'desktop') && (!isset($_SESSION['mode']) || !in_array($_SESSION['mode'], array('desktop')))) {
if (isset($suri['id'])) {
$slogan = getSloganById($blogid, $suri['id']);
if (!empty($slogan)) {
header("Location: " . $context->getProperty('uri.blog') . "/i/entry/" . URL::encode($slogan));
exit;
}
} else {
header("Location: " . $context->getProperty('uri.blog') . "/i");
exit;
}
}
$_SESSION['mode'] = 'desktop';
publishEntries();
if (!empty($_POST['mode']) && $_POST['mode'] == 'fb') {
// Treat comment notifier.
$result = receiveNotifiedComment($_POST);
if ($result > 0) {
echo '<?xml version="1.0" encoding="utf-8"?><response><error>1</error><message>error(' . $result . ')</message></response>';
} else {
示例11: getTrackbackFeedByEntryId
function getTrackbackFeedByEntryId($blogid = null, $entryId, $rawMode = false, $mode = 'rss')
{
global $database, $serviceURL, $defaultURL, $blogURL, $blog, $service;
if (empty($blogid)) {
$blogid = getBlogId();
}
$entry = POD::queryRow("SELECT slogan, visibility, category FROM {$database['prefix']}Entries WHERE blogid = {$blogid} AND id = {$entryId}");
if (empty($entry)) {
return false;
}
if ($entry['visibility'] < 2) {
return false;
}
if (in_array($entry['category'], getCategoryVisibilityList($blogid, 'private'))) {
return false;
}
$channel = array();
$channel = initializeRSSchannel($blogid);
$channel['title'] = RSSMessage($blog['title'] . ': ' . _textf('%1 에 달린 트랙백', $entry['slogan']));
if ($blog['useSloganOnPost']) {
$channel['link'] = $defaultURL . "/entry/" . URL::encode($entry['slogan'], true);
} else {
$channel['link'] = $defaultURL . "/" . $entryId;
}
$result = POD::queryAll("SELECT * \n\t\tFROM {$database['prefix']}RemoteResponses\n\t\tWHERE blogid = " . $blogid . " \n\t\t\tAND entry = " . $entryId . "\n\t\t\tAND isfiltered = 0\n\t\t\tAND type = 'trackback'");
if (!$result) {
$result = array();
}
$channel['items'] = array();
foreach ($result as $row) {
$trackbackURL = $channel['link'] . "#trackback";
$content = htmlspecialchars($row['excerpt']);
$item = array('id' => $row['id'], 'title' => RSSMessage($row['subject']), 'link' => $trackbackURL . $row['id'], 'categories' => array(), 'description' => RSSMessage($content), 'author' => RSSMessage(htmlspecialchars($row['site'])), 'pubDate' => $row['written'], 'comments' => $trackbackURL, 'guid' => $trackbackURL . $row['id']);
array_push($channel['items'], $item);
}
if ($rawMode == true) {
return $channel['items'];
}
$rss = array('channel' => $channel);
if ($mode == 'rss') {
return publishRSS($blogid, $rss);
} else {
if ($mode == 'atom') {
return publishATOM($blogid, $rss);
}
}
return false;
}
示例12: getHomepage
static function getHomepage($userid = null)
{
if (!isset($userid) || empty($userid)) {
$userid = getUserId();
}
$info = unserialize(Setting::getUserSettingGlobal('userLinkInfo', '', $userid));
if (is_null($info)) {
$info = array('type' => 'default');
}
switch ($info['type']) {
case "external":
$homepage = $info['url'];
break;
case "internal":
$homepage = getDefaultURL($info['blogid']);
break;
case "author":
$homepage = getDefaultURL($info['blogid']) . "/author/" . URL::encode(User::getName($userid));
break;
case "default":
default:
$homepage = null;
}
return $homepage;
}
示例13: dress
if (isset($cache) && strpos($cache->name, 'Paging') !== false) {
if ($cache->load()) {
$pagingView = $cache->contents;
} else {
$pagingView = Paging::getPagingView($paging, $skin->paging, $skin->pagingItem);
$cache->contents = $pagingView;
$cache->update();
}
} else {
$pagingView = Paging::getPagingView($paging, $skin->paging, $skin->pagingItem);
}
dress('paging_list', $pagingView, $view, false, true);
if (!empty($entries) || $suri['directive'] == '/guestbook') {
dress('paging', $pagingView, $view, false, true);
}
$url = URL::encode($paging['url'], $service['useEncodedURL']);
$prefix = $paging['prefix'];
$postfix = isset($paging['postfix']) ? $paging['postfix'] : '';
// prev_page, next_page for legacy support.
dress('prev_page', isset($paging['prev']) ? "href='{$url}{$prefix}{$paging['prev']}{$postfix}'" : '', $view);
dress('prev_page_title', isset($paging['prev_title']) ? $paging['prev_title'] : '', $view);
dress('next_page', isset($paging['next']) ? "href='{$url}{$prefix}{$paging['next']}{$postfix}'" : '', $view);
dress('next_page_title', isset($paging['next_title']) ? $paging['next_title'] : '', $view);
} else {
if (isset($cache) && strpos($cache->name, 'Paging') !== false && $cache->load()) {
dress('paging', $cache->contents, $view, false, true);
}
}
}
// Sidebar dressing
$sidebarElements = array_keys($skin->sidebarStorage);
示例14: foreach
<?php
/// Copyright (c) 2004-2012, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
$commentListView = $skin->commentList;
$itemsView = '';
foreach ($commentList['items'] as $item) {
$itemView = $skin->commentListItem;
dress('rplist_rep_regdate', fireEvent('ViewCommentListDate', Timestamp::format3($item['written']), $item['written']), $itemView);
dress('rplist_rep_link', $context->getProperty('uri.blog') . "/" . ($context->getProperty('blog.useSloganOnPost') ? "entry/" . URL::encode($item['slogan'], $service['useEncodedURL']) : $item['entry']) . "#comment{$item['id']}", $itemView);
dress('rplist_rep_name', htmlspecialchars($item['name']), $itemView);
dress('rplist_rep_body', htmlspecialchars(fireEvent('ViewCommentListTitle', Utils_Unicode::lessenAsEm($item['comment'], 70))), $itemView);
$itemsView .= $itemView;
}
dress('rplist_rep', $itemsView, $commentListView);
dress('rplist_conform', htmlspecialchars(fireEvent('ViewCommentListHeadTitle', $commentList['title'])), $commentListView);
dress('rplist_count', count($commentList['items']), $commentListView);
dress('rplist', $commentListView, $view);
示例15: array
$authorId = User::getUserIdByName($author);
if (empty($authorId)) {
exit;
}
if ($skinSetting['showListOnAuthor'] != 0) {
$cache->name = 'authorList-' . $authorId . "-" . $suri['page'] . "-";
if (!$cache->load()) {
if (!($listWithPaging = getEntryListWithPagingByAuthor($blogid, $author, $suri['page'], $blog['entriesOnList']))) {
$listWithPaging = array(array(), array('total' => 0));
}
$list = array('title' => $author, 'items' => $listWithPaging[0], 'count' => $listWithPaging[1]['total']);
$paging = $listWithPaging[1];
$listView = null;
} else {
$paging = $cache->dbContents;
$listView = $cache->contents;
}
require ROOT . '/interface/common/blog/begin.php';
$listFeedURL = 'author/' . URL::encode($author);
require ROOT . '/interface/common/blog/list.php';
}
$entries = array();
if ($skinSetting['showListOnAuthor'] != 2) {
unset($cache);
list($entries, $paging) = getEntriesWithPagingByAuthor($blogid, $author, $suri['page'], $blog['entriesOnList'], $skinSetting['showListOnAuthor'] == 3 ? $blog['entriesOnPage'] : $blog['entriesOnList']);
if ($skinSetting['showListOnAuthor'] == 0) {
require ROOT . '/interface/common/blog/begin.php';
}
require ROOT . '/interface/common/blog/entries.php';
}
require ROOT . '/interface/common/blog/end.php';